[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 benefit of the change is it actually backports 
the codes from 3.x so it's easy for later maintainence and it doesn't add 
additional work.

> I included a test case that works on 32-bit platforms, which you may use.

Thanks. But I don't get such an environment to test so I prefer not to add it 
now. I adjust my patch according to yours. :-)

--
Added file: http://bugs.python.org/file46223/overflow-checks-3x-2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 thread
_0 From 
worker thread

--
files: test.py
messages: 285021
nosy: desbma
priority: normal
severity: normal
status: open
title: Python 3.6 logging thread name regression with concurrent.future threads
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file46222/test.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 my unicode.patch in that bug. I 
included a test case that works on 32-bit platforms, which you may use. (From 
memory, you probably need to disable -fwrapv and maybe use -ftrapv or the 
undefined behaviour sanitizer to make the test fail.)

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 handling in urllib.
https://hg.python.org/cpython/rev/350c5a1f9cfd

New changeset e90efd9f203e by Xiang Zhang in branch '3.6':
Issue #29142: Merge 3.5.
https://hg.python.org/cpython/rev/e90efd9f203e

New changeset 3954f8f6be3d by Xiang Zhang in branch 'default':
Issue #29142: Merge 3.6.
https://hg.python.org/cpython/rev/3954f8f6be3d

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 different module objects derived from the same source 
code).

As such, with -m, adding:

import __main__
sys.modules[__main__.__spec__.name] = __main__

is sufficient to get this working again, and will work for any of the PEP 451 
based versions (i.e. 3.4+). (I'm open to an RFE to get runpy to do this by 
default in 3.7+ - it's an idea that has come up several times, and I think it 
will ultimately be less surprising than the current behaviour of allowing two 
entirely distinct copies of the module to be loaded)

The direct execution case is a bit different, as that's genuinely missing a 
__spec__ entry, and needs to be told how to reload itself:

import __main__
main_file = __main__.__file__
main_name = os.path.splitext(os.path.basename(main_file))[0]
__main__.__spec__ = importlib.util.spec_from_file_location(main_name, 
main_file)
sys.modules[__main__.__spec__.name] = __main__

The two cases can be distinguished at runtime by whether or not 
__main__.__spec__ was already set.

Since this isn't really something we encourage people to do in general, but 
does remain possible for frameworks that want to support live reloading of 
__main__, I'm OK with requiring that extra framework-provided scaffolding in 
3.4+.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 helper():
try:
yield
except PermissionError as e:
raise unittest.SkipTest(str(e))

or

@contextmanager
def helper():
if android_not_root:
raise unittest.SkipTest("operation not allowed, non root user")
yield

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 working urandom setup ignores urandom and seeds 
from the time and PID. Not a big deal, since the old code always seeded from a 
(lower resolution) time anyway. But if urandom failed, we get the SystemError.

The fix should be simple, in Modules/_randommodule.c change the random_seed() 
function to read

if (arg == NULL || arg == Py_None) {
if (random_seed_urandom(self) < 0) { // was >= 0!
PyErr_Clear();

/* Reading system entropy failed, fall back on the worst entropy:
   use the current time and process identifier. */
random_seed_time_pid(self);
}
Py_RETURN_NONE;
}

--
keywords: +3.6regression
nosy: +haypo, martin.panter
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, caught, 
and re-raised outside of the generator, then the clear_frames() will cause the 
generator to raise a StopIteration exception the next time it is used.

Here is a reproducible where I create a generator and wrap it inside of an 
object API:

def simple_gen():
yield 1, None
try:
1/0
except ZeroDivisionError as err:
yield None, err
yield 3, None

class Spam:
def __init__(self):
self.gen = simple_gen()
def get_next(self):
value, err = next(self.gen)
if err is not None:
raise err
return value

I can test this without unittest using the following:

def simple_test():
spam = Spam()
assert spam.get_next() == 1
try:
spam.get_next()
except ZeroDivisionError:
pass
else:
raise AssertionError
assert spam.get_next() == 3
print("simple test passed")

simple_test()


This prints "simple test passed", as expected.

The unittest implementation is simpler:

import unittest

class TestGen(unittest.TestCase):
def test_gen(self):
spam = Spam()
self.assertEqual(spam.get_next(), 1)
with self.assertRaises(ZeroDivisionError):
spam.get_next()
self.assertEqual(spam.get_next(), 3)

unittest.main()

but it reports an unexpected error:

==
ERROR: test_gen (__main__.TestGen)
--
Traceback (most recent call last):
 File "clear.py", line 40, in test_gen
   self.assertEqual(spam.get_next(), 3)
 File "clear.py", line 13, in get_next
   value, err = next(self.gen)
StopIteration

--
Ran 1 test in 0.000s

FAILED (errors=1)

I have tracked it down to the call to traceback.clear_frames(tb) in 
unittest/case.py. The following ClearFrames context manager will call 
traceback.clear_frames() if requested. The test code uses ClearFrames to 
demonstrate that the call to clear_frames() is what causes the unexpected 
StopIteration exception:


import traceback

class ClearFrames:
   def __init__(self, clear_frames):
   self.clear_frames = clear_frames
   def __enter__(self):
   return self

   def __exit__(self, exc_type, exc_value, tb):
   assert exc_type is ZeroDivisionError, exc_type
   if self.clear_frames:
   traceback.clear_frames(tb)  # This is the only difference between 
the tests.
   return True

# This is essentially the same test case as before, but structured using
# a context manager that either does or does not clear the traceback frames.
def clear_test(clear_frames):
spam = Spam()
assert spam.get_next() == 1
with ClearFrames(clear_frames):
spam.get_next()
try:
assert spam.get_next() == 3
except StopIteration:
print(" ... got StopIteration")
return
print(" ... clear_test passed")

print("\nDo not clear frames")
clear_test(False)
print("\nClear frames")
clear_test(True)


The output from this test is:

Do not clear frames
 ... clear_test passed

Clear frames
 ... got StopIteration

There are only a dozen or so tests in my code which are affected by this. 
(These are from a test suite which I am porting from 2.7 to 3.5.) I can easily 
re-write them to avoid using assertRaisesRegex.

I have no suggestion for a longer-term solution.

--
components: Library (Lib)
messages: 285006
nosy: dalke
priority: normal
severity: normal
status: open
title: assertRaises with exceptions re-raised from a generator kills generator
type: behavior
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: resolved -> patch review
status: closed -> open
Added file: http://bugs.python.org/file46218/without_android_not_root.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 then you have skewed the results.

As for your use-case, be aware that importlib.reload() is not designed for it. 
You will still have objects floating around in the interpreter that are using 
the original module and so you're not going to get all instances of objects 
automatically updated to the new code. The only way to guarantee usage of the 
new code is to restart the interpreter.

I get why you want this, John, but Python is simply not structured to support 
what you're after. Closing as "won't fix".

--
nosy: +ncoghlan
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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_tarfile_add_exclude.patch
keywords: patch
messages: 285002
nosy: lars.gustaebel, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Remove the support of the exclude argument in tarfile.TarFile.add()
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file46217/remove_tarfile_add_exclude.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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()
[395/401/1] test_xpickle
[396/401/1] test_xrange
[397/401/1] test_zipfile
[398/401/1] test_zipfile64
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long 
time to run
[399/401/1] test_zipimport
[400/401/1] test_zipimport_support
[401/401/1] test_zlib
359 tests OK.
1 test failed:
test_gdb
1 test altered the execution environment:
test_import
40 tests skipped:
test_aepack test_al test_applesingle test_bsddb test_bsddb185
test_bsddb3 test_cd test_cl test_codecmaps_cn test_codecmaps_hk
test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_curses
test_dl test_gl test_idle test_imgfile test_kqueue
test_linuxaudiodev test_macos test_macostools test_msilib
test_ossaudiodev test_scriptpackages test_smtpnet
test_socketserver test_startfile test_sunaudiodev test_tcl
test_timeout test_tk test_ttk_guionly test_ttk_textonly
test_turtle test_urllib2net test_urllibnet test_winreg
test_winsound test_zipfile64
8 skips unexpected on linux2:
test_bsddb test_bsddb3 test_idle test_tcl test_tk test_ttk_guionly
test_ttk_textonly test_turtle
make: *** [test] Error 1

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 getiterator(). 

* The html argument of XMLParser deprecated in 3.4.
 The rest of arguments are keyword-only now (passing them as keywords was 
recommended in the documentatin).

* The support of the doctype() method of XMLParser subclasses and its default 
implementation. Deprecated in 3.2. Define the doctype() method on a custom 
TreeBuilder target instead.

* The xml.etree.cElementTree module deprecated in 3.3.

Unfortunately some of these deprecations are in the documentation only or in 
Python implementatation, but not in C implementatation. Perhaps missed warnings 
should be added first (see issue29204). But if commit the patch from issue29204 
in 3.6, perhaps deprecated features could be removed in 3.7.

--
components: Extension Modules, Library (Lib), XML
files: etree_remove_deprecated.patch
keywords: patch
messages: 285000
nosy: eli.bendersky, ned.deily, scoder, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Remove old-deprecated ElementTree features
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file46216/etree_remove_deprecated.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 it, I'm using pkg_resources... which is importing the 
email parser which imports random which creates a random instance which causes 
this bug.

It seems to me then that the stdlib should be modified to avoid importing 
random unless they actually need it, otherwise this gets triggered. Or am I 
missing something here?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
importing the random module. However, it seems that this is not actually the 
case:

BlockingIOError: [Errno 11] Resource temporarily unavailable 
  
 The above exception was the direct cause of the following exception: 
  
 Traceback (most recent call last): 
   File "/home/lvuser/py/robot.py", line 15, in  
 import wpilib 
   File "/usr/local/lib/python3.6/site-packages/wpilib/__init__.py", line 72, 
in  
 from ._impl.main import run 
   File "/usr/local/lib/python3.6/site-packages/wpilib/_impl/main.py", line 7, 
in  
 from pkg_resources import iter_entry_points 
   File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", 
line 36, in  
 import email.parser 
   File "/usr/local/lib/python3.6/email/parser.py", line 12, in  
 from email.feedparser import FeedParser, BytesFeedParser 
   File "/usr/local/lib/python3.6/email/feedparser.py", line 27, in  
 from email._policybase import compat32 
   File "/usr/local/lib/python3.6/email/_policybase.py", line 9, in  
 from email.utils import _has_surrogates 
   File "/usr/local/lib/python3.6/email/utils.py", line 28, in  
 import random 
   File "/usr/local/lib/python3.6/random.py", line 742, in  
 _inst = Random() 
 SystemError:  returned a result with an error set 


Background: I'm the maintainer of the RobotPy project, which allows students to 
use Python to control their robots in the FIRST Robotics competition. The robot 
controller we use is an NI roboRIO, which is powered by an ARM cortex-a9.

This error was encountered when the robot is booting up with a python program. 
Presumably the program is started early enough in the boot process where the 
urandom blocking issue mentioned in the PEP occurs.

I'd love some help figuring out what's going on here, and the best way to fix 
it. Thanks!

I'm also tracking this issue at 
https://github.com/robotpy/robotpy-wpilib/issues/243

--
components: Library (Lib)
messages: 284996
nosy: virtuald
priority: normal
severity: normal
status: open
title: BlockingIOError during system startup
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 it so that tests calling 
os.link() are skipped based on the fact that they raise PermissionError instead 
of based on the fact that they are being run by an Android non-root user as is 
currently the case.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 ...
make: *** [libinstall] Error 1

Python 3.5.2 installation was successful on the same machine a little earlier. 
At the very least, a hint should be provided on how to get more verbose info.

--
components: Build
messages: 284994
nosy: petevine
priority: normal
severity: normal
status: open
title: make install fails on ARM
type: crash
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.
https://hg.python.org/cpython/rev/08042f0dbb67

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 has committed a fix for the “exception ignored” problem, so assuming 
> it works

I am looking forward to seeing that. Thanks Victor!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 a chance to add some assertions or 
additional checks in debug mode, it would be nice. Unless this complicate the 
code to much.

The i counter is not used in some loops. It can be eliminated.

--
assignee: serhiy.storchaka -> rhettinger
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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_entries is sparce, and there are many deleted entries 
on the right end.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 to check values for NULL, and needed to 
> iterate fewer elements), and could get rid of reallocations in often mutated 
> dicts. I haven't found clear explanation of this.

As far as I remember, I choose it because:

1. easy to explain, easy to discussion.

"keep insertion order" is easier than "keep insertion order unless deletion".

I want to start discussion based on most simple behavior.
But my patch was reviewed by core developers in sprint, when right before 3.6b1.

2. I want to share same implementation with OrderedDict, like PyPy.

3. Make patch compact.

If we compact dk_entries when deletion, we need another dk_indices compaction.
Before sprint, my patch wasn't reviewed for months.  I was afraid that my patch 
wasn't reviewed by 3.6b1.


For now, "namespace dict keeps insertion order" is language spec.
`del` shouldn't break insertion order.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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) 
might no longer have that cascade. On the other hand, issuing a warning for the 
module would also hit this import cascade, even though the code would work just 
fine without cElementTree. One argument speaks for deprecation, the other for 
removal.

However, cElementTree is redundant now, so it should be removed eventually. And 
since that removal would break some code anyway, I'd be ok with just removing 
it without prior import warnings. People can then decide whether they want to 
fix their code by adding the well-known import cascade (and not get annoying 
warnings for it) or by switching entirely to plain ET and not looking back.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
single module, say, "app.py" and run this with "python app.py".

When in development mode, on each page view, the modification time for each 
file backing each module is checked for changes.  If the file has changed, the 
file is reloaded.

This allows for an iterative development mode familiar to web developers since 
the glory days of writing VB pages in ASP.

The problem occurs when the file is loaded directly, or with "-m".

For example with the attached file:

  $ python reloader.py
  Traceback (most recent call last):
File "reloader.py", line 31, in 
  reload_module("__main__")
File "reloader.py", line 28, in reload_module
  importlib.reload(module)
File 
"/usr/local/var/pyenv/versions/3.5.2/lib/python3.5/importlib/__init__.py", line 
166, in reload
  _bootstrap._exec(spec, module)
File "", line 607, in _exec
  AttributeError: 'NoneType' object has no attribute 'name'

And with -m:

  $ python -m reloader
  Traceback (most recent call last):
File "/usr/local/var/pyenv/versions/3.5.2/lib/python3.5/runpy.py", line 
184, in _run_module_as_main
  "__main__", mod_spec)
File "/usr/local/var/pyenv/versions/3.5.2/lib/python3.5/runpy.py", line 85, 
in _run_code
  exec(code, run_globals)
File "reloader.py", line 31, in 
  reload_module("__main__")
File "reloader.py", line 28, in reload_module
  importlib.reload(module)
File 
"/usr/local/var/pyenv/versions/3.5.2/lib/python3.5/importlib/__init__.py", line 
147, in reload
  raise ImportError(msg.format(name), name=name)
  ImportError: module reloader not in sys.modules

Note that there are two different error messages, neither of which is great.

There are workarounds, but given that this works in previous version of python, 
it might be better to fix it.  Or to have an explicit error message that 
describes the problem more precisely:

  "Cannot reload __main__"

--
files: reloader.py
messages: 284982
nosy: brett.cannon, j1o1h1n, r.david.murray
priority: normal
severity: normal
status: open
title: importlib reload fails for module supplied as argument to command line
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file46212/reloader.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 = '@decorator\nasync def f():\nasync for x in y: pass'

In [32]: tree = ast.parse(code)

In [34]: tree.body[0].body[0]
Out[34]: <_ast.AsyncFor at 0x7f5cb6a77198>

In [35]: tree.body[0].body[0].col_offset
Out[35]: 10

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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]: <_ast.AsyncFunctionDef at 0x7f5cb6a58f60>

In [21]: tree.body[0].col_offset
Out[21]: 6

--
components: Library (Lib)
messages: 284978
nosy: Jelle Zijlstra
priority: normal
severity: normal
status: open
title: col_offset for AsyncFunctionDef AST nodes is wrong
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 that and instead implement the FTP downloads 
separately. That's unfortunate.

--
nosy: +scoder

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: "\N{ESC}\x43" == "\N{ESC}C" (Alt + Capital C), 
which probably runs the “capitalize-word” command, and "\N{ESC}\x2B" == 
"\N{ESC}+" (Alt + Plus), which presumably generates the bell character.

I don’t understand why you say Readline is “correctly” using the C or Posix 
locale (ASCII), while my understanding is Python on Android always uses UTF-8 
as the locale encoding. It seems there is an inconsistency with the locale or 
encodings being used.

Or is this just an obscure case that you choose not to support on Android, and 
therefore skip the test?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 only in tests where they are expected. This is possible 
since converting doctests to unittests some time ago.

Added deprecations:

* Element.getchildren() and Element.getiterator() methods. They were deprecated 
in the documentation and in Python implementation in 2.7 and 3.2.

* The xml.etree.cElementTree module. Deprecated in the documentation in 3.3.

* The html argument of XMLParser. Deprecated in the documentation in 3.4.

Ned, is it appropriate to commit the patch (or its part) in 3.6? The 
discrepancy between Python and C implementation can be considered as a bug. 
What are your thoughts?

--
components: Extension Modules, Library (Lib)
files: etree_deprecations.patch
keywords: patch
messages: 284975
nosy: ned.deily, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add code deprecations in ElementTree
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file46211/etree_deprecations.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 check values for NULL, and needed to iterate 
fewer elements), and could get rid of reallocations in often mutated dicts. I 
haven't found clear explanation of this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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', 1), ('b', 2)]
>>> f(b=2, a=1)
[('a', 1), ('b', 2)]

C implementation should be changed too.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 arise 
often and isn't really different than the status quo where f(1, b=2) or f(1, 2) 
are already cached separately.  Overall it is a net win by saving the sorting 
step on every call.

--
assignee: serhiy.storchaka
components: Library (Lib)
files: lru_468.diff
keywords: patch
messages: 284971
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: With PEP 468, the lru cache not longer needs to sort keyword args
type: performance
versions: Python 3.7
Added file: http://bugs.python.org/file46210/lru_468.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the table is usually dense packed to the left, this 
will give fewer loops and fewer memory accesses.

--
assignee: serhiy.storchaka
components: Interpreter Core
files: dict_shorter_iteration.diff
keywords: patch
messages: 284970
nosy: inada.naoki, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve dict iteration
type: performance
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46209/dict_shorter_iteration.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 that's a 
different issue.

--
Added file: http://bugs.python.org/file46207/ignore_dots-v3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com