[issue1475] test_popen fails when the directory contains a space

2007-11-21 Thread Christian Heimes

Christian Heimes added the comment:

In Python 3.x os.popen is implemented based on subprocess. I believe
it's still a problem with subprocess. Python 3.x also drops support for
Windows 95 to ME. Would the additional quoting be ok when the code
checks for COMPSPEC == cmd.exe first?

# Supply os.popen()
def popen(cmd, mode=r, buffering=None):
if not isinstance(cmd, str):
raise TypeError(invalid cmd type (%s, expected string) %
type(cmd))
if mode not in (r, w):
raise ValueError(invalid mode %r % mode)
import subprocess, io
if mode == r:
proc = subprocess.Popen(cmd,
shell=True,
stdout=subprocess.PIPE,
bufsize=buffering)
return _wrap_close(io.TextIOWrapper(proc.stdout), proc)
else:
proc = subprocess.Popen(cmd,
shell=True,
stdin=subprocess.PIPE,
bufsize=buffering)
return _wrap_close(io.TextIOWrapper(proc.stdin), proc)

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1475
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1481] test_uuid is warning about unreliable functions

2007-11-21 Thread Christian Heimes

New submission from Christian Heimes:

I'm putting the report into the tracker as a reminder.

WARNING: uuid.getnode is unreliable on many platforms.
It is disabled until the code and/or test can be fixed properly.
WARNING: uuid._ifconfig_getnode is unreliable on many platforms.
It is disabled until the code and/or test can be fixed properly.
WARNING: uuid._unixdll_getnode is unreliable on many platforms.
It is disabled until the code and/or test can be fixed properly.

--
components: Library (Lib), Tests
keywords: py3k
messages: 57733
nosy: tiran
priority: normal
severity: normal
status: open
title: test_uuid is warning about unreliable functions
type: behavior
versions: Python 2.6, Python 3.0

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1481
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1306] Embedded python reinitialization

2007-11-21 Thread Christian Heimes

Christian Heimes added the comment:

I've added some debugging code to _Py_ForgetReference and now I'm
getting this:

$ ./reinit_test
round 1
[23832 refs]
round 2
[24558 refs]
round 3
* ob
object  : refcnt 0 at 0x821d728
type: str
refcount: 0
address : 0x821d728
* op-_ob_prev-_ob_next
object  : refcnt 0 at 0x821d728
type: str
refcount: 0
address : 0x821d728
* op-_ob_next-_ob_prev
object  : buffer(b'')
type: buffer
refcount: 1
address : 0x826c8c8
* refchain
object  : refcnt 0 at 0x81a1500
type: NULL
refcount: 0
address : 0x81a1500
Fatal Python error: UNREF invalid object
Aborted

Added file: http://bugs.python.org/file8791/py3k_reinit2.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1306
__Index: Python/pythonrun.c
===
--- Python/pythonrun.c	(Revision 59091)
+++ Python/pythonrun.c	(Arbeitskopie)
@@ -502,6 +502,12 @@
 	/* Cleanup Unicode implementation */
 	_PyUnicode_Fini();
 
+	/* reset file system default encoding */
+	if (!Py_HasFileSystemDefaultEncoding) {
+		free(Py_FileSystemDefaultEncoding);
+	Py_FileSystemDefaultEncoding = NULL;
+	}
+
 	/* XXX Still allocated:
 	   - various static ad-hoc pointers to interned strings
 	   - int and float free list blocks
Index: Python/bltinmodule.c
===
--- Python/bltinmodule.c	(Revision 59091)
+++ Python/bltinmodule.c	(Arbeitskopie)
@@ -16,10 +16,13 @@
 */
 #if defined(MS_WINDOWS)  defined(HAVE_USABLE_WCHAR_T)
 const char *Py_FileSystemDefaultEncoding = mbcs;
+const int Py_HasFileSystemDefaultEncoding = 1;
 #elif defined(__APPLE__)
 const char *Py_FileSystemDefaultEncoding = utf-8;
+const int Py_HasFileSystemDefaultEncoding = 1;
 #else
 const char *Py_FileSystemDefaultEncoding = NULL; /* use default */
+const int Py_HasFileSystemDefaultEncoding = 0;
 #endif
 
 static PyObject *
Index: Include/fileobject.h
===
--- Include/fileobject.h	(Revision 59091)
+++ Include/fileobject.h	(Arbeitskopie)
@@ -20,6 +20,7 @@
If non-NULL, this is different than the default encoding for strings
 */
 PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
+PyAPI_DATA(const int) Py_HasFileSystemDefaultEncoding;
 
 /* Internal API
 
Index: Objects/object.c
===
--- Objects/object.c	(Revision 59091)
+++ Objects/object.c	(Arbeitskopie)
@@ -1532,8 +1532,15 @@
 	if (op-ob_refcnt  0)
 		Py_FatalError(UNREF negative refcnt);
 	if (op == refchain ||
-	op-_ob_prev-_ob_next != op || op-_ob_next-_ob_prev != op)
+	op-_ob_prev-_ob_next != op || op-_ob_next-_ob_prev != op) {
+		fprintf(stderr, * ob\n);
+		_PyObject_Dump(op);
+		fprintf(stderr, * op-_ob_prev-_ob_next\n);
+		_PyObject_Dump(op-_ob_prev-_ob_next);
+		fprintf(stderr, * op-_ob_next-_ob_prev\n);
+		_PyObject_Dump(op-_ob_next-_ob_prev);
 		Py_FatalError(UNREF invalid object);
+	}
 #ifdef SLOW_UNREF_CHECK
 	for (p = refchain._ob_next; p != refchain; p = p-_ob_next) {
 		if (p == op)
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1482] IMAP4 SSL isn't working

2007-11-21 Thread Christian Heimes

New submission from Christian Heimes:

The SSL version of the imap4 client isnt' working under 3.0. After I
applied the patch from http://bugs.python.org/issue1210 I tried to
connect to an IMAP server over SSL. The connection hangs.

import imaplib
conn = imaplib.IMAP4_SSL(mailbox.rwth-aachen.de, 993)

After a while I stopped the attempt with CTRL+C
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/heimes/dev/python/py3k/Lib/imaplib.py, line 1137, in __init__
IMAP4.__init__(self, host, port)
  File /home/heimes/dev/python/py3k/Lib/imaplib.py, line 184, in __init__
self.welcome = self._get_response()
  File /home/heimes/dev/python/py3k/Lib/imaplib.py, line 907, in
_get_response
resp = self._get_line()
  File /home/heimes/dev/python/py3k/Lib/imaplib.py, line 1000, in
_get_line
line = self.readline()
  File /home/heimes/dev/python/py3k/Lib/imaplib.py, line 1170, in readline
char = self.sslobj.read(1)
  File /home/heimes/dev/python/py3k/Lib/ssl.py, line 160, in read
return self._sslobj.read(len)
KeyboardInterrupt

--
assignee: janssen
components: Library (Lib)
keywords: py3k
messages: 57735
nosy: janssen, tiran
priority: normal
severity: normal
status: open
title: IMAP4 SSL isn't working
versions: Python 3.0

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1482
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1462525] URI parsing library

2007-11-21 Thread vincent kraeutler

vincent kraeutler added the comment:

Some more notes. 
a) RFC3986 explicitly states that the presented regex (which you use)
is the regular expression for breaking-down a *well-formed* URI
reference into its components.  (Emphasis added). I am not sure this
is a particularly good starting point for parsing potentially
security-critical data.

b) The parser fails on URI's containing numerical IPv6 addresses (e.g.
http://[::1]:88/path;). Specifically, the following code in
split_authority is broken:

if hostport and ':' in hostport:
host, port = hostport.split(':', 1)

Clearly, if the authority may contain a : in the host's IP field, you
cannot simply split() off the port part.

Again, I am afraid I have no simple solution. Hate to sound so negative.

Kind regards,
v.

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1462525
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1083] Confusing error message when dividing timedelta using /

2007-11-21 Thread Christian Heimes

Changes by Christian Heimes:


--
keywords: +patch
Added file: http://bugs.python.org/file8792/py3k_datetime_1083.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1083
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1483] xml.sax.saxutils.prepare_input_source ignores character stream in InputSource

2007-11-21 Thread Yitz Gale

New submission from Yitz Gale:

In the documentation for xml.sax.xmlreader.InputSource objects
(section 8.12.4 of the Library Reference) we find that
users of InputSource objects should use the following
sequence to get their input data:

1. If the InputSource has a character stream, use that.
2. Otherwise, if the InputSource has a byte stream, use that.
3. Otherwise, open a URI connection to the system ID.

prepare_input_source() skips step 1.

This is a one-line fix in Lib/xml/sax/saxutils.py:
-if source.getByteStream() is None:
+if source.getCharacterStream is None and source.getByteStream() is 
None:

--
components: Library (Lib)
messages: 57737
nosy: ygale
severity: normal
status: open
title: xml.sax.saxutils.prepare_input_source ignores character stream in 
InputSource
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1483
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1306] Embedded python reinitialization

2007-11-21 Thread Guido van Rossum

Guido van Rossum added the comment:

Note that the OP was complaining about Stackless. This is not the place
to report issues with that.

--
priority: normal - low

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1306
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1067] test_smtplib failures (caused by asyncore)

2007-11-21 Thread Guido van Rossum

Guido van Rossum added the comment:

I have no idea. I'm no asynchat expert. Let Thomas look into this once
he's back from vacation.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1067
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1348] httplib closes socket, then tries to read from it

2007-11-21 Thread Guido van Rossum

Guido van Rossum added the comment:

Is this still relevant?

--
assignee:  - janssen
priority: urgent - normal

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1348
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1484] logging: callHandlers tests handler levels instead of logger levels?

2007-11-21 Thread Gidi Avrahami

New submission from Gidi Avrahami:

I am using the logging module with multiple loggers and the following
behavior seems incorrect to me:

I set the root logger's level to WARN and the foo.bar module's logger's
level to DEBUG, and the foo.bar logger should is writing to a file.  So
basically, I want foo.bar to log itself in details behind the scenes
while the main console is quiet.

However, I still get all the sebug info printed to the console.  When I
trace down the code, I see that callHandlers() is climbing up the logger
hierarchy, but it's comparing record.level to hdlr.level, not to
c.level.  The handler levels, however, don't appear to be set normally
(i.e., after I do getLogger(foo.bar).setLevel, its handlers stay at
level NOTSET).  As a result, callHandlers will call all the handlers
above the first one, no matter what the loggers level.

Is this intentional?  If it is, how should I get the behavior that I
described above?  (I could set propagate=False, but in fact if the rott
logger is DEBUG then I do want it to print the foo.bar messages)

--
components: Library (Lib)
messages: 57741
nosy: gidi_avrahami
severity: normal
status: open
title: logging: callHandlers tests handler levels instead of logger levels?
type: behavior
versions: Python 2.4, Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1484
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1109] Warning required when calling register() on an ABCMeta subclass

2007-11-21 Thread Guido van Rossum

Guido van Rossum added the comment:

This would be easier to fix if we didn't have unbound methods.  I'm
going to ask the py3k list if anybody really cares about having those.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1109
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1469] SSL tests leak memory

2007-11-21 Thread Bill Janssen

Bill Janssen added the comment:

What platform?

Bill

On Nov 20, 2007 11:21 PM, Christian Heimes [EMAIL PROTECTED] wrote:

 Christian Heimes added the comment:

 I don't see leaks when I run the tests with

 $ ./python Lib/test/regrtest.py -R:: test_ssl.py
 test_ssl
 beginning 9 repetitions
 123456789
 .
 1 test OK.
 [80034 refs]

 --
 nosy: +tiran
 priority:  - normal

 __
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue1469
 __


__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1469
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1482] IMAP4 SSL isn't working

2007-11-21 Thread Bill Janssen

Bill Janssen added the comment:

I'll take a look at it this weekend.

Bill

On Nov 21, 2007 1:27 AM, Christian Heimes [EMAIL PROTECTED] wrote:

 New submission from Christian Heimes:

 The SSL version of the imap4 client isnt' working under 3.0. After I
 applied the patch from http://bugs.python.org/issue1210 I tried to
 connect to an IMAP server over SSL. The connection hangs.

 import imaplib
 conn = imaplib.IMAP4_SSL(mailbox.rwth-aachen.de, 993)

 After a while I stopped the attempt with CTRL+C
 Traceback (most recent call last):
   File stdin, line 1, in module
   File /home/heimes/dev/python/py3k/Lib/imaplib.py, line 1137, in __init__
 IMAP4.__init__(self, host, port)
   File /home/heimes/dev/python/py3k/Lib/imaplib.py, line 184, in __init__
 self.welcome = self._get_response()
   File /home/heimes/dev/python/py3k/Lib/imaplib.py, line 907, in
 _get_response
 resp = self._get_line()
   File /home/heimes/dev/python/py3k/Lib/imaplib.py, line 1000, in
 _get_line
 line = self.readline()
   File /home/heimes/dev/python/py3k/Lib/imaplib.py, line 1170, in readline
 char = self.sslobj.read(1)
   File /home/heimes/dev/python/py3k/Lib/ssl.py, line 160, in read
 return self._sslobj.read(len)
 KeyboardInterrupt

 --
 assignee: janssen
 components: Library (Lib)
 keywords: py3k
 messages: 57735
 nosy: janssen, tiran
 priority: normal
 severity: normal
 status: open
 title: IMAP4 SSL isn't working
 versions: Python 3.0

 __
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue1482
 __


__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1482
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1348] httplib closes socket, then tries to read from it

2007-11-21 Thread Bill Janssen

Bill Janssen added the comment:

Yes.  The close is stil in the wrong place.

On Nov 21, 2007 2:30 PM, Guido van Rossum [EMAIL PROTECTED] wrote:

 Guido van Rossum added the comment:

 Is this still relevant?

 --
 assignee:  - janssen
 priority: urgent - normal

 __
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue1348
 __


__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1348
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1269] Exception in pstats print_callers()

2007-11-21 Thread Matthew Fremont

Matthew Fremont added the comment:

I hit the same issue, and I think the problem is that at line 515 in
pstats.py add_callers() the two stats instead of adding them
member-wise. As a result, each time add() is called, the number of stats
associated with each func grows by 4. Then, when print_call_line() is
called by print_callers() or print_callees(), there are too many values
to unpack at line 417.

This change to pstats.py modifies add_callers() to add the stats
together instead of concatenating the tuples.

515c515
 new_callers[func] = caller + new_callers[func]
---
 new_callers[func] = map(lambda x,y: x+y, caller +
new_callers[func])

--
nosy: +matthew.fremont

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1269
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1383] Backport abcoll to 2.6

2007-11-21 Thread Guido van Rossum

Guido van Rossum added the comment:

I've submitted this as revision 59106.  Thanks so much for your effort!

I cleaned up the layout of some of the files, and I had to undo a
diffing mistake -- somehow your patch undid some changes to
collections.py and test_collections.py about renaming NamedTuple to
namedtuple that were submitted by Raymond Hettinger.

--
assignee:  - gvanrossum
nosy: +gvanrossum
resolution:  - accepted
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1383
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1469] SSL tests leak memory

2007-11-21 Thread Christian Heimes

Christian Heimes added the comment:

Ubuntu Linux x86

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1469
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1477] UnicodeDecodeError that cannot be caught in narrow unicode builds

2007-11-21 Thread Gabriel Genellina

Changes by Gabriel Genellina:


--
nosy: +gagenellina

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1477
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1475] test_popen fails when the directory contains a space

2007-11-21 Thread Gabriel Genellina

Changes by Gabriel Genellina:


--
nosy: +gagenellina

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1475
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com