[issue31462] Remove trailing whitespaces

2017-09-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +3553

___
Python tracker 

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



[issue31462] Remove trailing whitespaces

2017-09-13 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed PR removes trailing whitespaces from CPython source files. Some of 
them were added since the last trailing whitespaces removing. Some text files 
were omitted in previous trailing whitespaces removings. Now I consider them 
safe to cleanup.

--
messages: 302140
nosy: benjamin.peterson, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Remove trailing whitespaces
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



[issue19985] Not so correct error message when initializing Struct with ill argument

2017-09-13 Thread Xiang Zhang

Changes by Xiang Zhang :


--
versions: +Python 3.6, Python 3.7 -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



[issue19985] Not so correct error message when initializing Struct with ill argument

2017-09-13 Thread Xiang Zhang

Changes by Xiang Zhang :


--
dependencies: +fix several error messages in struct -Document whether it's safe 
to use bytes for struct format string
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



[issue30246] fix several error messages in struct

2017-09-13 Thread Xiang Zhang

Changes by Xiang Zhang :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue30246] fix several error messages in struct

2017-09-13 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset fa82dda1012b406a7091587fc65384ce11528346 by Xiang Zhang in branch 
'3.6':
[3.6] bpo-30246: fix several error messages which only mention bytes in struct 
(#3561)
https://github.com/python/cpython/commit/fa82dda1012b406a7091587fc65384ce11528346


--

___
Python tracker 

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



[issue30246] fix several error messages in struct

2017-09-13 Thread Xiang Zhang

Changes by Xiang Zhang :


--
keywords: +patch
pull_requests: +3552

___
Python tracker 

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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-13 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-13 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 905e4ef86e86dbf8f28b2f6e45af31a6eea84e10 by Mariatta in branch 
'3.6':
[3.6] bpo-31458: Update Misc/NEWS link in What's New page (GH-3555) (GH-3560)
https://github.com/python/cpython/commit/905e4ef86e86dbf8f28b2f6e45af31a6eea84e10


--

___
Python tracker 

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



[issue30246] fix several error messages in struct

2017-09-13 Thread Xiang Zhang

Xiang Zhang added the comment:


New changeset c3e97d9d984130d1c2aceedc4dfcd603b3162688 by Xiang Zhang in branch 
'master':
bpo-30246: fix several error messages which only mention bytes in struct (#1421)
https://github.com/python/cpython/commit/c3e97d9d984130d1c2aceedc4dfcd603b3162688


--

___
Python tracker 

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



[issue31438] IDLE 3 crashes and quits when caret character typed

2017-09-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If your installed Python with the 64/32 Mac installer from python.org, follow 
the instruction, on the link given, to install Active 8.5.18 and *not* 8.6.  I 
believe the issue is that the _tkinter binary is compiled to work with 8.5, not 
8.6.

If you used any other installer, talk with its providers.

--

___
Python tracker 

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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-13 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +3551

___
Python tracker 

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



[issue31461] IDLE: Enhance class browser

2017-09-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +csabella

___
Python tracker 

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



[issue31438] IDLE 3 crashes and quits when caret character typed

2017-09-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Ned, is 3.6.2 tkinter on Mac supposed to work with tcl/tk 8.6.6?

--

___
Python tracker 

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



[issue28556] typing.py upgrades

2017-09-13 Thread Łukasz Langa

Łukasz Langa added the comment:


New changeset 9e3cd78ec18b2d2078d30b04307916acd68be37a by Łukasz Langa (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-28556: Minor updates to typing module (GH-3550) (#3558)
https://github.com/python/cpython/commit/9e3cd78ec18b2d2078d30b04307916acd68be37a


--

___
Python tracker 

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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-13 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 1b8f612e1800b6e58472113f4abe8ee7c31f4db7 by Mariatta in branch 
'master':
bpo-31458: Update Misc/NEWS link in What's New page (GH-3555)
https://github.com/python/cpython/commit/1b8f612e1800b6e58472113f4abe8ee7c31f4db7


--

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 096ae3373abac2c8b3a26a3fe33cc8bd4cbccd4e by Victor Stinner in 
branch 'master':
bpo-31234: Try to fix lock_tests warning (#3557)
https://github.com/python/cpython/commit/096ae3373abac2c8b3a26a3fe33cc8bd4cbccd4e


--

___
Python tracker 

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



[issue28556] typing.py upgrades

2017-09-13 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3550

___
Python tracker 

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



[issue28556] typing.py upgrades

2017-09-13 Thread Łukasz Langa

Łukasz Langa added the comment:


New changeset 65bc62052fe5d550cb14c0033e8a2550618fb7b9 by Łukasz Langa (Ivan 
Levkivskyi) in branch 'master':
bpo-28556: Minor updates to typing module (#3550)
https://github.com/python/cpython/commit/65bc62052fe5d550cb14c0033e8a2550618fb7b9


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue31447] proc communicate not exiting on python subprocess timeout using PIPES

2017-09-13 Thread Eryk Sun

Eryk Sun added the comment:

> the process terminates, but "communicate" doesn't exit. It doesn't 
> say "communicate will hang as long as the pipes are open".

I think the problem with leaked handles does warrant a note. It can be a 
difficult problem to diagnose otherwise.

If communicate() raises subprocess.TimeoutExpired, it can be called again after 
the caller takes whatever action is necessary to resolve the problem, such as 
killing a process group as proposed by issue 5115.

> the "python.exe" process doesn't actually timeout!!! It just exits 
> (with exception, but that's not important), and I would like to get
> the error from stderr! While I can't get it because "communicate" 
> raises an exception...

subprocess.run() in the child does time out and raise 
subprocess.TimeoutExpired. For the parent to read stdout and stderr to EOF, all 
pipe handles with write access have to close. Calling communicate() again will 
succeed once waitfor.exe either exits or gets terminated. 

Since python.exe and waitfor.exe are console processes, and waitfor.exe 
inherits Python's console, you can send it a Ctrl+Break event to make it exit. 
Make sure to create a new process group in the Popen() call by passing the 
argument creationflags=subprocess.CREATE_NEW_PROCESS_GROUP. Then to deal with a 
timeout, call proc.send_signal(signal.CTRL_BREAK_EVENT) and retry 
communicate(). 

(Yes, it's wrong that send_signal sends Ctrl+Break to a process group instead 
of explicitly requiring a `group` argument to enable this, as proposed in issue 
5115. I guess whoever implemented os.kill for Windows didn't understand that 
GenerateConsoleCtrlEvent should have been used to implement os.killpg instead.)

> I don't care what the called process does. 

If you have source control of the child process and don't care about the output 
of grandchild processes, redirect their standard I/O to the NUL device. Also, 
make the child's standard I/O files non-inheritable, or if you're using C/C++, 
call CreateProcess with a PROC_THREAD_ATTRIBUTE_HANDLE_LIST to control handle 
inheritance (this should be available in Python 3.7, pending issue 19764).

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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3549

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:


New changeset ef323e8d82b07d4e7e4303c360dc32d3de0b3147 by Victor Stinner in 
branch '3.6':
[3.6] bpo-31234: Fix dangling thread in test_ftp/poplib (#3554)
https://github.com/python/cpython/commit/ef323e8d82b07d4e7e4303c360dc32d3de0b3147


--

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:


New changeset d99e85b9f6422dd5e4f2eb1539368fc4003d4c8b by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31234, socket.create_connection(): Fix ref cycle (GH-3546) (#3552)
https://github.com/python/cpython/commit/d99e85b9f6422dd5e4f2eb1539368fc4003d4c8b


--

___
Python tracker 

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



[issue28411] Eliminate PyInterpreterState.modules.

2017-09-13 Thread Eric Snow

Eric Snow added the comment:

FYI, this broke some (very) corner cases.  See issue #31404.

--

___
Python tracker 

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



[issue31418] assertion failure in PyErr_WriteUnraisable() in case of an exception with a bad __module__

2017-09-13 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3548

___
Python tracker 

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



[issue31418] assertion failure in PyErr_WriteUnraisable() in case of an exception with a bad __module__

2017-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset f6e61df01536493f1280cd07639c7ff9bffb2cdc by Serhiy Storchaka 
(Oren Milman) in branch 'master':
bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case of an 
exception with a bad __module__ attribute. (#3539)
https://github.com/python/cpython/commit/f6e61df01536493f1280cd07639c7ff9bffb2cdc


--

___
Python tracker 

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



[issue31418] assertion failure in PyErr_WriteUnraisable() in case of an exception with a bad __module__

2017-09-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue30442] Skip test_xml_etree under coverage

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 860839cc8e0a4a0890418f77c984955697f96828 by Victor Stinner (Miss 
Islington (bot)) in branch '2.7':
[2.7] bpo-30442: Skips refcount test in test_xml_etree under coverage (GH-1767) 
(#3549)
https://github.com/python/cpython/commit/860839cc8e0a4a0890418f77c984955697f96828


--

___
Python tracker 

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



[issue31461] IDLE: Enhance class browser

2017-09-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
dependencies: +Class Browser doesn't show internal classes, IDLE: Remane Class 
Browser as Module Browser, IDLE: Revise ModuleBrowser API

___
Python tracker 

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



[issue30891] importlib: _find_and_load() race condition on sys.modules[name] check

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Łukasz Langa: "If you're looking at this issue because it still happens to you, 
you are probably using zipimport. Stop using zipimport."

Hum, do you mean that zipimport also has an issue? Maybe open a new issue?

--

___
Python tracker 

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



[issue31461] IDLE: Enhance class browser

2017-09-13 Thread Terry J. Reedy

New submission from Terry J. Reedy:

This is an index issue for keeping track of improvements to IDLE's class 
browser.  They should mostly (or all?) be done in separate issues and PRs.  

Existing issues with patches.  Only the first, a 'must', is recently reviewed.
#1612262  Use 3.7 enhanced pyclbr to show nested classes and functions.
#6171   Obsolete problem but patch may have useful idea.
#20827  Display function arguments (would be nice).
#25090  Remove most icons (also applies to pathbrowser).

New 'must' issues that need patches.
#31459  Rename ClassBrowser as ModuleBrowser
#31460  Redo signature of ModuleBroser.__init__.

Other potential issues, most of which also affect pathbrowser.
Make broswers scrollable with mouse.  (See turtledemo for how.)
Start browsers with bigger window.
Clicking of module in pathbrowser should open module browser.
Separate toplevel window from browser frame.
Search tree (including items not visible) with status bar box.
Utilize ttk.Treeview in browsers.

Browsers currently use idlelib.tree.TreeWidget.  Treeview is not a drop-in 
replacement because TreeWidget has some of the higher-level app-specific 
functions that users are expected to add to Treeview.  But could Treeview 
replace the low-level parts of TreeWidget that actually display stuff on the 
screen?

Us

--
assignee: terry.reedy
components: IDLE
messages: 302123
nosy: terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Enhance class browser
type: behavior
versions: 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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Source_ModuleLockAsRLockTests.test_different_thread() of 
test.test_importlib.test_locks failed:

http://buildbot.python.org/all/builders/x86-64%20El%20Capitan%203.x/builds/758/steps/test/logs/stdio

test_different_thread 
(test.test_importlib.test_locks.Source_ModuleLockAsRLockTests) ... Warning -- 
threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 1)
Dangling thread: <_MainThread(MainThread, started 140735235059712)>
ok

--

___
Python tracker 

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



[issue31447] proc communicate not exiting on python subprocess timeout using PIPES

2017-09-13 Thread Martin Panter

Martin Panter added the comment:

.
Isn’t your use of “cmd” similar enough to shell=True? I.e. isn’t that a “cmd” 
parent process spawning a “waitfor” child? If your 4 s “subprocess.run” call 
times out, does it kill the “waitfor” process, or leave it running?

Could the “waitfor” process write to stdout or stderr, and should that be 
captured by your 20 s “communicate” call?

--

___
Python tracker 

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



[issue31460] IDLE: Revise ModuleBrowser API

2017-09-13 Thread Terry J. Reedy

New submission from Terry J. Reedy:

The signature of browser.ClassBrowser(to be renamed ModuleBrowser).__init__ is

def __init__(self, flist, name, path, _htest=False, _utest=False)

flist is only used to access the application root.  Change it to master.  Then 
text can directly pass the test root.

name and path are the split apart pieces of the module path, minus '.py', which 
are promptly rejoined, with '.py'.  Callers always start valid path and have to 
split it and delete '.py' for the call.  Let them pass the full path.  A 
side-effect is that the browser will not work with a file without '.py'.

ModuleBrowser can them split off the filename and remove a '.p?' extension, if 
present.

The patch will have to change both .__init__ and callers, and ideally should 
somehow test that everything works.

--
assignee: terry.reedy
components: IDLE
messages: 302119
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Revise ModuleBrowser API
type: behavior
versions: 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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-13 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
keywords: +patch
pull_requests: +3547
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



[issue31459] IDLE: Remane Class Browser as Module Browser

2017-09-13 Thread Terry J. Reedy

New submission from Terry J. Reedy:

'ClassBrowser' expanded to a module browser years ago.  Change the name in the 
menu, multiple places in browser.py, and wherever the class is referenced.

If one clicks the menu entry while not editing a Python file, an Open Module 
entry box is displayed.  Otherwise the edited module is opened. It would be 
good if this were.  We have no menu tests at the moment.

--
assignee: terry.reedy
components: IDLE
messages: 302118
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Remane Class Browser as Module Browser
type: behavior
versions: 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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-13 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
versions: +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



[issue31458] Broken link to Misc/NEWS in What's New page

2017-09-13 Thread Mariatta Wijaya

New submission from Mariatta Wijaya:

In "What's new in Python" page: 
(https://docs.python.org/3.7/whatsnew/index.html)

The link to Misc/NEWS is 404.

The text is: 
The “Changelog” is a HTML version of the file Misc/NEWS which contains all 
nontrivial changes to Python for the current version.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 302117
nosy: Mariatta, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: Broken link to Misc/NEWS in What's New page

___
Python tracker 

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



[issue30246] fix several error messages in struct

2017-09-13 Thread Martin Panter

Martin Panter added the comment:

FWIW a similar change to the Struct constructor message was also proposed in 
Issue 19985.

--

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Hum, test_barrier of test_thread failed:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.x/builds/880/steps/test/logs/stdio

0:02:09 load avg: 2.50 [106/405/1] test_thread failed (env changed) -- running: 
test_multiprocessing_spawn (63 sec), test_multiprocessing_forkserver (54 sec)

test_barrier (test.test_thread.BarrierTest) ...
(...)
task 8 leaving barrier
task 2 leaving barrier
task 9 leaving barrier
tasks done
Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 
1)
Dangling thread: <_MainThread(MainThread, started 34393318400)>
ok

--

___
Python tracker 

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



[issue31323] test_ssl: reference cycle between ThreadedEchoServer and its ConnectionHandler

2017-09-13 Thread STINNER Victor

Changes 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



[issue31424] test_socket hangs on x86 Gentoo Installed with X 3.x

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Hum, the test passed the following 17 builds.

--

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3546

___
Python tracker 

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



[issue19985] Not so correct error message when initializing Struct with ill argument

2017-09-13 Thread Martin Panter

Martin Panter added the comment:

For Python 2.7, this change doesn’t seem important enough for a bug fix.

--

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3545

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:


New changeset ace1ecc00b35a8b1dc6e352d547dde07913017bb by Victor Stinner in 
branch 'master':
bpo-31234: threading_cleanup() now warns immediately (#3138)
https://github.com/python/cpython/commit/ace1ecc00b35a8b1dc6e352d547dde07913017bb


--

___
Python tracker 

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



[issue31457] LoggerAdapter objects cannot be nested

2017-09-13 Thread Łukasz Langa

Changes by Łukasz Langa :


--
versions: +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



[issue31457] LoggerAdapter objects cannot be nested

2017-09-13 Thread Łukasz Langa

Changes by Łukasz Langa :


--
keywords: +patch
pull_requests: +3544

___
Python tracker 

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



[issue31457] LoggerAdapter objects cannot be nested

2017-09-13 Thread Łukasz Langa

Changes by Łukasz Langa :


--
title: LoggerAdapter -> LoggerAdapter objects cannot be nested

___
Python tracker 

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



[issue31457] LoggerAdapter

2017-09-13 Thread Łukasz Langa

New submission from Łukasz Langa:

LoggerAdapter objects cannot be nested in Python 3 due to their `log()` and 
`isEnabledFor()` methods addressing attributes that are not present on the 
proxy.

Adding the missing attributes fixes the issue.

--
assignee: lukasz.langa
messages: 302111
nosy: lukasz.langa, vinay.sajip
priority: normal
severity: normal
stage: patch review
status: open
title: LoggerAdapter
type: behavior

___
Python tracker 

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



[issue31353] Implement PEP 553 - built-in debug()

2017-09-13 Thread R. David Murray

R. David Murray added the comment:

It is a new feature, so no it would not be backported.

--
nosy: +r.david.murray
type:  -> enhancement

___
Python tracker 

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



[issue31353] Implement PEP 553 - built-in debug()

2017-09-13 Thread Dawid Gosławski

Dawid Gosławski added the comment:

Will that be backported also to Python2.7 ? I personally do not see a reason to 
teach old dog new tricks but it seems appropriate in such core things. New 
users could transition easier, otherwise this would be next py2<->py3 
difference to explain every time someone uses new code.

--
nosy: +alkuzad

___
Python tracker 

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



[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-13 Thread Stefan Behnel

Stefan Behnel added the comment:

> Is it correct to call _PyType_Lookup() with an exception set?

The general rule of thumb is that it's not safe to call any user code with a 
live exception set, and lookups can call into user code.

I quickly looked through all occurrences (there aren't that many actually), and 
they all seem be be called from a context where a live exception would be wrong.

> Perhaps we should save a current exception before calling find_name_in_mro() 
> and restore it after.

I thought about that, too, but it feels wrong. This just shouldn't be 
necessary. It's ok to save away exceptions in exception related code, but 
general purpose code shouldn't have to assume that it gets called with a live 
exception.

> Or just add assert(!PyErr_Occurred()) at the begin of find_name_in_mro().

That would catch the error at hand. The only concern is backwards 
compatibility. But it's easy to argue that it's the foreign code that is broken 
in this case (as show-cased by cElementTree) and clearly needs fixing if this 
occurs. An assert() seems like a reasonable way to catch this kind of bug, at 
least in a debug build.

--

___
Python tracker 

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



[issue28556] typing.py upgrades

2017-09-13 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


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

___
Python tracker 

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



[issue31455] ElementTree.XMLParser() mishandles exceptions

2017-09-13 Thread Stefan Behnel

Stefan Behnel added the comment:

Feel free to provide a separate pull request. These issues seem independent of 
the exception handling problem that I wrote a fix for.

--

___
Python tracker 

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



[issue30891] importlib: _find_and_load() race condition on sys.modules[name] check

2017-09-13 Thread Łukasz Langa

Łukasz Langa added the comment:

If you're looking at this issue because it still happens to you, you are 
probably using zipimport. Stop using zipimport.

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue31456] SimpleCookie fails to parse any cookie if an entry has whitespace in the name

2017-09-13 Thread Adam Davis

New submission from Adam Davis:

```>>> from http.cookies import SimpleCookie
>>> cookie_string = "ASDF=stuff; ASDF space=more stuff"
>>> cookie = SimpleCookie()
>>> cookie.load(cookie_string)
>>> cookie.items()
dict_items([])
>>> cookie_string = "ASDF=stuff"
>>> cookie.load(cookie_string)
>>> cookie.items()
dict_items([('ASDF', )])```

cookie.load should throw an error, or at least parse the cookies it can parse.

--
components: Library (Lib)
messages: 302105
nosy: Adam Davis
priority: normal
severity: normal
status: open
title: SimpleCookie fails to parse any cookie if an entry has whitespace in the 
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



[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Since _PyDict_GetItem_KnownHash() may or may not set an exception, we have to 
> check for a live exception after calling it, and that finds the old exception 
> of the last attribute lookup and decides that its own lookup failed.

Hmm, with PyDict_GetItem() we don't falsely detect a lookup failing with a live 
exception set. Is it correct to call _PyType_Lookup() with an exception set? 
Perhaps we should save a current exception before calling find_name_in_mro() 
and restore it after. Or raise SystemError if an exception set. Or just add 
assert(!PyErr_Occurred()) at the begin of find_name_in_mro(). I don't know what 
is more correct.

--

___
Python tracker 

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



[issue31455] ElementTree.XMLParser() mishandles exceptions

2017-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, I see many other issues with C implementation of ElementTree.

1. If XMLParser.__init__ is called twice, it leaks references and the Expat 
parser.

Possible solution: use the Py_XSETREF() macro instead of simple assignment. The 
Expat parser needs special handling.

Other possible solution: drop __init__() and make all initialization in 
__new__(). But this is a solution only for 3.7 because can break compatibility.

2. If XMLParser.__init__ is not called or if it fails to initialize the Expat 
parser, self->entity and self->target are NULL. Later in xmlparser_getattro() 
they are increfed unconditionally.

--

___
Python tracker 

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



[issue31454] Include "import as" in documentation

2017-09-13 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

import as is documented, so I'm closing this unless you have other concerns.

Python 3 docs: https://docs.python.org/3/reference/simple_stmts.html#import
```
If the module name is followed by as, then the name following as is bound 
directly to the imported module
```

Wording is somewhat different in Python 2.7 docs, but it's there: 
https://docs.python.org/2.7/reference/simple_stmts.html#the-import-statement

Thanks.

--
nosy: +Mariatta
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



[issue31455] ElementTree.XMLParser() mishandles exceptions

2017-09-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +eli.bendersky, haypo, serhiy.storchaka
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue31455] ElementTree.XMLParser() mishandles exceptions

2017-09-13 Thread Stefan Behnel

Changes by Stefan Behnel :


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

___
Python tracker 

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



[issue31455] ElementTree.XMLParser() mishandles exceptions

2017-09-13 Thread Stefan Behnel

New submission from Stefan Behnel:

The "XMLParser.__init__()" method in "_elementtree.c" contains this code:

self->handle_start = PyObject_GetAttrString(target, "start");
self->handle_data = PyObject_GetAttrString(target, "data");
self->handle_end = PyObject_GetAttrString(target, "end");
self->handle_comment = PyObject_GetAttrString(target, "comment");
self->handle_pi = PyObject_GetAttrString(target, "pi");
self->handle_close = PyObject_GetAttrString(target, "close");
self->handle_doctype = PyObject_GetAttrString(target, "doctype");
PyErr_Clear();

This ignores all exceptions, not only AttributeError.
It also passes live exceptions into the later lookup calls, which may execute 
arbitrary user code.

--
components: Extension Modules
messages: 302101
nosy: scoder
priority: normal
severity: normal
status: open
title: ElementTree.XMLParser() mishandles exceptions
type: behavior
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



[issue30442] Skip test_xml_etree under coverage

2017-09-13 Thread Roundup Robot

Changes by Roundup Robot :


--
keywords: +patch
pull_requests: +3541
stage: backport needed -> patch review

___
Python tracker 

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



[issue31271] an assertion failure in io.TextIOWrapper.write

2017-09-13 Thread Roundup Robot

Changes by Roundup Robot :


--
keywords: +patch
pull_requests: +3540
stage: backport needed -> patch review

___
Python tracker 

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



[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2017-09-13 Thread Christian Heimes

Christian Heimes added the comment:

It's an ugly hack and not a long term solution. The PROTOCOL_TLSv* constants 
and ssl.wrap_socket() are discouraged and will be removed soon.

--

___
Python tracker 

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



[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2017-09-13 Thread Christian Heimes

Christian Heimes added the comment:

Matthias, this issue affects Debian and probably Ubuntu, too. Could you please 
discuss it with Debian maintainers and propose a workaround? Python does not 
expose the new OpenSSL 1.1.0 SSL_CTX_set_min_proto_version() and 
SSL_CTX_set_max_proto_version() calls. We only support SSL_CTX_set_options() 
with SSL_OP_NO_TLSv1 and SSL_OP_NO_TLSv1_1.

--
assignee: christian.heimes -> 
nosy: +doko
versions: +Python 3.6, 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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:


New changeset acb9fa79fa6453c2bbe3ccfc9cad2837feb90093 by Victor Stinner in 
branch 'master':
bpo-31234, socket.create_connection(): Fix ref cycle (#3546)
https://github.com/python/cpython/commit/acb9fa79fa6453c2bbe3ccfc9cad2837feb90093


--

___
Python tracker 

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



[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2017-09-13 Thread Adrian Vollmer

Adrian Vollmer added the comment:

I have a workaround for now:

versions = [ssl.PROTOCOL_TLSv1,
ssl.PROTOCOL_TLSv1_1,
ssl.PROTOCOL_TLSv1_2,
   ]
firstbytes = s.recv(16, socket.MSG_PEEK)
ss = ssl.wrap_socket(
s,
server_side=True,
certfile="server.pem",
keyfile="server.pem",
#  ssl_version=versions[ord(firstbytes[10])-1] # python2
ssl_version=versions[firstbytes[10]-1]
)

How much of an ugly hack is this? :)

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



[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2017-09-13 Thread Christian Heimes

Changes by Christian Heimes :


--
title: ssl.PROTOCOL_TLS only select TLSv1.2 -> Debian Sid/Buster: Cannot enable 
TLS 1.0/1.1 with PROTOCOL_TLS

___
Python tracker 

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



[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2017-09-13 Thread Christian Heimes

Changes by Christian Heimes :


--
versions: +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



[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

2017-09-13 Thread Christian Heimes

Christian Heimes added the comment:

Ah, here we go: 
https://anonscm.debian.org/viewvc/pkg-openssl/openssl/branches/1.1.0/debian/patches/tls1_2_default.patch

Debian patched the default for SSL_CTX_set_min_proto_version(). The 
SSL_CTX_set_min_proto_version() and SSL_CTX_set_max_proto_version() API calls 
are OpenSSL 1.1.0-only and not available from Python. It is not possible to 
override the minimum version from Python.

--

___
Python tracker 

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



[issue31439] WindowsError: [Error 2] The system cannot find the file specified

2017-09-13 Thread Zachary Ware

New submission from Zachary Ware:

In the absence of a description of your issue, there's nothing we can do with 
just the generic exception in the title so I'm closing the issue.  If you can 
provide a real description of what went wrong for you, you may reopen the issue.

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



[issue31454] Include "import as" in documentation

2017-09-13 Thread R. David Murray

R. David Murray added the comment:

Where do you find that it is not documented that you would expect it to be?  
Because 'import' 'as' is certainly documented.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

2017-09-13 Thread Adrian Vollmer

Adrian Vollmer added the comment:

Okay, thanks for your time!

--

___
Python tracker 

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



[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

2017-09-13 Thread Christian Heimes

Christian Heimes added the comment:

Please report this issue to the Debian maintainers. I don't know how Debian has 
disabled TLS 1.0 and TLS 1.1 for the SSL_METHOD *TLS_method(void). It might not 
be possible to enable auto-negotiation for old protocols at all.

--

___
Python tracker 

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



[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

2017-09-13 Thread Adrian Vollmer

Adrian Vollmer added the comment:

Doesn't seem to do anything:

>>> ctx.options
2181170175L
>>> ctx.options & ~(ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1)
2181170175L

--

___
Python tracker 

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



[issue29639] test suite intentionally avoids referring to localhost, destroying abstraction away from IPv6 vs IPv4

2017-09-13 Thread Gregory P. Smith

Gregory P. Smith added the comment:

LOL. That is a very strange story and the last thing i'd have expected to fall 
out from changing one string to another. :)

--

___
Python tracker 

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



[issue29757] The loop in utility `socket.create_connection()` swallows previous errors

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:

I'm not excited to keep multiple exception objects alive because the 
Exception.__traceback__ causes many hairy reference cycle issues.

I just found an old bug in socket.create_connection():
https://github.com/python/cpython/pull/3546

See https://bugs.python.org/issue29639#msg302087 for my story of the bug.

--

___
Python tracker 

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



[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

2017-09-13 Thread Christian Heimes

Christian Heimes added the comment:

You have to enable the protocols by applying a reverse bitmask to 
SSLContext.options:

ctx = ssl.SSLContext(ssl.PROTOCOL_TLS)
ctx.load_cert_chain('server.pem')
ctx.options &= ~(ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1)

sslsock = ctx.wrap_socket(s, server_side=True)

--

___
Python tracker 

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



[issue29639] test suite intentionally avoids referring to localhost, destroying abstraction away from IPv6 vs IPv4

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:

I would like to share a short story with you.

I'm working on fixing *all* bugs on our 3 CI (buildbots, Travis CI, AppVeyor). 
I fixed almost all random test failures.

Right now, I'm trying to fix all "dangling thread" warnings: bpo-31234.

I was sure that I was done, but no, test_ssl failed on Travis CI and AppVeyor. 
Hum. The failure doesn't make sense. The code is perfectly fine. The thread is 
supposed to be gone for a long time, but not, it's still here for some reason.

After one day of debugging, I found that the thread is kept alive by a variable 
of a frame. The frame is kept alive from an traceback object of an Exception. 
The exception is ConnectionRefusedError. I continue to follow links, I see that 
the exception comes from socket.create_connection()... Interesting.

socket.create_connection() tries to be nice and keeps the last exception to 
re-raise it if no connection succeed.

The code seems correct: it stores the exception in the variable "err", and 
"return sock" is used to exit on succeed.

*But*.

It seems like the exception stored in "err" is part of a reference cycle, so 
indirectly, a lot of frames are kept alive because of this cycle.

So, I wanted to share this story with you because test_ssl only started to fail 
recently. The reason is that support.HOST was modified from "127.0.0.1" to 
"localhost". So if the name resolution first returns an IPv6 address, we may 
get the ConnectionRefusedError error, stored in "err", and then the connection 
succeed with IPv4... but you get the reference cycle mess.

Modifying support.HOST to "localhost" triggered a reference cycle!? Strange 
story.

I'm working on a quick fix: https://github.com/python/cpython/pull/3546

--
nosy: +haypo

___
Python tracker 

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



[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

2017-09-13 Thread Adrian Vollmer

Adrian Vollmer added the comment:

I read about that, but I don't understand. If I use openssl s_server -port  
 , I can connect using either one of the three protocols.

Even if that's the new default, is there no way now to get python on Buster/Sid 
to use OpenSSL in a non-default mode and have it offer all three versions?

--

___
Python tracker 

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



[issue31448] test_poplib started to log a lot of ResourceWarning warnings on AMD64 Windows8.1 Refleaks 3.x

2017-09-13 Thread STINNER Victor

Changes 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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3539

___
Python tracker 

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



[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

2017-09-13 Thread Christian Heimes

Christian Heimes added the comment:

Debian Buster has patched OpenSSL to disable TLS 1.0 and 1.1 by default, 
https://lists.debian.org/debian-devel-announce/2017/08/msg4.html

--

___
Python tracker 

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



[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

2017-09-13 Thread Adrian Vollmer

Adrian Vollmer added the comment:

Debian buster/sid

--

___
Python tracker 

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



[issue31454] Include "import as" in documentation

2017-09-13 Thread Steve Johnson

New submission from Steve Johnson:

I was wondering if you could do something like fiblib = import fibo or import 
fibo as fiblib, and low and behold, the "as" variant worked. I find this very 
useful, and thought it should be part of your documentation on "import"

--
assignee: docs@python
components: Documentation
messages: 302083
nosy: docs@python, svenyonson
priority: normal
severity: normal
status: open
title: Include "import as" in documentation
type: enhancement
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



[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

2017-09-13 Thread Adrian Vollmer

New submission from Adrian Vollmer:

According to the documentation 
(https://docs.python.org/2/library/ssl.html#ssl.PROTOCOL_TLS), using 
ssl_version = ssl.PROTOCOL_TLS in a server socket should offer all TLS/SSL 
versions. However, it only offers TLSv1_2.

I attached a proof of concept.


$ python3 poc.py
3.5.4 (default, Aug 12 2017, 14:08:14)
[GCC 7.1.0]
OpenSSL 1.1.0f  25 May 2017
[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:719)
[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:719)
b'test\n'

$ python2 poc.py
2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118]
OpenSSL 1.1.0f  25 May 2017
[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:661)
[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:661)
test


To connect with s_client:

 $ for i in {tls1,tls1_1,tls1_2} ; do echo test | openssl s_client -connect 
localhost: -CAfile server.pem -quiet -$i ; done
140164347663616:error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert 
protocol version:../ssl/record/rec_layer_s3.c:1399:SSL alert number 70
139926441944320:error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert 
protocol version:../ssl/record/rec_layer_s3.c:1399:SSL alert number 70
depth=0 C = AU, ST = Some-State, O = Internet Widgits Pty Ltd
verify return:1
read:errno=0

--
assignee: christian.heimes
components: SSL
files: poc.py
messages: 302081
nosy: adrianv, christian.heimes
priority: normal
severity: normal
status: open
title: ssl.PROTOCOL_TLS only select TLSv1.2
type: behavior
versions: Python 2.7, Python 3.5
Added file: https://bugs.python.org/file47139/poc.py

___
Python tracker 

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



[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

2017-09-13 Thread Alex Gaynor

Alex Gaynor added the comment:

What operating system are you on?

--
nosy: +Alex Gaynor

___
Python tracker 

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



[issue31438] IDLE 3 crashes and quits when caret character typed

2017-09-13 Thread ALPER PAKSOY

ALPER PAKSOY added the comment:

I downloaded and installed TCL 8.6.6.8606 and restarted my computer. I verified 
that the new version was installed. Unfortunately the problem has not been 
solved. Thank you.

Alper

--

___
Python tracker 

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



[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-13 Thread Andrew Lytvyn

New submission from Andrew Lytvyn:

If you do not await gather, then if one of gather inner coroutines fails, 
others keep working, but they should not.


```python
import asyncio
import logging

logging.basicConfig(level=logging.DEBUG)

loop = asyncio.get_event_loop()

async def success_coro(seconds):
await asyncio.sleep(seconds)
print(seconds)


async def failed_coro(seconds):
await asyncio.sleep(seconds)
print(seconds)
raise ZeroDivisionError

coros = [
success_coro(2),
failed_coro(3),
success_coro(5),
]

async def waiter():
await asyncio.gather(*coros)

asyncio.ensure_future(waiter())

loop.run_forever()
```
-
Console:
2
3
ERROR:asyncio:Task exception was never retrieved
future:  
exception=ZeroDivisionError()>
Traceback (most recent call last):
  File "tst.py", line 73, in waiter
await asyncio.gather(*coros)
  File "tst.py", line 64, in failed_coro
raise ZeroDivisionError
ZeroDivisionError
5
-

Expected behavior that 5 should not be printed.

--
components: asyncio
messages: 302079
nosy: Andrew Lytvyn, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.gather does not cancel tasks if one fails
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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:

test_ssl:

test_recv_zero (test.test_ssl.ThreadedTests) ...  server:  new connection from 
('127.0.0.1', 54502)
 server: connection cipher is now ('ECDHE-RSA-AES256-SHA', 'TLSv1/SSLv3', 256)
 server: selected protocol is now None
Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 
2)
Dangling thread: <_MainThread(MainThread, started 4757722688)>
Dangling thread: 
ok

test_socketserver (test.test_ssl.ThreadedTests)
(...)
stopping HTTPS server
joining HTTPS thread
Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 
2)
Dangling thread: 
Dangling thread: <_MainThread(MainThread, started 4757722688)>
ok

--

___
Python tracker 

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



[issue31451] PYTHONHOME is not absolutized

2017-09-13 Thread Xiang Zhang

New submission from Xiang Zhang:

I find that PYTHONHOME is not absolutized even after VM initialization. So 
sys.prefix will be "usr" if I execute `PYTHONHOME=usr python`.  This could lead 
to libraries like pip to fail if the current directory is changed, such as by 
`os.chdir`.

I am not sure this is a bug.  But I see PYTHONPATH is absolutized in site.py.  
Maybe PYTHONHOME should be too? Or it's by design.

--
messages: 302077
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: PYTHONHOME is not absolutized
type: 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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:


New changeset b157ce1e58b03988ce4340a55d0b856125833cc5 by Victor Stinner in 
branch 'master':
bpo-31234: Fix dangling thread in test_ftplib (#3544)
https://github.com/python/cpython/commit/b157ce1e58b03988ce4340a55d0b856125833cc5


--

___
Python tracker 

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



[issue31449] Potential DoS Attack when Parsing Email with Huge Number of MIME Parts

2017-09-13 Thread R. David Murray

R. David Murray added the comment:

10 million mime parts?  That sounds like the kind of thing rfc 1870 was 
designed to address in a more general fashion (ie: the SMTP server should be 
enforcing maximum message size if you are worried about DOS attacks).

1 million = 3 seconds, 10 million = "over three minutes" sounds like a linear 
increase, so I don't see that there is anything special about "mime parts" in 
this scenario.

I have no objection to PRs making the parsing more efficient, though :)

--
nosy: +christian.heimes

___
Python tracker 

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



[issue31447] proc communicate not exiting on python subprocess timeout using PIPES

2017-09-13 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue31443] Possibly out of date C extension documentation

2017-09-13 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

On Windows at least: I think "another C module" should be understood as 
"another DLL or executable".

A user extension module is a different DLL from the core Python, so the advice 
is still valid.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3538

___
Python tracker 

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



[issue31448] test_poplib started to log a lot of ResourceWarning warnings on AMD64 Windows8.1 Refleaks 3.x

2017-09-13 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 769ddb075ac3a840d473930a12a5b72bfbab366f by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31448, test_poplib: Fix ResourceWarning (GH-3542) (#3543)
https://github.com/python/cpython/commit/769ddb075ac3a840d473930a12a5b72bfbab366f


--

___
Python tracker 

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



[issue31441] Descriptor example in documentation is confusing, possibly wrong

2017-09-13 Thread R. David Murray

R. David Murray added the comment:

Here is a not-much-more-complicated version that solves the problem.  It is 
probably worth changing as the revised example makes clear the difference 
between self and obj, which is an important distinction.

class RevealAccess(object): 


   
"""A data descriptor that sets and returns values   


   
   normally and prints a message logging their access.  


   
""" 


   



   
def __init__(self, initval=None, name='var'):   


   
self.attrname = '_' + str(random.random())[2:]  



   
self.name = name


   
self.initval = initval  


   



   
def __get__(self, obj, objtype):


   
print('Retrieving', self.name)  


   
return getattr(obj, self.attrname, self.initval)


   



   
def __set__(self, obj, val):

   

  1   2   >