[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-09 Thread Mark Blakeney

Mark Blakeney added the comment:

Well my work-around is not ideal as I get an extra embedded space in those 
messages. I'm surprised this is "not a common use case"? It doesn't really 
worry me but it is a 3.6 incompatibility change which I would think is always 
far better to avoid.

--
status: pending -> open

___
Python tracker 

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



[issue29222] Python3 interactive shell hangs on

2017-01-09 Thread Eryk Sun

Eryk Sun added the comment:

As a workaround, the platform's default Ctrl+C handler should allow killing the 
process:

>>> signal.signal(signal.SIGINT, signal.SIG_DFL)


>>> counter = itertools.count()
>>> 'count' in counter
^C

But it's nowhere near as useful as a KeyboardInterrupt exception, if something 
ever gets implemented to resolve issue 26351.

--
nosy: +eryksun
status: open -> closed

___
Python tracker 

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



[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-09 Thread Vinay Sajip

Vinay Sajip added the comment:

This change was due to fixing #27937. Since yours is not a common use case, and 
since the workaround works for you, I propose not to change things back.

--
assignee:  -> vinay.sajip
status: open -> pending

___
Python tracker 

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



[issue29215] pyport.h uses non C90-style comment

2017-01-09 Thread Benjamin Peterson

Benjamin Peterson added the comment:

C99 is required to build or include Python headers since 3.6. PEP 7 could be 
clearer. The bullet about C99 is meant to override for 3.6 other directives 
such as the comment prohibition.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue29222] Python3 interactive shell hangs on

2017-01-09 Thread R. David Murray

R. David Murray added the comment:

This is an instance of the the problem discussed in Issue 26351.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
superseder:  -> Occasionally check for Ctrl-C in long-running operations like 
sum

___
Python tracker 

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



[issue29222] Python3 interactive shell hangs on

2017-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +rhettinger

___
Python tracker 

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



[issue29222] Python3 interactive shell hangs on

2017-01-09 Thread Vex Woo

New submission from Vex Woo:

I'v tested the following steps against python3.5 and python3.6. Python shell 
hangs on.

$ python3.6
Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import itertools
>>> counter = itertools.count()
>>> next(counter)
0
>>> next(counter)
1
>>> 'count' in counter




^C^C^C^C^C^C^C^C



^C^C^C


^D
^Z
[1]  + 47254 suspended  python3.6
~ ->> fg
[1]  + 47254 continued  python3.6


^C^C^Z
[1]  + 47254 suspended  python3.6

--
components: Build
messages: 285093
nosy: Nixawk
priority: normal
severity: normal
status: open
title: Python3 interactive shell hangs on
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



[issue26632] @public - an __all__ decorator

2017-01-09 Thread Nick Coghlan

Nick Coghlan added the comment:

Chiming in so Barry & Zach can take this feedback into account for any future 
proposal:

- I think the specific term "public" has too much baggage from other languages, 
especially in the sense that it implies that "private" is the default. In 
reality, all attributes in Python are public, with __all__ serving as 
executable documentation and a constraint on wildcard exports

- the notion of an automatically supplied __all__ object that defaults to 
reporting [name for name in dir(module) if not name.startswith("_")] has a lot 
more to recommend it (as it encodes the default wildcard export behaviour 
directly into the language implementation, rather than requiring that module 
analysis tools implement that default themselves)

- given "__all__" as the base name, the method name for class and function 
registration could just be the generic "__all__.register" (although 
"__all__.export" would also work, since it's the counterpart of "import *")

- using an object namespace would allow for other registration methods if that 
seemed appropriate

Even then, I'm at best +0 on the proposal, but I also don't make heavy use of 
code development helpers (IDEs, etc)

--
nosy: +ncoghlan

___
Python tracker 

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



[issue29219] TracebackException(capture_locals=True) may fail with RecursionError

2017-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please provide a script that reproduces an issue?

Seems the repr of uninitialized CDLL instance is used. It causes an infinite 
recursion in attempt to resolve not set private attributes (_name, _handle, 
_FuncPtr).

--
components: +ctypes
nosy: +amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka
type: crash -> behavior
versions: +Python 2.7, 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



[issue29221] ABC Recursion Error on isinstance() with less than recursion limit class hierarchy depth

2017-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue29221] ABC Recursion Error on isinstance() with less than recursion limit class hierarchy depth

2017-01-09 Thread Anthony Scopatz

New submission from Anthony Scopatz:

Classes that have an abstract base class somewhere in their hierarchy have a 
significantly reduced depth with respect to the recursion limit. In the 
attached minimal example, the class hierarchy is only able to be 245 deep past 
the ABC before a recursion error, rather than the expected 1000. 

Also disconcerting is that this recursion error is triggered by unrelated 
objects, namely an isinstance() check. This means that the error can happen at 
any point in the interpreter simply because the offending class exists. You 
don't need to call isinstance() with the offending class.

This is likely due to the way the way that ABCMeta.__subclasscheck__(). This 
issue can be avoided by either:

1. Not having a deep-ish hierarchy, or 
2. Calling the trigger, isinstance(), each time a new class is created (inside 
of the loop).

Option (2) works because it tricks ABCMeta into putting each subclass class 
into its internal cache of subclasses. This fix is undesirable in general 
because what triggers the error, in general may not be known and can cross 
package boundaries.

Note: I only tested this on Python v3.4 and v3.5, but it presumably affects all 
currently supported versions of Python.

--
components: Library (Lib)
files: abc_rec_fail.py
messages: 285090
nosy: Anthony Scopatz
priority: normal
severity: normal
status: open
title: ABC Recursion Error on isinstance() with less than recursion limit class 
hierarchy depth
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46236/abc_rec_fail.py

___
Python tracker 

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



[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-09 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue29217] Documentation for uuid has wrong description for variant

2017-01-09 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for your report David. :-) I simply remove the type description since I 
think the type of the constants doesn't matter here.

--
nosy: +xiang.zhang
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue29217] Documentation for uuid has wrong description for variant

2017-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0d4e0a736688 by Xiang Zhang in branch '2.7':
Issue #29217: Fix the wrong type description of UUID.variant.
https://hg.python.org/cpython/rev/0d4e0a736688

New changeset 1f8e8e16e996 by Xiang Zhang in branch '3.5':
Issue #29217: Fix the wrong type description of UUID.variant.
https://hg.python.org/cpython/rev/1f8e8e16e996

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

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

--
nosy: +python-dev

___
Python tracker 

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



[issue24699] TemporaryDirectory is cleaned up twice

2017-01-09 Thread Eryk Sun

Changes by Eryk Sun :


--
resolution:  -> out of date
stage:  -> resolved

___
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-09 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks you all. :-)

--
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-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 09b1cdac74de by Xiang Zhang in branch '3.5':
Issue #29145: Fix overflow checks in str.replace() and str.join().
https://hg.python.org/cpython/rev/09b1cdac74de

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

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

--

___
Python tracker 

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



[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-09 Thread Mark Blakeney

New submission from Mark Blakeney:

I have code which does a logging.addLevelName(logging.INFO, '') so that the 
logging level name is not displayed in INFO messages, but is in all other 
levels. I have been running this code fine since many versions of Python 2 
through to 3.5.

Now running with python 3.6.0-1 (on Arch Linux), the name is output in messages 
as "Level 20". Changing the empty string '' in the call above to a space ' ' is 
my current work-around.

--
components: Library (Lib)
messages: 285085
nosy: markb
priority: normal
severity: normal
status: open
title: Python 3.6 regression/change using logging.addLevelName() to clear a name
type: behavior
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



[issue28700] test_dbm failure: KeyError: b'0' (intermittent in 3.5, reliable in 3.6)

2017-01-09 Thread Anthony Sottile

Changes by Anthony Sottile :


--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue29219] TracebackException(capture_locals=True) may fail with RecursionError

2017-01-09 Thread Ilya Kulakov

New submission from Ilya Kulakov:

I'm using Python 3.5.2 to be precise. I have code that is roughly equivalent to:

import sys
import traceback

def handle_exception(exc_type, exc_value, exc_traceback):
traceback.TracebackException(exc_type, exc_value, exc_traceback, 
capture_locals=True)

sys.excepthook = handle_exception

For one of the clients the following error happened:

Traceback (most recent call last):
  File "...", line 222, in ...
  File "...", line 160, in ...
  File "...", line 878, in ...
  File ":/traceback.py", line 463, in __init__
  File ":/traceback.py", line 474, in __init__
  File ":/traceback.py", line 352, in extract
  File ":/traceback.py", line 257, in __init__
  File ":/traceback.py", line 257, in 
  File ":/ctypes/__init__.py", line 354, in __repr__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, in __getattr__
  File ":/ctypes/__init__.py", line 365, in __getitem__
  File ":/ctypes/__init__.py", line 360, 

[issue24699] TemporaryDirectory is cleaned up twice

2017-01-09 Thread Ilya Kulakov

Changes by Ilya Kulakov :


--
status: open -> closed

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2017-01-09 Thread paul j3

Changes by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue9182] document “--” as a way to distinguish option w/ narg='+' from positional argument in argparse

2017-01-09 Thread paul j3

Changes by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue14392] type=bool doesn't raise error in argparse.Action

2017-01-09 Thread paul j3

Changes by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue29218] distutils: Remove unused install_misc class

2017-01-09 Thread Eric N. Vander Weele

Changes by Eric N. Vander Weele :


--
components:  -Build

___
Python tracker 

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



[issue20094] intermitent failures with test_dbm

2017-01-09 Thread Anthony Sottile

Anthony Sottile added the comment:

That doesn't seem to be the problem though, that occurs in both the successful 
and failure case

--

___
Python tracker 

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



[issue20094] intermitent failures with test_dbm

2017-01-09 Thread Anthony Sottile

Anthony Sottile added the comment:

Stepping through the code, it seems under ndbm it is creating a file with a 
'.db' extension:

```
(Pdb) list
 47  'g': b'intended',
 48  }
 49 
 50 def init_db(self):
 51 import pdb; pdb.set_trace()
 52  -> with dbm.open(_fname, 'n') as f:
 53 for k in self._dict:
 54 f[k.encode("ascii")] = self._dict[k]
 55 
 56 def keys_helper(self, f):
 57 keys = sorted(k.decode("ascii") for k in f.keys())
(Pdb) n
> /home/asottile/workspace/cpython/Lib/test/test_dbm.py(53)init_db()
-> for k in self._dict:
(Pdb) os.listdir('.')
['@test_8371_tmp.db']
(Pdb) _fname
'@test_8371_tmp'
```

--

___
Python tracker 

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



[issue20094] intermitent failures with test_dbm

2017-01-09 Thread Anthony Sottile

Anthony Sottile added the comment:

I'm seeing this same failure in python3.5 on 16.04 about 20% of the time:

```
$ python3.5 -m test -v test_dbm
== CPython 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609]
==   Linux-4.4.0-57-generic-x86_64-with-Ubuntu-16.04-xenial little-endian
==   hash algorithm: siphash24 64bit
==   /tmp/test_python_8169
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[1/1] test_dbm
test_keys (test.test_dbm.WhichDBTestCase) ... ok
test_whichdb (test.test_dbm.WhichDBTestCase) ... ok
test_whichdb_ndbm (test.test_dbm.WhichDBTestCase) ... BDB0004 fop_read_meta: 
@test_8169_tmp_ndbm.db: unexpected file type or format
ok
test_anydbm_access (test.test_dbm.TestCase-dbm.gnu) ... ok
test_anydbm_creation (test.test_dbm.TestCase-dbm.gnu) ... ok
test_anydbm_creation_n_file_exists_with_invalid_contents 
(test.test_dbm.TestCase-dbm.gnu) ... ok
test_anydbm_keys (test.test_dbm.TestCase-dbm.gnu) ... ok
test_anydbm_modification (test.test_dbm.TestCase-dbm.gnu) ... ok
test_anydbm_not_existing (test.test_dbm.TestCase-dbm.gnu) ... ok
test_anydbm_read (test.test_dbm.TestCase-dbm.gnu) ... ok
test_error (test.test_dbm.TestCase-dbm.gnu) ... ok
test_anydbm_access (test.test_dbm.TestCase-dbm.ndbm) ... ok
test_anydbm_creation (test.test_dbm.TestCase-dbm.ndbm) ... ERROR
BDB3028 @test_8169_tmp.db: unable to flush: No such file or directory
test_anydbm_creation_n_file_exists_with_invalid_contents 
(test.test_dbm.TestCase-dbm.ndbm) ... ok
test_anydbm_keys (test.test_dbm.TestCase-dbm.ndbm) ... ok
test_anydbm_modification (test.test_dbm.TestCase-dbm.ndbm) ... ERROR
BDB3028 @test_8169_tmp.db: unable to flush: No such file or directory
test_anydbm_not_existing (test.test_dbm.TestCase-dbm.ndbm) ... ok
test_anydbm_read (test.test_dbm.TestCase-dbm.ndbm) ... ERROR
test_error (test.test_dbm.TestCase-dbm.ndbm) ... ok
test_anydbm_access (test.test_dbm.TestCase-dbm.dumb) ... ok
test_anydbm_creation (test.test_dbm.TestCase-dbm.dumb) ... ok
test_anydbm_creation_n_file_exists_with_invalid_contents 
(test.test_dbm.TestCase-dbm.dumb) ... ok
test_anydbm_keys (test.test_dbm.TestCase-dbm.dumb) ... ok
test_anydbm_modification (test.test_dbm.TestCase-dbm.dumb) ... ok
test_anydbm_not_existing (test.test_dbm.TestCase-dbm.dumb) ... ok
test_anydbm_read (test.test_dbm.TestCase-dbm.dumb) ... ok
test_error (test.test_dbm.TestCase-dbm.dumb) ... ok

==
ERROR: test_anydbm_creation (test.test_dbm.TestCase-dbm.ndbm)
--
Traceback (most recent call last):
  File "/usr/lib/python3.5/test/test_dbm.py", line 74, in test_anydbm_creation
self.read_helper(f)
  File "/usr/lib/python3.5/test/test_dbm.py", line 115, in read_helper
self.assertEqual(self._dict[key], f[key.encode("ascii")])
KeyError: b'0'

==
ERROR: test_anydbm_modification (test.test_dbm.TestCase-dbm.ndbm)
--
Traceback (most recent call last):
  File "/usr/lib/python3.5/test/test_dbm.py", line 89, in 
test_anydbm_modification
self.read_helper(f)
  File "/usr/lib/python3.5/test/test_dbm.py", line 115, in read_helper
self.assertEqual(self._dict[key], f[key.encode("ascii")])
KeyError: b'0'

==
ERROR: test_anydbm_read (test.test_dbm.TestCase-dbm.ndbm)
--
Traceback (most recent call last):
  File "/usr/lib/python3.5/test/test_dbm.py", line 95, in test_anydbm_read
self.read_helper(f)
  File "/usr/lib/python3.5/test/test_dbm.py", line 115, in read_helper
self.assertEqual(self._dict[key], f[key.encode("ascii")])
KeyError: b'0'

--
Ran 27 tests in 0.093s

FAILED (errors=3)
test test_dbm failed
1 test failed:
test_dbm
```

Under 3.6 (built from source), it seems to fail 100% of the time

```
$ ./python -m test test_dbm -v
== CPython 3.6.0 (default, Jan 9 2017, 15:00:38) [GCC 5.4.0 20160609]
==   Linux-4.4.0-57-generic-x86_64-with-debian-stretch-sid little-endian
==   hash algorithm: siphash24 64bit
==  cwd: /home/asottile/workspace/cpython/build/test_python_8246
==  encodings: locale=UTF-8, FS=utf-8
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
Run tests sequentially
0:00:00 [1/1] test_dbm
test_keys (test.test_dbm.WhichDBTestCase) ... ok
test_whichdb (test.test_dbm.WhichDBTestCase) ... ok
test_whichdb_ndbm (test.test_dbm.WhichDBTestCase) ... BDB0004 

[issue29218] distutils: Remove unused install_misc class

2017-01-09 Thread Eric N. Vander Weele

New submission from Eric N. Vander Weele:

This class hasn't been used for quite some time.  Seems safe to remove.

--
components: Build, Distutils
files: distutils-remove-install_misc-1.patch
keywords: patch
messages: 285080
nosy: dstufft, eric.araujo, ericvw, gward
priority: normal
severity: normal
status: open
title: distutils: Remove unused install_misc class
type: enhancement
versions: Python 3.7
Added file: 
http://bugs.python.org/file46235/distutils-remove-install_misc-1.patch

___
Python tracker 

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



[issue29217] Documentation for uuid has wrong description for variant

2017-01-09 Thread David Muller

New submission from David Muller:

The documentation's description for uuid.variant says that its value is one of 
several integer constants, but those constants are actually strings.

--
assignee: docs@python
components: Documentation
messages: 285079
nosy: TigerhawkT3, docs@python
priority: normal
severity: normal
status: open
title: Documentation for uuid has wrong description for variant
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, 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



[issue29145] failing overflow checks in replace_*

2017-01-09 Thread Martin Panter

Martin Panter added the comment:

Both fixes (join and replace) look good to me. However I don’t think it is 
necessary to change the exception message in 3.5 or 3.6.

--

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг

Марк Коренберг added the comment:

Such construction is not so easy. Especially for beginners. Not everyone even 
uses context managers to work with files. They will try to use os.chmod(). More 
clever will use os.fchmod(fileobj.fileno()). And in rare case someone asks 
about race condition between threads. So, not implementing that is error prone, 
and also forces users to make hidden bugs.

Why not to follow the principle of Least Surprise ?

In you way, we did not have to implement a lot of things, that we have now. 
Like tempfile, shutil and so on. They may be implemented using complex 
combination of simplier items. Answer: these things make Python easy, secure 
and (insert good words here by yourself).

Why are you afraid to add one very simple thing ?

Next, what if I want to use, say, 'r+b', in that case I should remember 
combination of O_X constants like O_TRUNC|O_CREAT|O_APPEND and so on.. It's 
great that Python allows such things! really great! but how many people want to 
write that in their code?

(Sorry for long text, but I really can not understand)

--

___
Python tracker 

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



[issue29057] Compiler failure on Mac OS X - sys/random.h

2017-01-09 Thread Ned Deily

Ned Deily added the comment:

George, did you do totally clean builds, including rerunning ./configure?  If 
so, what ./configure and make commands did you use?  Using the current hg repo, 
I don't see the failures you are seeing.

--

___
Python tracker 

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



[issue29162] pyshell.py: name 'sys' is not defined

2017-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree that incidental names should be eliminated from import. Could you open 
a new issue for this?

--

___
Python tracker 

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



[issue28909] Adding LTTng-UST tracing support

2017-01-09 Thread Francis Deslauriers

Francis Deslauriers added the comment:

Thanks Łukasz,
I will add tests following the example of the DTrace tests and update the 
Doc/howto/instrumentation.rst file to include this new information.

LTTng can be used  on all major Linux distros (Ubuntu, Debian, Fedora, etc.) 
either from distribution packages or compiled from source. It runs on kernels 
that came out after 2.6.27.

You are right, I should have explained why I changed the provider name. I 
changed it be as specific as possible to avoid potential name clash with other 
Python interpreters.
I will send an updated patch that keeps the old name given that it was already 
released.

--

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

open(..., opener=partial(os.open, mode=0o644))

Not every combination of functions deserves a new parameter of a builtin.

--

___
Python tracker 

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



[issue29057] Compiler failure on Mac OS X - sys/random.h

2017-01-09 Thread George King

George King added the comment:

(I meant the github mirror: github.com/python/cpython)

--

___
Python tracker 

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



[issue29057] Compiler failure on Mac OS X - sys/random.h

2017-01-09 Thread George King

George King added the comment:

I am encountering this problem on macOS 10.12.2, with Xcode 8.2.1 (latest).

I have tried building from the following cpython branches today (using the 
github fork):

2.7: 13a39142c047
In file included from ../../Python/random.c:7:
/usr/include/sys/random.h:37:32: error: unknown type name 'u_int'
void read_random(void* buffer, u_int numBytes);


3.5: 35334a4d41aa
3.6: 6bf563472ccd
Both 3.x branches report a different error:

../../Python/pytime.c:567:11: warning: implicit declaration of function 
'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration]
err = clock_gettime(CLOCK_REALTIME, );
  ^
../../Python/pytime.c:567:25: error: use of undeclared identifier 
'CLOCK_REALTIME'
err = clock_gettime(CLOCK_REALTIME, );
^
../../Python/pytime.c:581:13: warning: implicit declaration of function 
'clock_getres' is invalid in C99 [-Wimplicit-function-declaration]
if (clock_getres(CLOCK_REALTIME, ) == 0)
^
../../Python/pytime.c:581:26: error: use of undeclared identifier 
'CLOCK_REALTIME'
if (clock_getres(CLOCK_REALTIME, ) == 0)
 ^

--
nosy: +George.King

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг

Марк Коренберг added the comment:

so, io.open() should just pass that value down to implementation. 
implementation should use this value instead of hard-coded 0o666.

--

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг

Марк Коренберг added the comment:

I expect this:

open(, perms=0o644)

Why not?

--

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Brett Cannon

Brett Cannon added the comment:

I agree with Serhiy that I don't think this is necessary for io.open() when 
os.open() supports this. But this really can't be discussed further until 
someone provides a clear design proposal on how to make this work with 
io.open().

--
nosy: +brett.cannon
type: behavior -> enhancement
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue29184] skip tests of test_socketserver when bind() raises PermissionError (non-root user on Android)

2017-01-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

New patch following Serhiy's suggestion in msg285008.

--
Added file: http://bugs.python.org/file46234/issue29184_01.patch

___
Python tracker 

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



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

2017-01-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

New patch following Serhiy's suggestion in msg285008.

--
Added file: http://bugs.python.org/file46233/issue29181_01.patch

___
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-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

New patch following Serhiy's suggestion in msg285008.

--
Added file: http://bugs.python.org/file46232/issue29180_01.patch

___
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-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

New patch following Serhiy's suggestion in msg285008.

--
Added file: http://bugs.python.org/file46231/issue28759-01.patch

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг

Марк Коренберг added the comment:

Permissions -- are very important thing. As I think, such high-level functions 
should not hide that important functionality from end-users.

Also, it is not difficult to make a patch (as I think).

--

___
Python tracker 

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



[issue28414] SSL match_hostname fails for internationalized domain names

2017-01-09 Thread Socob

Changes by Socob <206a8...@opayq.com>:


--
nosy: +Socob

___
Python tracker 

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



[issue28969] lru_cache is not threadsafe

2017-01-09 Thread INADA Naoki

INADA Naoki added the comment:

LGTM

--
nosy: +inada.naoki

___
Python tracker 

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



[issue17305] IDNA2008 encoding missing

2017-01-09 Thread Socob

Changes by Socob <206a8...@opayq.com>:


--
nosy: +Socob

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

io.open() is high-level function. It handles buffering, encoding, newline 
translating. It is even higher-level than C's fopen().

Syscall open() is low-level. Python os.open() is an interface to this low-level 
feature.

There is a connection between low and high level -- io.open() accepts a file 
descriptor returned by os.open(). You also can provide the opener argument.

I don't think io.open() needs the support of mode and dir_fd arguments and all 
possible O_* flags. They are low-level features.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm not sure that the result of pyobjectl_callfunctionobjargs_stacksize() has 
direct relation to stack consumption in test_python_call, test_python_getitem 
and test_python_iterator. Try to measure the stack consumption in these cases. 
This can be done with _testcapi helper that just returns the value of stack 
pointer. Run all three tests with fixed level of recursion and measure the 
difference between stack pointers.

Would be nice also measure a performance effect of the patches.

--

___
Python tracker 

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



[issue29154] 5 failures in test_doctest: ModuleNotFoundError: No module named 'IPython'

2017-01-09 Thread Eric Snow

Eric Snow added the comment:

There shouldn't be anything in CPython that depends on IPython.  I'd recommend 
checking for $PYTHONSTARTUP, in site.py, and for .pth files in directories on 
sys.path.  Also look for .py files in the current directory that are shadowing 
stdlib modules.  Any of these could introduce the attempt to import IPython.  
Also, do you get the same error if you directly run the doctest-failing code?

--
nosy: +eric.snow

___
Python tracker 

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



[issue29216] Space saving step for the LRU cache

2017-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, there is a wart in the optimization in Python implementation. If call a 
cached function with multiple integer arguments and with equivalent float 
arguments, the second call will return a cached result. But if call with single 
integer and float arguments, both calls will be cached separately.

>>> import functools
>>> @functools.lru_cache()
... def f(*args):
... return args
... 
>>> f(1, None)
(1, None)
>>> f(1.0, None)
(1, None)
>>> f.cache_info()
CacheInfo(hits=1, misses=1, maxsize=128, currsize=1)
>>> f.cache_clear()
>>> f(1)
(1,)
>>> f(1.0)
(1.0,)
>>> f.cache_info()
CacheInfo(hits=0, misses=2, maxsize=128, currsize=2)

--

___
Python tracker 

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



[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-09 Thread STINNER Victor

STINNER Victor added the comment:

Impact of the _PY_FASTCALL_SMALL_STACK constant:

* _PY_FASTCALL_SMALL_STACK=1: 528 bytes/call

test_python_call 7376
test_python_getitem 6544
test_python_iterator 5572
=> total: 19 492

* _PY_FASTCALL_SMALL_STACK=3: 528 bytes/call

test_python_call 7272
test_python_getitem 6464
test_python_iterator 5512
=> total: 19 248

* _PY_FASTCALL_SMALL_STACK=5 (current value): 560 bytes/call

test_python_call 7172
test_python_getitem 6232
test_python_iterator 5344
=> total: 19 636

* _PY_FASTCALL_SMALL_STACK=10: 592 bytes/call

test_python_call 6984
test_python_getitem 5952
test_python_iterator 5132
=> total: 18 068

Increasing _PY_FASTCALL_SMALL_STACK has a clear effect on the total. Total 
decreases when _PY_FASTCALL_SMALL_STACK increases.


---

no_small_stack.patch with _PY_FASTCALL_SMALL_STACK=3: 368 bytes/call

test_python_call 7272
test_python_getitem 6628
test_python_iterator 5632
=> total: 19 532

--

___
Python tracker 

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



[issue29216] Space saving step for the LRU cache

2017-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The first patch fails with e.g. tuple subclasses.

The optimization is correct only for types not comparable with tuples. Tuple 
subclasses are comparable, and classes with custom __eq__ can be comparable. 
Thus the optimization should be used only for exact builtin types that are 
known not comparable with tuples. Of course it makes sense only for hashable 
types.

First than commit something like the second patch I would gather statistics. 
What are the most used types of the single positional argument of lru-cached 
functions? Is it worth to apply the optimization for bytes or None? Checking 
type in C is cheaper than in Python, we can use more types.

--
assignee: serhiy.storchaka -> rhettinger

___
Python tracker 

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



[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-09 Thread STINNER Victor

STINNER Victor added the comment:

I modified Serhiy's stack_overflow.py of #28858:
* re-run each test 10 tests and show the maximum depth
* only test: ['test_python_call', 'test_python_getitem', 'test_python_iterator']

Maximum number of Python calls before a crash.

(*) Reference (unpatched): 560 bytes/call

test_python_call 7172
test_python_getitem 6232
test_python_iterator 5344
=> total: 18 838

(1) no_small_stack.patch: 368 bytes/call

test_python_call 7172 (=)
test_python_getitem 6544 (+312)
test_python_iterator 5572 (+228)
=> total: 19 288

(2) less_stack.patch: 384 bytes/call

test_python_call 7272 (+100)
test_python_getitem 6384 (+152)
test_python_iterator 5456 (+112)
=> total: 19 112

(3) subfunc.patch: 496 bytes

test_python_call 7272 (+100)
test_python_getitem 6712 (+480)
test_python_iterator 6020 (+678)
=> total: 20 004

(4) alloca.patch: 528 bytes/call

test_python_call 7272 (+100)
test_python_getitem 6464 (+232)
test_python_iterator 5752 (+408)
=> total: 19 488

Patched sorted by bytes/call, from best to worst: no_small_stack.patch (368) > 
less_stack.patch (384) > subfunc.patch (496) > alloca.patch (528) > reference 
(560).

Patched sorted by number of calls before crash: subfunc.patch (20 004) > 
alloca.patch (19 488) > no_small_stack.patch (19 288) > less_stack.patch (19 
112) > reference (18 838).

I expected a correlation between the measure bytes/call measured by 
testcapi_stacksize.patch and the number of calls before a crash, but I fail to 
see an obvious correlation :-/

Maybe the compiler is smarter than what I would expect and emits efficient code 
to be able to use less stack memory?

Maybe the Linux kernel does weird things which makes the behaviour on 
stack-overflow non-obvious :-)

At least, I would expect that no_small_stack.patch would be the clear winner, 
since it has the smallest usage of C stack.

--
Added file: http://bugs.python.org/file46230/stack_overflow_28870.py

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг

Марк Коренберг added the comment:

1. Yes, I'm reporting problem about standard open(), not os.open().
2. Yes, I know about umask. But unfortunatelly, umask affects whole process, 
including all threads, so it is not possible to force specific permissions 
without of race conditions with other threds.
3. Calling C's `open()` with `0666` MUST be documented (with mentioning of 
umask, which also affects these bits). This is `MUST` because `man 2 open` says 
that there is no default for `mode` argument, and it must be specified when 
O_CREAT / O_TMPFILE is specified.

--

___
Python tracker 

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



[issue29177] skip tests of test_logging when bind() raises PermissionError (non-root user on Android)

2017-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6bf563472ccd by Vinay Sajip in branch '3.6':
Fixes #29177: Improved resilience of logging tests which use socket servers.
https://hg.python.org/cpython/rev/6bf563472ccd

New changeset 3f324d5df0c0 by Vinay Sajip in branch 'default':
Closes #29177: Merged fix from 3.6.
https://hg.python.org/cpython/rev/3f324d5df0c0

--
nosy: +python-dev
resolution:  -> fixed
stage: patch 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



[issue29133] Minor inaccuracy in shlex.shlex punctuation_chars example

2017-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset af5b34b2d169 by Vinay Sajip in branch '3.6':
Fixes #29133: clarified shlex documentation.
https://hg.python.org/cpython/rev/af5b34b2d169

New changeset e3d820c0c884 by Vinay Sajip in branch 'default':
Closes #29133: merged update from 3.6.
https://hg.python.org/cpython/rev/e3d820c0c884

--
nosy: +python-dev
resolution:  -> fixed
stage: patch 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



[issue29216] Space saving step for the LRU cache

2017-01-09 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Sync with the space savings optimization in the pure Python code.

I'm unsure whether the best way is to check for an exact tuple or whether to 
just check an exact int/str.

--
assignee: serhiy.storchaka
components: Library (Lib)
files: functools_sync.diff
keywords: patch
messages: 285051
nosy: rhettinger, serhiy.storchaka
priority: low
severity: normal
stage: patch review
status: open
title: Space saving step for the LRU cache
type: resource usage
versions: Python 3.7
Added file: http://bugs.python.org/file46228/functools_sync.diff

___
Python tracker 

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



[issue29216] Space saving step for the LRU cache

2017-01-09 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file46229/functools_sync2.diff

___
Python tracker 

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



[issue29215] pyport.h uses non C90-style comment

2017-01-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue29215] pyport.h uses non C90-style comment

2017-01-09 Thread Xiang Zhang

Xiang Zhang added the comment:

I found that conflict once but lost it then. :-(

> Or should I just assume that all headers are henceforth C99 and any wrapping 
> code should also be C99?

I am not sure. :-( Nosy other experts. :-)

--
nosy: +haypo, serhiy.storchaka

___
Python tracker 

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



[issue29215] pyport.h uses non C90-style comment

2017-01-09 Thread Sander Vrijders

Sander Vrijders added the comment:

Okay, a bit conflicted about the following though. The changelog refers to 
PEP7. This document indeed states that Python versions greater than or equal to 
3.6 use C89 with several select C99 features, such as C++-style line comments. 
But then below that it has a rule that says never use C++ style // one-line 
comments. That seems contradictory.

FYI, I mean not complaining about stdint.h, gcc (and clang) also support those 
with the C90 switch turned on. 

Or should I just assume that all headers are henceforth C99 and any wrapping 
code should also be C99? Though it seems a bit overkill to kill all 
compatibility for a single comment line. If I use a C89 comment on my system 
the build works perfectly.

--

___
Python tracker 

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



[issue29215] pyport.h uses non C90-style comment

2017-01-09 Thread Xiang Zhang

Xiang Zhang added the comment:

That's a change in 3.6, see 
https://docs.python.org/3/whatsnew/3.6.html#build-and-c-api-changes.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Christian Heimes

Christian Heimes added the comment:

I would be nice to have a public API to set permissions of files for io.open(), 
too.

Note to your note: the actual permission is influenced by the process' global 
umask. If you are concerned about security, you should set the umask to 0o077 
early.

--

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread STINNER Victor

STINNER Victor added the comment:

You can actually specify permission:

fd = os.open("document.txt", os.O_WRONLY | os.O_CREAT, 0o777)
fp = open(fd, "wb")
with fp:
   ...

You can also use the dir_fd parameter for even better security ;-)

Is your request for the standard open() function, rather than os.open()?

Note: io.FileIO(), the underlying object when calling the Python open(), calls 
the C open() function with 0o666 for the permission mode.

--
nosy: +haypo

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue29215] pyport.h uses non C90-style comment

2017-01-09 Thread Sander Vrijders

New submission from Sander Vrijders:

I am writing C90 compliant code and am wrapping my C headers with SWIG, which 
includes python3.6m/pyport.h. I've told my compiler to report all warnings as 
errors. Compilation fails with the following error:

```
/usr/include/python3.6m/pyport.h:40:1: error: C++ style comments are not 
allowed in ISO C90
 // long long is required. Ensure HAVE_LONG_LONG is defined for compatibility.
```

I believe the comment was added by the patch of a previous bug (see 
https://hg.python.org/cpython/rev/4745d801cae2). The solution would be to 
change this comment to a C90 comment.

--
messages: 285045
nosy: Sander Vrijders
priority: normal
severity: normal
status: open
title: pyport.h uses non C90-style comment
type: compile error
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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг

Changes by Марк Коренберг :


--
versions: +Python 3.7

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг

Changes by Марк Коренберг :


--
type:  -> behavior

___
Python tracker 

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



[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг

New submission from Марк Коренберг:

1. Syscall open() allows that.
2. This is important to prevent race-conditions between creating a file with 
default permissions and calling fchmod().

--
components: Library (Lib)
messages: 285044
nosy: mmarkk
priority: normal
severity: normal
status: open
title: Standard open() does not allow to specify file permissions.
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-01-09 Thread Josh Wilson

New submission from Josh Wilson:

The activate.bat file generated by python -m venv somevirtualenv seems to have 
a mix of line ending styles.  Sometimes using Carriage Return (CR) and Line 
Feed (LF) and other times using only CR.

This seems to cause unexpected behavior when trying to modify the file to set 
additional environment variables.  Since this is a Windows-specific file it 
seems like it should use Windows-style line endings of CRLF

Deactivate.bat has the same issue.

--
components: Windows
messages: 285043
nosy: Josh Wilson, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: python -m venv activate.bat has weird mix of line endings
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



[issue27931] Email parse IndexError <""@wiarcom.com>

2017-01-09 Thread Константин Волков

Константин Волков added the comment:

ping

--

___
Python tracker 

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



[issue29070] Integration tests for pty.spawn on Linux and all other platforms

2017-01-09 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy:  -haypo

___
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-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> re-open issue 28764.

Oops, no issue 28764 is not relevant here.

--

___
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-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Thanks for this interesting suggestion Serhiy. I propose to use 
supported_operation() as the name of the helper() generator.

I will update the patches accordingly in issues #29180, #29181 and #29184, and 
re-open issue 28764.

--

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2017-01-09 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

After Erik posted PEP 539 draft, we've discussed features of new API on the 
Python-ideas [*]. As the result of discussion, features of new API have been 
changed below points. Thus, I updated patch based on the result.

1. API uses opaque type because to cover the key details.
2. The key has the state that is whether initialized, and a function is added 
to check the state.
3. When key creation and deletion, API silently skips function in unnecessary 
case (i.e. valid key never be overwritten).
4. The test is added to check the key state that after calling API.

[*] https://mail.python.org/pipermail/python-ideas/2016-December/043983.html

--
Added file: http://bugs.python.org/file46227/pythread-tss-2.patch

___
Python tracker 

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



[issue29070] Integration tests for pty.spawn on Linux and all other platforms

2017-01-09 Thread Cornelius Diekmann

Cornelius Diekmann added the comment:

Dear Martin, now I understand your intention. I merged my test suite with 
Chris's fix and documented our insights. SmallPtyTests contains regression 
tests for this issue.

While testing, I found a subtle change in behavior introduced by Chris's patch: 
It is no longer possible to get a broken pipe easily. I made a small adjustment 
to preserve this existing behavior:  In the _copy loop, I changed the order in 
which master_fd and STDIN_FILENO are copied to preserve the BrokenPipeError.


I tuned the slow tests, the complete test suite now needs less than 1 second on 
my system. I updated the documentation to note that the module is no longer 
supposed to be Linux-only.


> I realized that PtyWhiteBoxIntegrationTermiosTest is a reasonable test for 
> the termios module, so it is beneficial. Though it may have been simpler to 
> write it using pty.openpty(), avoiding an extra thread that just copies data 
> between other threads.

I agree completely. However, pty.openpty() does not depend on the _copy() loop 
which is modified by Chris's patch. To add higher test coverage for the changes 
we introduce by merging Chris's fix, I decided to stick to pty.spawn().


I tested on Linux 4.4, Linux 3.13, FreeBSD 11, MacOS 10.11.6 and all tests are 
green. If anything goes wrong on the testbot army, here is the fallback 
strategy:
[I don't expect anything to go wrong, but I'm rather prepared than sorry]
If the test_pty does not finish within one minute on a system, please kill it. 
It would be nice to know on which platform it failed, so we can whitelist the 
module in the tests and the documentation for only the supported platforms.

--
Added file: http://bugs.python.org/file46226/pty.patch

___
Python tracker 

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



[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2017-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 35334a4d41aa by Stefan Krah in branch '3.5':
Issue #28701: Revert part of 5bdc8e1a50c8 for the following reasons:
https://hg.python.org/cpython/rev/35334a4d41aa

--

___
Python tracker 

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



[issue29133] Minor inaccuracy in shlex.shlex punctuation_chars example

2017-01-09 Thread Marco Buttu

Marco Buttu added the comment:

Here is a 3rd patch with the Berker's suggestion. I just limited the output to 
79 characters per line, and made use of the +NORMALIZE_WHITESPACE option  (to 
normalize the newline inside the output).

--
Added file: http://bugs.python.org/file46225/issue29133_3rd.patch

___
Python tracker 

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



[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-09 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue29157] random.c: Prefer getrandom() over getentropy() to support glibc 2.24 on Linux

2017-01-09 Thread STINNER Victor

STINNER Victor added the comment:

> It seems like Python 3.5 is close to a release, I prefer to wait after the 
> release to fix this issue. (...) @Larry: Do you want this change in Python 
> 3.5.3? The change is quite large.

Ah, I was wrong: 3.5 was already open for the next 3.5.4 release, so I pushed 
my change. Again, I don't think that supporting the glibc 2.24 in Python 3.5 is 
a bug important enough to post-pone a release.

--

___
Python tracker 

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



[issue29188] Backport random.c from Python 3.5 to Python 2.7

2017-01-09 Thread STINNER Victor

STINNER Victor added the comment:

> This is VERY far from our historical policy for backports.  Python 2.7 is 
> supposed to be getting more stable over time (that is one of its chief 
> virtues).  We don't want to risk the kind of mini-catastrophe that got 
> published in 3.6 (issue29085).

I don't consider that the issue #29085 is a catastrophe and it's just a bug 
which was already fixed.

Moreover, Python 2.7 and 3.5 don't have _PyOS_URandomNonblock() function and so 
the _random module is not impacted by this issue.


> If you want to push for this, there needs to be a thorough discussion on 
> python-dev (there are tons of possible backports that could be made if the 
> rationale was "I would prefer to use the same code on all maintained 
> versions").

Sorry, I suffered from the previous discussion about random numbers. I don't 
want to reopen a new discussion, people would become crazy again.

I just fixed Python/random.c in support glibc 2.24 that's all.

If someone wants the cool getrandom() function/syscall on Python 2.7, please 
open a new issue. It doesn't really enhance the security, it's just a matter of 
avoid a file descriptor.

--
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



[issue29188] Backport random.c from Python 3.5 to Python 2.7

2017-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 13a39142c047 by Victor Stinner in branch '2.7':
Don't use getentropy() on Linux
https://hg.python.org/cpython/rev/13a39142c047

--
nosy: +python-dev

___
Python tracker 

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



[issue29157] random.c: Prefer getrandom() over getentropy() to support glibc 2.24 on Linux

2017-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8125d9a8152b by Victor Stinner in branch '3.5':
Issue #29157: Prefer getrandom() over getentropy()
https://hg.python.org/cpython/rev/8125d9a8152b

--

___
Python tracker 

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



[issue29085] Python 3.6 on Windows doesn't seed Random() well enough

2017-01-09 Thread STINNER Victor

STINNER Victor added the comment:

Oh, sorry, I introduced the bug in Python 3.6 with the PEP 524 (os.urandom() 
now blocks on Linux). Too bad that there is no simple way to write an unit test 
for that.

> ... but only on Windows on Python 3.6

With the bug, or when the fix when _PyOS_URandomNonblock() fails, Random.seed() 
uses:

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

It's just that on Windows, the system clock has a resolution around 15 ms, 
whereas it has a resolution better than 1 us on Linux. So it's just that 
calling Random.seed() usually takes longer than the resolution of the system 
clock on Linux :-) Not really that the bug is specific to Windows.

Thanks for the fix Benjamin!

--
nosy: +haypo

___
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-09 Thread STINNER Victor

STINNER Victor added the comment:

+1 to remove platform.linux_distribution().

Linux distributions are moving much faster than the Python stdlib, so using the 
distro module which is hosted on PyPI is much simpler. In 2017, it became very 
easy to have dependencies, pip became the de factor standard.

--

___
Python tracker 

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



[issue29190] Avoid possible errors in comparing strings

2017-01-09 Thread Stefan Krah

Stefan Krah added the comment:

On Mon, Jan 09, 2017 at 08:21:17AM +, Serhiy Storchaka wrote:
> In the particular case of getround() in _decimal.c, seems the worst case is 
> raising TypeError instead of MemoryError in pretty rare circumstances. This 
> is not critically bad, there are a lot of other places where the initial 
> exception is silently replaced by less specific exception. But the code 
> *looks* fragile.

No, it does not.  It is obvious to a human that -1 <==> "not equal".

If Coccinelle does not understand that, well ...

--

___
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-09 Thread desbma

Changes by desbma :


--
components: +Library (Lib)
versions: +Python 3.7

___
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-09 Thread desbma

desbma added the comment:

Here is a patch that restores the previous behavior and update test to catch 
bogus naming.

--
keywords: +patch
Added file: http://bugs.python.org/file46224/issue29212_1.patch

___
Python tracker 

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



[issue29190] Avoid possible errors in comparing strings

2017-01-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In the particular case of getround() in _decimal.c, seems the worst case is 
raising TypeError instead of MemoryError in pretty rare circumstances. This is 
not critically bad, there are a lot of other places where the initial exception 
is silently replaced by less specific exception. But the code *looks* fragile.

--
resolution:  -> fixed
stage: patch 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



[issue29190] Avoid possible errors in comparing strings

2017-01-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 337461574c90 by Serhiy Storchaka in branch '3.5':
Issue #29190: Fixed possible errors in comparing strings in the pickle module.
https://hg.python.org/cpython/rev/337461574c90

New changeset 9fcff936f61f by Serhiy Storchaka in branch '3.6':
Issue #29190: Fixed possible errors in comparing strings in the pickle module.
https://hg.python.org/cpython/rev/9fcff936f61f

New changeset f477c715076c by Serhiy Storchaka in branch 'default':
Issue #29190: Fixed possible errors in comparing strings in the pickle module.
https://hg.python.org/cpython/rev/f477c715076c

--
nosy: +python-dev

___
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-09 Thread desbma

desbma added the comment:

The bug seem to have been introduced by 
https://hg.python.org/cpython/rev/1002a1bdc5b1

--

___
Python tracker 

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