[issue16991] Add OrderedDict written in C

2013-06-04 Thread Eric Snow
Eric Snow added the comment: Without too many optimzations, the C implementation of OrderedDict is basically between 1x and 4x the performance of raw dict. This contrasts with the pure Python OrderedDict, which falls in roughly between 4x and 100x. I've attached an addition to pybench, not

[issue16991] Add OrderedDict written in C

2013-06-04 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: Removed file: http://bugs.python.org/file30357/cOrderedDict.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16991 ___

[issue16991] Add OrderedDict written in C

2013-06-04 Thread Eric Snow
Eric Snow added the comment: Here's an updated patch that has fixes for recursive pickles and for a couple memory-related segfaults that I missed before. That leaves the following to be done: * handle the case where a node is deleted during iteration * check for any reference cycles (should

[issue18078] threading.Condition to allow notify on a specific waiter

2013-06-04 Thread Charles-François Natali
Charles-François Natali added the comment: I'm not convinced it's really useful. Furthermore, the complexity is rather bad: if T is the average number of waiting threads, an C the number of conditions being waited on, the wait is O(C) (appending to C wait queues) and wakeup is O(CT) (C removal

[issue18054] Add more exception related assertions to unittest

2013-06-04 Thread Nick Coghlan
Nick Coghlan added the comment: I like the idea of using the strategy pattern to at least decouple the assertion API from the main testcase API. I also like it better than the mixin suggested earlier. We would obviously have to keep the existing methods for backwards compatibility, but could

[issue18021] Update broken link to Apple Publication Style Guide

2013-06-04 Thread Madison May
Madison May added the comment: So I've done a quick comparison of the two, and for the most part each entry is an identical copy of the 2009 version. Some dated entries have been removed, which I would consider a plus -- who realistically needs to know how to refer to a 56K modems these day,

[issue18078] threading.Condition to allow notify on a specific waiter

2013-06-04 Thread João Bernardo
João Bernardo added the comment: I'm not convinced it's really useful. It doesn't seem a lot useful until you *really* need it. I've got 2 highly parallel programs that took advantage of this pattern. the wait is O(C) (appending to C wait queues) and wakeup is O(CT) (C removal from a

[issue18111] Add a default argument to min max

2013-06-04 Thread David Beazley
David Beazley added the comment: To me, the fact that m = max(s) if s else default doesn't work with iterators alone makes this worthy of consideration. I would also note that min/max are the only reduction functions that don't have the ability to work with a possibly empty sequence. For

[issue18132] buttons in turtledemo disappear on small screens

2013-06-04 Thread Jan Kanis
Changes by Jan Kanis jan.pyt...@jankanis.nl: -- components: +Demos and Tools type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18132 ___

[issue18132] buttons in turtledemo disappear on small screens

2013-06-04 Thread Jan Kanis
New submission from Jan Kanis: If the window of the turtledemo is small enough, the start/stop/clear buttons disappear. This is specifically a problem when running on a netbook with a small screen, because the buttons are never shown. For a newcommer checking out the demo app this could be

[issue18078] threading.Condition to allow notify on a specific waiter

2013-06-04 Thread Richard Oudkerk
Richard Oudkerk added the comment: Furthermore, the complexity is rather bad: if T is the average number of waiting threads, an C the number of conditions being waited on, the wait is O(C) (appending to C wait queues) and wakeup is O(CT) (C removal from a T-length deque). Which just means

[issue17269] getaddrinfo segfaults on OS X when provided with invalid arguments combinations

2013-06-04 Thread Ronald Oussoren
Ronald Oussoren added the comment: I've tested a patch for the 2.7 branch on a 10.5 machine (which also failed to build without the patch), and will commit once I've finished running the testsuite on the 3.3 branch as well. -- ___ Python tracker

[issue18078] threading.Condition to allow notify on a specific waiter

2013-06-04 Thread João Bernardo
João Bernardo added the comment: BTW, I think it would be better to have wait_for_any() return a list of ready conditions rather than a boolean. That was the original idea until I realized `wait` and `wait_for` were just specializations of `wait_for_any`. This can probably be done with

[issue17222] py_compile.compile() replaces target files, breaking special files and symlinks

2013-06-04 Thread Brett Cannon
Brett Cannon added the comment: I'm going to toss Armin's request over to core-mentorship since the fix is easy. Is all you are after, Armin, a ``not os.path.isfile(cfile) or os.path.islink(cfile)`` check which if true raises an exception? -- assignee: brett.cannon - status: closed -

[issue18054] Add more exception related assertions to unittest

2013-06-04 Thread Julian Berman
Julian Berman added the comment: I don't either really off the top of my head, though I've toyed with some things. If there's support for some exploration I wouldn't mind attempting a POC externally though. -- ___ Python tracker

[issue18054] Add more exception related assertions to unittest

2013-06-04 Thread Michael Foord
Michael Foord added the comment: There's always (almost) support for exploration... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18054 ___ ___

[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2013-06-04 Thread Mher Movsisyan
Changes by Mher Movsisyan mher.movsis...@gmail.com: -- nosy: +mher.movsisyan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18119 ___ ___

[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-04 Thread Vajrasky Kok
Vajrasky Kok added the comment: Based on the input from Benjamin Peterson, I grab encoding from the os module in the getpass module. I put some test as well. Until the whole function is rewritten, I hope this patch will suffice and do the job properly. -- Added file:

[issue18005] faster modular exponentiation in some cases

2013-06-04 Thread Aaron Meurer
Changes by Aaron Meurer asmeu...@gmail.com: -- nosy: +Aaron.Meurer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18005 ___ ___ Python-bugs-list

[issue18078] threading.Condition to allow notify on a specific waiter

2013-06-04 Thread Charles-François Natali
Charles-François Natali added the comment: Which just means that waiting on C conditions is C times more expensive than waiting on 1 currently is. That seems reasonable enough to me, and anyway, I would expect C to be fairly small. Waking up a single thread (through notify()) is currently

[issue18078] threading.Condition to allow notify on a specific waiter

2013-06-04 Thread João Bernardo
João Bernardo added the comment: Here, removing a thread from a wait queue other than the one from which it was signalled is O(waiting threads). To be fair, You will probably never have more than a few hundred/thousand threads on a process. Usually you'll work under a few dozen threads. To

[issue18133] Modulus not calculating properly?

2013-06-04 Thread Joshua
New submission from Joshua: The Modulus doesn't seem to pull the proper remainder from simple calculations. Look at the difference below between the remainder of a regular division calculation and the modulus: Am I missing something??? print (str(10.2 / 2)) 5.1 print (str(10.2 % 2))

[issue18132] buttons in turtledemo disappear on small screens

2013-06-04 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- versions: -Python 2.6, Python 3.1, Python 3.2, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18132 ___

[issue18133] Modulus not calculating properly?

2013-06-04 Thread Joshua
Joshua added the comment: never mind, long day sorry! -- resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18133 ___

[issue18021] Update broken link to Apple Publication Style Guide

2013-06-04 Thread Ned Deily
Ned Deily added the comment: Documenting Python references to the Apple Style Guide go back to at least Python 2.3.5's documentation, at that time to the 2001 version of the Apple Style Guide. I was more curious if the Apple Style Guide was still being actively consulted by the documentation

[issue18021] Update broken link to Apple Publication Style Guide

2013-06-04 Thread Ezio Melotti
Ezio Melotti added the comment: I don't think I ever read/consulted that page, except maybe the first time I came across that link. I consult http://docs.python.org/devguide/documenting.html regularly, but that is mostly for the rst markup. Usually I just try to be consistent with the

[issue18134] zipfile extractall accepts wrong password

2013-06-04 Thread Benedict Kwok
New submission from Benedict Kwok: Steps to reproduce: 1) create a ssn.txt file with social security numbers of customers 2) create a zip file with a password: zip -P secret ssn ssn.txt 3) create a python script to extract the zipfile by: import=zipfile zFile=zipfile.ZipFile(ssn.zip) try:

[issue18134] zipfile extractall accepts wrong password

2013-06-04 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18134 ___ ___ Python-bugs-list

[issue18103] Create a GUI test framework for Idle

2013-06-04 Thread Ned Deily
Ned Deily added the comment: Terry: FYI, I just noticed the languishing patches in Issue4343 which *might* be of some use here. -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18103

[issue17222] py_compile.compile() replaces target files, breaking special files and symlinks

2013-06-04 Thread Armin Rigo
Armin Rigo added the comment: That's not really what I'm after, but that's a workaround I proposed to avoid the worst breakage. I don't have an opinion about what to do with symlinks. -- ___ Python tracker rep...@bugs.python.org

[issue17932] Win64: possible integer overflow in iterobject.c

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 757a121a27c2 by Victor Stinner in branch 'default': Close #17932: Fix an integer overflow issue on Windows 64-bit in iterators: http://hg.python.org/cpython/rev/757a121a27c2 -- nosy: +python-dev resolution: - fixed stage: -

[issue17932] Win64: possible integer overflow in iterobject.c

2013-06-04 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- stage: committed/rejected - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17932 ___ ___

[issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes)

2013-06-04 Thread STINNER Victor
New submission from STINNER Victor: Our Windows 64-bit buildbot has interesting warnings: ..\Modules\_ssl.c(493): warning C4244: 'function' : conversion from 'SOCKET_T' to 'int', possible loss of data [C:\buildbot.python.org\3.x.kloth-win64\build\PCbuild\_ssl.vcxproj]

[issue18136] test_distutils failing under OS X 10.8 w/ clang

2013-06-04 Thread Brett Cannon
New submission from Brett Cannon: I have not had test_distutils succeed in ages. It looks like various header files are not being passed to the compiler properly as all three test failures stem from PyModuleDef_HEAD_INIT supposedly not existing or some other macro. Below is an example failure

[issue17222] py_compile.compile() replaces target files, breaking special files and symlinks

2013-06-04 Thread Brett Cannon
Brett Cannon added the comment: Armin: I'm going off of http://bugs.python.org/msg189428 where you say you want an exception raised. If there is something else you want to suggest that's fine as long as it's not to revert the semantics since I'm not willing to do that. --

[issue11959] smtpd cannot be used without affecting global state

2013-06-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: The changes to smtpd.py seem reasonable to me. I see no reason not to make this change, so +1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11959 ___

[issue9566] Compilation warnings under x64 Windows

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 46401ce03547 by Victor Stinner in branch 'default': Issue #9566: Fix compiler warning on Windows 64-bit in _bz2module.c http://hg.python.org/cpython/rev/46401ce03547 -- ___ Python tracker

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2298bcba6ec9 by Victor Stinner in branch 'default': Close #17931: Fix PyLong_FromPid() on Windows 64-bit: processes are identified http://hg.python.org/cpython/rev/2298bcba6ec9 -- nosy: +python-dev resolution: - fixed stage: -

[issue17932] Win64: possible integer overflow in iterobject.c

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 52075f60719e by Victor Stinner in branch 'default': Issuse #17932: Fix an integer overflow issue on Windows 64-bit in tuple http://hg.python.org/cpython/rev/52075f60719e -- ___ Python tracker

[issue9566] Compilation warnings under x64 Windows

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 93f4b32fc95c by Victor Stinner in branch 'default': Issue #9566: Fix a compiler warning on Windows 64-bit in namespace_init() http://hg.python.org/cpython/rev/93f4b32fc95c -- ___ Python tracker

[issue9566] Compilation warnings under x64 Windows

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5dcbd5d8d004 by Victor Stinner in branch 'default': Issue #9566: Fix compiler warning on Windows 64-bit http://hg.python.org/cpython/rev/5dcbd5d8d004 New changeset 41b8be55b160 by Victor Stinner in branch 'default': Issue #9566: Fix compiler

[issue17206] Py_XDECREF() expands its argument multiple times

2013-06-04 Thread STINNER Victor
STINNER Victor added the comment: AMD64 Windows7 SP1 3.x buildbot is crashing in test_marshal. It looks like a regression introduced by the changeset aff41a6421c2: [ 88/375] test_marshal Traceback (most recent call last): File ../lib/test/regrtest.py, line 1611, in module

[issue11959] smtpd cannot be used without affecting global state

2013-06-04 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Changes to Doc/library/asyncore.rst should be reverted. Also I would do: - asynchat.async_chat.__init__(self, conn, map) + asynchat.async_chat.__init__(self, conn, map=map) -- ___ Python tracker

[issue13772] listdir() doesn't work with non-trivial symlinks

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset f431cd0edd85 by Victor Stinner in branch 'default': Issue #13772: Fix compiler warnings on Windows http://hg.python.org/cpython/rev/f431cd0edd85 -- ___ Python tracker rep...@bugs.python.org

[issue13772] listdir() doesn't work with non-trivial symlinks

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset c351591f1f63 by Victor Stinner in branch 'default': Issue #13772: fix _check_dirA(): call *A() functions, not *W() functions http://hg.python.org/cpython/rev/c351591f1f63 -- ___ Python tracker

[issue13772] listdir() doesn't work with non-trivial symlinks

2013-06-04 Thread STINNER Victor
STINNER Victor added the comment: @Jason R. Coombs: Can you please review my following commit? It looks like you made a copy/paste failure in _check_dirA() :-) New changeset c351591f1f63 by Victor Stinner in branch 'default': Issue #13772: fix _check_dirA(): call *A() functions, not *W()

[issue17206] Py_XDECREF() expands its argument multiple times

2013-06-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Hum, a stack overflow? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17206 ___ ___ Python-bugs-list

[issue18137] format(float, str): integer overflow for huge precision

2013-06-04 Thread STINNER Victor
New submission from STINNER Victor: format(1.2, .%sf % (2**32 + 2)) returns 1.20: the integer overflow is not catced. Attached patch fixes the issue. -- components: Interpreter Core files: float_format_precision.patch keywords: patch messages: 190629 nosy: haypo, mark.dickinson

[issue9566] Compilation warnings under x64 Windows

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 36c35a1893fe by Victor Stinner in branch 'default': Issue #9566: Fix compiler warning on Windows 64-bit http://hg.python.org/cpython/rev/36c35a1893fe New changeset 88a21c5a97ef by Victor Stinner in branch 'default': Issue #9566: Fix compiler

[issue13772] listdir() doesn't work with non-trivial symlinks

2013-06-04 Thread Jason R. Coombs
Jason R. Coombs added the comment: @Victor Stinner Thanks for fixing this. You're absolutely right. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13772 ___

[issue13772] listdir() doesn't work with non-trivial symlinks

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset e024236ea253 by Victor Stinner in branch 'default': Issue #13772: Fix a compiler warning on Windows http://hg.python.org/cpython/rev/e024236ea253 New changeset d9f3ea27f826 by Victor Stinner in branch 'default': Issue #13772: Mark helper functions

[issue13772] listdir() doesn't work with non-trivial symlinks

2013-06-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset c8212fca8747 by Victor Stinner in branch 'default': Issue #13772: Use syntax for literal wchar_t character http://hg.python.org/cpython/rev/c8212fca8747 -- ___ Python tracker rep...@bugs.python.org

[issue4343] New function in Tkinter.py: setup_master

2013-06-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am still confused about the master/parent business and why required args are documented as optional. (Besides #18131, I also discovered that messageboxes usually, but not always, require parent=something passed, to be collected into **options. I need to

[issue17628] str==str: compare the first character before calling memcmp()

2013-06-04 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: str==str: compare the first and last character before calling memcmp() - str==str: compare the first character before calling memcmp() ___ Python tracker rep...@bugs.python.org

[issue18129] Fatal Python error: Cannot recover from stack overflow.

2013-06-04 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18129 ___ ___ Python-bugs-list

[issue17991] ctypes.c_char gives a misleading error when passed a one-character unicode string

2013-06-04 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17991 ___ ___ Python-bugs-list

[issue4343] New function in Tkinter.py: setup_master

2013-06-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: After searching through tkinter.py for '_default_root', the patch looks better. The point I missed before is that Tk().__init__(self,...) normally calls _loadtk(self) which installs self as _default_tk if it was None before. So the new function will return

[issue18103] Create a GUI test framework for Idle

2013-06-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thanks Ned. I commented on the issue. The code in the proposed function will fix one of the two problems with tkinter.Variable that I noted in #18131. I can imagine there might be situations in which it would also be useful for testing, as GP claims.

[issue18138] ssl.SSLContext.add_cert()

2013-06-04 Thread Christian Heimes
New submission from Christian Heimes: The patch implements an add_cert(pem_or_der_data) method for the ssl.SSLContext() object. On success the method adds a trusted CA cert to the context's internal cert store. The CA certificate can either be an ASCII unicode string (PEM format) or buffer

[issue18134] zipfile extractall accepts wrong password

2013-06-04 Thread R. David Murray
R. David Murray added the comment: This is a duplicate of issue 10876. According to that issue it is a bug in the zipfile format. -- nosy: +r.david.murray resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - Zipfile sometimes considers a false

[issue16991] Add OrderedDict written in C

2013-06-04 Thread Eric Snow
Eric Snow added the comment: Here's one solution to the deletion-during-iteration problem. It makes the iterators track the key rather than the node, at the expense of a sliver of speed on __iter__() and keys(). -- Added file:

[issue16991] Add OrderedDict written in C

2013-06-04 Thread Eric Snow
Eric Snow added the comment: The concern about reference cycles here lies in their existence in the linked-list. To see what I mean, check out the use of weakrefs in the pure Python implementation at Lib/collections/__init__.py. As the current implementation does not use PyObjects for the

[issue11470] Flag inappropriate uses of callable class attributes

2013-06-04 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11470 ___ ___ Python-bugs-list

[issue18139] email module's add_header appends instead of inserting

2013-06-04 Thread Kiran Bandla
New submission from Kiran Bandla: This issue is in message.py in the email module. The add_header method should insert the new header on the top of the existing headers. The current function implementation appends the header at the end of the existing headers. -- components: Library

[issue18135] _ssl module: possible integer overflow for very long strings (+2^31 bytes)

2013-06-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18135 ___ ___

[issue18137] format(float, str): integer overflow for huge precision

2013-06-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18137 ___ ___

[issue4331] Add functools.partialmethod

2013-06-04 Thread Nick Coghlan
Nick Coghlan added the comment: I don't believe it is reasonable to change the behaviour of partial at this late stage of the game. It's documented as behaving like staticmethod (albeit by not implementing the descriptor protocol at all), so that's no longer something we can change. If issue