[issue3708] os.urandom(1.1): infinite loop

2008-08-28 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: better patch with tests attached, no explicit int conversion is done. i also wrapped the use of the fd returned by open with a try: finally: to avoid any chance of a leak and renamed the bytes variable to bs to match whats in py3k and avoid

[issue3704] cookielib doesn't handle URLs with / in parameters

2008-08-28 Thread Gregory P. Smith
Changes by Gregory P. Smith [EMAIL PROTECTED]: -- keywords: +patch Added file: http://bugs.python.org/file11282/cookielib.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3704 ___

[issue3014] file_dealloc() assumes errno is set when EOF is returned

2008-08-28 Thread Laszlo (Laca) Peter
Changes by Laszlo (Laca) Peter [EMAIL PROTECTED]: -- nosy: +laca ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3014 ___ ___ Python-bugs-list mailing

[issue3704] cookielib doesn't handle URLs with / in parameters

2008-08-28 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: attached is a patch with the suggested fix along with a unit test. -- assignee: - gregory.p.smith keywords: +needs review nosy: +gregory.p.smith priority: - normal Added file:

[issue3647] urlparse - relative url parsing and joins to be RFC3986 compliance

2008-08-28 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: given where we are in the release process at the moment I doubt this can go into 2.6/3.0. Bring it up on python-dev if you have compelling reasons why it should. Otherwise, looks good for trunk 2.7/3.1 immediately after the releases are

[issue3703] open() on directory raises IOError with unhelpful message

2008-08-28 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: looks good to me -- nosy: +gregory.p.smith ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3703 ___

[issue3706] Fix error message for wrong exec() argument type

2008-08-28 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: OK, I changed that and committed r66051. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3706 ___

[issue3696] Error parsing arguments on OpenBSD = 4.4

2008-08-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: Another small remark; #ifdef is better then #ifndef Simply because it easier to get Be positive than Don't be negative. Yes; but here, the symbol (HAVE_BROKEN_MBSTOWC) has a negative meaning. I tried to put the optimistic (=not

[issue3711] docs still say to use .dll for compiled extensions

2008-08-28 Thread Gabriel Genellina
New submission from Gabriel Genellina [EMAIL PROTECTED]: The Extending and Embedding document still says, in section Building C and C++ Extensions on Windows: http://docs.python.org/dev/extending/windows.html#a-cookbook-approach that a C extension may be called spam.dll or spam_d.dll Since

[issue3014] file_dealloc() assumes errno is set when EOF is returned

2008-08-28 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: The title of your bug report might be misleading. Is the problem that errno is misinterpreted in the error message, or that there is an error message at all? -- nosy: +pitrou priority: - normal versions: +Python 2.7 -Python 2.4

[issue3711] docs still say to use .dll for compiled extensions

2008-08-28 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: Thanks, fixed in r66053. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3711 ___

[issue3708] os.urandom(1.1): infinite loop

2008-08-28 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: The explicit int() conversion looked saner to me, rather than passing a float argument to read(). By the way, is there a reason this code still uses os.open rather than the builtin io.open? -- nosy: +pitrou

[issue3660] reference leaks in 3.0

2008-08-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: - the test_site leaked [88, 88] is the same as problem as issue3667. - test_unicodes leaks in PyUnicode_AsEncodedString (attached patch), and also with: str(memoryview(b'character buffers are decoded to unicode'), 'utf-8') I tried

[issue3660] reference leaks in 3.0

2008-08-28 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: str(memoryview(b'character buffers are decoded to unicode'), 'utf-8') I tried another patch, but I'm not sure: I get lost between all these buffers... a Py_DECREF(self-view.obj) in memory_releasebuf() seems to work. Could you open a

[issue3696] Error parsing arguments on OpenBSD = 4.4

2008-08-28 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Yes; but here, the symbol (HAVE_BROKEN_MBSTOWC) has a negative meaning. I tried to put the optimistic (=not broken) case first. However, if this makes the code more difficult to read, I'll change it. You could change HAVE_BROKEN_MBSTOWC for

[issue3712] memoryview leaks references

2008-08-28 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc [EMAIL PROTECTED]: Two problems with memoryview: - The buffer interface of memoryview leaks a reference: str(memoryview(b'text'), 'utf-8') - memoryview does not implement tp_traverse and tp_clear, so reference cycle cannot be collected, as with:

[issue3660] reference leaks in 3.0

2008-08-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: issue3712 tracks the memoryview issues. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3660 ___ ___

[issue3712] memoryview leaks references

2008-08-28 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Here is a patch. I feel a bit unsafe with the intended semantics of getting a buffer on a memoryview object, but it fixes the leak. -- components: +Interpreter Core keywords: +needs review, patch nosy: +pitrou, teoliphant type: -

[issue3712] memoryview leaks references

2008-08-28 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: (I forgot to say, the patch is for the first problem only) ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3712 ___

[issue3660] reference leaks in 3.0

2008-08-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: the leaks in test_pickle and test_pickletools are corrected by the attached patch. Added file: http://bugs.python.org/file11288/pickle-leak.patch ___ Python tracker [EMAIL PROTECTED]

[issue3616] shutil.rmtree() fails on invalid filename

2008-08-28 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: Python 2.5 has the same problem (at least, on Linux). rmtree(unicode directory name) fails if the directory contains invalid unicode string. Backtrace: --- File shutil.py, line 163, in rmtree fullname = os.path.join(path, name) File

[issue3667] Reloading an extension module always leaks

2008-08-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: The fix is actually simple: _PyImport_FindExtension() used to return a borrowed reference, the strong reference being stored in the PyImport_GetModuleDict() dictionary. All paths should behave the same. See attached patch. (for unit

[issue3712] memoryview leaks references

2008-08-28 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Here is an aggregate patch addressing both problems. Please review. Added file: http://bugs.python.org/file11290/memleak2.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3712

[issue3713] Compile warning for Objects/stringlib

2008-08-28 Thread Andy
New submission from Andy [EMAIL PROTECTED]: Checked out the PY3K branch and built. Received a warning about characters after #ifdef ignored from Objects/stringlib/find.h the line in question is: #ifdef STRINGLIB_WANT_CONTAINS_OBJ !defined(FROM_BYTEARRAY) Which is likely to mean that it will

[issue3713] Compile warning for Objects/stringlib

2008-08-28 Thread Andy
Andy [EMAIL PROTECTED] added the comment: patch for issue attached. gcc -v = gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7) tests: ./runtests.sh = 0 BAD 297 GOOD 27 SKIPPED 324 total -- keywords: +patch Added file: http://bugs.python.org/file11291/issue3713.patch

[issue3714] nntplib module broken by str to unicode conversion

2008-08-28 Thread Dmitry Vasiliev
New submission from Dmitry Vasiliev [EMAIL PROTECTED]: The following commands fail badly: from nntplib import NNTP s = NNTP(free-text.usenetserver.com) Traceback (most recent call last): File stdin, line 1, in module File /py3k/Lib/nntplib.py, line 116, in __init__ self.welcome =

[issue3714] nntplib module broken by str to unicode conversion

2008-08-28 Thread Dmitry Vasiliev
Dmitry Vasiliev [EMAIL PROTECTED] added the comment: I've attached the patch which adds encoding parameter to the NNTP class. -- keywords: +patch Added file: http://bugs.python.org/file11292/nntplib.patch ___ Python tracker [EMAIL PROTECTED]

[issue3014] file_dealloc() assumes errno is set when EOF is returned

2008-08-28 Thread johansen
johansen [EMAIL PROTECTED] added the comment: The problem is present in Python 2.4.4, the version that we're using here. I'm not familiar with the versions keyword that's used here, but that's the version for which I'm reporting this bug. To be clear, the problem is that when file_dealloc()

[issue3014] file_dealloc() assumes errno is set when EOF is returned

2008-08-28 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Selon johansen [EMAIL PROTECTED]: The problem is present in Python 2.4.4, the version that we're using here. I'm not familiar with the versions keyword that's used here, but that's the version for which I'm reporting this bug. The only

[issue3675] Python 2.6 can't read sets pickled with Python 3.0

2008-08-28 Thread Daniel Diniz
Daniel Diniz [EMAIL PROTECTED] added the comment: Hagen, does this simple patch (against 2.6) solve it for you? Index: Lib/pickle.py === --- Lib/pickle.py (revision 66050) +++ Lib/pickle.py (working copy) @@ -1121,6

[issue3675] Python 2.6 can't read sets pickled with Python 3.0

2008-08-28 Thread Hagen Fürstenau
Hagen Fürstenau [EMAIL PROTECTED] added the comment: Well, Python = 2.5 still wouldn't be able to unpickle those built in objects. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3675 ___

[issue3014] file_dealloc() assumes errno is set when EOF is returned

2008-08-28 Thread johansen
johansen [EMAIL PROTECTED] added the comment: As I said before: check_and_flush calls ferror(3C) and then fflush(3C) on the FILE stream associated with the file object. There's just one problem here. If it finds an error that was previously encountered on the file stream, there's no

[issue3715] hashlib's docstring throws exception in pydoc

2008-08-28 Thread Erick Tryzelaar
New submission from Erick Tryzelaar [EMAIL PROTECTED]: Hello, I noticed that doing pydoc3.0 hashlib was throwing this exception: Traceback (most recent call last): File /opt/local/bin/pydoc3.0, line 5, in module pydoc.cli() File

[issue3675] Python 2.6 can't read sets pickled with Python 3.0

2008-08-28 Thread Daniel Diniz
Daniel Diniz [EMAIL PROTECTED] added the comment: FWIW, there's a mapping of 2.6:3.0 modules in lib2to3: from lib2to3.fixes.fix_imports import MAPPING The attached patch uses that for a quick and dirty way of loading 3.0 pickles in 2.6. -- keywords: +patch Added file:

[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-08-28 Thread Daniel Diniz
Daniel Diniz [EMAIL PROTECTED] added the comment: ISTM that this release blocker can be solved by changing xml.sax.xmlreader.py line 122 from: while buffer != : to while buffer != b: -- nosy: +ajaksu2 ___ Python tracker [EMAIL

[issue3680] Cycles with some iterator are leaking.

2008-08-28 Thread Jesús Cea Avión
Changes by Jesús Cea Avión [EMAIL PROTECTED]: -- nosy: +jcea ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3680 ___ ___ Python-bugs-list mailing list

[issue2501] xml.sax.parser() doesn't terminate when given a filename

2008-08-28 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: I've a better idea: while buffer: It's faster and works for both empty bytes and str. The patch fixes the issue and re-enables three unit tests. -- keywords: +needs review, patch Added file:

[issue1923] meaningful whitespace can be lost in rfc822_escape

2008-08-28 Thread Simon Cross
Simon Cross [EMAIL PROTECTED] added the comment: I've just checked that the patch still applies cleanly to 2.6 and it does and the tests still passes. It looks like the patch has already been applied to 3.0 but without the test. The test part of the part applies cleanly to 3.0 too. --

[issue3716] mistake in 3.4.2 Customizing attribute access

2008-08-28 Thread Alex7564
New submission from Alex7564 [EMAIL PROTECTED]: Note that if the attribute is found through the normal mechanism, __getattr__() is not called. ...because otherwise __setattr__() would have no way to access other attributes of the instance. I think it should be __getattr__() instead of

[issue3716] mistake in 3.4.2 Customizing attribute access

2008-08-28 Thread Alex7564
Alex7564 [EMAIL PROTECTED] added the comment: Note that if the attribute is found through the normal mechanism, __getattr__() is not called. because otherwise __setattr__() would have no way to access other attributes of the instance. I think it's __getattr__() instead of __setattr__()

[issue3708] os.urandom(1.1): infinite loop

2008-08-28 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: if i did n = int(n) that would change the API to allow bytes/unicode to be passed in which is not something i want. i don't even like that it allows floats. by not doing the int conversion at all, a DeprecationWarning is raised by the

[issue3716] mistake in 3.4.2 Customizing attribute access

2008-08-28 Thread Alex7564
Alex7564 [EMAIL PROTECTED] added the comment: I was talking about Python Reference Manual (http://docs.python.org/ref/attribute-access.html) ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3716 ___

[issue3708] os.urandom(1.1): infinite loop

2008-08-28 Thread Daniel Diniz
Daniel Diniz [EMAIL PROTECTED] added the comment: Gregory, IMHO your patch is better in all aspects. Regarding my patch, the API wouldn't change at all, as the source reads: while len(bytes) int(n): bytes += read(_urandomfd, n - len(bytes)) So n - len(bytes) restricts the

[issue1868] threading.local doesn't free attrs when assigning thread exits

2008-08-28 Thread Ben Cottrell
Ben Cottrell [EMAIL PROTECTED] added the comment: I like this patch, too! I think it's a much cleaner way of implementing the thread._local type. However, when I test it, I have problems with subclasses of thread._local; using the class itself seems to work. I've attached a test program that

[issue3717] Py_InitModule* is still referenced in docs

2008-08-28 Thread Erick Tryzelaar
New submission from Erick Tryzelaar [EMAIL PROTECTED]: The docs still reference Py_InitModule*, which was removed in r64107. Also, Demo/embed/demo.c still use Py_InitModule, and thus doesn't compile. -- assignee: georg.brandl components: Documentation messages: 72111 nosy: erickt,

[issue1868] threading.local doesn't free attrs when assigning thread exits

2008-08-28 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: Good catch, Ben! The generic setattr/getattr functions don't work as expected when the base class doesn't provide a __dict__. They are setting the attributes in the subclass' __dict__ instead of the thread local dict. My patch fixes the

[issue3717] Py_InitModule* is still referenced in docs

2008-08-28 Thread Erick Tryzelaar
Erick Tryzelaar [EMAIL PROTECTED] added the comment: On Thu, Aug 28, 2008 at 1:48 PM, Erick Tryzelaar [EMAIL PROTECTED] wrote: New submission from Erick Tryzelaar [EMAIL PROTECTED]: The docs still reference Py_InitModule*, which was removed in r64107. Also, Demo/embed/demo.c still use

[issue2235] __eq__ / __hash__ check doesn't take inheritance into account

2008-08-28 Thread Nick Coghlan
Nick Coghlan [EMAIL PROTECTED] added the comment: Reopening - still need to fix the Python level docs for hash() and __hash__(). -- resolution: fixed - status: closed - open ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2235

[issue1868] threading.local doesn't free attrs when assigning thread exits

2008-08-28 Thread Ben Cottrell
Ben Cottrell [EMAIL PROTECTED] added the comment: Christian, Your patch works for me -- thanks!! I made a slight modification to your patch to allow del to work, and have attached my modified version. I agree that allowing subclassing makes thread._local harder to get right than it would

[issue3718] environment variable MACHDEP and python build system

2008-08-28 Thread Roumen Petrov
New submission from Roumen Petrov [EMAIL PROTECTED]: A) The reason to propose this patch following paragraph from README: 2) To set sys.platform to something sensible, pass the following environment variable to the configure script:

[issue3014] file_dealloc() assumes errno is set when EOF is returned

2008-08-28 Thread Antoine Pitrou
Changes by Antoine Pitrou [EMAIL PROTECTED]: -- nosy: -pitrou ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3014 ___ ___ Python-bugs-list mailing list

[issue3708] os.urandom(1.1): infinite loop

2008-08-28 Thread Antoine Pitrou
Antoine Pitrou [EMAIL PROTECTED] added the comment: Le jeudi 28 août 2008 à 19:30 +, Gregory P. Smith a écrit : if i did n = int(n) that would change the API to allow bytes/unicode to be passed in which is not something i want. Ok, I hadn't thought about that. You convinced me.

[issue3719] platform.py: _syscmd_file() can't handle target path with space or special shell character

2008-08-28 Thread jfdp
New submission from jfdp [EMAIL PROTECTED]: If you install python in a location which has a space or shell character in the path then platform.platform() will generate an error and/or fail to get all platform information. For example $ pwd /disk0/tmp/foobar(2)/python2.4/bin $ ./python Python

[issue3720] segfault in for loop with evil iterator

2008-08-28 Thread Gideon Smeding
New submission from Gideon Smeding [EMAIL PROTECTED]: The attached example crashes python. The crash is caused by an evil iterator that removes its own next function. -- files: baditerator.py messages: 72119 nosy: gideon severity: normal status: open title: segfault in for loop with