[issue29469] AST-level Constant folding

2017-12-15 Thread INADA Naoki

Change by INADA Naoki :


--
pull_requests: +4773

___
Python tracker 

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



[issue29469] AST-level Constant folding

2017-12-15 Thread INADA Naoki

INADA Naoki  added the comment:

> ISTM, the constant-tracking macros for peephole.c can also be removed, 
> essentially reverting back to the simpler cumlc-style code in Py2.5.

I tried it in GH-4879.

--

___
Python tracker 

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



[issue32331] apply SOCK_TYPE_MASK to socket.type on Linux

2017-12-15 Thread INADA Naoki

INADA Naoki  added the comment:

Should we backport it to 3.6?

--

___
Python tracker 

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



[issue27169] __debug__ is not optimized out at compile time for anything but `if:` and `while:` blocks

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4774
stage: needs patch -> patch review

___
Python tracker 

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



[issue22091] __debug__ in compile(optimize=1)

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4775
stage:  -> patch review

___
Python tracker 

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



[issue32331] apply SOCK_TYPE_MASK to socket.type on Linux

2017-12-15 Thread INADA Naoki

INADA Naoki  added the comment:

Document of socket.type says:

  The socket type.

  https://docs.python.org/3/library/socket.html#socket.socket.type

OK, so, are SOCK_CLOEXEC and SOCK_NONBLOCK socket type?

  These two constants, if defined, can be combined with the socket types and 
allow you to set some flags atomically...

   https://docs.python.org/3/library/socket.html#socket.SOCK_CLOEXEC

So they are not socket type.  They are constants which can be used for
setting some flags.

Regarding to this document, I think this can be bugfix rather than
behavior change.

--

___
Python tracker 

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



[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-15 Thread Stefan Behnel

Stefan Behnel  added the comment:

Seems ok from Cython side. Could be a bit difficult to make an actual use of 
this, but at least it shouldn't break anything. And it's a reasonable 
constraint to enforce.

--

___
Python tracker 

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



[issue27938] PyUnicode_AsEncodedString, PyUnicode_Decode: add fast-path for "us-ascii" encoding

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 297fd876aad8ef443d8992618de22c46dbda258b by Victor Stinner (Ville 
Skyttä) in branch 'master':
bpo-28393: Update encoding lookup docs wrt bpo-27938 (#4871)
https://github.com/python/cpython/commit/297fd876aad8ef443d8992618de22c46dbda258b


--

___
Python tracker 

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



[issue32311] Implement asyncio.create_task() shortcut

2017-12-15 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Thanks for careful review!

--

___
Python tracker 

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



[issue28393] Update encoding lookup docs wrt #27938

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 297fd876aad8ef443d8992618de22c46dbda258b by Victor Stinner (Ville 
Skyttä) in branch 'master':
bpo-28393: Update encoding lookup docs wrt bpo-27938 (#4871)
https://github.com/python/cpython/commit/297fd876aad8ef443d8992618de22c46dbda258b


--

___
Python tracker 

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



[issue32331] apply SOCK_TYPE_MASK to socket.type on Linux

2017-12-15 Thread Christian Heimes

Christian Heimes  added the comment:

Python's handling of socket has multiple issues, see #28134 for more fun. At 
the moment the values of type, family and protocol are unreliable at best and 
dangerously wrong at worst. The attributes are only correct if and only if the 
socket has not been created from a file descriptor and the socket hasn't been 
manipulated with ioctl or setsockopt().

Now to the issue at hand. I'm -1 on applying a mask to type. You can easily 
work around your problem by replacing "sock.type == SOCK_STREAM" with 
"sock.type & SOCK_STREAM == SOCK_STREAM".

--
nosy: +christian.heimes

___
Python tracker 

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



[issue27938] PyUnicode_AsEncodedString, PyUnicode_Decode: add fast-path for "us-ascii" encoding

2017-12-15 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4777

___
Python tracker 

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



[issue28393] Update encoding lookup docs wrt #27938

2017-12-15 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4776

___
Python tracker 

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



[issue22091] __debug__ in compile(optimize=1)

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 3325a6780c81f1ea51190370b5454879c4862a37 by Serhiy Storchaka in 
branch 'master':
bpo-27169: The __debug__ constant is now optimized out at compile time. (#4880)
https://github.com/python/cpython/commit/3325a6780c81f1ea51190370b5454879c4862a37


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27169] __debug__ is not optimized out at compile time for anything but `if:` and `while:` blocks

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 3325a6780c81f1ea51190370b5454879c4862a37 by Serhiy Storchaka in 
branch 'master':
bpo-27169: The __debug__ constant is now optimized out at compile time. (#4880)
https://github.com/python/cpython/commit/3325a6780c81f1ea51190370b5454879c4862a37


--

___
Python tracker 

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



[issue22091] __debug__ in compile(optimize=1)

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is it worth to backport this change?

--

___
Python tracker 

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



[issue22091] __debug__ in compile(optimize=1)

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

> Is it worth to backport this change?

It's an optimization, usually the answer is no.

The change is short and can be seen as a bugfix, so it's up to you, it's ok to 
backport to 3.6, and maybe even 2.7, if it's not too hard to write the backport.

--
nosy: +vstinner

___
Python tracker 

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



[issue27169] __debug__ is not optimized out at compile time for anything but `if:` and `while:` blocks

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4778

___
Python tracker 

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



[issue22091] __debug__ in compile(optimize=1)

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4779

___
Python tracker 

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



[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset a5552f023e1d8cbafee1e51d316cc581deb2295f by Serhiy Storchaka in 
branch 'master':
bpo-32240: Add the const qualifier to declarations of PyObject* array 
arguments. (#4746)
https://github.com/python/cpython/commit/a5552f023e1d8cbafee1e51d316cc581deb2295f


--

___
Python tracker 

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



[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue22091] __debug__ in compile(optimize=1)

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset b82da9ebb20053637e731fd40589e1e52f9f8f6e by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-27169: The __debug__ constant is now optimized out at compile time. 
(GH-4880) (#4882)
https://github.com/python/cpython/commit/b82da9ebb20053637e731fd40589e1e52f9f8f6e


--

___
Python tracker 

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



[issue27169] __debug__ is not optimized out at compile time for anything but `if:` and `while:` blocks

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset b82da9ebb20053637e731fd40589e1e52f9f8f6e by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-27169: The __debug__ constant is now optimized out at compile time. 
(GH-4880) (#4882)
https://github.com/python/cpython/commit/b82da9ebb20053637e731fd40589e1e52f9f8f6e


--

___
Python tracker 

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



[issue27169] __debug__ is not optimized out at compile time for anything but `if:` and `while:` blocks

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
dependencies:  -Build-out an AST optimizer, moving some functionality out of 
the peephole optimizer
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue22091] __debug__ in compile(optimize=1)

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The backport to 3.6 is straightforward, but backporting to 2.7 would require 
larger changes.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior
versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue32222] pygettext doesn't extract docstrings for functions with type annotated params

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue21074] Too aggressive constant folding

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 2e3f5701858d1fc04caedefdd9a8ea43810270d2 by Serhiy Storchaka in 
branch 'master':
bpo-30416: Protect the optimizer during constant folding. (#4860)
https://github.com/python/cpython/commit/2e3f5701858d1fc04caedefdd9a8ea43810270d2


--

___
Python tracker 

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



[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 2e3f5701858d1fc04caedefdd9a8ea43810270d2 by Serhiy Storchaka in 
branch 'master':
bpo-30416: Protect the optimizer during constant folding. (#4860)
https://github.com/python/cpython/commit/2e3f5701858d1fc04caedefdd9a8ea43810270d2


--

___
Python tracker 

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



[issue21074] Too aggressive constant folding

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset b580f4f2bf49fd3b11f2a046911993560c02492a by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30416: Protect the optimizer during constant folding. (#4865)
https://github.com/python/cpython/commit/b580f4f2bf49fd3b11f2a046911993560c02492a


--

___
Python tracker 

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



[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset b580f4f2bf49fd3b11f2a046911993560c02492a by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30416: Protect the optimizer during constant folding. (#4865)
https://github.com/python/cpython/commit/b580f4f2bf49fd3b11f2a046911993560c02492a


--

___
Python tracker 

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



[issue32265] Correctly classify builtin static and class methods

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue32265] Correctly classify builtin static and class methods

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 3327a2ddf1eaf8cc678f0219ba9edf7d632d1b20 by Serhiy Storchaka in 
branch 'master':
bpo-32265: Classify class and static methods of builtin types. (#4776)
https://github.com/python/cpython/commit/3327a2ddf1eaf8cc678f0219ba9edf7d632d1b20


--

___
Python tracker 

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



[issue32324] [Security] "python3 directory" inserts "directory" at sys.path[0] even in isolated mode

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

> Since the directory is where the code that is being executed exists don't you 
> have to implicitly trust that directory is secure? Otherwise how can you even 
> trust the code you're choosing to execute?

The question is if the following example must work with -I:

---
vstinner@apu$ mkdir directory
vstinner@apu$ echo "import submodule" > directory/__main__.py
vstinner@apu$ echo 'print("submodule", __file__)' > directory/submodule.py

vstinner@apu$ python3 directory
submodule directory/submodule.py

vstinner@apu$ python3 -I directory
submodule directory/submodule.py
---

Do you expect that "python3 directory" allows imports from directory/?

The second question is if directory must be prepended to sys.path (start), or 
if it must be appended to sys.path (end)?

Prepend allows to override stdlib imports, whereas append risks of conflicts 
with others paths in sys.path and so loading the "wrong" submodule.

For example, I still expect to run __main__ from directory in the following 
example:

---
vstinner@apu$ mkdir other
vstinner@apu$ echo "print('other main')" > other/__main__.py
vstinner@apu$ PYTHONPATH=other python3 directory
submodule directory/submodule.py
---

--

___
Python tracker 

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



[issue27938] PyUnicode_AsEncodedString, PyUnicode_Decode: add fast-path for "us-ascii" encoding

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 77bf6da7258b4a312e224860ea50ac010aa17c1e by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-28393: Update encoding lookup docs wrt bpo-27938 (GH-4871) (#4881)
https://github.com/python/cpython/commit/77bf6da7258b4a312e224860ea50ac010aa17c1e


--

___
Python tracker 

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



[issue28393] Update encoding lookup docs wrt #27938

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 77bf6da7258b4a312e224860ea50ac010aa17c1e by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
bpo-28393: Update encoding lookup docs wrt bpo-27938 (GH-4871) (#4881)
https://github.com/python/cpython/commit/77bf6da7258b4a312e224860ea50ac010aa17c1e


--

___
Python tracker 

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



[issue28393] Update encoding lookup docs wrt #27938

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

Thank you Ville Skyttä for your contribution! I merged your PR and backported 
it to Python 3.6.

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



[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

Dummy question. If lchmod() is not supported by the libc, would it be possible 
to reimplement it using readlink()?

--

___
Python tracker 

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



[issue32330] Email parser creates a message object that can't be flattened

2017-12-15 Thread R. David Murray

R. David Murray  added the comment:

I do wonder where you are using the string version of messages :)

I actually thought I'd already done this (errors=replace), but obviously not.  
I don't have time now to work on a patch for this, and the patch in the other 
issue hasn't be updated to reflect the review I did :(

--

___
Python tracker 

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



[issue32333] test_smtplib: dangling threads on x86 Gentoo Non-Debug with X 3.x

2017-12-15 Thread STINNER Victor

New submission from STINNER Victor :

http://buildbot.python.org/all/#/builders/99/builds/363

0:00:16 load avg: 2.60 [ 12/412/1] test_smtplib failed (env changed)
testFailingHELO (test.test_smtplib.BadHELOServerTests) ... ok
(...)
testLineTooLong (test.test_smtplib.TooLongLineTests) ... ok

--
Ran 54 tests in 1.828s

OK (skipped=1)
Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 
3)
Dangling thread: <_MainThread(MainThread, started 3075602176)>
Dangling thread: 
Dangling thread: 

--
components: Tests
messages: 308396
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_smtplib: dangling threads on x86 Gentoo Non-Debug with X 3.x
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



[issue32332] Implement slots support for magic methods added in PEP 560

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 4883 shows how magic methods for PEP 560 can be implemented without 
introducing new slots.

--

___
Python tracker 

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



[issue32334] test_configparser left @test_2876_tmp temporary file on x86 Windows7 3.x

2017-12-15 Thread STINNER Victor

New submission from STINNER Victor :

http://buildbot.python.org/all/#/builders/58/builds/332

running: test_multiprocessing_spawn (901 sec), test_concurrent_futures (151 sec)
0:47:16 [250/413/1] test_multiprocessing_spawn crashed (Exit code 1) -- 
running: test_concurrent_futures (154 sec)
Timeout (0:15:00)!
Thread 0x0238 (most recent call first):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\popen_spawn_win32.py",
 line 80 in wait
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py",
 line 140 in join
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py",
 line 2128 in join_thread
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py",
 line 83 in join_process
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py",
 line 740 in test_sys_exit
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", 
line 615 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", 
line 663 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 122 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 84 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 122 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 84 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 122 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", 
line 84 in __call__
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\runner.py",
 line 176 in run
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py",
 line 1861 in _run_suite
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py",
 line 1951 in run_unittest
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py",
 line 175 in test_runner
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py",
 line 176 in runtest_inner
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py",
 line 130 in runtest
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest_mp.py",
 line 67 in run_tests_slave
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py",
 line 517 in _main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py",
 line 510 in main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py",
 line 585 in main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\regrtest.py", 
line 46 in _main
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\regrtest.py", 
line 50 in 
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\runpy.py", 
line 85 in _run_code
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\runpy.py", 
line 193 in _run_module_as_main
0:47:21 [251/413/1] test_timeit passed -- running: test_concurrent_futures (159 
sec)
(...)
0:54:34 [295/413/1] test_tempfile passed -- running: test_mmap (238 sec)
minkernel\crts\ucrt\src\appcrt\lowio\write.cpp(49) : Assertion failed: 
(_osfile(fh) & FOPEN)
0:54:39 [296/413/2] test_configparser failed (env changed) -- running: 
test_mmap (243 sec)
D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py:1000:
 RuntimeWarning: tests may fail, unable to create temporary directory 
'D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows7\\build\\build\\test_python_2876':
 [WinError 183] Cannot create a file when that file already exists: 
'D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows7\\build\\build\\test_python_2876'
  with temp_dir(path=name, quiet=quiet) as temp_path:
test_converters_at_init 
(test.test_configparser.BlatantOverrideConvertersTestCase) ... ok
(...)
test_write (test.test_configparser.StrictTestCase) ... ok

--
Ran 341 tests in 3.745s

OK (skipped=5)
Warning -- files was modified by test_configparser
  Before: ['@test_2876_tmp']
  After:  []

--
components: Tests
messages: 308398
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_configparser left @test_2876_tmp temporary file on x86 Windows7 3.x
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-

[issue32332] Implement slots support for magic methods added in PEP 560

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

Serhiy, I've tested METH_STATIC approach and it works just fine.  Thanks for 
pointing that out!

I agree that adding slots for something that's already possible is an overkill, 
so let's close this issue.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue32329] PYTHONHASHSEED=0 python3 -R should enable hash randomization

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4780

___
Python tracker 

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



[issue32294] test_semaphore_tracker() of test_multiprocessing_spawn fails with -W error

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


--
keywords: +patch
pull_requests: +4781
stage:  -> patch review

___
Python tracker 

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



[issue32124] Document functions safe to be called before Py_Initialize()

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


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



[issue32119] test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer"

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

I really have no clue on the root bug, and the bug only occurred once, so I 
choose to close it.

--
resolution:  -> out of date
stage:  -> 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



[issue31971] idle_test: failures on x86 Windows7 3.x

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

Terry: you proposed a fix, do you still want to write it? The buildbot didn't 
fail again since I reported the failure.

--

___
Python tracker 

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



[issue31967] [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe'

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

The AMD64 Windows10 3.x buildbot: is green again, I close the issue.

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



[issue31964] [3.4][3.5] pyexpat: compilaton of libexpat fails with: ISO C90 forbids mixed declarations and code

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

The bug has been fixed by commit 8b11e8de7aedacfbbcc8c780f3c4097396f1d1a3 in 
Python 3.4

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



[issue32329] PYTHONHASHSEED=0 python3 -R should enable hash randomization

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 642d67b4f25262889b43f91ad2a96ca0e37fd5a2 by Victor Stinner in 
branch 'master':
bpo-32329: Add versionchanged to -R option doc (#4884)
https://github.com/python/cpython/commit/642d67b4f25262889b43f91ad2a96ca0e37fd5a2


--

___
Python tracker 

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



[issue32294] test_semaphore_tracker() of test_multiprocessing_spawn fails with -W error

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 9402c8367bf6ada1b84f620ad957750c33adbaf9 by Victor Stinner in 
branch 'master':
bpo-32294: Fix multiprocessing test_semaphore_tracker() (#4885)
https://github.com/python/cpython/commit/9402c8367bf6ada1b84f620ad957750c33adbaf9


--

___
Python tracker 

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



[issue32294] test_semaphore_tracker() of test_multiprocessing_spawn fails with -W error

2017-12-15 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4782

___
Python tracker 

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



[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-12-15 Thread Anthony Sottile

Anthony Sottile  added the comment:

if I'm reading the manpage correctly: `readlink` tells the filename that the 
symlink points to.  lchmod is concerned with setting the `stat` on the link 
itself (which only some platforms actually support)

--

___
Python tracker 

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



[issue32290] bolen-dmg-3.6: compilation failed with OSError: [Errno 23] Too many open files in system

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

Another different failure on "bolen-dmg-3.x". I don't understand the 
"RuntimeError: command failed: make" error :-(

http://buildbot.python.org/all/#/builders/69/builds/69

(...)
gcc-4.0 -c -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g 
-fwrapv -O3 -Wall -Wstrict-prototypes -arch ppc -arch i386 -isysroot 
/Developer/SDKs/MacOSX10.4u.sdk -g 
-I/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/dmg/libraries/usr/local/include 
  -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers  
-IObjects -IInclude -IPython -I. 
-I/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Include -isysroot 
/Developer/SDKs/MacOSX10.4u.sdk-DPy_BUILD_CORE -o Python/frozen.o 
/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Python/frozen.c
rm -f libpython3.7m.a
ar rcs libpython3.7m.a Modules/getbuildinfo.o Parser/acceler.o 
Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o 
Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o 
Parser/pgen.o Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o 
Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o 
Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o 
Objects/cellobject.o Objects/classobject.o Objects/codeobject.o 
Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o 
Objects/exceptions.o Objects/genobject.o Objects/fileobject.o 
Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o 
Objects/iterobject.o Objects/listobject.o Objects/longobject.o 
Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o 
Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o 
Objects/object.o Objects/obmalloc.o Objects/capsule.o Objects/rangeobject.o 
Objects/setobject.o Objects/sliceobject.o Object
 s/structseq.o Objects/tupleobject.o Objects/typeobject.o 
Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o 
Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o 
Python/ast_opt.o Python/bltinmodule.o Python/ceval.o Python/compile.o 
Python/codecs.o Python/dynamic_annotations.o Python/errors.o 
Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o 
Python/getcopyright.o Python/getplatform.o Python/getversion.o 
Python/graminit.o Python/import.o Python/importdl.o Python/marshal.o 
Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o 
Python/peephole.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o 
Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o 
Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o 
Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o 
Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o 
Python/pystrhex.o Python/dtoa.o Python/format
 ter_unicode.o Python/fileutils.o Python/dynload_shlib.oModules/config.o 
Modules/getpath.o Modules/main.o Modules/gcmodule.o Modules/posixmodule.o  
Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  
Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  
Modules/_operator.o  Modules/_collectionsmodule.o  Modules/itertoolsmodule.o  
Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  
Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  
Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o 
Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/zipimport.o  
Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  
Modules/symtablemodule.o  Modules/xxsubtype.o Python/frozen.o
/usr/bin/install -c -d -m 755 Python.framework/Versions/3.7
gcc-4.0 -o Python.framework/Versions/3.7/Python -arch ppc -arch i386 -isysroot 
/Developer/SDKs/MacOSX10.4u.sdk -g 
-L/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/dmg/libraries/usr/local/lib  
-dynamiclib \
-all_load libpython3.7m.a -Wl,-single_module \
-install_name /Library/Frameworks/Python.framework/Versions/3.7/Python \
-compatibility_version 3.7 \
-current_version 3.7 \
-framework CoreFoundation -ldl  -framework CoreFoundation;
Traceback (most recent call last):
  File 
"/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py",
 line 1659, in 
main()
  File 
"/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py",
 line 1612, in main
buildPython()
  File 
"/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py",
 line 1162, in buildPython
runCommand(make_cmd)
  File 
"/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py",
 line 532, in runCommand
raise RuntimeError("command failed: %s"%(commandline,))
RuntimeError: command failed: make
program finished with exit code 1
elapsedTime=1601.300462

--

___
Python tracker 

___
___

[issue32329] PYTHONHASHSEED=0 python3 -R should enable hash randomization

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


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



[issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation?

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

> if I'm reading the manpage correctly: `readlink` tells the filename that the 
> symlink points to.  lchmod is concerned with setting the `stat` on the link 
> itself (which only some platforms actually support)

Oops, my bad. Ignore my comment :-)

--

___
Python tracker 

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



[issue32333] test_smtplib: dangling threads on x86 Gentoo Non-Debug with X 3.x

2017-12-15 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


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



[issue32294] test_semaphore_tracker() of test_multiprocessing_spawn fails with -W error

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


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



[issue32331] apply SOCK_TYPE_MASK to socket.type on Linux

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

> You can easily work around your problem by replacing "sock.type == 
> SOCK_STREAM" with "sock.type & SOCK_STREAM == SOCK_STREAM".

Heh :) No, that would be a buggy code.  Try this on your Linux box:

(socket.SOCK_SEQPACKET & socket.SOCK_STREAM) == socket.SOCK_STREAM

The _only_ way of checking socket type reliably is to explicitly reset 
SOCK_NONBLOCK and SOCK_CLOEXEC or to apply 0xF mask on Linux, and don't do that 
on other platforms.

That's why I think it's important to fix this one way or another.

--

___
Python tracker 

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



[issue32331] apply SOCK_TYPE_MASK to socket.type on Linux

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

On GH (https://github.com/python/cpython/pull/4877), Antoine wrote:

> I agree with Victor:

> it can't go into 3.6
> making the change in 3.7 is contentious
> Can there be an other way to solve the issue? Can we for example keep 
> socket.type as it is and add a utility function or a property reporting the 
> "masked" type?

I agree.   Here's what I propose:

1. We don't touch `socket.type`.  We don't know what kind of code exists out 
there and in what ways it will break.  The ship has sailed to fix it.

2. We add `socket.SOCK_TYPE_MASK` (on Linux).

3. We fix `socket.__repr__` to correctly render type.  Currently:

>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM | 
socket.SOCK_NONBLOCK)
>>> s


What I want to see:



4. We add `socket.true_type` which will apply `SOCK_TYPE_MASK` and return a 
socket type that's safe to compare to `socket.SOCK_*` constants.

Thoughts?

--

___
Python tracker 

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



[issue32331] apply SOCK_TYPE_MASK to socket.type on Linux

2017-12-15 Thread Christian Heimes

Christian Heimes  added the comment:

Should socket.true_type use getsockopt(fd, ...) to get the actual type?

While we are talking about socket types, please have a look at #28134 .

--

___
Python tracker 

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



[issue32320] Add default value support to collections.namedtuple()

2017-12-15 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-15 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

In the process of trying to write a test for this, I now realize that PR 4847 
is not really a fix.  If the underlying file gets closed during an earlier 
gc.collect() and not during shutdown, the extra flushing step is not going to 
help.  So, using atexit is not really a fix.  Maybe there is something else we 
can do, need to think about it more.

--

___
Python tracker 

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



[issue32335] Failed Python build on Fedora 27

2017-12-15 Thread Amit Ghadge

New submission from Amit Ghadge :

Hi, I'm try to build Python from source on Fedora 27 but it shows below message 
and build was failed,
gcc -pthread   -Xlinker -export-dynamic -o python Programs/python.o 
libpython3.7dm.a -lpthread -ldl  -lutil   -lm  
gcc -pthread   -Xlinker -export-dynamic -o Programs/_testembed 
Programs/_testembed.o libpython3.7dm.a -lpthread -ldl  -lutil   -lm  
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
Traceback (most recent call last):
  File "", line 1141, in _install
  File "", line 1133, in _setup
  File "", line 1100, in _builtin_from_name
ImportError: no built-in module named _thread
Fatal Python error: initimport: importlib install failed

Current thread 0x7fefeacef600 (most recent call first):
/bin/sh: line 5: 12806 Aborted (core dumped) ./python -E -S -m 
sysconfig --generate-posix-vars
generate-posix-vars failed
make: *** [Makefile:590: pybuilddir.txt] Error 1

--
messages: 308413
nosy: amitg-b14
priority: normal
severity: normal
status: open
title: Failed Python build on Fedora 27
type: compile error
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



[issue32335] Failed Python build on Fedora 27

2017-12-15 Thread Amit Ghadge

Amit Ghadge  added the comment:

After the some investigation,
1f06a680de465be0c24a78ea3b610053955daa99 PR was OK,
a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 build failed but ./python run
88c60c9668f0aa732693517a60b851cc1dfce0cb build failed and same error comes 
after click ./python

--

___
Python tracker 

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



[issue32335] Failed Python build on Fedora 27

2017-12-15 Thread Amit Ghadge

Amit Ghadge  added the comment:

My current git log is,
Author: Victor Stinner 
Date:   Fri Dec 15 16:29:24 2017 +0100

bpo-32294: Fix multiprocessing test_semaphore_tracker() (#4885)

--

___
Python tracker 

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



[issue32336] Save OrderedDict import in argparse

2017-12-15 Thread Raymond Hettinger

New submission from Raymond Hettinger :

Since regular dicts are now ordered by default, the OrderedDict import is no 
longer necessary.  Removing it will give a small boost to start-up time.

--
assignee: bethard
components: Library (Lib)
messages: 308416
nosy: bethard, rhettinger
priority: normal
severity: normal
status: open
title: Save OrderedDict import in argparse
type: performance
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



[issue32336] Save OrderedDict import in argparse

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +4783
stage:  -> patch review

___
Python tracker 

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



[issue32337] Dict order is now guaranteed, so add tests for it

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
assignee: rhettinger
components: Tests
nosy: rhettinger
priority: normal
severity: normal
stage: needs patch
status: open
title: Dict order is now guaranteed, so add tests for it
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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I'm not well known with GC, but if it be possible to call destructors in the 
reversed chronological order, this could help with this issue.

--

___
Python tracker 

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



[issue32338] Save OrderedDict import in re

2017-12-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Since regular dicts are now ordered by default, the OrderedDict import is no 
longer necessary.

--
components: Library (Lib), Regular Expressions
messages: 308418
nosy: ezio.melotti, mrabarnett, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Save OrderedDict import in re
type: enhancement
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



[issue32338] Save OrderedDict import in re

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4784
stage:  -> patch review

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-15 Thread Neil Schemenauer

Neil Schemenauer  added the comment:

Using reversed chronological order would work in 99% of the cases probably but 
then you would have that rare case where it didn't work.  So, I'm not too keen 
on that approach.

I think this is a classic problem with finalization and GC, probably should do 
some actual reading of literature.  One idea that occurs to me is that the 
underlying file object could keep a weakref to the higher level (e.g. buffer) 
objects.  Then, if the underlying file gets closes, it could make sure to call 
flush on the higher level objects first.  The weakref would ensure that a ref 
cycle is not created.

--

___
Python tracker 

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



[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2017-12-15 Thread Brett Cannon

Change by Brett Cannon :


--
keywords: +patch
pull_requests: +4785
stage:  -> patch review

___
Python tracker 

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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-15 Thread Nitish

Change by Nitish :


--
nosy: +nitishch

___
Python tracker 

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



[issue32339] Make the dict type used in csv.DictReader configurable

2017-12-15 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Since 3.6 csv.DictReader emits OrderedDicts instead of regular dicts. Since 
regular dicts are ordered in 3.7, this is an overkill. It would be nice to add 
a configuration option for a return type.

This is an easy issue.

--
components: Library (Lib)
keywords: easy
messages: 308420
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Make the dict type used in csv.DictReader configurable
type: enhancement
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



[issue32330] Email parser creates a message object that can't be flattened

2017-12-15 Thread Mark Sapiro

Mark Sapiro  added the comment:

> I do wonder where you are using the string version of messages :)

Probably some places where we could use bytes, but one of the problem areas is 
where we save the content of a message held for moderation.

--

___
Python tracker 

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



[issue31971] idle_test: failures on x86 Windows7 3.x

2017-12-15 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I want to add the try-except here and in the few other places where a method is 
temporarily masked.  One failure causing another strikes me a  test code bug.  
I would like to hold off on adding 'hover', as it now seems to have been an 
idiosyncratic and temporary glitch on one buildbot.  I cannot see anything 
different about this particular button state check.  If 'hover' were needed 
here, so it would seem equally needed in several other places.

--

___
Python tracker 

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



[issue32340] ValueError: time data 'N/A' does not match format '%Y%m%d'

2017-12-15 Thread ikram

New submission from ikram :

Traceback (most recent call last):
  File "H:\Whatsapp_Xtract_V2.2_2012-11-17\whatsapp_xtract.py", line 2453, in 

main(sys.argv[1:])
  File "H:\Whatsapp_Xtract_V2.2_2012-11-17\whatsapp_xtract.py", line 1921, in 
main
linkimage = findfile ("IMG", y.media_size, y.local_url, date, 2)
  File "H:\Whatsapp_Xtract_V2.2_2012-11-17\whatsapp_xtract.py", line 1266, in 
findfile
timestamptoday = int(str(time.mktime(datetime.datetime.strptime(date, 
"%Y%m%d").timetuple()))[:-2])
  File "C:\Python27\lib\_strptime.py", line 332, in _strptime
(data_string, format))
ValueError: time data 'N/A' does not match format '%Y%m%d'
Press any key to continue . . .

--
components: Windows
messages: 308423
nosy: marki94, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: ValueError: time data 'N/A' does not match format '%Y%m%d'
type: compile error
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



[issue17852] Built-in module _io can lose data from buffered files at exit

2017-12-15 Thread Nikolaus Rath

Nikolaus Rath  added the comment:

Given the apparent difficulties getting this right, how about not attempting to 
implicitly flush buffers in the finalizer at all? This means scripts relying on 
this will break, but in contrast to the current behavior they will break 
consistently so it's easy to find and fix the problem.

--

___
Python tracker 

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



[issue32341] itertools "generators"?

2017-12-15 Thread Stefan Pochmann

New submission from Stefan Pochmann :

The itertools page https://docs.python.org/3.6/library/itertools.html says 
"Combinatoric generators:" above the table with product(), permutations(), etc. 
But as far as I understand, they're not generators and they don't produce 
generator iterators. I think the table title should be "Combinatoric 
iterators:" instead, in line with "Infinite Iterators:" and "Iterators 
terminating on the shortest input sequence:" of the two tables above it.

Reference:
https://docs.python.org/3/glossary.html#term-generator

--
assignee: docs@python
components: Documentation
messages: 308425
nosy: Stefan Pochmann, docs@python
priority: normal
severity: normal
status: open
title: itertools "generators"?
versions: Python 2.7, 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



[issue32341] itertools "generators"?

2017-12-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The term is used in the generic sense rather than the sense of an actual type.  
That said, I don't mind changing "Combinatoric generators" to "Combinatoric 
iterators" for 3.6 and 3.7.   Otherwise, this isn't worth the backport effort.

--
assignee: docs@python -> rhettinger
nosy: +rhettinger
priority: normal -> low
versions:  -Python 2.7, Python 3.5

___
Python tracker 

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



[issue32341] itertools "generators"?

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +4786
stage:  -> patch review

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-15 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4787

___
Python tracker 

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



[issue30416] constant folding opens compiler to quadratic time hashing

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4788

___
Python tracker 

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



[issue21074] Too aggressive constant folding

2017-12-15 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4789

___
Python tracker 

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



[issue32341] itertools "generators"?

2017-12-15 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4790

___
Python tracker 

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



[issue32341] itertools "generators"?

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


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



[issue32340] ValueError: time data 'N/A' does not match format '%Y%m%d'

2017-12-15 Thread R. David Murray

R. David Murray  added the comment:

This is not a bug in python.  If it is your code contact the pyhon-list mailing 
for help.  If you got whatsapp_xtract from somewhere else, contact that 
community with your questions.

--
nosy: +r.david.murray
resolution:  -> third party
stage:  -> 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



[issue32337] Dict order is now guaranteed, so add tests and doc for it

2017-12-15 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
title: Dict order is now guaranteed, so add tests for it -> Dict order is now 
guaranteed, so add tests and doc for it

___
Python tracker 

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



[issue32342] safe_power(): CID 1426161: Integer handling issues (DIVIDE_BY_ZERO)

2017-12-15 Thread STINNER Victor

New submission from STINNER Victor :

Coverity found an issue in the commit 2e3f5701858d1fc04caedefdd9a8ea43810270d2 
(bpo-30416).

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)

** CID 1426161:  Integer handling issues  (DIVIDE_BY_ZERO)
/Python/ast_opt.c: 219 in safe_power()


*** CID 1426161:  Integer handling issues  (DIVIDE_BY_ZERO)
/Python/ast_opt.c: 219 in safe_power()
213 if (PyLong_Check(v) && PyLong_Check(w) && Py_SIZE(v) && Py_SIZE(w) 
> 0) {
214 size_t vbits = _PyLong_NumBits(v);
215 size_t wbits = PyLong_AsSize_t(w);
216 if (vbits == (size_t)-1 || wbits == (size_t)-1) {
217 return NULL;
218 }
>>> CID 1426161:  Integer handling issues  (DIVIDE_BY_ZERO)
>>> In expression "128UL / wbits", division by expression "wbits" which may 
>>> be zero has undefined behavior.
219 if (vbits > MAX_INT_SIZE / wbits) {
220 return NULL;
221 }
222 }
223
224 return PyNumber_Power(v, w, Py_None);

--
components: Interpreter Core
messages: 308428
nosy: serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: safe_power(): CID 1426161:  Integer handling issues  (DIVIDE_BY_ZERO)
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



[issue32342] safe_power(): CID 1426161: Integer handling issues (DIVIDE_BY_ZERO)

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:

PyLong_AsSize_t(w) cannot be zero thanks to Py_SIZE(w) > 0. I classified the 
issue as a false positive. Sorry for the noise.

--
resolution:  -> not a bug
stage:  -> 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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-12-15 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue29240] PEP 540: Add a new UTF-8 mode

2017-12-15 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset d2b02310acbfe6c978a8ad3cd3ac8b3f12927442 by Victor Stinner in 
branch 'master':
bpo-29240: Don't define decode_locale() on macOS (#4895)
https://github.com/python/cpython/commit/d2b02310acbfe6c978a8ad3cd3ac8b3f12927442


--

___
Python tracker 

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



[issue32324] [Security] "python3 directory" inserts "directory" at sys.path[0] even in isolated mode

2017-12-15 Thread Brett Cannon

Brett Cannon  added the comment:

I vote that it has to work and it should be prepended.

--

___
Python tracker 

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



[issue32331] Add socket.truetype property

2017-12-15 Thread Yury Selivanov

Change by Yury Selivanov :


--
title: apply SOCK_TYPE_MASK to socket.type on Linux -> Add socket.truetype 
property

___
Python tracker 

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



[issue32331] Add socket.truetype property

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

Update:

I've rewritten the PR from scratch.

1. SOCK_TYPE_MASK isn't exported on Linux.  Therefore we will not export 
socket.SOCK_TYPE_MASK too.

2. I've added the new socket.truetype property.

3. When a socket is created without an FD, e.g. "socket.socket(family, type, 
proto)", we trust that the type of the socket is correct.  It might contain 
extra flags on Linux, so we filter them out.

4. When a socket is created from an FD, e.g. with "socket.fromfd" or with 
"socket.socket(family, type, proto, FD)" we don't trust the type.  So 
socket.truetype will call getsockopt(SOL_SOCKET, SO_TYPE) on the FD to ensure 
we have the correct socket type at hand.

5. Since Linux doesn't export SOCK_TYPE_MASK I decided to hardcode it in 
socketmodule.c.  My reasoning:

a/ It's highly unlikely that Linux will implement 5 more new socket types 
anytime soon, so 0xF should last for a *very* long time.

b/ It's more likely than "a/" that they add a new flag like SOCK_CLOEXEC, in 
which case the "type & ~(SOCK_NONBLOCK | SOCK_CLOEXEC)" approach will fail.

So given a/ and b/ I think it's safe to just use 0xF mask on Linux.

--

___
Python tracker 

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



[issue28134] socket.socket(fileno=fd) does not work as documented

2017-12-15 Thread Yury Selivanov

Yury Selivanov  added the comment:

Let's quickly iterate over what's possible first:

* It's possible to check the type of the FD using "getsockopt(SOL_SOCKET, 
SO_TYPE)" on all platforms.

* It's possible to check family/proto of the FD using "getsockopt(SOL_SOCKET, 
SO_DOMAIN/SO_PROTOCOL)" on Linux.

Given the above I propose the following:

1. Passing a wrong type can be considered as a serious error.  SOCK_STREAM is 
fundamentally different from SOCK_DGRAM.  Because we have a way to validate 
socket type on all platforms, I propose to do this validation when we create a 
socket from an FD, and raise an error if the passed socket type isn't correct.

2. When Python is running with '-X dev' (new dev mode added by Victor), I 
propose to also validate socket.family and socket.proto on Linux, and raise a 
RuntimeWarning when they don't match.

--
nosy: +pitrou, vstinner, yselivanov

___
Python tracker 

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



[issue32339] Make the dict type used in csv.DictReader configurable

2017-12-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

For csv.DictReader and collections.namedtuple._asdict, it might be cleaner to 
just deprecate the OrderedDict in favor of returning regular dict.  I suspect 
that in these contexts, no one really wants an actual OrderedDict.

--
nosy: +rhettinger

___
Python tracker 

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



  1   2   >