[issue5986] Avoid reversed() in Random.shuffle()

2009-05-11 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: -1 on this patch. Reversed has a very low overhead. Readability if more important. The current code is self-evidently correct but the patched code is less obviously so. -- ___

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Francesco Sechi
Francesco Sechi francesco.se...@iet.unipi.it added the comment: All right, now I understand, thanks. But I think that, for internal class coherence, it is necessary not to modify toxml method, but the 'setAttribute' one, because this is the source of the problem. --

[issue5986] Avoid reversed() in Random.shuffle()

2009-05-11 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: FWIW, the inefficiency is only in the loop setup, the time to call reversed() and __reversed__(). The inner loop runs at the same speed because xrange provides a __reversed__ iterator. Please do not go through the standard

[issue1759845] subprocess.call fails with unicode strings in command line

2009-05-11 Thread Kuang-che Wu
Kuang-che Wu k...@csie.org added the comment: ocrean-city's patch applied cleanly with trunk and it works for me. Could anybody review and commit? I could help if any refinement required. -- nosy: +kcwu ___ Python tracker rep...@bugs.python.org

[issue5804] Add an 'offset' argument to zlib.decompress

2009-05-11 Thread Robert Collins
Robert Collins robe...@robertcollins.net added the comment: Well, I think its relatively uncommon to be doing such a loop with a static buffer anyway - often you'll instead be reading from disk or a network stream; if we could make those cases simpler and avoid copying that would be great.

[issue5987] Broken link to Curses Programming with Python

2009-05-11 Thread Ralph Corderoy
Ralph Corderoy ralph-pythonb...@inputplus.co.uk added the comment: Does that mean it's policy not to correct documentation for non-latest versions? Fair enough. But perhaps http://www.python.org/doc/2.5.2/lib/about.html should be changed to reflect that, and likewise on other non-latest

[issue5994] help(marshal) just gives an outline; no help text provided.

2009-05-11 Thread Senthil
New submission from Senthil orsent...@gmail.com: Help on built-in module marshal: NAME marshal FILE (built-in) MODULE DOCS http://docs.python.org/library/marshal FUNCTIONS dump(...) dumps(...) load(...) loads(...) DATA version = 2 --

[issue5995] unittest command line behaviour

2009-05-11 Thread Michael Foord
New submission from Michael Foord mich...@voidspace.org.uk: This patch adds a verbosity keyword argument to unittest.main - so you can do: if __name__ == '__main__': unittest.main(verbosity=2) It also has a minor fix allowing you to specify test modules / classes from the command

[issue5995] unittest command line behaviour

2009-05-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It would be nice to have a test for the command line functionality but I'm not sure it's easy. In Misc/NEWS, please add the issue number as in other entries. Other than that, looks fine. -- keywords: -needs review nosy: +pitrou priority:

[issue5995] unittest command line behaviour

2009-05-11 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: I didn't add the issue number because I created the patch prior to creating the issue. Will add when I commit. Would like permission to commit this from an interested core developer. -- ___

[issue5996] abstract class instantiable when subclassing dict

2009-05-11 Thread johannes raggam
New submission from johannes raggam raggam...@adm.at: when declaring a abstract base class with an abstract property or method and subclassing from dict, the class is instantiable (instanceable?). import abc class A(object): ... __metaclass__ = abc.ABCMeta ... @abc.abstractproperty

[issue5964] WeakSet cmp methods

2009-05-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: 2. The current WeakSet implementation returns True if a WeakSet is compared to any Iterable which contains the same set of objects: Sounds bad. It should probably be fixed. -- ___ Python tracker

[issue5964] WeakSet cmp methods

2009-05-11 Thread Robert Schuppenies
Robert Schuppenies robert.schuppen...@gmail.com added the comment: Sounds right to me. Here is another patch plus tests. Going through the other tests, I adapted two more tests to actually test WeakSet. Also, I found the following one and think it is a copypaste from test_set which is not

[issue5964] WeakSet cmp methods

2009-05-11 Thread Robert Schuppenies
Changes by Robert Schuppenies robert.schuppen...@gmail.com: Removed file: http://bugs.python.org/file13955/_weakrefset.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5964 ___

[issue5964] WeakSet cmp methods

2009-05-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Going through the other tests, I adapted two more tests to actually test WeakSet. Also, I found the following one and think it is a copypaste from test_set which is not useful for test_weakset. Should it be removed (as currently done in the

[issue2708] IDLE subprocess error

2009-05-11 Thread Christopher Altona
Christopher Altona calto...@gmail.com added the comment: I found that if I go into the Windows Task Manager and end (somtimes both of) the Python processes, the program will run properly the next time I open it. Hope this helps. -- nosy: +ChrisAltona

[issue1759845] subprocess.call fails with unicode strings in command line

2009-05-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The first patch will introduce regressions for strings that cannot be decoded with the filesystem encoding. It is necessary to provide a fallback to the CreateProcessA function. I'd prefer the python-only patch, except for the sys=sys

[issue5981] float.fromhex bugs

2009-05-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Fixed in r72564 (trunk), r72565 (py3k). The trailing whitespace bugfix was backported in r72566 (2.6) and r72567 (3.0), but those versions still use locale-aware isspace and islower. As a semi-accidental by-product, the fix also changes

[issue5997] strftime is broken

2009-05-11 Thread Jonathan
New submission from Jonathan jonathan.cervi...@gmail.com: [...@jaydee Development]$ cat is-strftime-broken.py #!/usr/bin/env python import subprocess import time date_process = subprocess.Popen( (date, +%x), stdout=subprocess.PIPE) from_date_command = date_process.communicate()[0].rstrip()

[issue5995] unittest command line behaviour

2009-05-11 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Committed in revision 72570. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5995 ___

[issue5997] strftime is broken

2009-05-11 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Please read http://docs.python.org/library/locale.html specifically the docs for 'setlocale'. Before you call setlocale, python's locale is 'C', just like for any C program before it calls setlocale. Python 2.6.2 (r262:71600, May 2

[issue5945] PyMapping_Check returns 1 for lists

2009-05-11 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5945 ___

[issue5982] classmethod, staticmethod: expose wrapped function

2009-05-11 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5982 ___

[issue5953] Add to whats new: range(n) != range(n)

2009-05-11 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: georg.brandl - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5953 ___

[issue3292] Position index limit; s.insert(i,x) not same as s[i:i]=[x]

2009-05-11 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: georg.brandl - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3292 ___

[issue5238] ssl makefile never closes socket

2009-05-11 Thread Jonathan Hayward
Jonathan Hayward jonathan.hayw...@pobox.com added the comment: Constantine Sapuntzakis wrote: import ssl # Work around python bug #5328 def SSLSocket_makefile_fixed(self, mode='r', bufsize=-1): from socket import _fileobject self._makefile_refs += 1 return _fileobject(self,

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Francesco Sechi
Francesco Sechi francesco.se...@iet.unipi.it added the comment: A solution for this issue could be to replace the setAttribute method as follow: - d[value] = d[nodeValue] = value + d[value] = d[nodeValue] = value.replace('\n',' ') NOTE: I didn't do a patch, because I don't know which python

[issue5998] Add __bool__ to threading.Event and multiprocessing.Event

2009-05-11 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: I think it would allow for more pythonic code if the threading.Event and multiprocessing.Event classes had the __bool__ special attribute. This would allow doing if e: ... instead of if e.is_set(): This could be backported

[issue5999] compile error on HP-UX 11.22 ia64 - 'mbstate_t' is used as a type, but has not been defined as a type

2009-05-11 Thread Sridhar Ratnakumar
New submission from Sridhar Ratnakumar sridh...@activestate.com: cc +DD64 -Ae -D_REENTRANT +Z -c -DNDEBUG -O -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c Error 419: ./Modules/python.c, line 34 # 'mbstate_t' is used as a type, but has not been defined as a

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Francesco Sechi
Changes by Francesco Sechi francesco.se...@iet.unipi.it: Removed file: http://bugs.python.org/file13837/test_toxml.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5752 ___

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Francesco Sechi
Changes by Francesco Sechi francesco.se...@iet.unipi.it: Added file: http://bugs.python.org/file13960/test_toxml.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5752 ___

[issue6000] compile error on AIX and HP-UX 11.00 - PyNumber_InPlaceOr(newfree, allfree) 0

2009-05-11 Thread Sridhar Ratnakumar
New submission from Sridhar Ratnakumar sridh...@activestate.com: cc_r -qlanglvl=ansi -c -DNDEBUG -O -I. -IInclude -I./Include -DPy_BUILD_CORE -o Python/symtable.o Python/symtable.c Python/symtable.c, line 767.50: 1506-068 (S) Operation between types struct _object* and int is not allowed.

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Francesco Sechi
Francesco Sechi francesco.se...@iet.unipi.it added the comment: I have uploaded a test script that shows that, without my patch, the methods setAttribute and parseString work differently; adding my patch, the behaviour is symmetric. -- ___ Python

[issue6001] Test discovery for unittest

2009-05-11 Thread Michael Foord
New submission from Michael Foord mich...@voidspace.org.uk: Attached is a patch that implements test discovery for unittest. It includes command line argument handling (awkward manual handling but works fine...), so that it can be invoked through: python -m unittest discover python -m

[issue5846] Deprecate obsolete functions in unittest

2009-05-11 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Hehe - I wasn't actually doing that, just replacing the use of the obsolete functions. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5846

[issue5596] memory leaks in 3.1

2009-05-11 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- dependencies: +test_urlllib2_localnet DigestAuthHandler leaks nonces ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5596 ___

[issue6002] test_urllib2_localnet DigestAuthHandler leaks nonces

2009-05-11 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- title: test_urlllib2_localnet DigestAuthHandler leaks nonces - test_urllib2_localnet DigestAuthHandler leaks nonces ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6002

[issue5997] strftime is broken

2009-05-11 Thread Jonathan
Jonathan jonathan.cervi...@gmail.com added the comment: Works perfectly now, thank you and sorry for the inaccurate report. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5997 ___

[issue5201] Using LDFLAGS='-rpath=\$$LIB:/some/other/path' ./configure breaks the build

2009-05-11 Thread Floris Bruynooghe
Floris Bruynooghe floris.bruynoo...@gmail.com added the comment: The updated patch inserts the single $ when needed. I've checked this on compiling python, stdlib extension modules and custom extension modules and this gives the correct results in all cases. -- Added file:

[issue1759845] subprocess.call fails with unicode strings in command line

2009-05-11 Thread Greg Couch
Greg Couch gr...@cgl.ucsf.edu added the comment: I like the C patch better. It only tries to decode non-unicode objects with the filesystem (mbcs) encoding. This fits in with Python 3.0 perfectly where all strings are unicode. In 2.5, strings are assumed to be in the mbcs encoding, to match

[issue4066] smtplib SMTP_SSL._get_socket doesn't return a value

2009-05-11 Thread Daniel Diniz
Daniel Diniz aja...@gmail.com added the comment: Thanks, Marcin! Same bug seems to apply to py3k, ported patches attached. -- stage: - patch review versions: +Python 3.1 Added file: http://bugs.python.org/file13964/return_socket.diff ___ Python

[issue5265] StringIO can duplicate newlines in universal newlines mode

2009-05-11 Thread Jason R. Coombs
Jason R. Coombs jar...@jaraco.com added the comment: Although this was fixed for 3.1, it appears not to be fixed for Python 2.6 or 2.7. PS C:\Users\jaraco python Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for

[issue5994] help(marshal) just gives an outline; no help text provided.

2009-05-11 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Patch attached for trunk based on 2.6.2 docs. I only included what felt like the essential parts of the module description. -- assignee: georg.brandl - r.david.murray keywords: +patch nosy: +r.david.murray stage: - patch review

[issue5957] Possible mistake regarding writeback in documentation of shelve.open()

2009-05-11 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Fixed in r72572, r72573, r72574, and r72575. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue5994] help(marshal) just gives an outline; no help text provided.

2009-05-11 Thread Senthil
Senthil orsent...@gmail.com added the comment: David, should the marshal.version be explained as it is present in the docs? marshal.version Indicates the format that the module uses. Version 0 is the historical format, version 1 (added in Python 2.4) shares interned strings and version 2

[issue5265] StringIO can duplicate newlines in universal newlines mode

2009-05-11 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: The bug shouldn't affect 2.6 and 2.7 unless you backported the now obsolete _stringio module from 3.0. I tested 2.6 and 2.7 and as expected I didn't see the bug: Python 2.6.2+ (release26-maint:72576, May 11 2009, 23:16:48) [GCC

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Daniel Diniz
Daniel Diniz aja...@gmail.com added the comment: Francesco, Your patch still doesn't allow one to add a multiline attribute values as Tomalak describes: The catch: This leads to an actual data loss if I *wanted* to store newline characters in an attribute -- unless the newline characters are

[issue5752] xml.dom.minidom does not escape newline characters within attribute values

2009-05-11 Thread Daniel Diniz
Changes by Daniel Diniz aja...@gmail.com: -- priority: - normal stage: test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5752 ___

[issue1759845] subprocess.call fails with unicode strings in command line

2009-05-11 Thread Kuang-che Wu
Kuang-che Wu k...@csie.org added the comment: There is slight difference between C and python patch. C version: convert mbcs argument to unicode py version: convert unicode argument to mbcs Actually, python version patch may not work if the string is unicode and cannot encoded by mbcs. For

[issue2813] No float formatting in PyString_FromFormat

2009-05-11 Thread Daniel Diniz
Changes by Daniel Diniz aja...@gmail.com: -- nosy: +eric.smith priority: - normal stage: - patch review versions: +Python 2.7, Python 3.2 -Python 2.1.1, Python 2.1.2, Python 2.2, Python 2.2.1, Python 2.2.2, Python 2.2.3, Python 2.3, Python 2.4, Python 2.5, Python 2.6, Python 3.0

[issue1672568] silent error in email.message.Message.get_payload

2009-05-11 Thread Daniel Diniz
Daniel Diniz aja...@gmail.com added the comment: Renaud, Here's your patch with a test case against trunk. -- stage: test needed - patch review Added file: http://bugs.python.org/file13967/noisy_get_payload.diff ___ Python tracker