[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)
Josh Triplett j...@joshtriplett.org added the comment: I currently use Python 2.7, and I'd like to make use of memoryview. Specifically, I work on BITS (http://biosbits.org/), which runs Python in ring 0 as part of GRUB, and I'd like to use memoryview to give Python access to data in physical memory. I ran into several of the problems documented here when trying to do so. I'd really love to see a backport of this fixed version into 2.7. -- nosy: +joshtriplett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10181 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)
Josh Triplett j...@joshtriplett.org added the comment: I currently use Python 2.7, and I'd like to make use of memoryview. Specifically, I work on BITS (http://biosbits.org/), which runs Python in ring 0 as part of GRUB, and I'd like to use memoryview to give Python access to data in physical memory. I ran into several of the problems documented here when trying to do so. I'd really love to see a backport of this fixed version into 2.7. More specifically, the primary functionality that I'd like to use exists in 3.3 as PyMemoryView_FromMemory. I've tried to approximate that function using the available API in 2.7, but that led me here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10181 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection
Kristján Valur Jónsson krist...@ccpgames.com added the comment: possibly, multiprocessing.Connection uses handles, which can be socket handles on windows, and that code also uses DuplicateHandle. I think a generic solution must be found for multiprocessing, so I'll create a separate issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14522 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14532] multiprocessing module performs a time-dependent hmac comparison
sbt shibt...@gmail.com added the comment: I only looked quickly at the web pages, so I may have misunderstood. But it sounds like this applies when the attacker gets multiple chances to guess the digest for a *fixed* message (which was presumably chosen by the attacker). That is not the case here because deliver_challenge() generates a new message each time. Therefore the expected digest changes each time. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14532 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4892] Sending Connection-objects over multiprocessing connections fails
sbt shibt...@gmail.com added the comment: There is an undocumented function multiprocessing.allow_connection_pickling() whose docstring claims it allows connection and socket objects to be pickled. The attached patch fixes the multiprocessing.reduction module so that it works correctly. This means that TestPicklingConnections can be reenabled in the unit tests. The patch uses the new socket.share() and socket.fromshare() methods on Windows. -- keywords: +patch Added file: http://bugs.python.org/file25160/mp_pickle_conn.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4892 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection
sbt shibt...@gmail.com added the comment: I think a generic solution must be found for multiprocessing, so I'll create a separate issue. I have submitted a patch for Issue 4892 which makes connection and socket objects picklable. It uses socket.share() and socket.fromshare() on Windows. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14522 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4892] Sending Connection-objects over multiprocessing connections fails
Antoine Pitrou pit...@free.fr added the comment: Unless there's a technical barrier, I still think it would be better to use ForkingPickler in multiprocessing.connection, rather than modify global state (copyreg). The pickling support is multiprocessing-specific and wouldn't make sense for other pickles (e.g. stored to disk). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4892 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate
Antoine Pitrou pit...@free.fr added the comment: This looks rather good on the principle. I think PyExcState needn't be public, it should be _PyExcState. I haven't checked the detailed mechanics of the patch, I hope someone else can. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13897 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14534] Add method to mark unittest.TestCases as do not run.
New submission from R. David Murray rdmur...@bitdance.com: A common pattern in testing is to have a base test class that implements test methods, and subclasses that provide various data that drives the tests to be run in different ways. It is convenient for the base class to inherit from TestCase, but this causes the normal test loader to load it as a test to be run, when most times it can't run by itself. My proposed solution is to make test case loading depend on an attribute of the class rather than the fact that it subclasses TestCase. TestCase would then have the attribute set to True by default. A decorator would be provided that sets the attribute to False, since that would make it visually obvious which TestCases are base classes and not to be loaded. (Note: once this is available the 'best practices' description of test file construction in the documentation for the stdlib 'test' module should be updated to use it.) -- assignee: michael.foord components: Library (Lib) keywords: easy messages: 157842 nosy: michael.foord, r.david.murray priority: normal severity: normal stage: needs patch status: open title: Add method to mark unittest.TestCases as do not run. type: enhancement versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14534 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14533] Modify regrtest to make test_main optional
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset eff551437abd by R David Murray in branch 'default': #14533: if a test has no test_main, use loadTestsFromModule. http://hg.python.org/cpython/rev/eff551437abd -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14533 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14533] Modify regrtest to make test_main optional
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14533 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8799] Hang in lib/test/test_threading.py
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Here is a new patch. 1) I´ve simplified and relaxed test_notify() for Condition objects. Condition variables don't guarantee that there won't be any spurious wakeups so the test must maintain internal bookkeeping so that it doesn't break with a different implementation of Condition. 2) The main thread now properly waits for the workers to settle in the test. 2) I've added two generic tests of Condition objects in their natural environment as building blocks for bigger things, a Queue and a Lock. -- versions: +Python 3.3 -Python 2.7, Python 3.2 Added file: http://bugs.python.org/file25161/lock_tests.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8799 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4892] Sending Connection-objects over multiprocessing connections fails
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- nosy: +kristjan.jonsson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4892 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14535] three code examples in docs are not syntax highlighted
New submission from Ramchandra Apte maniandra...@gmail.com: Three code examples in http://docs.python.org/py3k/library/multiprocessing.html#examples are not syntax highlighted. -- assignee: docs@python components: Documentation messages: 157845 nosy: docs@python, ramchandra.apte priority: normal severity: normal status: open title: three code examples in docs are not syntax highlighted versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14535 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13126] find() slower than rfind()
Serhiy Storchaka storch...@gmail.com added the comment: I checked one example on a 32-bit system (you have a 64-bit?)), because I was afraid pessimization because of a lack of registers. str.find() is faster than str.rfind(), but the patch makes it even faster. But I would like to see the script and the results of benchmarking of the 1/2/3/20-character ascii/ucs1/ucs2/ucs4-substring in ascii/ucs1/ucs2/ucs4-string, in all possible combinations. May be, such benchmark scripts already exist? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13126 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8799] Hang in lib/test/test_threading.py
Antoine Pitrou pit...@free.fr added the comment: Condition variables don't guarantee that there won't be any spurious wakeups What do you mean? The implementation doesn't seem prone to spurious wakeups, and the docs don't say so either. I've added two generic tests of Condition objects in their natural environment as building blocks for bigger things, a Queue and a Lock. Why would you build a Lock out of a Condition? -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8799 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13165] Integrate stringbench in the Tools directory
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 704630a9c5d5 by Antoine Pitrou in branch 'default': Issue #13165: stringbench is now available in the Tools/stringbench folder. http://hg.python.org/cpython/rev/704630a9c5d5 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13165 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13165] Integrate stringbench in the Tools directory
Changes by Antoine Pitrou pit...@free.fr: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13165 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13126] find() slower than rfind()
Antoine Pitrou pit...@free.fr added the comment: But I would like to see the script and the results of benchmarking of the 1/2/3/20-character ascii/ucs1/ucs2/ucs4-substring in ascii/ucs1 /ucs2/ucs4-string, in all possible combinations. May be, such benchmark scripts already exist? stringbench (the tool which produced those results) now exists in Tools/stringbench/stringbench.py. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13126 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate
Stefan Behnel sco...@users.sourceforge.net added the comment: FWIW, Cython keeps the exception state in the generator struct and that works nicely. Note that Amaury is right in that extensions use tstate-exc_value and friends. Cython does so quite extensively, for example. I don't see any use in changing the plain fields into a struct, but it will definitely break code, and not just some. This is also unrelated to the topic of this issue, so it should be a separate issue in the first place, and that should then be rejected IMHO. Also note that there is a separate issue 14098 (with patch) on providing a public C-API for these three fields - as long as there is none but direct access to these public fields, a change that basically removes them should not even be seriously considered. -- nosy: +scoder ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13897 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14536] Invalid links in svn.python.org
New submission from Serhiy Storchaka storch...@gmail.com: Links Subversion instructions and Developer FAQ on http://svn.python.org/ are invalid. -- components: Devguide messages: 157851 nosy: ezio.melotti, storchaka priority: normal severity: normal status: open title: Invalid links in svn.python.org ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14536 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4892] Sending Connection-objects over multiprocessing connections fails
Kristján Valur Jónsson krist...@ccpgames.com added the comment: I just want to point out that each time socket.share() is called, the resulting data can only be used once by socket.fromshare(). I'm mentioning this because I know there is some caching mechanism in reduction.py and that this data is not cacheable/reuseable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4892 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13126] find() slower than rfind()
Serhiy Storchaka storch...@gmail.com added the comment: stringbench (the tool which produced those results) now exists in Tools/stringbench/stringbench.py. Thank you, yesterday they were not. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13126 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate
Antoine Pitrou pit...@free.fr added the comment: Note that Amaury is right in that extensions use tstate-exc_value and friends. Cython does so quite extensively, for example. I understand for Cython, but why would pedestrian extension code look up tstate-exc_value? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13897 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14098] provide public C-API for reading/setting sys.exc_info()
Antoine Pitrou pit...@free.fr added the comment: Stefan's latest patch looks fine to me. -- nosy: +pitrou stage: - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14098 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate
Mark Shannon m...@hotpy.org added the comment: 3rd party code should not be accessing fields in the threadstate object, but without the accessors proposed in issue 14098 there may be no alternative. Once the patch for issue 14098 has been applied it, would it then be acceptable to remove the surperfluous fields from the frameobject? The logic for accessing sys.exc_info can be moved to into the new accessor fucntions. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13897 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14520] Buggy Decimal.__sizeof__
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14520 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14520] Buggy Decimal.__sizeof__
Mark Dickinson dicki...@gmail.com added the comment: In the C version of decimal, do distinct Decimal objects ever share coefficients? (This would be an obvious optimization for methods like Decimal.copy_negate; I don't know whether the C version applies such optimizations.) If there's potential for shared coefficients, that might make the not count any memory twice part tricky. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14520 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11060] distutils2 sdist does not complain about version that is not PEP 386 compliant
Rik Poggi poggi.ri...@gmail.com added the comment: Moving on, I've understood what the bug is about. I've made a couple of tests for this issue. I'm waiting for a review before adding others (if necessary). The fix is not going to be easy, because I'm not sure about the Metadata design. I think that what should be done is to make available the old version scheme check for metadata-version 1.0 and 1.1. -- Added file: http://bugs.python.org/file25162/issue_tests.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11060 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14521] math.copysign(1., float('nan')) returns -1.
Mark Dickinson dicki...@gmail.com added the comment: Thanks for the updated patch! (BTW, you can attach patches as files to the issue rather than writing them inline.) Yes, this patch is more along the lines that I was thinking of. There are some issues, though: (1) we need to deal with endianness issues (including the ARM mixed-endian case). (2) It looks to me as though the (double *) cast violates strict aliasing rules; gcc's optimizations can do nasty things in this area. Rather than reinventing the wheel, we should use the same mechanisms as are already in Python's version of dtoa.c (e.g., see the use of the union to deal with aliasing issues); we may even be able to steal bits of David Gay's original code directly. I'll try to find time to look at this in the near future. I'm still not convinced that anything really needs to change here, though. I don't understand your comment about pickled objects; as far as I'm aware there aren't any issues with transferring pickled NaNs from one system to another. -- assignee: - mark.dickinson nosy: +eric.smith priority: normal - low stage: - needs patch type: behavior - enhancement versions: +Python 3.3 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14520] Buggy Decimal.__sizeof__
Martin v. Löwis mar...@v.loewis.de added the comment: In the C version of decimal, do distinct Decimal objects ever share coefficients? (This would be an obvious optimization for methods like Decimal.copy_negate; I don't know whether the C version applies such optimizations.) If there's potential for shared coefficients, that might make the not count any memory twice part tricky. I know of three strategies to deal with such a case: a) expose the inner objects, preferably through tp_traverse, and don't account for them in the container, b) find a canonical owner of the contained objects, and only account for them along with the canonical container. c) compute the number N of shared owners, and divide the object size by N. Due to rounding, this may be somewhat incorrect. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14520 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14520] Buggy Decimal.__sizeof__
Stefan Krah stefan-use...@bytereef.org added the comment: Mark Dickinson rep...@bugs.python.org wrote: In the C version of decimal, do distinct Decimal objects ever share coefficients? The coefficients are members of the mpd_t struct (libmpdec data type), and they are not exposed as Python objects or shared. Cache locality is incredibly important: I have a patch that reserves a static coefficient of four words inside the PyDecObject. This patch speeds up _decimal by roughly another 30-40% for regularly sized decimals. If the decimal grows beyond that, libmpdec automatically switches to a dynamically allocated coefficient. I think sharing would probably slow things down a bit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14520 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14521] math.copysign(1., float('nan')) returns -1.
Mark Dickinson dicki...@gmail.com added the comment: Here's an example based on the dtoa.c code. It only changes the return value of float('nan'), and doesn't affect any other existing uses of the Py_NAN macro. It needs tests. -- keywords: +patch Added file: http://bugs.python.org/file25163/issue14521.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate
Stefan Behnel sco...@users.sourceforge.net added the comment: I can't speak for much outside of Cython, and Cython generated modules would best be regenerated with a newer Cython version anyway in order to work with Py3.3. I'm not sure that's currently required, though. As long as there is a way to access these fields directly from the struct (with the usual preprocessor conditional), I don't think Cython will actually start to use the PyErr_[GS]etExcInfo() functions in CPython - simply for performance reasons. Inlining the access is just way faster than calling into external functions, especially when that happens more than once. I'm still surprised about the general lack of resistence against incompatible changes to a public struct, though, especially when they come without an obvious gain. Is this really just for code beautification? I agree that this would be nice, but how can it be worth breaking code? I don't see any objection to the generator related changes in this patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13897 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14520] Buggy Decimal.__sizeof__
Mark Dickinson dicki...@gmail.com added the comment: and they are not exposed as Python objects or shared. Okay, thanks. Sounds like this isn't an issue at the moment then. +1 for having getsizeof report the total size used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14520 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate
Antoine Pitrou pit...@free.fr added the comment: As long as there is a way to access these fields directly from the struct (with the usual preprocessor conditional), I don't think Cython will actually start to use the PyErr_[GS]etExcInfo() functions in CPython - simply for performance reasons. Isn't this premature optimization? Do you have any workload where you measured a performance degradation? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13897 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14536] Invalid links in svn.python.org
Antoine Pitrou pit...@free.fr added the comment: Thanks for pointing it - I've fixed the instructions. -- nosy: +pitrou resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14536 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14534] Add method to mark unittest.TestCases as do not run.
Antoine Pitrou pit...@free.fr added the comment: A decorator would be provided that sets the attribute to False, since that would make it visually obvious which TestCases are base classes and not to be loaded. What's the point? Just derive from TestCase in the derived classes, not the base classes. -1 on useless complication. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14534 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14534] Add method to mark unittest.TestCases as do not run.
Daniel Stutzbach stutzb...@google.com added the comment: Wouldn't the subclass inherit the False value? Then the user would need to remember to override the value again in the subclass, which is error prone. Antoine: I've used the pattern you describe on a couple of occasions, and it routinely confuses my code reviewers. -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14534 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14534] Add method to mark unittest.TestCases as do not run.
R. David Murray rdmur...@bitdance.com added the comment: Antoine: I don't have any problem with that personally, but Michael did, and he's the maintainer :) But there is a small advantage: it means you don't have to keep repeating the 'unittest.TestCase' boilerplate in each subclass declaration, you only have to decorate the base class once. Daniel: Oops, you are right. Michael seemed to have some idea on how to implement the decorator. The class attribute was my contribution, and obviously that isn't going to work. I wanted something more transparent than a magic decorator, but it looks like magic will be required. Which, IMO, is a point in Antoine's favor. Let's see what Michael has to say. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14534 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14534] Add method to mark unittest.TestCases as do not run.
Antoine Pitrou pit...@free.fr added the comment: Antoine: I've used the pattern you describe on a couple of occasions, and it routinely confuses my code reviewers. Really? What is confusing about it? Perhaps we should simply document it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14534 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13165] Integrate stringbench in the Tools directory
Serhiy Storchaka storch...@gmail.com added the comment: I think that would be a useful tool for comparing two stringbench results. I propose an example of a script. Can use them separately or included in the stringbench.py, it's only an idea. -- nosy: +storchaka Added file: http://bugs.python.org/file25164/stringbench-diff.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13165 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13126] find() slower than rfind()
Serhiy Storchaka storch...@gmail.com added the comment: I used stringbench and self-writen script (see issue13165) for comparison and saw no convincing difference. The difference to str.find does not exceed accidental deviations for other functions which are not affected by the patch. Apparently, the accuracy of stringbench is not enough for a reliable measurement. == late match, 100 characters +8.6+8.8 s=ABC*33; ((s+D)*500+s+E).find(s+E) (*100) +0.1+0.2 s=ABC*33; ((s+D)*500+E+s).find(E+s) (*100) +7.9+7.4 s=ABC*33; (s+E) in ((s+D)*300+s+E) (*100) +7.2+7.3 s=ABC*33; ((s+D)*500+s+E).index(s+E) (*100) +8.0+7.9 s=ABC*33; ((s+D)*500+s+E).partition(s+E) (*100) -4.3-4.3 s=ABC*33; (E+s+(D+s)*500).rfind(E+s) (*100) -4.9-6.9 s=ABC*33; (s+E+(D+s)*500).rfind(s+E) (*100) -3.0-3.0 s=ABC*33; (E+s+(D+s)*500).rindex(E+s) (*100) -3.7-4.2 s=ABC*33; (E+s+(D+s)*500).rpartition(E+s) (*100) -4.0-2.6 s=ABC*33; (E+s+(D+s)*500).rsplit(E+s, 1) (*100) +28.0+6.5 s=ABC*33; ((s+D)*500+s+E).split(s+E, 1) (*100) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13126 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14521] math.copysign(1., float('nan')) returns -1.
Serhiy Storchaka storch...@gmail.com added the comment: May be it would be more reasonable if math.copysign(1., float('nan')) return a float('nan')? -- nosy: +storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14521] math.copysign(1., float('nan')) returns -1.
Mark Dickinson dicki...@gmail.com added the comment: May be it would be more reasonable if math.copysign(1., float('nan')) return a float('nan')? -1. That would go against all the existing standards. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14521] math.copysign(1., float('nan')) returns -1.
mattip matti.pi...@gmail.com added the comment: Your patch is much more reasonable than mine. Should I add a test that fails pre-patch and passes with the patch, or one that is skipped pre-patch and passes post-patch? I'm not sure what is accepted in the cpython development cycle -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite
New submission from Aaron Meurer asmeu...@gmail.com: Recently, after a small seemingly unrelated refactoring, the SymPy test suite in Python 3 started dying with Fatal Python error: Cannot recover from stack overflow. Here's how to reproduce the error git clone git://github.com/sympy/sympy.git # Clone the development version of SymPy cd sympy git checkout 0856119bd7399a416c21e1692855a1077164f21c # This is the first commit to exhibit the problem. Do this in case we make an unrelated change that removes the problem. ./bin/use2to3 # Convert the codebase to Python 3 python3 py3k-sympy/setup.py test # Run the tests The issue is described in more detail at http://groups.google.com/group/sympy/browse_thread/thread/f664fe88e6b4f29d/3a44691c945695db#3a44691c945695db. Some key points: - The test that triggers the error is an XFAIL test (test that is expected to fail) that raises RuntimeError: maximum recursion depth exceeded. - The change that caused the error, 0856119bd7399a416c21e1692855a1077164f21c (see https://github.com/sympy/sympy/commit/0856119bd7399a416c21e1692855a1077164f21c), is seemingly unrelated. The only thing that I can think of is that it has added another call to the stack. - This kills Python with Abort Trap: 6 in Mac OS X, which generates a problem report to be sent to Apple. I have included a copy of it here: https://gist.github.com/2317869. - Others have reproduced this error as well, as can be seen by our test reporter tool. See the mailing list thread for more info. - I tested this in 3.2.3r2, and the error still occurred. I tried testing in the 3.3 alpha, but I could not get it to compile. -- messages: 157876 nosy: Aaron.Meurer priority: normal severity: normal status: open title: Fatal Python error: Cannot recover from stack overflow. with SymPy test suite type: crash versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Re. logging, logging._acquireLock and logging._releaseLock are not part of the public API and are undocumented at present. The case when _releaseLock does not raise an error is when threading couldn't be imported, so the _lock variable is None. I don't see the need for adding any documentation for this. Logging doesn't use dummy_thread: if threading isn't available, all lock acquisition and release operations become no-ops. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6884] Impossible to include file in sdist that starts with 'build' on Win32
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset b5f0ce4ddf0c by Éric Araujo in branch '2.7': Fix long-standing bugs with MANIFEST.in parsing on Windows (#6884). http://hg.python.org/cpython/rev/b5f0ce4ddf0c -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6884 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9691] sdist includes files that are not in MANIFEST.in
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset b5f0ce4ddf0c by Éric Araujo in branch '2.7': Fix long-standing bugs with MANIFEST.in parsing on Windows (#6884). http://hg.python.org/cpython/rev/b5f0ce4ddf0c -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9691 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14509] Build failures in non-pydebug builds without NDEBUG.
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset a11a2bbd8241 by Benjamin Peterson in branch '2.7': fix build without Py_DEBUG and DNDEBUG (closes #14509) http://hg.python.org/cpython/rev/a11a2bbd8241 New changeset 64bb1d258322 by Benjamin Peterson in branch '3.1': fix build without Py_DEBUG and DNDEBUG (closes #14509) http://hg.python.org/cpython/rev/64bb1d258322 New changeset 5168483316b5 by Benjamin Peterson in branch '3.2': merge 3.1 (#14509) http://hg.python.org/cpython/rev/5168483316b5 New changeset c20f604a2da6 by Benjamin Peterson in branch 'default': merge 3.2 (#14509) http://hg.python.org/cpython/rev/c20f604a2da6 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14509 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Jim Jewett jimjjew...@gmail.com added the comment: Vinay, The current question is what contract locks should follow, and whether all locks should follow it. Would it be acceptable for logging._releaseLock to raise a RuntimeError if the lock hadn't previously been acquired? In other words, would it be acceptable to replace the current None with a counter (and to note in comments that it should be safe from race conditions because it is only used when threading isn't available). -jJ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Antoine Pitrou pit...@free.fr added the comment: The current question is what contract locks should follow, and whether all locks should follow it. Would it be acceptable for logging._releaseLock to raise a RuntimeError if the lock hadn't previously been acquired? I don't see the point of this discussion. We are talking about threading.Lock (and, possibly, multiprocessing.Lock), not every lock API under the sun. Especially when it's a private API... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14098] provide public C-API for reading/setting sys.exc_info()
Martin v. Löwis mar...@v.loewis.de added the comment: Fine with me as well. Stefan, please submit a contributor form. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14098 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14520] Buggy Decimal.__sizeof__
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 010aa5d955ac by Stefan Krah in branch 'default': Issue #14520: Add __sizeof__() method to the Decimal object. http://hg.python.org/cpython/rev/010aa5d955ac -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14520 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14521] math.copysign(1., float('nan')) returns -1.
Martin v. Löwis mar...@v.loewis.de added the comment: The test should fail pre-patch and pass post-patch. There will be no state in the repository where the patch is present and fails, since it will be committed along with the patch. Skipping tests is only ok for tests that lack prerequisites on some systems, and (exceptionally) for tests that document known bugs. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14521] math.copysign(1., float('nan')) returns -1.
Martin v. Löwis mar...@v.loewis.de added the comment: Also, mattip: if you want to contribute some chunk of code (such as the test), please submit a contributor form. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14520] Buggy Decimal.__sizeof__
Stefan Krah stefan-use...@bytereef.org added the comment: Thanks for the explanations. The new __sizeof__() method should now report the exact memory usage. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14520 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14538] HTMLParser
New submission from Michel Leunen michel.leu...@gmail.com: HTMLParser fails to parse this structure of tags: 'a/ascript/scriptmetameta / body/body' Parsing stops after the first meta tag ignoring the remainers from HTMLParser import HTMLParser parser = process_html() parser.feed('a/ascript/scriptmetameta / body/body') Python 2.7.2+ Ubuntu 11.10 -- components: Library (Lib) messages: 157890 nosy: Michel.Leunen priority: normal severity: normal status: open title: HTMLParser type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14538 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14538] HTMLParser: parsing error
Changes by Michel Leunen michel.leu...@gmail.com: -- title: HTMLParser - HTMLParser: parsing error ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14538 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11218] pattern=None when following documentation for load_tests and unittest.main()
Rik Poggi poggi.ri...@gmail.com added the comment: I think the doc should be improved (http://docs.python.org/library/unittest.html#load-tests-protocol), it's not clear how pattern in the example (last one) could not be None. Changing the discover signature doesn't seem to be an option since the TestLoader.discover doc http://docs.python.org/library/unittest.html#unittest.TestLoader.discover says: The pattern is deliberately not stored as a loader attribute so that packages can continue discovery themselves. -- nosy: +rik.poggi ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11218 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable
Jim Jewett jimjjew...@gmail.com added the comment: @Brian -- to clarify, (1) Does issue3561.diff completely supersede prependpath_in-progress.diff? (And should that be the one currently subject to review?) (2) What happens with multiple installations? Do users have to manually unset the path to avoid surprises? Does this become obsolete if the py.exe shim delegating to the appropriate py* is included with 3.3? Does installing 3.3.2 in over top of 3.3.1 add the directory to the path twice? -- nosy: +Jim.Jewett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable
Changes by Brian Curtin br...@python.org: Removed file: http://bugs.python.org/file24574/prependpath_in-progress.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable
Antoine Pitrou pit...@free.fr added the comment: UI-wise, I'm not sure why it looks like an installable component rather than a separate checkbox. Is it a limitation of the installation software? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14534] Add method to mark unittest.TestCases as do not run.
Michael Foord mich...@voidspace.org.uk added the comment: So the technique I suggested is that the TestLoader checks classes for the testbase (or whatever we call it) *in the class dict*. So inheritance doesn't matter - a class is only excluded from test loading if it has the attribute directly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14534 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable
Brian Curtin br...@python.org added the comment: I unlinked the old diff. issue3561.diff is the one that matters. As for what happens with multiple installations, it's no different than how you'd already be managing it or anything else like it. If you install 2.7 with the path option enabled and then you install 3.2 with the path option enabled, 3.2 goes in front of 2.7. The installations don't touch each other. If we want to get smart and detect other installations on the Path, I believe this gets a lot more complicated. It does not become obsolete with the launcher. The launcher solves a wider problem in a different way. You could just switch to the launcher if you wanted to, but because we (probably will) have that feature doesn't mean the bare python.exe can't grow this functionality. People have been asking for it for years. It's the first step of every tutorial on the internet. It takes up a special page on the information for a sprint I just saw. As for the question of 3.3.2 over 3.3.1: I'm not sure yet. I'll build a few installers with different versions and run some upgrades to see what happens. We're using MSI's builtin ability to manage everything here, so I would imagine it knows what to do, but I'll confirm. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14534] Add method to mark unittest.TestCases as do not run.
Michael Foord mich...@voidspace.org.uk added the comment: Here are my objections to the standard (but not widely used outside our own tests) mixin pattern for base testcases (copied and pasted from issue 14408): Because you then have classes that inherit from object calling methods that clearly don't exist (until you subclass them *and* TestCase). It looks weird and also means the classes can't be tested in isolation. With a class decorator the code would *look* straightforward, and the hidden attribute is just an implementation detail. It still looks weird to see code calling methods that obviously don't exist, and with no indication *at the call site* where they come from. Making it clearer with naming would help: TestThingMixin or similar. There are classes like this in the unittest test suite, and I was very confused by them initially until I found where and how they were used. It is obviously *not* a pattern that is widely known for test base classes, as we have this problem of it not being done even in the standard library tests. In contrast I think code similar to the following would be clear and readable without knowing about multiple inheritance and the mixin trick: @test_base_class class SomeTestBase(TestCase): ... Besides which, the mixin pattern won't *stop* working if we provide this extra functionality - it would just be an alternative for those (like myself) who think it impedes code readability. :-) At this point we're off topic for the *specific issue*, and I'm fine with our own standard library tests moving to use mixins to support standard unittest invocation. I would suggest the base test cases include Mixin in their name to make it clear how they should be used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14534 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14534] Add method to mark unittest.TestCases as do not run.
Antoine Pitrou pit...@free.fr added the comment: So the technique I suggested is that the TestLoader checks classes for the testbase (or whatever we call it) *in the class dict*. So inheritance doesn't matter - a class is only excluded from test loading if it has the attribute directly. Why not document the official recommendation in the docs? Adding another gimmick isn't very useful. It doesn't add a functionality. It doesn't even make it significantly easier to write tests (unless you have more test classes than test methods). And it means that people have to remember two idioms instead of one. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14534 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable
Brian Curtin br...@python.org added the comment: UI-wise, I'm not sure why it looks like an installable component rather than a separate checkbox. Is it a limitation of the installation software? I originally did it as a separate check box UI-wise but couldn't hook that into be an actual Feature in MSI terms. The way it's currently done allows it to be added to certain tables, allowing us to conditionally modify the Environment table which contains the optional path addition. I am by no means an MSI expert. This is just the way Martin and I talked about it at PyCon and the way I've seen it done around the web. If there's a way to tie a checkbox to the Feature table, I would like that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14538] HTMLParser: parsing error
Jim Jewett jimjjew...@gmail.com added the comment: What do you think it should do? My thought is that meta tags may or may not be void, but certainly should not be nested. As XML, I would parse that as a/a script/script meta meta / body/body *missing closing tag But for html, there is more cleanup. The catch is that this module probably can't keep up with BeautifulSoup or HTML5lib ... is this particular tag situation common enough to be even have a defined handling, let alone one that is worth adding to a simple module? -- nosy: +Jim.Jewett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14538 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14521] math.copysign(1., float('nan')) returns -1.
mattip matti.pi...@gmail.com added the comment: I added tests to the mark.dickinson patch, test.test_math passes. -- Added file: http://bugs.python.org/file25165/math_patch2.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14502] Document better what happens on releasing an unacquired lock
Georg Brandl ge...@python.org added the comment: Agreed. Jim, I think you're trying to get consistency where none is required. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14502 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14521] math.copysign(1., float('nan')) returns -1.
mattip matti.pi...@gmail.com added the comment: I also submitted a form. Sorry about the patch name, still learning. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14082] shutil doesn't copy extended attributes
Antoine Pitrou pit...@free.fr added the comment: I’m writing a shutil.copyxattr() first which could simple get another argument for the namespaces that should be copied. Sounds good to me :-) However what to do inside copy2()? I’m tending to either: 1. copy only user.* 2. ignore errors in any namespace != user Personally, I find the second approach rather non-deterministic. But it's also more practical, e.g. when running as root you would probably be surprised if only a subset of xattrs get copied, wouldn't you? “Practicality beats purity.” For reference, here is part of the documentation for GNU cp's -a option: `-a' `--archive' Preserve as much as possible of the structure and attributes of the original files in the copy (but do not attempt to preserve internal directory structure; i.e., `ls -U' may list the entries in a copied directory in a different order). Try to preserve SELinux security context and extended attributes (xattr), but ignore any failure to do that and print no corresponding diagnostic. Equivalent to `-dR --preserve=all' with the reduced diagnostics. Meaning that cp -a tries to copy all xattrs and silences errors when it's not possible to do so. cp --preserve=all seems to have a similar error-silencing behaviour: `all' Preserve all file attributes. Equivalent to specifying all of the above, but with the difference that failure to preserve SELinux security context or extended attributes does not change `cp''s exit status. In contrast to `-a', all but `Operation not supported' warnings are output. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14082 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14538] HTMLParser: parsing error
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14538 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14412] Sqlite Integer Fields
Benjamin Peterson benja...@python.org added the comment: Given the lack of progress here, I will be releasing 2.7.3. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14423] Getting the starting date of iso week from a week number and a year.
Antoine Pitrou pit...@free.fr added the comment: Some comments: - you also need to modify the C version in Modules/_datetimemodule.c (make sure the tests exercise both versions!) - the doc needs a versionadded tag - I don't understand this: +if self.isocalendar()[1] != 1: +if self.weekday() 3: # Jan 1 is not in week one +self += timedelta(7 - self.weekday()) What if self.weekday() = 3 ? Surely some adjustment is needed as well? (you should probably add more tests to cover the various cases) - this comment: +# Test that we get the OverflowError when the year has 52 weeks seems wrong since ValueError is raised -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14538] HTMLParser: parsing error
Ezio Melotti ezio.melo...@gmail.com added the comment: With Python 2.7.3rc2 and 3.3.0a0 (strict=False) I get: Start tag: a End tag : a Start tag: script End tag : script Start tag: meta Data : meta / Start tag: body End tag : body This is better, but still not 100% correct, the meta / shouldn't be seen as data. -- assignee: - ezio.melotti stage: - test needed versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14538 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14423] Getting the starting date of iso week from a week number and a year.
Alexander Belopolsky alexander.belopol...@gmail.com added the comment: Before you invest in a C version, let's discuss whether this feature is desirable. The proposed function implements a very simple and not very common calculation. Note that even dateutil does not provide direct support for this: you are instructed to use relativedelta to add weeks to January 1st of the given year. If we are going to add yet another way to construct dates, I would like to consider some universal solution. For example, a make_date function that would behave similar to the timedelta constructor: take a large number of keyword arguments and return a date. For example, make_date(year=2000, isoweek=5, weekday=3) make_date(year=2000, isoday=63) etc. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14539] logging module: logger does not print log message with logging.INFO level
New submission from zodalahtathi m8r-a70...@mailinator.com: The logging module does not print logging message when the logging level is set to a level inferior to the default level. I can reproduce it using the Python3 (3.2.2) package from Ubuntu 12.04 beta2, or using a hand compiled Python 3.2.2. The bug is NOT present in Python 3.2.1. ~ $ python3 Python 3.2.3rc2 (default, Mar 21 2012, 16:59:51) [GCC 4.6.3] on linux2 Type help, copyright, credits or license for more information. import logging logger = logging.getLogger() logger.getEffectiveLevel() = logging.WARN True logger.warn(warning message) warning message logger.setLevel(logging.INFO) logger.getEffectiveLevel() = logging.INFO True logger.info(info message) -- messages: 157908 nosy: zodalahtathi priority: normal severity: normal status: open title: logging module: logger does not print log message with logging.INFO level type: behavior versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable
Martin v. Löwis mar...@v.loewis.de added the comment: UI-wise, I'm not sure why it looks like an installable component rather than a separate checkbox. Is it a limitation of the installation software? You are misinterpreting the UI. The list is not of installable components, but of features. Adjusting the path is a feature just as registering the .py extension. That feature can be installed and uninstalled. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14539] logging module: logger does not print log message with logging.INFO level
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14534] Add method to mark unittest.TestCases as do not run.
R. David Murray rdmur...@bitdance.com added the comment: Note that I did just document the mixin idiom in the Lib/test docs. Which core developers probably don't read :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14534 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable
Martin v. Löwis mar...@v.loewis.de added the comment: IANANSOE (I am not a native speaker of English), but it seems to me that Prepend path is a bit terse, in particular since Path is being prepended *to*. How about Add python.exe to the search path? That it is added to the beginning could be elaborated (i.e. prepended) in the feature description. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14423] Getting the starting date of iso week from a week number and a year.
Marc-Andre Lemburg m...@egenix.com added the comment: Alexander Belopolsky wrote: Alexander Belopolsky alexander.belopol...@gmail.com added the comment: Before you invest in a C version, let's discuss whether this feature is desirable. The proposed function implements a very simple and not very common calculation. Note that even dateutil does not provide direct support for this: you are instructed to use relativedelta to add weeks to January 1st of the given year. Which is wrong, since the start of the first ISO week of a year can in fact start in the preceeding year... http://en.wikipedia.org/wiki/ISO_week_date and it's not a simple calculation. ISO weeks are in common use throughout Europe, it's part of the ISO 8601 standard. mxDateTime has had such constructors for ages: http://www.egenix.com/products/python/mxBase/mxDateTime/doc/#_Toc293683820 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13165] Integrate stringbench in the Tools directory
STINNER Victor victor.stin...@gmail.com added the comment: I think that would be a useful tool for comparing two stringbench results. Please open a new issue for such improvement. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13165 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14423] Getting the starting date of iso week from a week number and a year.
Alexander Belopolsky alexander.belopol...@gmail.com added the comment: On Mon, Apr 9, 2012 at 6:20 PM, Marc-Andre Lemburg rep...@bugs.python.org wrote: Which is wrong, since the start of the first ISO week of a year can in fact start in the preceeding year... Hmm, the dateutil documentation seems to imply that relativedelta takes care of this: http://labix.org/python-dateutil#head-72c4689ec5608067d118b9143cef6bdffb6dad4e (Search the page for ISO) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite
STINNER Victor victor.stin...@gmail.com added the comment: It looks like an issue in SymPy, a stack overflow. Why did you report this issue on CPython bug tracker? Is there an infinite loop in a recursive function call? Can you try to get the full Python traceback using faulthandler? Use -X faulthandler command line option, or use import faulthandler; faulthandler.enable() at the beginning of your program. You have to install it manually for Python 3.3. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10408] Denser dicts and linear probing
Jim Jewett jimjjew...@gmail.com added the comment: FWIW, doing a linear probe only within a cache line (changing the 1's bit) before applying perturb might also be useful -- and the results may change if the size of a dictentry were reduced. (Mark Shannon's now-integrated patch doesn't actually do that for the keys, but it would be doable.) -- nosy: +Jim.Jewett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10408 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite
Aaron Meurer asmeu...@gmail.com added the comment: We do have a stack overflow, but this should be raising a RuntimeError, not killing Python. The way it is now, Python dies completely with abort trap 6 (hence the Mac OS X problem report). Sorry if I didn't make this clear in the OP. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite
STINNER Victor victor.stin...@gmail.com added the comment: SymPy uses a C extension, numpy. The problem may be related to numpy. CPython tries to catch segmentation fault, but when a C extension is used, CPython may fail to protect your program against stack overflow. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite
Aaron Meurer asmeu...@gmail.com added the comment: No it does not. SymPy is a pure Python library. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14423] Getting the starting date of iso week from a week number and a year.
Antoine Pitrou pit...@free.fr added the comment: Hmm, the dateutil documentation seems to imply that relativedelta takes care of this: This is all a bit moot since we don't have a relativedelta in the stdlib. I think the two questions here are: - is this feature desirable? I think the answer is yes - is the implementation correct? I don't know :-) Talk of a magical generic constructor sounds a bit futile to me, especially if the constructor's behaviour becomes so complicated that it's difficult to understand for users... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable
Brian Curtin br...@python.org added the comment: Agreed. I will work up a more friendly text to go along with the feature. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3561 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14423] Getting the starting date of iso week from a week number and a year.
Alexander Belopolsky alexander.belopol...@gmail.com added the comment: On Mon, Apr 9, 2012 at 6:56 PM, Antoine Pitrou rep...@bugs.python.org wrote: This is all a bit moot since we don't have a relativedelta in the stdlib. It is still worthwhile to see how it is done elsewhere. So far, we have dateutil that does not have this function and mxDateTime that keeps this and other ISO related functions in a submodule. Does anyone know how this is done in other languages? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14537] Fatal Python error: Cannot recover from stack overflow. with SymPy test suite
STINNER Victor victor.stin...@gmail.com added the comment: The (first) Python stack overflow occurs at: --- (gdb) py-bt Traceback (most recent call first): File /home/haypo/issue14537/sympy/py3k-sympy/sympy/core/expr.py, line 2531, in expand from sympy.simplify.simplify import fraction File /home/haypo/issue14537/sympy/py3k-sympy/sympy/core/cache.py, line 91, in wrapper func_cache_it_cache[k] = r = func(*args, **kw_args) File /home/haypo/issue14537/sympy/py3k-sympy/sympy/functions/elementary/hyperbolic.py, line 514, in as_real_imag return (self.expand(deep, **hints), S.Zero) File /home/haypo/issue14537/sympy/py3k-sympy/sympy/functions/elementary/hyperbolic.py, line 525, in _eval_expand_complex re_part, im_part = self.as_real_imag(deep=deep, **hints) File /home/haypo/issue14537/sympy/py3k-sympy/sympy/core/expr.py, line 2551, in expand expr = func(deep=deep, **hints) File /home/haypo/issue14537/sympy/py3k-sympy/sympy/core/cache.py, line 91, in wrapper func_cache_it_cache[k] = r = func(*args, **kw_args) File /home/haypo/issue14537/sympy/py3k-sympy/sympy/functions/elementary/hyperbolic.py, line 514, in as_real_imag return (self.expand(deep, **hints), S.Zero) File /home/haypo/issue14537/sympy/py3k-sympy/sympy/functions/elementary/hyperbolic.py, line 525, in _eval_expand_complex (gdb) where #0 _Py_CheckRecursiveCall (where=0x624f4b in comparison) at Python/ceval.c:736 #1 0x00419e6a in PyObject_RichCompare (v='sympy', w='sympy', op=2) at Objects/object.c:604 #2 0x00419f2d in PyObject_RichCompareBool (v='sympy', w='sympy', op=2) at Objects/object.c:628 #3 0x005e854e in lookdict (mp=0x71b3b1a8, key='sympy', hash=-191038920480525830) at Objects/dictobject.c:341 #4 0x005e99ca in PyDict_GetItem (op= {'sympy.logic.inference': module at remote 0x7fffeef80ba0, ..., key='sympy') at Objects/dictobject.c:752 #5 0x004f1510 in import_submodule (mod=None, subname='sympy', fullname='sympy') at Python/import.c:3313 #6 0x004f064b in load_next (mod=None, altmod=None, inputname='sympy.simplify.simplify', p_outputname=0x7fe67e28, p_prefix=0x7fe67e20) at Python/import.c:3150 #7 0x004ef610 in import_module_level (name='sympy.simplify.simplify', globals= {...}, locals=None, fromlist=('fraction',), level=0) at Python/import.c:2843 --- Ok, now I see the problem: import_submodule() uses PyDict_GetItem() whereas PyDict_GetItem() *clears* the exception (!). It should use PyDict_GetItemWithError() instead. Try attached patch. The problem is a generic problem: PyDict_GetItem() should be replaced by PyDict_GetItemWithError() everywhere... But it would be nice to start with import.c :-) -- keywords: +patch Added file: http://bugs.python.org/file25166/import_pydict_getitem.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14537 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14423] Getting the starting date of iso week from a week number and a year.
Marc-Andre Lemburg m...@egenix.com added the comment: Alexander Belopolsky wrote: Alexander Belopolsky alexander.belopol...@gmail.com added the comment: On Mon, Apr 9, 2012 at 6:20 PM, Marc-Andre Lemburg rep...@bugs.python.org wrote: Which is wrong, since the start of the first ISO week of a year can in fact start in the preceeding year... Hmm, the dateutil documentation seems to imply that relativedelta takes care of this: http://labix.org/python-dateutil#head-72c4689ec5608067d118b9143cef6bdffb6dad4e (Search the page for ISO) That's not realtivedelta taking care of it, it's the way it is used: the week with 4.1. in it is the first ISO week of a year; it then goes back to the previous Monday and adds 14 weeks from there to go to the Monday of the 15th week. This works fine as long as 4.1. doesn't fall on a Monday... You don't really expect anyone to remember such rules, do you ? :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows
Nick Coghlan ncogh...@gmail.com added the comment: I agree we need to add something here to better support the idiom where the close and delete operations on a NamedTemporaryFile are decoupled without the delete becoming a completely independent call to os.unlink(). I agree with RDM's proposal in issue 14514 that the replacement should be delete on __exit__ but not on close. As with generator context managers, I'd also add in the last ditch cleanup behaviour in __del__. Converting the issue to a feature request for 3.3 - there's no bug here, just an interaction with Windows that makes the existing behavioural options inconvenient. After all, you can currently get deterministic cleanup (with a __del__ fallback) via: @contextmanager def named_temp(name): f = NamedTemporaryFile(name, delete=False) try: yield f finally: try: os.unlink(name) except OSError: pass You need to be careful to make sure you keep the CM alive (or it will delete the file behind your back), but the idiom RDM described in the other issues handles that for you: with named_temp(fname) as f: data = Data\n f.write(data) f.close() # Windows compatibility with open(fname) as f: self.assertEqual(f.read(), data) As far as the API goes, I'm inclined to make a CM with the above behavour available as a new class method on NamedTemporaryFile: with NamedTemporaryFile.delete_after(fname) as f: # As per the workaround -- title: NamedTemporaryFile unusable under Windows - tempfile.NamedTemporaryFile not particularly useful on Windows type: behavior - enhancement versions: -Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14243 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14514] Equivalent to tempfile.NamedTemporaryFile that deletes file at context exit
Nick Coghlan ncogh...@gmail.com added the comment: I converted issue #14243 to a feature request, so this is now a duplicate. -- nosy: +ncoghlan resolution: - duplicate status: open - closed superseder: - tempfile.NamedTemporaryFile not particularly useful on Windows ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14514 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com