[issue6972] zipfile.ZipFile overwrites files outside destination path

2012-04-08 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: +# make sure the zip file isn't traversing out of the path +if not targetpath.startswith(basepath): Check is insufficient. basepath='/etc/asd', member.filename='../asdfgh'. The issue10905 has relations with this issue.

[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-08 Thread mattip
mattip matti.pi...@gmail.com added the comment: I was going to add a test for this to Lib/test/test_math.py, but found this comment: # copysign(INF, NAN) may be INF or it may be NINF, since # we don't know whether the sign bit of NAN is set on any # given platform. I

[issue2193] Cookie Colon Name Bug

2012-04-08 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Ping. -- nosy: +storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2193 ___ ___

[issue14455] plistlib unable to read json and binary plist files

2012-04-08 Thread d9pouces
d9pouces pyt...@19pouces.net added the comment: Here is the new patch, allowing read and write binary, json and xml plist files. It includes both the plistlib.py and test/test_plistlib.py patches. JSON format does not allow dates and data, so XML is used by default to write files. I use the

[issue14222] Use time.steady() to implement timeout

2012-04-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The not subject to adjustment property is more desirable than not. The undefined reference point property isn't harmful in this context (the start time isn't exposed). So you're closing the issue while you're in agreement with it? --

[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Chris Jerdonek
New submission from Chris Jerdonek chris.jerdo...@gmail.com: While converting code from Python 2 to Python 3, I came across the gotcha that strings implement __iter__ in Python 3 but not in Python 2. Looking through the documentation, I don't seem to see anything like this mentioned in the

[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Why is it so important if strings implement __iter__? They are iterable in both versions, since iteration falls back on __getitem__ if no __iter__ is defined. For user code it is irrelevant which of the iteration protocols is present.

[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: It is not so important. I just feel that the change should be acknowledged somewhere -- insofar as the existing user documentation on iterator types already discusses __iter__(). As it stands now, the Python 2 documentation is a bit

[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: behaves like a list is misleading. If you mean checking for iterable-ness, calling iter() on the object is the way to do it. -- ___ Python tracker rep...@bugs.python.org

[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: Okay, then that also might be worth mentioning. As it stands now, the emphasis in the section on iterator types is on __iter__() (e.g. it is the main focus of the introduction), whereas iter() is barely mentioned (only in the sections

[issue14423] Getting the starting date of iso week from a week number and a year.

2012-04-08 Thread Esben Agerbæk Black
Changes by Esben Agerbæk Black esbe...@gmail.com: Added file: http://bugs.python.org/file25157/isodates.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14423 ___

[issue10576] Add a progress callback to gcmodule

2012-04-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: A new patch, taking Antoine's review and comments into account. -- Added file: http://bugs.python.org/file25158/gccallback.patch ___ Python tracker rep...@bugs.python.org

[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- components: +Interpreter Core -None nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14521 ___

[issue6972] zipfile.ZipFile overwrites files outside destination path

2012-04-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: To clarify what Serhiy said about the patches, the link to the patch works, but the Reitveld review button isn't working. I get 'No issue exists with that id (6972)'. -- nosy: +loewis ___

[issue12805] Optimizations for bytes.join() et. al

2012-04-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Honestly, I don't think there's much point in these optimizations. The first one (The sequence length and separator length are both 0) is probably useless. -- ___ Python tracker rep...@bugs.python.org

[issue14524] Python-2.7.3rc2/Modules/_ctypes/libffi/src/dlmalloc.c won't compile on ia64-hp-hpux11.31 without -DHAVE_USR_INCLUDE_MALLOC_H

2012-04-08 Thread Paul A.
Paul A. p...@freeshell.org added the comment: On Sun, Apr 08, 2012 at 02:01:05AM +, R. David Murray wrote: R. David Murray rdmur...@bitdance.com added the comment: Is this a bug report about configure, or a bug report about a crash during compilation after you've adjusted the

[issue14525] ia64-hp-hpux11.31 won't compile Python-2.6.8rc2 without -D_TERMIOS_INCLUDED

2012-04-08 Thread Paul A.
Paul A. p...@freeshell.org added the comment: On Sun, Apr 08, 2012 at 02:06:46AM +, R. David Murray wrote: R. David Murray rdmur...@bitdance.com added the comment: Can you suggest a patch? As I said on the other issue I don't believe any core developers have access to hpux. Sure,

[issue14526] Python-2.6.8rc2 test never finishes ia64-hp-hpux11.31

2012-04-08 Thread Paul A.
Paul A. p...@freeshell.org added the comment: On Sun, Apr 08, 2012 at 02:13:39AM +, R. David Murray wrote: R. David Murray rdmur...@bitdance.com added the comment: Oh, wait, I see you are testing the security RC. Is this a new problem, or does it also occur with the previous

[issue14526] Python-2.6.8rc2 test never finishes ia64-hp-hpux11.31

2012-04-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Can you clarify? In what sense has the 2.7.3 rc regressed? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14526 ___

[issue14527] How to link with an external libffi?

2012-04-08 Thread Paul A.
Paul A. p...@freeshell.org added the comment: On Sun, Apr 08, 2012 at 05:58:29AM +, Ross Lagerwall wrote: Ross Lagerwall rosslagerw...@gmail.com added the comment: If it is in a non-standard location, try setting the environment variables: LDFLAGS linker flags, e.g. -Llib dir if

[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-08 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Hmm. I don't see this as a bug: the sign of a nan isn't really all that meaningful anyway, and this doesn't (AFAIK) contradict any documentation. On the other hand, given that most other aspects of floating-point are now reasonably

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: multiprocessing.reduction still appears to use DuplicateHandle to copy sockets. I propose adding a pair of custom functions to _multiprocessing, that pickles and unpickles handles. It can detect socket handles as being different

[issue14288] Make iterators pickleable

2012-04-08 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14288 ___

[issue14520] Buggy Decimal.__sizeof__

2012-04-08 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: There are really two options: a) if an object is a container, and the contained is accessible to reflection (preferably through gc.get_referents), then the container shouldn't account for the size of the contained. b) if the contained is

[issue14529] distutils's build_msi command ignores the data_files argument

2012-04-08 Thread Mario Vilas
New submission from Mario Vilas mvi...@gmail.com: When creating an MSI installer on Python 2.7 (Windows, both in 32 and 64 bits) the data_files argument of the setup function is completely ignored. This results in broken installations. -- assignee: eric.araujo components: Distutils

[issue7839] Popen should raise ValueError if pass a string when shell=False or a list when shell=True

2012-04-08 Thread Andrew Svetlov
Andrew Svetlov andrew.svet...@gmail.com added the comment: If fylesystem doesn't support unicode (only Windows directly does as I know) str filename should to be converted by `sys.getfilesystemencoding()`. `os.exec` family already does it as well as other fs functions — but they are supports

[issue14530] distutils's build_wininst command fails to correctly interpret the data_files argument

2012-04-08 Thread Mario Vilas
New submission from Mario Vilas mvi...@gmail.com: I tried the following: setup( data_files = [(sys.prefix_exec, os.path.join('Win32', 'BeaEngine.dll'))] # (... rest of the setup call here...) ) This works perfectly when running the python setup.py install. But when generating an

[issue12805] Optimizations for bytes.join() et. al

2012-04-08 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Honestly, I don't think there's much point in these optimizations. The first one (The sequence length and separator length are both 0) is probably useless. This optimization changes the behavior. ... def __repr__(self): return

[issue12805] Optimizations for bytes.join() et. al

2012-04-08 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Regardless of whether optimization (which is negligible in this case), I don't know whether to consider such side effect desirable or undesirable. After some thought, I realized that this is an erroneous behavior. --

[issue12805] Optimizations for bytes.join() et. al

2012-04-08 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Side note: Windows requires that args be quoted with , not ', to work properly, at least with these args. Main note: the patched test adds a space to the separator, but that is not enough to account for the difference.

[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Edward Yang
New submission from Edward Yang ezy...@mit.edu: When generating a backtrace from an interactive Python session (e.g. the input is from stdin, Python attempts to actually find a file named stdin, to somewhat hilarious consequences. See the strace'd Python session below: foo

[issue12805] Optimizations for bytes.join() et. al

2012-04-08 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Main note: the patched test adds a space to the separator, but that is not enough to account for the difference. Sorry, I copied the wrong line. $ ./python -m timeit -s seq=[bytes([i]*10) for i in range(256)] b' '.join(seq) 10

[issue14521] math.copysign(1., float('nan')) returns -1.

2012-04-08 Thread mattip
mattip matti.pi...@gmail.com added the comment: You are correct, the patch should use fabs I would go with a standard, cross-platform definition of Py_NAN so that pickled objects could be opened by other platforms. Would this patch be better? It's more complicated as I needed to cast the repr

[issue14528] Document whether strings implement __iter__

2012-04-08 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Sorry, I agree with Georg, this isn't a bug, not even a documentation bug. A type is free to implement iteration either by way of __iter__ or by way of __getitem__. How it chooses to do so is an implementation detail (and

[issue14532] multiprocessing module performs a time-dependent hmac comparison

2012-04-08 Thread Jon Oberheide
New submission from Jon Oberheide j...@oberheide.org: The multiprocessing module performs a time-dependent comparison of the HMAC digest used for authentication: def deliver_challenge(connection, authkey): import hmac assert isinstance(authkey, bytes) message =

[issue14532] multiprocessing module performs a time-dependent hmac comparison

2012-04-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14532 ___ ___ Python-bugs-list mailing list

[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Ned Deily
Ned Deily n...@acm.org added the comment: That does seem like silly behavior. On the other hand, the only ill effect is likely the time required to execute the series of open calls which, in the interactive case, would not even be noticed on most systems. Would you be interested in writing

[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Edward Yang
Edward Yang ezy...@mit.edu added the comment: stdin is a valid name of a file on Unix systems. So the fix is not so clear. ezyang@javelin:~$ python Python 2.7.2+ (default, Oct 4 2011, 20:03:08) [GCC 4.6.1] on linux2 Type help, copyright, credits or license for more information. a Traceback

[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 5493d44b56d8 by Antoine Pitrou in branch '3.2': Issue #7978: socketserver now restarts the select() call when EINTR is returned. http://hg.python.org/cpython/rev/5493d44b56d8 New changeset 97a0c6230ece by Antoine

[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset d941d1fcc6e6 by Antoine Pitrou in branch '2.7': Issue #7978: socketserver now restarts the select() call when EINTR is returned. http://hg.python.org/cpython/rev/d941d1fcc6e6 --

[issue14533] Modify regrtest to make test_main optional

2012-04-08 Thread R. David Murray
New submission from R. David Murray rdmur...@bitdance.com: The attached patch makes 'test_main' optional for stdlib tests. If a test module does not have a 'test_main', regrtest will use the unittest loadTestsFromModule loader to load the tests. This moves us further in the direction of

[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: You must recompute the timeout when select() is interrupted: see issue #12338. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7978

[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: You must recompute the timeout when select() is interrupted: see issue #12338. Ah, right. It's a minor issue, though. I would suggest opening a separate issue for it. The patch is now committed to all 3 branches (I'm finally convinced this

[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- type: enhancement - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7978 ___ ___

[issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts

2012-04-08 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: SocketServer has been changed to restart select() on EINTR, but it doesn't recompute the timeout. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12338

[issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts

2012-04-08 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: SocketServer has been changed to restart select() on EINTR, but it doesn't recompute the timeout. See issue #7978. -- ___ Python tracker rep...@bugs.python.org

[issue12338] multiprocessing.util._eintr_retry doen't recalculate timeouts

2012-04-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Note that socketserver's timeout is not really important: it's just used for a polling loop, with a default of 0.5 seconds. -- ___ Python tracker rep...@bugs.python.org

[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14531 ___ ___ Python-bugs-list mailing

[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Jerzy Kozera
Jerzy Kozera jerzy.koz...@gmail.com added the comment: I forgot to mention my patch is 3.3-only, sorry - it depends on changes from #12555 (http://hg.python.org/cpython/rev/41a1de81ef2b#l18.21 to be precise). To support 3.2 and 2.7: (1) select.error must be caught as in the original patch,

[issue14533] Modify regrtest to make test_main optional

2012-04-08 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Looks good to me. Note that if module level setup and teardown is needed for running tests then it should be possible to do this with setUpModule and tearDownModule functions (unless those should *only* be done when running under

[issue14531] Backtrace should not attempt to open stdin file

2012-04-08 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: The filename is retrieved from: traceback-frame-f_code-co_filename. co_filename is an arbitrary string. Example: exec(compile(1+a, /etc/passwd, exec)) Traceback (most recent call last): File stdin, line 1, in module File

[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f8e7fcd581ff by Antoine Pitrou in branch '3.2': Fix the patch for issue #7978: select() raises select.error before 3.3, not OSError. http://hg.python.org/cpython/rev/f8e7fcd581ff New changeset 4298d6e79ecb by

[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: To support 3.2 and 2.7: (1) select.error must be caught as in the original patch, (2) e.args[0] must be used - select.error doesn't have 'errno' attribute. Should I prepare the patch for 3.2 and 2.7? It shouldn't be necessary, I've just

[issue14502] Document better what happens on releasing an unacquired lock

2012-04-08 Thread Jim Jewett
Jim Jewett jimjjew...@gmail.com added the comment: On Fri, Apr 6, 2012 at 10:32 PM, R. David Murray rep...@bugs.python.org wrote: R. David Murray rdmur...@bitdance.com added the comment: I, on the other hand, would prefer if it were made part of the API contract that an error is raised,

[issue14526] Python-2.6.8rc2 test never finishes ia64-hp-hpux11.31

2012-04-08 Thread Paul A.
Paul A. p...@freeshell.org added the comment: On Sun, Apr 08, 2012 at 04:16:39PM +, R. David Murray wrote: R. David Murray rdmur...@bitdance.com added the comment: Can you clarify? In what sense has the 2.7.3 rc regressed? Shouldn't have left that out -- I was referring to the crash

[issue14533] Modify regrtest to make test_main optional

2012-04-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I can't imagine when you'd *not* want setUpModule/tearDownModule to run, so that's a reasonable conversion path. The other path for reap_children and reap_threads would be to apply them to the individual classes that require them

[issue14502] Document better what happens on releasing an unacquired lock

2012-04-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I think dummy_threading should be fixed (but only in 3.3, just in case it causes any backward compatibility issues with someone's code). Logging I'd leave to Vinay to decide about. I'm assuming that if any of the others devs nosy on

[issue12537] mailbox's _become_message is very fragile

2012-04-08 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 5c1c402a63e5 by R David Murray in branch 'default': #12537: in mailbox avoid depending on knowledge of email package internals http://hg.python.org/cpython/rev/5c1c402a63e5 -- nosy: +python-dev

[issue12537] mailbox's _become_message is very fragile

2012-04-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: David, thanks for your assistance. I didn't wind up using your patch, but the work you did was valuable in preparing the patch I committed. What I did was turn your 'detect the attributes' recipe into a unit test. I then applied your

[issue14523] IDLE's subprocess startup error

2012-04-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I'm sorry, but the bug tracker isn't a good place to get help. You'll have better luck getting assistance for this on the python-list mailing list (see mail.python.org). -- nosy: +r.david.murray resolution: - invalid stage: -