[issue21308] PEP 466: backport ssl changes

2014-05-12 Thread Nick Coghlan
Nick Coghlan added the comment: Christian, Alex, Donald - is there an in-progress patch for this available at all? 2.7.7rc1 is bearing down on us quite rapidly. Given the likely magnitude of this change, should we consider targeting 2.7.8, and give the OpenStack CI team and others a greater c

[issue19776] Provide expanduser() on Path objects

2014-05-12 Thread Claudiu.Popa
Claudiu.Popa added the comment: Added a new version of the patch with improvements suggested by Berker Peksag. Thanks for the review! -- Added file: http://bugs.python.org/file35237/issue19776.patch ___ Python tracker

[issue21430] Document ssl.pending()

2014-05-12 Thread Bas Wijnen
Bas Wijnen added the comment: The documentation about non-blocking is clear enough, thank you for pointing it out. However, I would ask to write anything in there that contains the word "pending". The reason is that I didn't find anything in the documentation, looked in the source, found the

[issue21469] False positive hazards in robotparser

2014-05-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue21401] python2 -3 does not warn about str/unicode to bytes conversions and comparisons

2014-05-12 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue21469] False positive hazards in robotparser

2014-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 560320c10564 by Raymond Hettinger in branch 'default': Issue 21469: Minor code modernization (convert and/or expression to an if/else expression). http://hg.python.org/cpython/rev/560320c10564 -- ___ Py

[issue21469] False positive hazards in robotparser

2014-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset d4fd55278cec by Raymond Hettinger in branch '2.7': Issue 21469: Mitigate risk of false positives with robotparser. http://hg.python.org/cpython/rev/d4fd55278cec -- ___ Python tracker

[issue21469] False positive hazards in robotparser

2014-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset f67cf5747a26 by Raymond Hettinger in branch '3.4': Issue 21469: Add missing news item http://hg.python.org/cpython/rev/f67cf5747a26 -- ___ Python tracker

[issue21469] False positive hazards in robotparser

2014-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4ea86cd87f95 by Raymond Hettinger in branch '3.4': Issue 21469: Mitigate risk of false positives with robotparser. http://hg.python.org/cpython/rev/4ea86cd87f95 -- nosy: +python-dev ___ Python tracker <

[issue21455] add default backlog to socket.listen()

2014-05-12 Thread Charles-François Natali
Charles-François Natali added the comment: >> Py_MIN(SOMAXCONN, 128) > > On Windows, it's not the best choice to use this hardcoded limit. > socket.SOMAXCONN is 2^31-1. I don't see what this would bring: 128 *is* a reasonable limit. > listen() documentation says that Windows chooses a reasonab

[issue21470] Better seeding for the random module

2014-05-12 Thread Charles-François Natali
Charles-François Natali added the comment: Tim, any idea why openssl, openssh & Co get away with just 32 bytes of seed read from /dev/urandom? Is it because of a much smaller state space of the underlying CSPRNG? -- ___ Python tracker

[issue21469] False positive hazards in robotparser

2014-05-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Changes LGTM. Thanks for the review :-) > This module could certainly use some cleanup and updates. Yes, the API is a mess, but I would like to be very conservative with API modifications (preferably none at all) so we don't break the code of very few p

[issue21430] Document ssl.pending()

2014-05-12 Thread Alexey
Alexey added the comment: Please document this method. I'm developing xmpp client using python 3.4 and it's ssl module. Stuck with this same issue for a few days just because of a lack of documentation. I'm asking you: why should I know about this method not from python documentation, but fro

[issue16099] robotparser doesn't support request rate and crawl delay parameters

2014-05-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue12806] argparse: Hybrid help text formatter

2014-05-12 Thread paul j3
paul j3 added the comment: An alternative to adding a 'ParagraphFormatter' class to 'argparse', is to format the individual text blocks PRIOR to passing them to the 'parser', and use the 'RawTextHelpFormatter'. In the attached script I use a simple function that applies 'textwrap' to each 'li

[issue21412] core dump in PyThreadState_Get when built --with-pymalloc

2014-05-12 Thread John Beck
John Beck added the comment: Victor: * This is not a SPARC-specific issue; the exact same failure occurs on x86. * I had built Python 3.3 (some time ago) but only --without-pymalloc. But I tried just now rebuilt Python 3.3 --with-pymalloc, and it failed in the exact same way. --

[issue12806] argparse: Hybrid help text formatter

2014-05-12 Thread paul j3
paul j3 added the comment: An alternative to passing a Formatter instance to the parser is to use a wrapper function. `HelpFormatter.__init__` takes several keyword args. '_get_formatter' does not use those. However we could define: def format_wrapper(**kwargs): # class 'factory'

[issue21401] python2 -3 does not warn about str/unicode to bytes conversions and comparisons

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: The title of the issue is "python2 -3 does not warn about str/unicode to bytes conversions and comparisons". IMO it would be insane to emit BytesWarning on unicode(str). It would break most code using unicode. six.u() function is based on this feature. For ex

[issue21401] python2 -3 does not warn about str/unicode to bytes conversions and comparisons

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: Attached py2_warn_cmp_bytes_text.patch adds BytesWarning for bytes == unicode, bytes != unicode, unicode == bytes, unicode != bytes and similar comparisons with bytearray. The new warnings are added when -b or -bb command line options are used. As a consequen

[issue21415] Python __new__ method doc typo (it's a class and not a static method)

2014-05-12 Thread Eric Snow
Eric Snow added the comment: FYI, __new__() is a staticmethod to accommodate subclassing. Several things that happen at instantiation-time (when __new__() is called), including memory allocation, are tied to the class that is passed in and may be different for subclasses. For example: clas

[issue21436] Consider leaving importlib.abc.Loader.load_module()

2014-05-12 Thread Boris Dayma
Changes by Boris Dayma : -- nosy: +Borisd13 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21226] PyImport_ExecCodeModuleObject not setting module attributes

2014-05-12 Thread Eric Snow
Changes by Eric Snow : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Pyth

[issue21226] PyImport_ExecCodeModuleObject not setting module attributes

2014-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7d20e30bd540 by Eric Snow in branch '3.4': Issue #21226: Set all attrs in PyImport_ExecCodeModuleObject. http://hg.python.org/cpython/rev/7d20e30bd540 New changeset bc324a49d0fc by Eric Snow in branch 'default': Merge from 3.4 (for #21226). http://h

[issue21489] Switching from -OO to -O still uses cached bytecode

2014-05-12 Thread Matthew Fernandez
Matthew Fernandez added the comment: Ah thanks, Antoine. Sorry, failed to find that issue in my prior searching. -- ___ Python tracker ___ ___

[issue21398] LC_CTYPE=C: pydoc leaves terminal in an unusable state

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: I fixed the initial bug and so I close the issue. Open a new issue if you have an idea to restore the terminal state when the pager breaks the terminal. I don't think that it's possible to save/restore the terminal state in a portable way. -- resoluti

[issue21398] LC_CTYPE=C: pydoc leaves terminal in an unusable state

2014-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 89a29e92416f by Victor Stinner in branch '3.4': Issue #21398: Fix an unicode error in the pydoc pager when the documentation http://hg.python.org/cpython/rev/89a29e92416f New changeset 3424d65ad5ce by Victor Stinner in branch 'default': (Merge 3.4)

[issue21489] Switching from -OO to -O still uses cached bytecode

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Not really intentional, it's just a limitation of the current implementation (where the same .pyo files are used for both -O and -OO). Already reported as issue1538778 (which was closed as won't fix). -- nosy: +barry, pitrou superseder: -> pyo's are n

[issue21412] core dump in PyThreadState_Get when built --with-pymalloc

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: > Victor: sure; see attached. Ok, so the error occurs when Python tries to import the _heapq dynamic module: PyModule_Create2() calls PyThreadState_Get() to retrieve to current thread, but it fails. There is a current thread because PyModule_Create2() is calle

[issue21489] Switching from -OO to -O still uses cached bytecode

2014-05-12 Thread Matthew Fernandez
New submission from Matthew Fernandez: Perhaps others wouldn't consider this a bug, but it was definitely surprising to me. When switching between optimisation levels -OO (optimise and strip docstrings) and -O (just optimise), you will find the docstrings are still stripped. E.g. $ ls hello.p

[issue21470] Better seeding for the random module

2014-05-12 Thread Tim Peters
Tim Peters added the comment: > Thanks for the explanation. It's much clearer now. Maybe, but it's also overblown - LOL ;-) That is, no matter what the starting seed, the user will see a microscopically tiny span of the Twister's entire period. So all those "provably correct" properties that

[issue21385] in debug mode, compile(ast) fails with an assertion error if an AST node has no line number information

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: With the development version (Python 3.5), I reproduce the crash when Python is compiled in debug mode: $ ./python astlinenotest.py python: Python/compile.c:3975: assemble_lnotab: Assertion `d_lineno >= 0' failed. Abandon (core dumped) The problem is that as

[issue21470] Better seeding for the random module

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The theoretical properties that make the Twister so attractive were > all proved based on mathematical analysis of its entire period. The > only way to get at the whole period is to allow for all possible > seeds. > > If the seeds Python can use are drawn fro

[issue21308] PEP 466: backport ssl changes

2014-05-12 Thread Mark Nottingham
Changes by Mark Nottingham : -- nosy: +mnot ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21088] curses addch() argument position reverses in Python3.4.0

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: Can we now close this issue? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue21488] codecs.encode/decode documentation inconsistency

2014-05-12 Thread Brad Aylsworth
New submission from Brad Aylsworth: The documentation page for codecs (https://docs.python.org/2/library/codecs.html) shows keyword arguments for codecs.encode and codecs.decode, but they throw an error if keyword arguments are used. codecs.decode.__doc__ reports 'decode(obj, [encoding[,errors

[issue21470] Better seeding for the random module

2014-05-12 Thread Tim Peters
Tim Peters added the comment: [pitrou] > I still find it difficult to understand where is the said danger. The theoretical properties that make the Twister so attractive were all proved based on mathematical analysis of its entire period. The only way to get at the whole period is to allow fo

[issue21418] Segv during call to super_init in application embedding Python interpreter.

2014-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue21418] Segv during call to super_init in application embedding Python interpreter.

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: "While embedding the Python interpreter in an application, I have encountered a crash when the built-in function 'super' is invoked with no arguments." This is not supported. When super() is invoked with no arguments, the class is retrieved (indirectly) from t

[issue21418] Segv during call to super_init in application embedding Python interpreter.

2014-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset cee528d44b1e by Victor Stinner in branch '3.4': Issue #21418: Fix a crash in the builtin function super() when called without http://hg.python.org/cpython/rev/cee528d44b1e New changeset 53cf343c4fff by Victor Stinner in branch 'default': (Merge 3.4)

[issue21437] document that asyncio.ProactorEventLoop doesn't support SSL

2014-05-12 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +gvanrossum, haypo, yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue21422] int << 0: return the number unmodified

2014-05-12 Thread R. David Murray
R. David Murray added the comment: Arfrever pointed out on irc that I misread. It would indeed be assertIs(True << 0, 1), but that wouldn't make a good test because the fact that '1 is 1' is an implementation detail of CPython and can't be relied upon. --

[issue21470] Better seeding for the random module

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > There is no useful theory that allows us to predict the > characteristics of the produced sequences from a set of possible > seeds, so limiting the set of possible seeds is potentially dangerous. I still find it difficult to understand where is the said danger

[issue21455] add default backlog to socket.listen()

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: An article suggests to use max(1024, socket.SOMAXCONN) (to "listen() backlog as large as possible") instead of socket.SOMAXCONN because the OS maximum can be larger than SOMAXCONN (and that it's not possible in Python to get the OS value): http://utcc.utoronto

[issue21470] Better seeding for the random module

2014-05-12 Thread Tim Peters
Tim Peters added the comment: [haypo] > No user complained past years. Raymond said "We've previously had this problem with MT (since resolved, where it is was landed in a very non-random zone)." Do you believe he was wrong? > I don't think that we should worry so much, because it looks like

[issue21422] int << 0: return the number unmodified

2014-05-12 Thread R. David Murray
R. David Murray added the comment: Arfrever's advice was misleading...the test would have needed to be assertIsNot(True << 0, 1), but the fact that True is not preserved is not really what we want to test. What we want to test is that the return value is of type 'int', which is what Victor's

[issue21470] Better seeding for the random module

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: > A sequence that would greatly surprise a user. No user complained past years. I don't think that we should worry so much, because it looks like reading more data from /dev/urandom can be a more serious and concrete issue. -- ___

[issue21470] Better seeding for the random module

2014-05-12 Thread Tim Peters
Tim Peters added the comment: [haypo] > What is an uninteresting sequence? What are the problem of these > sequences? A sequence that would greatly surprise a user. For example, if you generate 32-bit ints from the Twister in one obvious way, there are starting places where you'll get 623 zer

[issue21455] add default backlog to socket.listen()

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: > Py_MIN(SOMAXCONN, 128) On Windows, it's not the best choice to use this hardcoded limit. socket.SOMAXCONN is 2^31-1. listen() documentation says that Windows chooses a reasonable backlog value for you if you pass SOMAXCONN: http://msdn.microsoft.com/en-us/l

[issue21470] Better seeding for the random module

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: "MT is equidistributed. This a major point in its favor but also implies that there are long stretches of "uninteresting" sequences. When we seed with only a subset the state space, there is a risk of systematically landing in those stretches." What is an u

[issue21485] remove unnecesary .flush() calls in the asyncio subprocess code example

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: I wrote the example and the first call to buffer.flush() is a mistake. Thanks for your patch, I applied it. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue21485] remove unnecesary .flush() calls in the asyncio subprocess code example

2014-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset c0404f0da01a by Victor Stinner in branch '3.4': Issue #21485: remove unnecesary .flush() calls in the asyncio subprocess code http://hg.python.org/cpython/rev/c0404f0da01a New changeset 3c26389d741c by Victor Stinner in branch 'default': (Merge 3.4)

[issue21384] Windows: Make handle non inheritable by default

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: > For example, hCryptProv in Python/random.c is inheritable or not? This is not a standard handle. GetHandleInformation() fails with a Windows error 6 (invalid descriptor). I listed inheritable handles with a loop on range(0, 0x1001): only handles of stdin, s

[issue21422] int << 0: return the number unmodified

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: > What I was doing wrong? The "is" operator should only be used to compare identical objects. Small integers (range -5..255 if I remember correctly) are singletons. I prefer to not rely on this implementation detail in a unit test of the Python standard libra

[issue21422] int << 0: return the number unmodified

2014-05-12 Thread Francisco Martín Brugué
Francisco Martín Brugué added the comment: I Victor you were so fast, I started with one patch also in bool (at least the place was right). The problem is that I was getting some extrage (for me at least). As far I hat: def test_shifted_true(self): with self.assertRaises(ValueError

[issue21478] mock calls don't propagate to parent (autospec)

2014-05-12 Thread Michael Foord
Changes by Michael Foord : -- nosy: +kushal.das stage: -> needs patch versions: +Python 3.5 ___ Python tracker ___ ___ Python-bugs-li

[issue21478] mock calls don't propagate to parent (autospec)

2014-05-12 Thread Michael Foord
Michael Foord added the comment: Mock objects detect when another mock is added as a "child", but they don't currently detect that a function created by autospec has been added. It should be a fairly easy fix. -- assignee: -> michael.foord ___ Pyth

[issue21419] Use calloc() instead of malloc() for int << int (lshift)

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: The optimization of 2**n looks to be only useful for very large value of n, result larger than 1 MB. This use case is very rare, and you should probably use another library (GMP, numpy, or something else) for such large numbers. I close the issue. --

[issue21420] Optimize 2 ** n: implement it as 1 << n

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: My main motivation was to use calloc() (issue #21419) for 2**n. It looks like using calloc() for this is only useful for very rare cases (very large value of n: result larger than 1 MB). I close the issue. -- resolution: -> rejected status: open -> cl

[issue21478] mock calls don't propagate to parent (autospec)

2014-05-12 Thread Ned Deily
Changes by Ned Deily : -- nosy: +michael.foord ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue21422] int << 0: return the number unmodified

2014-05-12 Thread STINNER Victor
STINNER Victor added the comment: Ok, 3 core dev are opposed to the change, I close the issue. I added a test on bool >> int and bool << int to ensure that the result is an int. -- resolution: -> rejected status: open -> closed ___ Python tracker

[issue21422] int << 0: return the number unmodified

2014-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset ef49aaad3812 by Victor Stinner in branch '3.4': Issue #21422: Add a test to check that bool << int and bool >> int return an int http://hg.python.org/cpython/rev/ef49aaad3812 New changeset 3da4aed1d18a by Victor Stinner in branch 'default': (Merge 3

[issue21487] Assorted ipaddress performance improvements

2014-05-12 Thread Antoine Pitrou
New submission from Antoine Pitrou: Now that issue #16531 has been committed, it becomes possible to make some operations faster. Attached patch makes summarize_address_range() ~2x faster and Network.subnets() ~4x faster. -- components: Library (Lib) files: ipaddr_perf.patch keywords:

[issue21469] False positive hazards in robotparser

2014-05-12 Thread Skip Montanaro
Skip Montanaro added the comment: Can this change be (easily) tested? If so, a test case akin to your original example would be nice. -- nosy: +skip.montanaro ___ Python tracker ___

[issue7776] http.client.HTTPConnection tunneling is broken

2014-05-12 Thread Donald Stufft
Donald Stufft added the comment: Just an update, the issue is fixed in urllib3 and that has been pulled into requests. Requests is currently prepping to release a new version which I'll pull into pip and issue a pip 1.5.6 release which can be pulled into CPython which should fix this. ---

[issue20826] Faster implementation to collapse consecutive ip-networks

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch, a bit faster yet. After issue16531 is committed, it is now ~15x faster than 3.4. -- Added file: http://bugs.python.org/file35233/faster_collapse2.patch ___ Python tracker

[issue12556] Disable size checks in mmap.mmap()

2014-05-12 Thread Charles-François Natali
Charles-François Natali added the comment: Scratch that. I'll try to work on a patch that doesn't break guarantees for regular files (we try to limit the possibilities of segfault). -- ___ Python tracker __

[issue21485] remove unnecesary .flush() calls in the asyncio subprocess code example

2014-05-12 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov ___ Python tracker ___ ___ Python-bugs-li

[issue7776] http.client.HTTPConnection tunneling is broken

2014-05-12 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21482] get_versions() in cygwinccomiler.py cannot return correct gcc version

2014-05-12 Thread Joe Chan
Joe Chan added the comment: To prevent system crashes, I have to exclude msvc runtime library $ diff -rupN cygwinccompiler.py.original cygwinccompiler.py --- cygwinccompiler.py.original 2014-05-12 23:54:01.296303800 +0800 +++ cygwinccompiler.py 2014-05-13 02:59:37.870414900 +0800 @@ -341,7 +341

[issue12556] Disable size checks in mmap.mmap()

2014-05-12 Thread Charles-François Natali
Charles-François Natali added the comment: >From a cursory inspection, we only check the size for regular files. What exception are you seeing exactly? What does stat return on this file? -- ___ Python tracker

[issue21422] int << 0: return the number unmodified

2014-05-12 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: Use assertIs, since True == 1, but True is not 1. -- ___ Python tracker ___ ___

[issue21486] optimize v4 & v6 netmask parsing

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch, also optimizing v6 netmask parsing (same principle). Before patch: $ ./python -m timeit -s "import ipaddress" "net = ipaddress.IPv6Network(('2001:db8::', 96))" 1 loops, best of 3: 26.1 usec per loop $ ./python -m timeit -s "import ipaddress

[issue21422] int << 0: return the number unmodified

2014-05-12 Thread R. David Murray
R. David Murray added the comment: Francisco: I'd say that was a good idea. Would you like to propose a patch? (ie: figure out where it should go) -- nosy: +r.david.murray ___ Python tracker _

[issue16531] Allow IPNetwork to take a tuple

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the approval, Peter! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue16531] Allow IPNetwork to take a tuple

2014-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4e33c343a264 by Antoine Pitrou in branch 'default': Issue #16531: ipaddress.IPv4Network and ipaddress.IPv6Network now accept an (address, netmask) tuple argument, so as to easily construct network objects from existing addresses. http://hg.python.o

[issue16531] Allow IPNetwork to take a tuple

2014-05-12 Thread pmoody
pmoody added the comment: fine by me. this has been on my todo list forever by $payingjob and $family have prevented me from devoting any time. -- ___ Python tracker ___ ___

[issue21486] optimize v4 netmask parsing

2014-05-12 Thread Antoine Pitrou
New submission from Antoine Pitrou: Here is a patch to optimize ipv4 netmask parsing by maintaining a cache (there are not many valid ipv4 netmask representations). This should be especially useful with #16531. -- components: Library (Lib) files: v4_netmask.patch keywords: patch messag

[issue21486] optimize v4 netmask parsing

2014-05-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- dependencies: +Allow IPNetwork to take a tuple ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue21422] int << 0: return the number unmodified

2014-05-12 Thread Francisco Martín Brugué
Francisco Martín Brugué added the comment: Hi, sorry if it's trivial but shouldn't we add a 'shifted_true' test some were to make sure that this behavior change gets noticed next time? def test_shifted_true(self): self.assertEqual(True << 0, 1) self.assertEqual(True << 1, 2) --

[issue1475692] replacing obj.__dict__ with a subclass of dict

2014-05-12 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue21485] remove unnecesary .flush() calls in the asyncio subprocess code example

2014-05-12 Thread akira
New submission from akira: The current code example contains [1]: print("Python failed with exit code %s:" % exitcode) sys.stdout.flush() sys.stdout.buffer.flush() sys.stdout.buffer.write(stdout) sys.stdout.buffer.flush() that looks bizarre. Either a comment should be added

[issue17794] Add a key parameter to PriorityQueue

2014-05-12 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue13742] Add a key parameter (like sorted) to heapq.merge

2014-05-12 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue16531] Allow IPNetwork to take a tuple

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch with more tests, documentation updates, and an optimized version of the supernet() that's now 5x faster than the original. I would like to commit this if there's no further comment. -- Added file: http://bugs.python.org/file35229/issue165

[issue20826] Faster implementation to collapse consecutive ip-networks

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: It seems like the speed of Network.supernet() is a bottleneck here. issue16531 would probably allow making supernet() much faster. -- ___ Python tracker __

[issue21484] More clarity needed about difference between "x += e" and "x = x + e"

2014-05-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: It seems to me like that is one of the most obvious consequences. How is this not an immediately obvious consequence? -- nosy: +josh.rosenberg ___ Python tracker _

[issue16531] Allow IPNetwork to take a tuple

2014-05-12 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: needs patch -> patch review versions: +Python 3.5 -Python 3.4 ___ Python tracker ___ ___ Python-

[issue21484] More clarity needed about difference between "x += e" and "x = x + e"

2014-05-12 Thread Feliks
New submission from Feliks: In Sec. 7.2.1 of the Language Reference, in the description of "+=" we have: "Also, when possible, the actual operation is performed in-place, meaning that rather than creating a new object and assigning that to the target, the old object is modified instead." Altho

[issue20826] Faster implementation to collapse consecutive ip-networks

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Uh, those measurements are wrong, sorry, since tester.py doesn't consume the iterator. When consuming the iterator, the patch is ~ 4x faster than the original code, which is more reasonable :-) -- ___ Python tracker

[issue21483] Skip os.utime() test on NFS?

2014-05-12 Thread Skip Montanaro
New submission from Skip Montanaro: I got a strange error during "make test" in a fresh build (hg clone ; ./configure ; make ; make test) Traceback (most recent call last): File "Lib/test/test_import.py", line 293, in test_timestamp_overflow os.utime(source, (2 ** 33 - 5, 2 ** 33 - 5)) OSE

[issue12556] Disable size checks in mmap.mmap()

2014-05-12 Thread Josh Triplett
Josh Triplett added the comment: This rejection is indeed problematic. If mmap.mmap receives an explicit size, checking that size against stat will break on devices or special files. It's perfectly reasonable that mmap.mmap's automatic logic when passed length=0 (to map the entire file) won'

[issue20826] Faster implementation to collapse consecutive ip-networks

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a much faster patch, around 30x faster than the original code. With exhuma's data set and tester.py, the original code gives: $ time python3.4 tester.py Execution time: 5.949284339199949 seconds real0m30.152s user0m30.104s sys 0m0.016s Th

[issue21482] get_versions() in cygwinccomiler.py cannot return correct gcc version

2014-05-12 Thread Joe Chan
Joe Chan added the comment: better to parenthesis all three exes[gcc, ld and dllwrap] with "%s" to better support path names that contain non-alphanumeric characters. $ diff -rupN cygwinccompiler.py.original cygwinccompiler.py --- cygwinccompiler.py.original 2014-05-12 23:54:01.296303800 +0800

[issue21480] A build now requires...

2014-05-12 Thread Skip Montanaro
Skip Montanaro added the comment: > Does "make touch" work for you as well? Hadn't tried, and wasn't aware of its existence. I searched Makefile for things like AST_H. Perhaps: * Note "make touch" where the "A build now requires..." comment exists. That comment currently discourages users, as i

[issue21480] A build now requires...

2014-05-12 Thread Eli Bendersky
Eli Bendersky added the comment: Skip, PTAL at the devguide. https://docs.python.org/devguide/setup.html#avoiding-re-creating-auto-generated-files -- ___ Python tracker ___

[issue21481] Argpase Namespace object methods __eq__ and __ne__ raise TypeError when comparing to None

2014-05-12 Thread Joe Borg
Joe Borg added the comment: I believe this comes from doing vars(None). But why would this be happening if Namespace is empty. -- ___ Python tracker ___ ___

[issue20969] Author of EPUB version of Python docs is set to Unknown instead of PSF

2014-05-12 Thread Berker Peksag
Berker Peksag added the comment: Here's a patch. I followed Antoine's name suggestion. PSF would more suitable for the "epub_publisher" option: http://sphinx-doc.org/config.html#confval-epub_publisher -- keywords: +patch nosy: +berker.peksag stage: needs patch -> patch review Added fil

[issue21480] A build now requires...

2014-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Does "make touch" work for you as well? -- components: +Devguide nosy: +eli.bendersky, ezio.melotti, pitrou ___ Python tracker ___ _

[issue21482] get_versions() in cygwinccomiler.py cannot return correct gcc version

2014-05-12 Thread Joe Chan
New submission from Joe Chan: cannot return correct gcc version if the path name contains "space". Suggest to change to: $ diff -rupN cygwinccompiler.py.original cygwinccompiler.py --- cygwinccompiler.py.original 2014-05-12 23:54:01.296303800 +0800 +++ cygwinccompiler.py 2014-05-12 23:59:57.429

[issue21481] Argpase Namespace object methods __eq__ and __ne__ raise TypeError when comparing to None

2014-05-12 Thread Joe Borg
New submission from Joe Borg: See example: >>> import argparse >>> a = argparse.ArgumentParser() >>> b = a.parse_args([]) >>> if b != None: ... print "hey" File "", line 2 print "hey" ^ SyntaxError: invalid syntax >>> >>> if b != None: ... print("hey") ...

  1   2   >