[issue18594] C accelerator for collections.Counter is slow

2013-07-30 Thread Stefan Behnel
New submission from Stefan Behnel: The C accelerator for the collections.Counter class (_count_elements() in _collections.c) is slower than the pure Python versions for data that has many unique entries. This is because the fast path for dicts is not taken (Counter is a subtype of dict) and

[issue18595] zipfile: symlinks etc.

2013-07-30 Thread Ronald Oussoren
New submission from Ronald Oussoren: The zipfile format (as described by .zip file format specification) allows for storing extra unix data, such as symlinks and device nodes in zipfile. Storing at least symlinks would be useful, and is supported by the infozip tools as well (the command-line

[issue18570] OverflowError in division: wrong message

2013-07-30 Thread Mark Dickinson
Mark Dickinson added the comment: I think we might be better with two consistently behaving float classes That sounds a bit extreme. Personally, I'd look for a solution involving only one float class and a with float.nonstopmode: ... setting under which we get infinities and nans as

[issue18596] enable usage of AddressSanitizer in CPython [PATCH]

2013-07-30 Thread halfie
New submission from halfie: Hi, When trying to build CPython tip with AddressSanitizer enabled, I get the following crash, make Parser/pgen make[1]: Entering directory `/scratch/repos/cpython' make[1]: `Parser/pgen' is up to date. make[1]: Leaving directory `/scratch/repos/cpython'

[issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly

2013-07-30 Thread Drekin
New submission from Drekin: When I run sys.stdin.readline() interactivelly (on Windows and Python 3.3.2) and hit Ctrl-C, sometimes it returns an empty string just before KeyboardInterrupt is raised. Sometimes it isn't even raised and instead after hitting Return some weird SyntaxtError:

[issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly

2013-07-30 Thread Tim Golden
Tim Golden added the comment: The Ctrl-C handling in Python on Windows is a bit strange in places. I'll add this to my list of things to look at. If you'd care to walk through the code to produce a patch or at least to point to suspect code, that would make it more likely that it be fixed.

[issue18585] Add a text truncation function

2013-07-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Oops, sorry, I was mistaken. There is no bug actually here: textwrap.summarize('hello world!', width=10) '(...)' 'hello (...)' cannot be the right answer since its len() is 11, greater than 10. -- ___ Python

[issue18585] Add a text truncation function

2013-07-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch to not add any space before the placeholder, with (...) as default placeholder value. -- Added file: http://bugs.python.org/file31084/summarize2.patch ___ Python tracker rep...@bugs.python.org

[issue18594] C accelerator for collections.Counter is slow

2013-07-30 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +rhettinger priority: normal - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18594 ___ ___

[issue18598] Importlib, more verbosity please

2013-07-30 Thread Lukáš Němec
New submission from Lukáš Němec: Hello, recently I filed this bugreport to Django, but they clarified this by pointing me to commits for new version of Django that uses python builtin importlib (import_module) But since most of their import_module code is done like [import_module(x) for y

[issue6643] Throw away more radioactive locks that could be held across a fork in threading.py

2013-07-30 Thread Maciej Bliziński
Maciej Bliziński added the comment: Python version: 2.7.5 OS: Solaris 9 I'm still observing this issue (or Issue5114) on Solaris 9. The symptom is that test_threading hangs indefinitely (tested: overnight) and running pstack on the process, I'm seeing: - lwp# 1 / thread# 1

[issue8713] multiprocessing needs option to eschew fork() under Linux

2013-07-30 Thread Richard Oudkerk
Richard Oudkerk added the comment: The spawn branch is in decent shape, although the documentation is not up-to-date. I would like to commit before the first alpha. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8713

[issue18598] Importlib, more verbosity please

2013-07-30 Thread Brett Cannon
Brett Cannon added the comment: It could be changed to something like the 'package' argument is required to perform a relative import for {!r}.format(name) . Would that have made it more clear? -- assignee: - brett.cannon nosy: +brett.cannon priority: normal - low stage: - needs

[issue18598] Importlib, more verbosity please

2013-07-30 Thread Lukáš Němec
Lukáš Němec added the comment: Yes, absolutely, that is what was I needed to debug it easily, the name parameter Thank you :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18598 ___

[issue18598] Importlib, more verbosity please

2013-07-30 Thread Lukáš Němec
Lukáš Němec added the comment: Also, please do not forget on backports for python 2.6+ :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18598 ___

[issue18594] C accelerator for collections.Counter is slow

2013-07-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Are there any cases where the counter class with the C accelerator is faster than the pure Python version? Here is a benchmarking script (modification of Roy Smith's script [1]) and looks as the pure Python version is faster even for data that has not many

[issue18594] C accelerator for collections.Counter is slow

2013-07-30 Thread Eli Bendersky
Eli Bendersky added the comment: That sounds like a good idea, Stefan. -- nosy: +eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18594 ___

[issue18599] _sha1module report SHA as its name

2013-07-30 Thread Christian Heimes
New submission from Christian Heimes: I found the issue while I was working on unit tests. It looks like a honest mistake ... :) PyUnicode_FromStringAndSize(SHA1, 3); -- files: sha1name.patch keywords: patch messages: 193930 nosy: christian.heimes, gregory.p.smith, pitrou priority:

[issue9035] os.path.ismount on windows doesn't support windows mount points

2013-07-30 Thread Tim Golden
Tim Golden added the comment: I put a bit of work in on this this morning, following Mark's suggestion (msg138197) since that's the canonical approach. Unfortunately, it completely fails to work for the most common case: the root folder of a drive! The documentation for FindFirstFile

[issue18593] Typo in Lib/multiprocessing/heap.py

2013-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 634d6307730d by Eli Bendersky in branch '3.3': Issue #18593: fix typo in comment http://hg.python.org/cpython/rev/634d6307730d New changeset b805bace07c5 by Eli Bendersky in branch 'default': Issue #18593: fix typo in comment

[issue18593] Typo in Lib/multiprocessing/heap.py

2013-07-30 Thread Eli Bendersky
Changes by Eli Bendersky eli...@gmail.com: -- resolution: - fixed stage: - committed/rejected status: open - closed versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18593

[issue18596] enable usage of AddressSanitizer in CPython [PATCH]

2013-07-30 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +christian.heimes, haypo stage: - patch review type: crash - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18596 ___

[issue18598] Importlib, more verbosity please

2013-07-30 Thread Brett Cannon
Brett Cannon added the comment: Sorry, I can't backport this change as it's not a bugfix but an enhancement and it could break someone's code who relies on the specific format of the exception message. -- ___ Python tracker rep...@bugs.python.org

[issue18599] _sha1module report SHA as its name

2013-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset c34c018a8390 by Christian Heimes in branch '3.3': Issue #18599: Fix name attribute of _sha1.sha1() object. It now returns http://hg.python.org/cpython/rev/c34c018a8390 New changeset 5fbf23e947d8 by Christian Heimes in branch 'default': Issue

[issue18599] _sha1module report SHA as its name

2013-07-30 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18599 ___

[issue18596] enable usage of AddressSanitizer in CPython [PATCH]

2013-07-30 Thread halfie
halfie added the comment: This patch should only be applied if we are sure that the allocator is fine and doing such things by design. -- type: enhancement - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18596

[issue18596] enable usage of AddressSanitizer in CPython [PATCH]

2013-07-30 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: -- type: crash - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18596 ___ ___

[issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly

2013-07-30 Thread Drekin
Drekin added the comment: I haven't experience with Python C code but I tried to find some clues in the code. First for input(): it call PyOS_Readline which may call PyOS_StdioReadline my_fgets fgets in Parser/myreadline.c. There is Windows related comment on line 56: “Ctrl-C anywhere on

[issue18600] email.policy doc example passes 'policy' to as_string, but that doesn't work

2013-07-30 Thread R. David Murray
New submission from R. David Murray: When I wrote those docs I intended to add a policy argument to as_string, but did not do it by the time 3.3 was released. The docs for 3.3 need to be corrected, and I need to decide if I do want to add that keyword to as_string in 3.4 (the answer is

[issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly

2013-07-30 Thread Tim Golden
Tim Golden added the comment: Thanks for doing the investigation. Yes, that comment was added by me as part of the fix for issue1677. I'll try to have a look at the codepath you describe to see if we can add a similar workaround. The Ctrl-C / SIGINT handling on Windows is less than ideal, I

[issue9035] os.path.ismount on windows doesn't support windows mount points

2013-07-30 Thread Tim Golden
Tim Golden added the comment: issue9035.2.patch is an updated version of Atsuo's patch. Known issues: * I haven't reworked it for the new memory-management API * There's no test for a non-root mount point (which is really the basis for this issue). It's difficult to see how to do that in a

[issue18369] X509 cert class for ssl module

2013-07-30 Thread Derek Wilson
Derek Wilson added the comment: actually, i suppose rather than change a bunch of existing functions/methods to handle X509 certs it would make more sense to add new methods to the X509 cert class (like match_hostname) so that old stuff doesn't break. --

[issue18570] OverflowError in division: wrong message

2013-07-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: I would prefer one type too, if it can be done gracefully enough. I had thought of a set-mode function (method), but anticipate objection to such modal action-at-distance behavior. A context manager, which I had not thought of, somewhat alleviates that

[issue18112] PEP 442 implementation

2013-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3f994367a979 by Antoine Pitrou in branch 'default': Issue #18112: PEP 442 implementation (safe object finalization). http://hg.python.org/cpython/rev/3f994367a979 -- nosy: +python-dev ___ Python tracker

[issue18112] PEP 442 implementation

2013-07-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed with a couple further doc changes! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18112

[issue18533] Avoid error from repr() of recursive dictview

2013-07-30 Thread Ben North
Changes by Ben North b...@redfrontdoor.org: Added file: http://bugs.python.org/file31089/against-9bf89c909bd4-3.3-1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18533 ___

[issue18533] Avoid error from repr() of recursive dictview

2013-07-30 Thread Ben North
Ben North added the comment: I'll attach fresh patches, one against latest 2.7 and one against latest 3.3 (unchanged apart from headers from previous patch). Both branches pass ./python -m test.regrtest -R20:30 test_dictviews -- ___ Python

[issue18533] Avoid error from repr() of recursive dictview

2013-07-30 Thread Ben North
Changes by Ben North b...@redfrontdoor.org: Added file: http://bugs.python.org/file31088/against-6e1dd1ce95b8-2.7-1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18533 ___

[issue18214] Stop purging modules which are garbage collected before shutdown

2013-07-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Now that PEP 442 is committed, here is the patch. -- Added file: http://bugs.python.org/file31090/module_cleanup.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18214

[issue18214] Stop purging modules which are garbage collected before shutdown

2013-07-30 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- components: +Interpreter Core nosy: +amaury.forgeotdarc, gregory.p.smith stage: - patch review type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18214

[issue812369] module shutdown procedure based on GC

2013-07-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Superceded by patch in issue 18214. -- resolution: - duplicate status: open - closed superseder: - module shutdown procedure based on GC ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue812369

[issue18584] examples in email.policy doc are fu'd

2013-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7b86be4e822c by R David Murray in branch '3.3': #18584: s/testcleanup/testsetup/ until we switch to Sphinx 1.1. http://hg.python.org/cpython/rev/7b86be4e822c New changeset 1901a04a3b4a by R David Murray in branch 'default': Merge #18584:

[issue18601] Example command-line interface to difflib has typographical error

2013-07-30 Thread Stephen Paul Chappell
New submission from Stephen Paul Chappell: The example at the bottom is good but has a line with a bad variable it is name. It says: with open(fromlines) as fromf, open(tofile) as tof: fromlines, tolines = list(fromf), list(tof) In the first line, fromlines does no even exist yet.

[issue18601] Example command-line interface to difflib has typographical error

2013-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0e1f0faacb0d by R David Murray in branch '3.3': #18601: fix error made when difflib example was converted to use 'with'. http://hg.python.org/cpython/rev/0e1f0faacb0d New changeset c4f377d710da by R David Murray in branch 'default': Merge: #18601:

[issue18601] Example command-line interface to difflib has typographical error

2013-07-30 Thread R. David Murray
R. David Murray added the comment: Thanks for the report. Actually that first 'fromlines' should be 'fromfile'. Looks like someone made a typo when converting the example to use the 'with' statement. -- nosy: +r.david.murray resolution: - fixed stage: - committed/rejected status:

[issue16273] f.tell() returning negative number on Windows build

2013-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 81bc2d64c006 by R David Murray in branch '3.3': #16273: Fix tutorial discussion of seek/tell (opaque text-mode values). http://hg.python.org/cpython/rev/81bc2d64c006 New changeset c7d9a2159c6c by R David Murray in branch 'default': Merge: #16273:

[issue18602] _io module names itself io

2013-07-30 Thread Antoine Pitrou
New submission from Antoine Pitrou: In Modules/_io/_iomodule.c, the name field of the module struct is initialized to io rather than _io. The change should intuitively be harmless, but perhaps there's a reason why it is like that? -- components: Library (Lib) messages: 193953 nosy:

[issue18214] Stop purging modules which are garbage collected before shutdown

2013-07-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Slightly better patch. Also, as I pointed out in python-dev (http://mail.python.org/pipermail/python-dev/2013-July/127673.html), this is still imperfect due to various ways modules can be kept alive from long-lived C variables. -- Added file:

[issue9035] os.path.ismount on windows doesn't support windows mount points

2013-07-30 Thread Tim Golden
Tim Golden added the comment: issue9035.3.patch has switched to the new memory management API and has tweaked the tests slightly for robustness. This approach does introduce a behavioural change: the root of a SUBSTed drive (essentially a symlink into the Dos namespace) will raise an OSError

[issue9253] argparse: optional subparsers

2013-07-30 Thread paul j3
paul j3 added the comment: msg113512 - (view) Author: Steven Bethard (bethard) Seems like there's minimally the bug that argparse should currently throw an error if you add an argument after subparsers (since that argument will never be parsed under the current semantics). This isn't

[issue18519] test_sqlite crashes on OS X tiger 3.x buildbot

2013-07-30 Thread Ned Deily
Ned Deily added the comment: The changes for this issue appear to have changed the behavior of test_sqlite. Prior to 5643e873f06e on OS X 10.4 Tiger with the system libsqlite (3.1.3), all test cases of test_sqlite pass. As of current tip on the same platform, there are now two failures in

[issue18580] distutils compilers are unicode strings on OS X since Python 2.7.4

2013-07-30 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- Removed message: http://bugs.python.org/msg193830 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18580 ___

[issue18580] distutils compilers are unicode strings on OS X since Python 2.7.4

2013-07-30 Thread Ned Deily
Ned Deily added the comment: Thanks for the analysis. I'm consolidating this issue with Issue18071. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18580 ___

[issue18214] Stop purging modules which are garbage collected before shutdown

2013-07-30 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Added file: http://bugs.python.org/file31093/module_cleanup3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18214 ___

[issue18519] test_sqlite crashes on OS X tiger 3.x buildbot

2013-07-30 Thread R. David Murray
R. David Murray added the comment: Heh, that's the kind of behavior change I was worried about :(. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18519 ___

[issue18481] lcov report

2013-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 85ec2b5bfcd2 by Christian Heimes in branch 'default': Issue #18481: Add C coverage reporting with gcov and lcov. A new make target http://hg.python.org/cpython/rev/85ec2b5bfcd2 -- nosy: +python-dev ___

[issue18481] lcov report

2013-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 116b05b98bea by Christian Heimes in branch 'default': Issue #18481: document new C coverage make targets http://hg.python.org/devguide/rev/116b05b98bea -- ___ Python tracker rep...@bugs.python.org

[issue18481] lcov report

2013-07-30 Thread Christian Heimes
Christian Heimes added the comment: I have add two new make targets and documented the new stuff in our devguide. I'm going to run and upload the report every now and then. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed

[issue18603] PyOS_mystricmp unused and no longer available

2013-07-30 Thread Christian Heimes
New submission from Christian Heimes: The two functions PyOS_strnicmp() and PyOS_stricmp() from Python/pystrcmp.c are no longer used by any function in the core. Because no module references any object from Python/pystrcmp.c the object file is not included in the Python binary: $ nm -P

[issue18604] Consolidate gui available checks in test.support

2013-07-30 Thread Terry J. Reedy
New submission from Terry J. Reedy: Current situation: test.support.requires starts with if resource == 'gui' and not _is_gui_available(): On windows, _is_gui_available() uses ctypes to determine that there really is a graphics screen. On other systems, it just returns True, even when it

[issue18441] Idle: Make test.support.requires('gui') skip when it should.

2013-07-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: This is working, so closing. I opened #18604 for consolidating gui checks in test.support. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker

[issue16472] Distutils+mingw links agains msvcr90, while python27.dll is linked agains msvcrt

2013-07-30 Thread Marek Marczykowski-Górecki
Marek Marczykowski-Górecki added the comment: I can confirm that when a module is linked against msvcr90, it crashes with invalid access to memory. When removed that library from the linker options (that is - no explicit msvcr, in any version) - module worked perfectly. Note that comment on

[issue18573] In unittest.TestCase.assertWarns doc there is some text about assertRaises()

2013-07-30 Thread py.user
py.user added the comment: What about the second line? It doesn't catch any exception utest.py #!/usr/bin/env python3 import unittest class Test(unittest.TestCase): def test_warning(self): import warnings with self.assertWarns(RuntimeWarning) as cm: raise

[issue11955] 3.3 : test_argparse.py fails 'make test'

2013-07-30 Thread paul j3
paul j3 added the comment: The test names are: FAIL: test_failures_many_groups_listargs (__main__.TestFileTypeW) FAIL: test_failures_many_groups_sysargs (__main__.TestFileTypeW) FAIL: test_failures_no_groups_listargs (__main__.TestFileTypeW) FAIL:

[issue18573] In unittest.TestCase.assertWarns doc there is some text about assertRaises()

2013-07-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: What about the second line? What second line? It doesn't catch any exception It? I do not understand your point. Your example works as documented, including any unexpected exception is an error. Actually, that should be 'any exception' as none is expected.

[issue18573] In unittest.TestCase.assertWarns doc there is some text about assertRaises()

2013-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 366beee880aa by Terry Jan Reedy in branch '3.3': Issue #18573: More copy-paste fixes to assertWarns entry. http://hg.python.org/cpython/rev/366beee880aa -- ___ Python tracker rep...@bugs.python.org

[issue18596] enable usage of AddressSanitizer in CPython [PATCH]

2013-07-30 Thread Charles-François Natali
Charles-François Natali added the comment: The warning is due to the Py_ADDRESS_IN_RANGE() macro: it's a know limitation, we have the same problem with valgrind. This would be a nice neature. It would IMO be even nicer to have an ASAN-enabled buildbot. -- nosy: +neologix