[issue31440] wrong default module search path in help message

2017-09-13 Thread Xiang Zhang
New submission from Xiang Zhang: In python --help: PYTHONHOME : alternate directory (or :). The default module search path uses /pythonX.X. I think the default module search path should be /lib/pythonX.X. -- keywords: easy messages: 302032 nosy: xiang.zhang priority:

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

2017-09-13 Thread Benjamin Wohlwend
New submission from Benjamin Wohlwend: The first descriptor example in the descriptor docs (https://docs.python.org/3/howto/descriptor.html#descriptor-example) stores the value on the descriptor instance, which is shared among all MyClass instances. This leads to surprising (and arguably buggy

[issue31233] socketserver.ThreadingMixIn leaks running threads after server_close()

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 97d7e65dfed1d42d40d9bc2f630af56240555f02 by Victor Stinner in branch 'master': bpo-30830: logging.config.listen() calls server_close() (#3524) https://github.com/python/cpython/commit/97d7e65dfed1d42d40d9bc2f630af56240555f02 --

[issue30830] test_logging leaks dangling threads on FreeBSD

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 97d7e65dfed1d42d40d9bc2f630af56240555f02 by Victor Stinner in branch 'master': bpo-30830: logging.config.listen() calls server_close() (#3524) https://github.com/python/cpython/commit/97d7e65dfed1d42d40d9bc2f630af56240555f02 --

[issue31442] assertion failures on Windows in Python/traceback.c in case of a bad io.open

2017-09-13 Thread Oren Milman
New submission from Oren Milman: the following code causes an assertion failure on my Windows: import io def _bad_open(*args): return 42 io.open = _bad_open 1/0 this is because _Py_DisplaySourceLine() (in Python/traceback.c) assumes that the return value of io.open() is valid. IIUC, this

[issue31233] socketserver.ThreadingMixIn leaks running threads after server_close()

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset b8f4163da30e16c7cd58fe04f4b17e38d53cd57e by Victor Stinner in branch 'master': bpo-31233: socketserver.ThreadingMixIn.server_close() (#3523) https://github.com/python/cpython/commit/b8f4163da30e16c7cd58fe04f4b17e38d53cd57e -- __

[issue31443] Possibly out of date C extension documentation

2017-09-13 Thread Romuald Brunet
New submission from Romuald Brunet: In the "Defining New Types documentation" basics about tp_new -> PyType_GenericNew, the doc states: > We’d like to just assign this to the tp_new slot, but we can’t, for > portability sake, On some platforms or compilers, we can’t statically > initialize a st

[issue31444] ResourceWarning in Python/traceback.c in case of a bad io.TextIOWrapper

2017-09-13 Thread Oren Milman
New submission from Oren Milman: the following code causes a ResourceWarning: import io def _bad_TextIOWrapper(*args): return None io.TextIOWrapper = _bad_TextIOWrapper 1/0 this is because _Py_DisplaySourceLine() (in Python/traceback.c) assumes that io.TextIOWrapper() returned a stream obj

[issue31444] ResourceWarning in Python/traceback.c in case of a bad io.TextIOWrapper

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: > this is because _Py_DisplaySourceLine() (in Python/traceback.c) assumes that > io.TextIOWrapper() returned a stream object, and tries to call its close() > method. in case calling close() fails, _Py_DisplaySourceLine() just calls > PyErr_Clear(). I conside

[issue30830] test_logging leaks dangling threads on FreeBSD

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: Ok, the main bugs have been fixed by the following socketserver fix. commit b8f4163da30e16c7cd58fe04f4b17e38d53cd57e Author: Victor Stinner Date: Wed Sep 13 01:47:22 2017 -0700 bpo-31233: socketserver.ThreadingMixIn.server_close() (#3523) socket

[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3530 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

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

2017-09-13 Thread Oren Milman
Oren Milman added the comment: what do you mean by 'Implicit converting to str can raise a warning or exception if __module__ is a bytes object.'? should we treat __module__ differently in case it is a bytes object? -- ___ Python tracker

[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +3531 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +3532 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue31445] Index out of range in get of message.EmailMessage.get()

2017-09-13 Thread Michala
New submission from Michala: This error occured when the email field "From" was demanded: File "/home/user/processing/Test/process_email.py", line 84, in __init__ self.field_from_full = msg.get("From") File "/usr/local/lib/python3.6/email/message.py", line 471, in get return self.pol

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

2017-09-13 Thread Roundup Robot
Changes by Roundup Robot : -- keywords: +patch pull_requests: +3533 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue31250] test_asyncio leaks dangling threads

2017-09-13 Thread STINNER Victor
Changes by STINNER Victor : -- versions: +Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

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

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: I don't think that Python 2.7 is affected since Exception has no __traceback__ attribute in Python 2.7. -- ___ Python tracker ___

[issue31446] _winapi.CreateProcess (used by subprocess) is not thread-safe

2017-09-13 Thread Evan Andrews
New submission from Evan Andrews: The method used for spawning subprocesses on Windows is not thread-safe under certain circumstances. The following example demonstrates how this manifests: >>> import threading >>> import subprocess >>> for i in range(100): ... threading.Thr

[issue31446] _winapi.CreateProcess (used by subprocess) is not thread-safe

2017-09-13 Thread STINNER Victor
Changes by STINNER Victor : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___ ___

[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: PyFile_WriteObject(moduleName, f, Py_PRINT_RAW) implicitly converts its argument to string. I mean that treating non-string moduleName the same way as string moduleName not equal to string "builtins" and calling PyFile_WriteObject() would cause other problem

[issue31446] _winapi.CreateProcess (used by subprocess) is not thread-safe

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: I remove Python 3.3-3.5 from Python versions since these versions don't accept bugfixes anymore, only security fixes: https://devguide.python.org/#status-of-python-branches -- nosy: +haypo versions: -Python 3.3, Python 3.4, Python 3.5

[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: I rebased PR 3138: 3 tests failed on Travis CI. test_ssl: Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 3) Dangling thread: Dangling thread: Dangling thread: <_MainThread(MainThread, started 47903383548928)> test_poplib: W

[issue31444] ResourceWarning in Python/traceback.c in case of a bad io.TextIOWrapper

2017-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it should be closed as "not a bug". If io.TextIOWrapper() is successful, it is responsible for property closing a binary file. The bug is in user code, not in the interpreter code. _Py_DisplaySourceLine() correctly calls binary.close() if io.TextIOWr

[issue31444] ResourceWarning in Python/traceback.c in case of a bad io.TextIOWrapper

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: Ok, thanks for the confirmation Serhiy. I close the bug. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

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

2017-09-13 Thread Leonardo Francalanci
New submission from Leonardo Francalanci: the script below (a python process is called, which calls a waitfor cmd with a timeout of 4 seconds) is supposed to end after 4 seconds. But instead proc.communicate stops after the 20 seconds timeout. Everything works 100% ok if I remove the stdin/std

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

2017-09-13 Thread Leonardo Francalanci
Changes by Leonardo Francalanci : -- components: +Interpreter Core type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mai

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: On my computer the speed up is 13% without LTO and PGO and around 20% with LTO and PGO. Building with LTO and PGO adds other 20%. -- ___ Python tracker

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

2017-09-13 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch pull_requests: +3534 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 42f7e0d8b0ca940a809a786f25d967dcce4d71b6 by Victor Stinner in branch '2.7': bpo-31234: fork_wait tests now join threads (#3139) (#3535) https://github.com/python/cpython/commit/42f7e0d8b0ca940a809a786f25d967dcce4d71b6 -- ___

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

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 1b00bddd5c4a5728b15eee5a27ed3f78a173ef64 by Victor Stinner (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31323: Fix reference leak in test_ssl (GH-3263) (#3538) https://github.com/python/cpython/commit/1b00bddd5c4a5728b15eee5a27ed3f78a173ef64

[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 6c25b73194714e78975eddea3799f06f3de74647 by Victor Stinner (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31234: test_httpservers joins the server thread (GH-3188) (#3536) https://github.com/python/cpython/commit/6c25b73194714e78975eddea3799f06

[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 89bfc9b0d9033f7c9f086c7281a31a489fe1136f by Victor Stinner (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31234: test_threaded_import: fix test_side_effect_import() (GH-3189) (#3537) https://github.com/python/cpython/commit/89bfc9b0d9033f7c9f0

[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3535 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

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

2017-09-13 Thread STINNER Victor
New submission from STINNER Victor: On AMD64 Windows8.1 Refleaks 3.x buildbot, test_poplib started to log a lot of ResourceWarning warnings since the build 101: http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.x/builds/101/ 2:30:30 [388/405/3] test_poplib passed (64 se

[issue31448] test_pop 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 : -- components: +Tests ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue31234] Make support.threading_cleanup() stricter

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset d403a29c0055de6b03ed5ae7a5c564e1c95a5950 by Victor Stinner in branch 'master': bpo-31234: Fix dangling thread in test_ftp/poplib (#3540) https://github.com/python/cpython/commit/d403a29c0055de6b03ed5ae7a5c564e1c95a5950 -- __

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

2017-09-13 Thread Eryk Sun
Eryk Sun added the comment: I don't see a bug here. The inner run() kills cmd.exe after 4 seconds. But the waitfor.exe process waits for 200 seconds and has handles for the pipes. The OS won't close out the pipes as long as there are potential writers, so the outer communicate() waits the full

[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 : -- title: test_pop started to log a lot of ResourceWarning warnings on AMD64 Windows8.1 Refleaks 3.x -> test_poplib started to log a lot of ResourceWarning warnings on AMD64 Windows8.1 Refleaks 3.x ___ Python tracker

[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 : -- keywords: +patch pull_requests: +3536 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

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

2017-09-13 Thread Christian Koßmann
New submission from Christian Koßmann: Python's email parser consumes a lot of resources (CPU and memory) when parsing emails with a large amount of MIME parts. Attackers can probably exploit this behavior to perform denial-of-service (DoS) attacks. A potentially malicious email has the follow

[issue31069] test_multiprocessing_spawn and test_multiprocessing_forkserver leak dangling processes

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: New test_multiprocessing_fork failure on AMD64 FreeBSD CURRENT Debug 3.x: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.x/builds/869/steps/test/logs/stdio (...) test_traceback (test.test_multiprocessing_fork.WithThreadsTestPool)

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

2017-09-13 Thread Leonardo Francalanci
Leonardo Francalanci added the comment: The called "C:\\Program Files (x86)\\Anaconda3\\Python.exe" process exits after 4 seconds. The reason why it ends shouldn't matter, right? I expect that a call to communicate should exit as soon as the called process is not running anymore. I don't hold

[issue31174] test_tools leaks randomly references on x86 Gentoo Refleaks 3.x

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: test_tools also fails on x86 Gentoo Refleaks 3.6: http://buildbot.python.org/all/builders/x86%20Gentoo%20Refleaks%203.6/builds/90 test_tools leaked [1, 1, 118] memory blocks, sum=120 (...) test_tools leaked [7, 1, 6] memory blocks, sum=14 -- _

[issue31450] Subprocess exceptions re-raised in parent process do not have child_traceback attribute

2017-09-13 Thread Michal Sekletar
New submission from Michal Sekletar: Issue - Documentation of subprocess module claims that exceptions raised in child process will be re-raised in the parent process and will have child_traceback attribute set [1]. At least on Fedora Rawhide with python-3.6.2 this is not the case. Repro

[issue31174] test_tools leaks randomly references on x86 Gentoo Refleaks 3.6 and 3.x

2017-09-13 Thread STINNER Victor
Changes by STINNER Victor : -- title: test_tools leaks randomly references on x86 Gentoo Refleaks 3.x -> test_tools leaks randomly references on x86 Gentoo Refleaks 3.6 and 3.x versions: +Python 3.6 ___ Python tracker

[issue31429] TLS cipher suite compile time option for downstream

2017-09-13 Thread Charalampos Stratakis
Changes by Charalampos Stratakis : -- nosy: +cstratak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue31450] Subprocess exceptions re-raised in parent process do not have child_traceback attribute

2017-09-13 Thread Charalampos Stratakis
Changes by Charalampos Stratakis : -- nosy: +cstratak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue30188] test_nntplib: random EOFError in setUpClass()

2017-09-13 Thread STINNER Victor
STINNER Victor added the comment: The SSL EOF error is still common, but in the test, not in setUpClass(). Example: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.x/builds/874/steps/test/logs/stdio ===

[issue31450] Subprocess exceptions re-raised in parent process do not have child_traceback attribute

2017-09-13 Thread Christian Heimes
Christian Heimes added the comment: Documentation and implementation are out of sync. Python 3's subprocess module no longer sets child_traceback. I checked 3.3 to master. The assignment has been removed. -- nosy: +christian.heimes, gregory.p.smith versions: +Python 3.7 __

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

2017-09-13 Thread Martin Panter
Martin Panter added the comment: I’m not familiar with Windows commands or processes enough, but going by Erik’s comment, this sounds similar to Issue 26534 and Issue 30154. Doesn’t your “waitfor” command inherit the same parent process’s stdout etc pipes? -- nosy: +martin.panter

[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 d165e14e29b45a22450263722f5c2c386c3a748a by Victor Stinner in branch 'master': bpo-31448, test_poplib: Fix ResourceWarning (#3542) https://github.com/python/cpython/commit/d165e14e29b45a22450263722f5c2c386c3a748a --

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

2017-09-13 Thread Leonardo Francalanci
Leonardo Francalanci added the comment: thank you for your replies! I used waitfor because it's the simplest and shortest way to have reproducible code. The issue I'm having is obviously not with waitfor, but with another exe, but this doesn't change the fact that I need a way to exit as soon

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

2017-09-13 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +3537 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue30566] punycode codec raises IndexError in decode_generalized_number()

2017-09-13 Thread Vikram Hegde
Vikram Hegde added the comment: Could someone please review my PR. It has been in the pending state for over three months. -- nosy: +vikhegde ___ Python tracker ___ ___

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

2017-09-13 Thread Leonardo Francalanci
Leonardo Francalanci added the comment: (forgot: Issue 26534 is about shell=True, I use shell=False, right?) -- ___ Python tracker ___ __

[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):

[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/769ddb075ac3a840d473930a12a5b72bfbab366

[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://ma

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

[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://

[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 = "ove

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

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

[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() fa

[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(seco

[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

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

[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. $ pyth

[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@pytho

[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:/

[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

[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://ma

[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 ___ __

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

[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

[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

[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.or

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

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

[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. -- _

[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

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

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

[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() A

[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 ___ __

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

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

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

[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

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

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

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

[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, "en

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

[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 ___ _

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

[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

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

[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) >>> coo

  1   2   >