[issue5416] str.replace does strange things when given a negative count

2010-08-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank you. Please do the reversion and the docstring fixup. -- ___ Python tracker ___ ___ Python

[issue9424] Disable unittest.TestCase.assertEquals and assert_ during a regrtest run

2010-08-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please don't pursue this further. It does not matter at all whether developers use assertEqual or assertEquals. That is no more than a stylistic preference. I do not want a commit hook, or for developer patches to be edited, or for there to be as assert

[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Jervis Whitley
New submission from Jervis Whitley : complex() raises ValueError when parsing a string argument containing both real and imaginary where one of the real or imaginary is a decimal. To reproduce: >>> complex("1.1 + 2.1j") ValueError: complex() arg is a malformed string >>> complex("2.1j") 2.1j

[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2010-08-12 Thread kai zhu
kai zhu added the comment: python 3.1.2 mimetypes initialization also fails in redhat linux: >>> import http.server Traceback (most recent call last): File "/home/public/i386-redhat-linux-gnu/python/lib/python3.1/http/server.py", line 588, in class SimpleHTTPRequestHandler(BaseHTTPReq

[issue9522] xml.etree.ElementTree forgets the encoding

2010-08-12 Thread Mark Summerfield
Mark Summerfield added the comment: Perhaps a useful compromise would be to add an "encoding" attribute that is set to the encoding of the XML file that's read in (and with a default of "ascii"). That way it would be possible to preserve the encoding, e.g.: import xml.etree.ElementTree as etr

[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Mark Dickinson
Mark Dickinson added the comment: The problem here is the spaces in the input string: newton:~ dickinsm$ python2.7 Python 2.7 (r27:82500, Jul 13 2010, 14:10:05) [GCC 4.2.1 (Apple Inc. build 5659)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> complex("1.1

[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Mark Dickinson
Mark Dickinson added the comment: Note also that spaces are already allowed immediately inside the parentheses in a string argument to the complex constructor (in python 2.6 and later): >>> complex("( 1.1+2.1j )") (1.1001+2.1001j) -- _

[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Mark Dickinson
Changes by Mark Dickinson : -- stage: -> needs patch versions: +Python 3.2 -Python 2.5, Python 2.6, Python 2.7, Python 3.1 ___ Python tracker ___

[issue9522] xml.etree.ElementTree forgets the encoding

2010-08-12 Thread Stefan Behnel
Stefan Behnel added the comment: lxml.etree has encapsulated this in a 'docinfo' property which also holds the XML 'version', the 'standalone' state and the DOCTYPE (if available). Note that this information is readily available in lxml.etree for any parsed Element (by wrapping it in a new El

[issue9522] xml.etree.ElementTree forgets the encoding

2010-08-12 Thread Mark Summerfield
Mark Summerfield added the comment: I don't see how lxml is relevant here? lxml is a third party library, whereas etree is part of the standard library. And according to the 3.1.2 docs etree doesn't have a docinfo (or any other) property. -- ___ Py

[issue9571] argparse: Allow the use of -- to break out of nargs and into subparser

2010-08-12 Thread Steven Bethard
Steven Bethard added the comment: This is closely related to issue 9338. The parser should know that your command line requires at least the COMMAND argument, so it should stop parsing in time for that. However, in the case of subcommands, even if we solved issue 9338, you would still get the

[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Nir Aides
Nir Aides added the comment: I think patch may be simplified. Instead of keeping track of CRC offset, invoke it directly on the 'data' variable being added to _readbuffer. Also the call to _update_crc() before the return from read1() looks redundant. Finally, is it possible to determine end

[issue9522] xml.etree.ElementTree forgets the encoding

2010-08-12 Thread Stefan Behnel
Stefan Behnel added the comment: That's why I mention it here to prevent future incompatibilities between the two libraries. -- ___ Python tracker ___ __

[issue1491804] Simple slice support for list.sort() and .reverse()

2010-08-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm rejecting this feature request on the grounds that the use cases are sufficiently uncommon to warrant adding API complexity. Currently, the notions of reverse() and sort() are comparatively simple. They correspond well to what I see in other languag

[issue9338] argparse optionals with nargs='+' can't be followed by positionals

2010-08-12 Thread Michael . Elsdörfer
Changes by Michael.Elsdörfer : -- nosy: +elsdoerfer ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-12 Thread Heejin
New submission from Heejin : As far as I have seen, this bug only appears in Windows 7. I tested with Python 2.5, 2.6, and 2.7 and they all seem to have this bug. I tested with Windows 7 Korean version. I'm not sure if other language versions have the same problem. Reproduction steps: 1. Run

[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-12 Thread Tim Golden
Changes by Tim Golden : -- assignee: -> tim.golden nosy: +tim.golden versions: -Python 2.5 ___ Python tracker ___ ___ Python-bugs-lis

[issue3482] re.split, re.sub and re.subn should support flags

2010-08-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: unit test needed -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue6164] [AIX] Patch to correct the AIX C/C++ linker argument used for 'runtime_library_dirs'

2010-08-12 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo versions: -Python 2.7, Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue9055] test_issue_8959_b fails when run from a service

2010-08-12 Thread Tim Golden
Tim Golden added the comment: Fudge-fix committed as r83948, r83958. Not sure what status to set -- status: open -> pending ___ Python tracker ___ ___

[issue2304] subprocess under windows fails to quote properly when shell=True

2010-08-12 Thread Tim Golden
Tim Golden added the comment: ReComitted as r83947, r83956, r83957 and this time the buildbots look happy. (At least as regards this change). -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue9055] test_issue_8959_b fails when run from a service

2010-08-12 Thread Paul Moore
Paul Moore added the comment: Certainly the 2.7 branch on my buildbot is now OK (3.x is failing for other reasons :-() -- status: pending -> open ___ Python tracker ___ _

[issue9574] complex does not parse strings containing decimals

2010-08-12 Thread Mark Dickinson
Mark Dickinson added the comment: I'm wondering whether the moratorium (PEP 3003) applies to this; from a close reading I'd say it does. At any rate, it seems like an inessential enhancement, so I'd be happy to delay this until 3.3. -- versions: +Python 3.3 -Python 3.2 _

[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-12 Thread Tim Golden
Tim Golden added the comment: I can't get it crash on a path that short. I can produce an error message if I push it beyond the 254 limit, but you can work around that by applying the filesystem namespace prefix: import os path = "c:\\" + "\\".join (130 * ['xx']) os.makedirs (path) # # will

[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-12 Thread Heejin
Heejin added the comment: Thank you for your answer. Actually I tried that in two Windows7-installed computers and failed in both. But I don't think it is the problem of path lengths; I created other paths that long and that deep but os.listdir() works on them. That's why I wrote the path verba

[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

2010-08-12 Thread Tim Golden
Tim Golden added the comment: See: http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx I tried first with your exact path and it caused no issues on my Win7 box. FWIW you could easily roll your own os.walk (starting by copying the code that's there) if you needed to roll in special

[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, here is a new patch with a simpler logic. I've also added tests with a deflated zipfile entry with a bad CRC (in addition to the one with a stored zipfile entry). > Finally, is it possible to determine end of file if length of 'data' > (computed for crc)

[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-12 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: -belopolsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue9573] importing a module that executes fork() raises RuntimeError

2010-08-12 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- Removed message: http://bugs.python.org/msg113654 ___ Python tracker ___ ___ Python-bugs-list mail

[issue8857] socket.getaddrinfo needs tests

2010-08-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've ported the patch to py3k and checked it works under Mandriva Linux and Windows 7 x64. -- versions: -Python 2.6 Added file: http://bugs.python.org/file18485/getaddrinfo3.patch ___ Python tracker

[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Nir Aides
Nir Aides added the comment: But you answered my question with code :) self._file_size is now unused and may be removed. -- ___ Python tracker ___ __

[issue1475] test_popen fails when the directory contains a space

2010-08-12 Thread Tim Golden
Tim Golden added the comment: Fixed by issue2304 -- components: -Library (Lib), Tests, Windows nosy: +tim.golden resolution: -> duplicate stage: -> committed/rejected status: open -> closed type: -> behavior ___ Python tracker

[issue7467] The zipfile module does not check files' CRCs, including in ZipFile.testzip

2010-08-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, indeed. I've committed an updated patch in r83959 (py3k), r83962 (3.1) and r83961 (2.7). Thank you! -- resolution: accepted -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tr

[issue5484] subprocess.call() fails for .bat files on Windows, if executable path contains parenthesis

2010-08-12 Thread Tim Golden
Tim Golden added the comment: OK; issue2304 is now fixed and closed. But it doesn't seem to make any difference to this behaviour. I've just retested and I see on py3k the behaviour the OP saw. CreateProcess does the same thing and I couldn't even get it to work with multiply-nested quotes. S

[issue9576] logging.addLevelName in file-based configurations

2010-08-12 Thread Tarek Ziadé
New submission from Tarek Ziadé : It's not possible to use a custom level in a file-based configuration unless you programatically call logging.addLevelName('LEVEL', VALUE) It would be nice to be able to declare new levels in config files -- assignee: vinay.sajip components: Library (L

[issue6884] Impossible to include file in sdist that starts with 'build' on Win32

2010-08-12 Thread Éric Araujo
Éric Araujo added the comment: I’ll write a unit test shortly. -- assignee: tarek -> eric.araujo versions: +Python 3.1, Python 3.2 -Python 2.6 ___ Python tracker ___

[issue9576] logging.addLevelName in file-based configurations

2010-08-12 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue9577] html parser bug related with CDATA sections

2010-08-12 Thread Arman
New submission from Arman : When HTMLParser reaches CDATA element it enters cdata mode by calling set_cdata_mode (file html/parser.py line 270). this method assigns self.interesting member new value r'<(/|\Z)'. But this is not correct. Consider following case