[issue14237] Special sequences \A and \Z don't work in character set []

2012-03-08 Thread Martin v . Löwis
Martin v. Löwis added the comment: What behavior would you expect? -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list maili

[issue14229] On KeyboardInterrupt, the exit code should mirror the signal number

2012-03-08 Thread Martin v . Löwis
Martin v. Löwis added the comment: I'm not so sure that Python is in violation of the convention here. The exit code should report *unhandled* signals, indicating that the process didn't provide an exit code at all (as it didn't call exit(2)). You are supposed to use WIFEXITED/WIFSIGNALED/WIF

[issue14237] Special sequences \A and \Z don't work in character set []

2012-03-08 Thread py.user
New submission from py.user : >>> import re >>> re.search(r'\Ac\Z', 'c') <_sre.SRE_Match object at 0xb74cff38> >>> re.search(r'[\A]c[\Z]', 'c') >>> re.purge() >>> re.search(r'[\A]c[\Z]', 'c', re.DEBUG) in at at_beginning_string literal 99 in at at_end_string >>> -- components: Reg

[issue14236] In help(re) are insufficient details

2012-03-08 Thread py.user
New submission from py.user : 1) help(re) "\s Matches any whitespace character; equivalent to [ \t\n\r\f\v]. \S Matches any non-whitespace character; equiv. to [^ \t\n\r\f\v]." no info about unicode spaces 2) help(re.split) "split(pattern, string, maxsplit=0, fla

[issue14217] text output pretends to be code

2012-03-08 Thread Senthil Kumaran
Senthil Kumaran added the comment: I reviewed the patch, built the docs and found it good. Fixed it in 3d877dee1bde and aaf45928899c Thanks! -- nosy: +orsenthil resolution: -> fixed status: open -> closed versions: -Python 2.7 ___ Python tracker

[issue14205] Raise an error if a dict is modified during a lookup

2012-03-08 Thread Jim Jewett
Jim Jewett added the comment: On Thu, Mar 8, 2012 at 7:43 PM, STINNER Victor wrote: > Python < 3.3 retries the lookup an unlimited number of times which > lead to a crash, that's the issue fixed by my change. How does it lead to a crash? I think it just leads to an infinite loop (which is wors

[issue14036] urlparse insufficient port property validation

2012-03-08 Thread Senthil Kumaran
Senthil Kumaran added the comment: Couple of points: 1. On your last example, which webserver treats 'L' as part of port number? I can't of anything. 2. Can you write a "real application" which is listening to beyond 65535? Which platform would it be? Current way of handling invalid port li

[issue14233] argparse: "append" action fails to override default values

2012-03-08 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think it's worth checking that you've passed in the correct type for the default parameter. That's not something that Python code typically does. The error you get: AttributeError: 'tuple' object has no attribute 'append' seem pretty clear. Pass in a li

[issue14233] argparse: "append" action fails to override default values

2012-03-08 Thread guilherme-pg
Changes by guilherme-pg : -- type: crash -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-08 Thread Glenn Linderman
Glenn Linderman added the comment: *Very* interesting, Steven. Looking again at section 15.4.6, and recognizing that positional arguments were never parsed by optparse, then we discover that with two minor tweaks, removing "and add additional ArgumentParser.add_argument() calls for the positi

[issue14235] test_cmd.py does not correctly call reload()

2012-03-08 Thread Josh Watson
Changes by Josh Watson : -- type: crash -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue14235] test_cmd.py does not correctly call reload()

2012-03-08 Thread Josh Watson
Josh Watson added the comment: Accidentally submitted before finishing typing. Anyways, it calls "reload(cmd)" in the test_coverage function in test_cmd.py, which does not work anymore given that reload has been moved to imp. I've uploaded a patch that fixes this. -- keywords: +patch

[issue14235] test_cmd.py does not correctly call reload()

2012-03-08 Thread Josh Watson
New submission from Josh Watson : The test_coverage function in test_cmd.py calls reload(cmd) -- components: Tests messages: 155200 nosy: Josh.Watson priority: normal severity: normal status: open title: test_cmd.py does not correctly call reload() type: crash versions: Python 3.3 _

[issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat

2012-03-08 Thread Dave Malcolm
Changes by Dave Malcolm : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue14205] Raise an error if a dict is modified during a lookup

2012-03-08 Thread Guido van Rossum
Guido van Rossum added the comment: On Thu, Mar 8, 2012 at 4:56 PM, STINNER Victor wrote: > > STINNER Victor added the comment: > >> Can you implement the counter without adding an extra field to the dict >> object? > > Add a counter requires to change the prototype of the C lookup function:

[issue14234] CVE-2012-0876 (hash table collisions CPU usage DoS) for embedded copy of expat

2012-03-08 Thread Dave Malcolm
New submission from Dave Malcolm : Expat 2.1.0 Beta was recently announced: http://mail.libexpat.org/pipermail/expat-discuss/2012-March/002768.html which contains (among other things) a fix for a hash-collision denial-of-service attack (CVE-2012-0876) I'm attaching a patch which minimally bac

[issue14205] Raise an error if a dict is modified during a lookup

2012-03-08 Thread STINNER Victor
STINNER Victor added the comment: > Can you implement the counter without adding an extra field to the dict > object? Add a counter requires to change the prototype of the C lookup function: PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, Py_hash_t hash); I don't know if it is a pr

[issue14205] Raise an error if a dict is modified during a lookup

2012-03-08 Thread Guido van Rossum
Guido van Rossum added the comment: I'm still torn. Can you implement the counter without adding an extra field to the dict object? I worry that we'll get the same objection we had when MAL proposed collision counting as a solution to the hash DoS attack. The numbers 0, 1 and infinity are s

[issue14233] argparse: "append" action fails to override default values

2012-03-08 Thread guilherme-pg
New submission from guilherme-pg : Trying to set a default value to arguments whose action is "append" causes argparse to raise AttributeError when such arguments are provided in the command line (see attached test case t1.py). This happens because _AppendAction doesn't expect the presence of

[issue14205] Raise an error if a dict is modified during a lookup

2012-03-08 Thread STINNER Victor
STINNER Victor added the comment: Guido: So, what do you think? Do you like the new behaviour, or would you prefer a softer solution like retrying N times? Python < 3.3 retries the lookup an unlimited number of times which lead to a crash, that's the issue fixed by my change. -- ___

[issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py

2012-03-08 Thread STINNER Victor
STINNER Victor added the comment: Oh, it looks like the following commit fixed the issue without touching to the crasher test: ba6376dff6c4. Armin, Benjamin: can you confirm? -- nosy: +benjamin.peterson ___ Python tracker

[issue14232] obmalloc: mmap() returns MAP_FAILED on error, not 0

2012-03-08 Thread STINNER Victor
New submission from STINNER Victor : Python fails to catch memory allocation error in its memory allocator when mmap() is used. Attached patch fixes the issue. -- components: Interpreter Core files: obmalloc_map_failed.patch keywords: patch messages: 155192 nosy: haypo, neologix, pitrou

[issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py

2012-03-08 Thread Armin Rigo
Armin Rigo added the comment: Crashes for me on Python 2.5 and 2.6, but no longer on Python 2.7. The problem may have been fixed in the meantime. -- ___ Python tracker ___ ___

[issue14211] Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr()

2012-03-08 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue14231] Fix or drop Lib/test/crashers/borrowed_ref_1.py

2012-03-08 Thread STINNER Victor
New submission from STINNER Victor : Lib/test/crashers/borrowed_ref_1.py contains the docstring: "_PyType_Lookup() returns a borrowed reference. This attacks the call in dictobject.c." The file was added by Armin in 2006 by the changeset 4dd1a9383e47. I just fixed #14211 which was a similar bug

[issue14211] Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr()

2012-03-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2cc44cd8098e by Victor Stinner in branch 'default': Issue #14211: Oops, I removed the wrong file :-) http://hg.python.org/cpython/rev/2cc44cd8098e -- ___ Python tracker

[issue14211] Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr()

2012-03-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 579f845ac396 by Victor Stinner in branch 'default': Issue #14211: _PyObject_GenericSetAttrWithDict() keeps a strong reference to http://hg.python.org/cpython/rev/579f845ac396 -- nosy: +python-dev ___ Pyt

[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-08 Thread Steven Bethard
Steven Bethard added the comment: Actually, that could be even simpler: args, remaining_args = optionals.parse_known_args() args = positionals.parse_args(remaining_args, args) -- ___ Python tracker __

[issue14199] Keep a refence to mro in _PyType_Lookup() and super_getattro()

2012-03-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 21e245ed3747 by Victor Stinner in branch 'default': Close #14199: _PyType_Lookup() and super_getattro() keep a strong reference to http://hg.python.org/cpython/rev/21e245ed3747 -- nosy: +python-dev resolution: -> fixed stage: -> committed

[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-08 Thread Steven Bethard
Steven Bethard added the comment: Thinking about it a bit more, it strikes me that maybe you could get the behavior you want by declaring two parsers, one with just optionals, and one with just positionals. Then: optional_args, remaining_args = optionals.parse_known_args() args = positionals.

[issue6333] logging: ValueError: I/O operation on closed file

2012-03-08 Thread Vinay Sajip
Vinay Sajip added the comment: > IMHO nobody should ever register StreamHandler with sys.stderr because you > cannot be sure has someone intercepted it or not. There's a strong > convention that sys.__stderr__ should not be intercepted so using it is safe. Actually, I believe it is reasonabl

[issue8754] quote bad module name in ImportError-like messages

2012-03-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-03-08 Thread Łukasz Langa
Changes by Łukasz Langa : -- assignee: -> lukasz.langa nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-03-08 Thread Łukasz Langa
Changes by Łukasz Langa : -- assignee: -> lukasz.langa nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue14220] "yield from" kills generator on re-entry

2012-03-08 Thread Mark Shannon
Mark Shannon added the comment: I've just added issue 14230 which overlaps with this issue somewhat. -- ___ Python tracker ___ ___ Py

[issue14230] Delegating generator is not always visible to debugging tools such as inspect & pdb

2012-03-08 Thread Mark Shannon
New submission from Mark Shannon : Delegating generators do not show always up in stack traces, such as inspect.stack(). The show up during the first delegation, but not thereafter. I have attached a patch. It alters the way the YIELD_FROM bytecode works; it loops back on itself. This ensures

[issue6333] logging: ValueError: I/O operation on closed file

2012-03-08 Thread Pekka Klärck
Pekka Klärck added the comment: @vinay.sajip the problem is that many tools that don't do anything with logging module intercept sys.stdout and sys.stderr. Such tools typically aren't even aware of libraries they use (or test) using logging and much less about them registering StreamHandler u

[issue14218] include rendered output in addition to markup

2012-03-08 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: > Sandro Tosi added the comment: > Tshepang: did I get it correctly? Éric: is it (at least a bit) clearer? that's exactly what I tried to convey -- ___ Python tracker

[issue14218] include rendered output in addition to markup

2012-03-08 Thread Sandro Tosi
Sandro Tosi added the comment: eheh yeah it seems so :) What I think Tshepang wants is this: - the devguide contains the description of how to document python - that documentation is about a set of ReST coding commands that generate the desired output - currently the devguide reports only the

[issue14218] include rendered output in addition to markup

2012-03-08 Thread Éric Araujo
Éric Araujo added the comment: It looks like I have a hard time putting myself in your shoes and seeing what you want, so I’m going to shut up for a while and let Ezio and Sandro state their opinion on your original request. :) -- ___ Python track

[issue14220] "yield from" kills generator on re-entry

2012-03-08 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue14218] include rendered output in addition to markup

2012-03-08 Thread Éric Araujo
Éric Araujo added the comment: I don’t get why you want to know what it looks like, and then, I don’t get why you can’t build the doc or look at docs.python.org. Also, not getting what you talk about re-building: building the devguide or docs once should be enough. -- __

[issue14229] On KeyboardInterrupt, the exit code should mirror the signal number

2012-03-08 Thread Nadeem Vawda
Changes by Nadeem Vawda : -- nosy: +nadeem.vawda ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue14218] include rendered output in addition to markup

2012-03-08 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: Okay, let me try again: I want the documentation tutorial to tell me, for example, (1) here is the markup for a code block, and (2) here is what it looks like. At the moment, I only get (1)... point is I do not want to have to rebuild a reST file each t

[issue14228] SIGINT (Ctrl-C) not caught at startup

2012-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Opened issue14229 for the "signal number as exit code" enhancement as mentioned on the Debian issue tracker. -- ___ Python tracker ___ ___

[issue14229] On KeyboardInterrupt, the exit code should mirror the signal number

2012-03-08 Thread Antoine Pitrou
New submission from Antoine Pitrou : Compare: $ ./python -c "import subprocess, signal, time; p = subprocess.Popen(['cat']); time.sleep(1); p.send_signal(signal.SIGINT); print(p.wait())" -2 with: $ ./python -c "import subprocess, signal, time; p = subprocess.Popen(['python', '-c', 'input()']

[issue14228] SIGINT (Ctrl-C) not caught at startup

2012-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Regarding "feature request": I think this is a *bug*, not a feature > request: For me, it is impossible to handle SIGINT correctly with my > code, because it is half-handled (exception raised, but impossible to > catch) by python itself. In the trace you just

[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-08 Thread Glenn Linderman
Glenn Linderman added the comment: Ah yes, argparse had a life outside the stdlib, so now I understand your compatibility concerns. Mind you, I think the overall technology of argparse is superior to optparse, which is why, together with the optparse deprecation, I am trying to port to use i

[issue14228] SIGINT (Ctrl-C) not caught at startup

2012-03-08 Thread telmich
telmich added the comment: Regarding "feature request": I think this is a *bug*, not a feature request: For me, it is impossible to handle SIGINT correctly with my code, because it is half-handled (exception raised, but impossible to catch) by python itself. Imho this behaviour should not be

[issue14228] SIGINT (Ctrl-C) not caught at startup

2012-03-08 Thread telmich
telmich added the comment: This does not change a thing: Indirect child being called ^CTraceback (most recent call last): File "/usr/lib/python3.2/functools.py", line 176, in wrapper caught signint in parent result = cache[key] KeyError: (, '[ \\f\\t]*((\\r?\\n|#[^\\r\\n]*|([bB]?[rR]

[issue6727] ImportError when package is symlinked on Windows

2012-03-08 Thread Brian Curtin
Brian Curtin added the comment: The @support.skip_unless_symlink decorator could be helpful there. -- ___ Python tracker ___ ___ Pytho

[issue14144] urllib2 HTTPRedirectHandler not forwarding POST data in redirect

2012-03-08 Thread Senthil Kumaran
Senthil Kumaran added the comment: I am closing this issue as I feel that the requirement may not be addressed by a change. If there is patch for HowTo, we can tackle that in another issue. Thank you for contribution. -- resolution: -> invalid status: open -> closed

[issue6727] ImportError when package is symlinked on Windows

2012-03-08 Thread Jason R. Coombs
Jason R. Coombs added the comment: The Unix tests are now passing again. Some Windows buildbots are failing because they do not have the symlink privilege. I'll add a guard in the test to not run it if it doesn't have privilege to symlink. -- ___ P

[issue6333] logging: ValueError: I/O operation on closed file

2012-03-08 Thread Vinay Sajip
Vinay Sajip added the comment: Re. the fix to #9501, the swallowing of exceptions was done for specific reasons noted in the comments in the exception clause which does the swallowing. This only happens during application shutdown - not all ValueErrors on flush() or close() are swallowed. In

[issue14218] include rendered output in addition to markup

2012-03-08 Thread Éric Araujo
Éric Araujo added the comment: I don’t understand why you don’t want to build the doc if you want to see what the output looks like. You should build the doc anyway before making a patch to make sure there are no errors, and it does not take that long. As I don’t understand your problem, I

[issue14228] SIGINT (Ctrl-C) not caught at startup

2012-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Try to enclose the whole code (including the imports) in the try...except block. I'm not sure why this matters, though. If you want Python to have a different return code when terminated by a KeyboardInterrupt, then I agree it is a valid feature request.

[issue9408] curses: Link against libncursesw instead of libncurses

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

[issue6333] logging: ValueError: I/O operation on closed file

2012-03-08 Thread Pekka Klärck
Pekka Klärck added the comment: The same problem that caused problems to py.test caused problems also to Robot Framework: http://code.google.com/p/robotframework/issues/detail?id=1079 I was surprised to notice this issue was closed as invalid although the problem didn't occur with Python 2.7

[issue6727] ImportError when package is symlinked on Windows

2012-03-08 Thread Jason R. Coombs
Jason R. Coombs added the comment: I see that. Thanks. I'm on it. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue6727] ImportError when package is symlinked on Windows

2012-03-08 Thread Florent Xicluna
Florent Xicluna added the comment: It breaks the compilation on few buildbots. Python/import.c:130:14: error: #if with no expression -- nosy: +flox ___ Python tracker ___ ___

[issue6727] ImportError when package is symlinked on Windows

2012-03-08 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've gone ahead and pushed the changesets for Python 2.7. I'll continue to hold off on Python 3.2/3.3 until I can review. Perhaps Brian and I can review these changes at PyCon. -- ___ Python tracker

[issue6727] ImportError when package is symlinked on Windows

2012-03-08 Thread Jason R. Coombs
Changes by Jason R. Coombs : -- hgrepos: -104 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue6727] ImportError when package is symlinked on Windows

2012-03-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6c218b9c5c4c by Jason R. Coombs in branch '2.7': Extracted Windows directory detection from NullImporter.__init__. This greatly simplifies the code and fixes issue6727. http://hg.python.org/cpython/rev/6c218b9c5c4c New changeset 92f4d4eebed1 by Ja

[issue14227] console w/ cp65001 displays extra characters for non-ascii strings.

2012-03-08 Thread STINNER Victor
STINNER Victor added the comment: See the issue #1602. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue14217] text output pretends to be code

2012-03-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> patch review type: -> enhancement ___ Python tracker ___ ___ Python-bugs-

[issue14227] console w/ cp65001 displays extra characters for non-ascii strings.

2012-03-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +haypo, loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue14191] argparse: nargs='*' doesn't get out-of-order positional parameters

2012-03-08 Thread Steven Bethard
Steven Bethard added the comment: > Hence, I conclude that, unless this was spelled out in the PEP and I > missed it, that having such boundaries is a bug Practically speaking, we just can't change this because it will break existing argparse scripts. Argparse has had this behavior since 2006

[issue14217] text output pretends to be code

2012-03-08 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: > Éric Araujo added the comment: > > Use this: > > .. code-block:: none > >   output etc. Thanks much. I've attached a patch. -- Added file: http://bugs.python.org/file24757/tis-not-code-2.patch ___ Python tr

[issue14216] ImportError: No module named binascii

2012-03-08 Thread Ramchandra Apte
Ramchandra Apte added the comment: See http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3. What it says might be the cause of the problem. -- nosy: +ramchandra.apte ___ Python tracker

[issue14218] include rendered output in addition to markup

2012-03-08 Thread Tshepang Lekhonkhobe
Tshepang Lekhonkhobe added the comment: > Éric Araujo added the comment: >> For devguide/documenting, If you show me markup, also show me what output it >> gives me. > Would this really be useful?  If you’re looking at that page, you want to > know what markup to use for what situation; why d

[issue14228] SIGINT (Ctrl-C) not caught at startup

2012-03-08 Thread telmich
telmich added the comment: And here's the actual python code -- Added file: http://bugs.python.org/file24756/caller.py ___ Python tracker ___ ___

[issue14228] SIGINT (Ctrl-C) not caught at startup

2012-03-08 Thread telmich
New submission from telmich : Hello, pressing ctrl-c or having sigint delivered to the python process in its startup phase results in random tracebacks displayed. This is related to issue3137, but actually happening in Python 3.2.2 on archlinux. We noticed this during development of the cdis