[issue28969] lru_cache is not threadsafe

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: With Antoine's suggestion lru_cache-dict-pop-simpler-3.5.patch no longer has an advantage. Just ignore it. -- ___ Python tracker ___

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: patch review -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue29200] is it a bug in `functools._HashedSeq`

2017-01-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue29142] urllib: no_proxy variable values with leading dot not properly handled

2017-01-08 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks Milan and Thomas! -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___ __

[issue29145] failing overflow checks in replace_*

2017-01-08 Thread Xiang Zhang
Xiang Zhang added the comment: > FTR I thought the consensus was not to backport these fixes unless there was > a demonstrated problem: , though > personally, I would be in favour of backporting in many cases. Sorry not know that. :-( Another benefi

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-01-08 Thread desbma
New submission from desbma: Logging statement using 'threadName' from concurrent.futures threads produce the wrong output with Python 3.6. The attached program with Python 3.5.X outputs: MainThread From main thread Thread-1 From worker thread But with 3.6, it outputs: MainThread From main thre

[issue29145] failing overflow checks in replace_*

2017-01-08 Thread Martin Panter
Martin Panter added the comment: FTR I thought the consensus was not to backport these fixes unless there was a demonstrated problem: , though personally, I would be in favour of backporting in many cases. Regarding str.join() in unicode.c, see also

[issue1621] Do not assume signed integer overflow behavior

2017-01-08 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +failing overflow checks in replace_* ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue29142] urllib: no_proxy variable values with leading dot not properly handled

2017-01-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset cb4f73be9486 by Xiang Zhang in branch '2.7': Issue #29142: Fix suffixes in no_proxy handling in urllib. https://hg.python.org/cpython/rev/cb4f73be9486 New changeset 350c5a1f9cfd by Xiang Zhang in branch '3.5': Issue #29142: Fix suffixes in no_proxy

[issue29145] failing overflow checks in replace_*

2017-01-08 Thread Xiang Zhang
Xiang Zhang added the comment: I committed the patch to 2.7. The new patch is for 3.x. -- stage: patch review -> commit review versions: +Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46221/overflow-checks-3x.patch ___ Pyth

[issue29145] failing overflow checks in replace_*

2017-01-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 29e505526bdd by Xiang Zhang in branch '2.7': Issue #29145: Fix overflow checks in string, bytearray and unicode. https://hg.python.org/cpython/rev/29e505526bdd -- nosy: +python-dev ___ Python tracker

[issue29142] urllib: no_proxy variable values with leading dot not properly handled

2017-01-08 Thread Xiang Zhang
Xiang Zhang added the comment: LGTM. -- assignee: -> xiang.zhang stage: patch review -> commit review ___ Python tracker ___ ___ Pyth

[issue29206] importlib reload fails for module supplied as argument to command line

2017-01-08 Thread Nick Coghlan
Nick Coghlan added the comment: Since reload re-uses the existing namespace, having two names is less messy when they're just aliases for the same module object (it still has all the usual cache validity problems of any reload operation, but it doesn't have the extra challenges of two differen

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset cc47d385512b by Raymond Hettinger in branch 'default': Complete the merge for issue #29203 https://hg.python.org/cpython/rev/cc47d385512b -- ___ Python tracker ___

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 48c750c26710 by Raymond Hettinger in branch '3.6': Issue #29203: functools.lru_cache() now respects PEP 468 https://hg.python.org/cpython/rev/48c750c26710 -- nosy: +python-dev ___ Python tracker

[issue29208] BlockingIOError during system startup

2017-01-08 Thread Martin Panter
Martin Panter added the comment: David you are right, thanks. Dustin: the exact patch you want is revision 0a55e039d25f. -- resolution: -> duplicate status: open -> closed superseder: -> Python 3.6 on Windows doesn't seed Random() well enough ___

[issue29198] AsyncGenerator is missing from typing

2017-01-08 Thread Jelle Zijlstra
Changes by Jelle Zijlstra : Added file: http://bugs.python.org/file46220/typingindentation.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue29198] AsyncGenerator is missing from typing

2017-01-08 Thread Jelle Zijlstra
Changes by Jelle Zijlstra : Added file: http://bugs.python.org/file46219/asyncgenerator3.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue29208] BlockingIOError during system startup

2017-01-08 Thread Dustin Spicuzza
Dustin Spicuzza added the comment: I'll try applying that fix tomorrow and see if the issue is addressed. -- ___ Python tracker ___ __

[issue29208] BlockingIOError during system startup

2017-01-08 Thread David Vo
David Vo added the comment: It looks like this was already fixed in issue 29085. -- nosy: +auscompgeek ___ Python tracker ___ ___ Pyth

[issue29195] Get rid of supporting outdated wrong keyword arguments in re methods

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: "pattern" is not more informative, it is just wrong. The argument of the match() method is not a pattern, it is a string with which a pattern is matched. -- ___ Python tracker _

[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is worth to add special helper in test.support for using as a context manager: with helper(): os.mkfifo(filename) Then you could change its implementation without changing the testing code. For example: @contextmanager def he

[issue29208] BlockingIOError during system startup

2017-01-08 Thread Martin Panter
Martin Panter added the comment: It looks like the logic for handling an error seeding from urandom is reversed: . Random_seed_urandom() actually returns -1 if is an exception set, and 0 if it was successful. The result would be a normal wo

[issue29211] assertRaises with exceptions re-raised from a generator kills generator

2017-01-08 Thread Andrew Dalke
New submission from Andrew Dalke: The unittest assertRaises/assertRaisesRegex implementation calls traceback.clear_frames() because of issue9815 ("assertRaises as a context manager keeps tracebacks and frames alive"). However, if the traceback is from an exception created in a generator, caugh

[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-01-08 Thread Xavier de Gaye
Xavier de Gaye added the comment: Re-opening the issue for a more generic change that skips the tests when PermissionError is raised instead of when they are run by an Android non-root user as this is done currently after the previously pushed changes. -- resolution: fixed -> stage: r

[issue28167] remove platform.linux_distribution()

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But platform.dist() can be removed. It was deprecated in 2.6. -- nosy: +serhiy.storchaka ___ Python tracker ___ __

[issue29206] importlib reload fails for module supplied as argument to command line

2017-01-08 Thread Brett Cannon
Brett Cannon added the comment: The error from using -m stems from runpy not aliasing the module as both "__main__" and "reloader". I suspect the reason is that having a module under two names gets really messy because if you update just one of those modules you leave the other one around and

[issue29210] Remove the support of the exclude argument in tarfile.TarFile.add()

2017-01-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch removes the support of the exclude argument in tarfile.TarFile.add(). It was deprecated in 2.7 and 3.2. The filter argument that supersedes it is available in all maintained releases. -- components: Library (Lib) files: remove_tarfil

[issue29207] make install fails on ARM

2017-01-08 Thread petevine
petevine added the comment: In case a clue might be gleaned right away from `make test`, I'm posting the final part of the output here: [394/401/1] test_xmlrpc ../Python-2.7.13/Lib/threading.py:846: DeprecationWarning: sys.exc_clear() not supported in 3.x; use except clauses self.__exc_clear

[issue29209] Remove old-deprecated ElementTree features

2017-01-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Add code deprecations in ElementTree ___ Python tracker ___ ___ Python-bugs-list maili

[issue29209] Remove old-deprecated ElementTree features

2017-01-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch removes old-deprecated ElementTree features. * Methods Element.getchildren(), Element.getiterator() and ElementTree.getiterator() deprecated in 2.7 and 3.2. Use list(elem) or iteration instead of getchildren(), methods iter() instead of get

[issue29034] Fix memory leak and use-after-free in path_converter

2017-01-08 Thread Xiang Zhang
Xiang Zhang added the comment: > Is 3.5 free from all these bugs? path_converter is much simpler in 3.5 so I think it's free of these bugs. :-) -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue29208] BlockingIOError during system startup

2017-01-08 Thread Dustin Spicuzza
Dustin Spicuzza added the comment: Crap, after reading more carefully, I see that PEP was rejected in favor of PEP 524. According to that PEP, then I must implement the wait_for_system_rng() function? It's a bit weird, because I'm not explicitly using the random module and don't care to use i

[issue29034] Fix memory leak and use-after-free in path_converter

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is 3.5 free from all these bugs? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue29208] BlockingIOError during system startup

2017-01-08 Thread Dustin Spicuzza
New submission from Dustin Spicuzza: I haven't dug into this very deeply yet, so I'm seeking some clarity on this issue before doing so. According to my reading of PEP 522 (https://www.python.org/dev/peps/pep-0522/), BlockingIOError will be raised in security sensitive APIs, but not when just

[issue29180] skip tests that raise PermissionError in test_os (non-root user on Android)

2017-01-08 Thread Xavier de Gaye
Xavier de Gaye added the comment: > If test_os is the only user of the helper, I'd say let's keep it in > Lib/test/test_os.py for now. I agree with that concern. support.os_link() is also used by a patch in issue 29181, and I am planning to modify the changes made by issue 28759 to also use i

[issue29207] make install fails on ARM

2017-01-08 Thread petevine
New submission from petevine: I've just tried installing 2.7.13 on my ARM machine but after a successful build, `make install` fails without any hint what's wrong: Compiling /usr/lib/python2.7/xmllib.py ... Compiling /usr/lib/python2.7/xmlrpclib.py ... Compiling /usr/lib/python2.7/zipfile.py ..

[issue29034] Fix memory leak and use-after-free in path_converter

2017-01-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 553eedb8b247 by Xiang Zhang in branch '3.6': Issue #29034: Fix memory leak and use-after-free in path_converter. https://hg.python.org/cpython/rev/553eedb8b247 New changeset 08042f0dbb67 by Xiang Zhang in branch 'default': Issue #29034: Merge 3.6. h

[issue29205] col_offset for AsyncFunctionDef AST nodes is wrong

2017-01-08 Thread Jelle Zijlstra
Changes by Jelle Zijlstra : -- keywords: +patch Added file: http://bugs.python.org/file46215/issue29205.patch ___ Python tracker ___ _

[issue29174] 'NoneType' object is not callable in subprocess.py

2017-01-08 Thread ita1024
ita1024 added the comment: > The code in test.py is not realistic. My application uses a process pool that gets freed when my application terminates. > You might have more influence with a realistic use case. I am reporting this because the users of my application are complaining. > Victor h

[issue27603] Migrate IDLE context menu items to shell extension

2017-01-08 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- assignee: terry.reedy -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue29202] Improve dict iteration

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In general the idea LGTM. It it is slightly dangerous if dict structure is broken. j is incremented only when value != NULL, and if ma_used is not correct, this can cause reading out of the end of an array. Of course this should never happen. But if there is

[issue29202] Improve dict iteration

2017-01-08 Thread INADA Naoki
INADA Naoki added the comment: While this isn't bugfix, I'm +1 to commit this to 3.6 branch to reduce future maintenance cost. -- ___ Python tracker ___ _

[issue29202] Improve dict iteration

2017-01-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file46214/dict_shorter_iteration.diff ___ Python tracker ___ ___ Python-bugs-

[issue29202] Improve dict iteration

2017-01-08 Thread INADA Naoki
INADA Naoki added the comment: patch LGTM. > Since the table is usually dense packed to the left, this will give fewer > loops and fewer memory accesses. Since dk_nentries is "right end of active entries", this patch doesn't affect for "dence packed to the left" dict. But it can affect when dk

[issue29202] Improve dict iteration

2017-01-08 Thread INADA Naoki
INADA Naoki added the comment: > I'm wondering why new dict implementation don't keep the array of items > compact? Original Raymond's implementation did not preserve the order after > deletions, but saved items in an array without gaps. This could simplify and > speed up an iteration (no need

[issue29204] Add code deprecations in ElementTree

2017-01-08 Thread Stefan Behnel
Stefan Behnel added the comment: I'm ok with the deprecations. Regarding the cElementTree module, this is a bit problematic. The idiomatic import has lost its use in Py2.5 when ET and cET were added to the stdlib, so code that was written for Py2.5 or later (e.g. because it uses generators) m

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2017-01-08 Thread Stefan Behnel
Stefan Behnel added the comment: Actually, it seems that calling urlcleanup() is sufficient as a work-around. -- ___ Python tracker ___ __

[issue29204] Add code deprecations in ElementTree

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, I have a doubt about this too. Perhaps it can be just removed. The idiomatic code in Python 2 is: try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET -- ___

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that fixes also C implementation and has tests. -- type: performance -> behavior versions: +Python 3.6 Added file: http://bugs.python.org/file46213/lru_cache_pep468.patch ___ Python tracker

[issue29206] importlib reload fails for module supplied as argument to command line

2017-01-08 Thread John Lehmann
John Lehmann added the comment: I may not have been clear as to how the problem seems when working with a web.py application: * visit the web page, see something that needs fixing * make the required change to app.py * reload the webpage * error occurs -- _

[issue29206] importlib reload fails for module supplied as argument to command line

2017-01-08 Thread John Lehmann
New submission from John Lehmann: In testing the py3 port for the web framework web.py, I found a limitation of importlib.reload. A module that was loaded via the command line cannot be reloaded with importlib.reload. The basic mode of operation for web.py is to create a web application as a

[issue29205] col_offset for AsyncFunctionDef AST nodes is wrong

2017-01-08 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: The col_offset is actually correct when there is a decorator: In [26]: code = '@decorator\nasync def f(): pass' In [27]: tree = ast.parse(code) In [28]: tree.body[0].col_offset Out[28]: 0 The same issue appears with async for and async with: In [31]: code =

[issue29204] Add code deprecations in ElementTree

2017-01-08 Thread Martin Panter
Martin Panter added the comment: Isn’t cElementTree useful and recommended in 2.7? It would be awkward to deprecate it in Python 3. But I guess the other cases should be okay to deprecate in 3.7. -- nosy: +martin.panter ___ Python tracker

[issue29194] importlib reload fails for module supplied as argument to command line

2017-01-08 Thread John Lehmann
John Lehmann added the comment: You get a slightly different error using "-m". I'll raise a new defect - with some background that may make the bug seem more reasonable. -- ___ Python tracker

[issue29205] col_offset for AsyncFunctionDef AST nodes is wrong

2017-01-08 Thread Jelle Zijlstra
New submission from Jelle Zijlstra: The col_offset attribute for ast.AsyncFunctionDef objects points to the "def" keyword, not to the "async" keyword that actually starts the node. Test case: In [18]: code = 'async def f(): pass' In [19]: tree = ast.parse(code) In [20]: tree.body[0] Out[20]:

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2017-01-08 Thread Stefan Behnel
Stefan Behnel added the comment: This bug makes the installation of lxml fail on many systems (especially MacOS) when pip installs from sources, because it tries to download its library dependencies from FTP and crashes due to the FTP "error". I guess the current fix is to not use urllib for t

[issue28997] test_readline.test_nonascii fails on Android

2017-01-08 Thread Martin Panter
Martin Panter added the comment: . Thanks for the explanation. It sounds like the Readline library assumes an ASCII-only locale and sets its “convert-meta” variable to “on”. But Python assumes UTF-8 and inputs b"\xC3\xAB" to the terminal. Readline converts the input to two escape sequences: "\

[issue29204] Add code deprecations in ElementTree

2017-01-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +eli.bendersky, scoder ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue29204] Add code deprecations in ElementTree

2017-01-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Some deprecated ElementTree features are deprecated only in the documentation or in Python implementation (that is virtually the same since C implementation is default). Proposed patch adds missed deprecations is code. It also makes warnings be ignored onl

[issue29202] Improve dict iteration

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm wondering why new dict implementation don't keep the array of items compact? Original Raymond's implementation did not preserve the order after deletions, but saved items in an array without gaps. This could simplify and speed up an iteration (no need to

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I think this is a bug and it should be fixed in 3.6. I concur. Do you care to whip-up a patch (it is late here). -- ___ Python tracker __

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this is a bug and it should be fixed in 3.6. Currenly lru_cache breaks PEP 468 (Preserving Keyword Argument Order). >>> from functools import lru_cache >>> @lru_cache() ... def f(**kwargs): ... return list(kwargs.items()) ... >>> f(a=1, b=2) [('a

[issue29203] With PEP 468, the lru cache not longer needs to sort keyword args

2017-01-08 Thread Raymond Hettinger
New submission from Raymond Hettinger: Since the ordering of keyword arguments is now guaranteed, the LRU cache doesn't need to sort any longer. The will give a small change in behavior that I don't care about. A call f(a=1, b=2) would now be cached separately from f(b=2, a=1). That won't ar

[issue29202] Improve dict iteration

2017-01-08 Thread Raymond Hettinger
New submission from Raymond Hettinger: I haven't had much of a chance to comb through all the code it detail, but there are least a few places that loop over the whole entry table (size is dk_nentries) when fewer iterations would suffice (stop once mp->ma_used entries have been seen). Since t

[issue29202] Improve dict iteration

2017-01-08 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> low ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue29034] Fix memory leak and use-after-free in path_converter

2017-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The last patch LGTM. Thanks Xiang! At the end this issue has appeared much more complex that it was looked at the start. -- assignee: -> xiang.zhang stage: patch review -> commit review ___ Python tracker

[issue29034] Fix memory leak and use-after-free in path_converter

2017-01-08 Thread Xiang Zhang
Changes by Xiang Zhang : Added file: http://bugs.python.org/file46208/path_converter-new-4.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue29142] urllib: no_proxy variable values with leading dot not properly handled

2017-01-08 Thread Milan Oberkirch
Milan Oberkirch added the comment: Thanks for the feedback! I changed the patch to use lstrip so that the FQDN "example.com." would match the NOPROXY entry "example.com.". I don't think we get FQDNs, but that's just my guess. I think ideally "example.com" would also match "example.com." but t

[issue29034] Fix memory leak and use-after-free in path_converter

2017-01-08 Thread Xiang Zhang
Xiang Zhang added the comment: path_converter-new-3.patch fixes the wrong return value on successful cases. -- Added file: http://bugs.python.org/file46206/path_converter-new-3.patch ___ Python tracker