From report at bugs.python.org Wed Nov 1 05:55:52 2017 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0LDRgiDQndCw0LPQsNC10LI=?=) Date: Wed, 01 Nov 2017 09:55:52 +0000 Subject: [New-bugs-announce] [issue31918] D Message-ID: <1509530152.12.0.213398074469.issue31918@psf.upfronthosting.co.za> Change by ????? ?????? : ---------- nosy: ????? ?????? priority: normal severity: normal status: open title: D type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 1 06:53:38 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 01 Nov 2017 10:53:38 +0000 Subject: [New-bugs-announce] [issue31919] Make curses compiling on OpenIndiana and tests passing Message-ID: <1509533618.0.0.213398074469.issue31919@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The proposed PR makes curses compiling on OpenIndiana (2017.04) and fixes tests. I suppose it fixes issues on Solaris too. ---------- assignee: serhiy.storchaka components: Extension Modules messages: 305368 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Make curses compiling on OpenIndiana and tests passing type: compile error versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 04:37:20 2017 From: report at bugs.python.org (Oleg Krasnikov) Date: Thu, 02 Nov 2017 08:37:20 +0000 Subject: [New-bugs-announce] [issue31920] pygettext ignores directories as inputfile argument Message-ID: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> New submission from Oleg Krasnikov : This happens because pygettext's `getFilesForName` calls `os.walk` as if it was `os.path.walk`. But the `walk` function has changed signature when moved from `os.path` to `os`. So now `_visit_pyfiles` is passed to `walk` as `topdown` argument which is obviously wrong and therefore `_visit_pyfiles` is never called. ---------- components: Demos and Tools messages: 305406 nosy: Oleg Krasnikov priority: normal severity: normal status: open title: pygettext ignores directories as inputfile argument type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 05:56:19 2017 From: report at bugs.python.org (pdox) Date: Thu, 02 Nov 2017 09:56:19 +0000 Subject: [New-bugs-announce] [issue31921] Bring together logic for entering/leaving a frame in frameobject.c Message-ID: <1509616579.32.0.213398074469.issue31921@psf.upfronthosting.co.za> New submission from pdox : This is a refactor to move all the code involved in entering a frame (making it the active frame for the current tstate) and leaving a frame (removing it as an active frame, possibly destructing it or making it GC tracked) into private functions in frameobject.c. The underlying goal of this change is to make it possible to add (as a performance feature) stack-allocated frames, in addition to the usual heap-allocated ones. ---------- components: Interpreter Core messages: 305408 nosy: pdox priority: normal severity: normal status: open title: Bring together logic for entering/leaving a frame in frameobject.c type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 06:51:16 2017 From: report at bugs.python.org (Vincent Michel) Date: Thu, 02 Nov 2017 10:51:16 +0000 Subject: [New-bugs-announce] [issue31922] Can't receive replies from multicast UDP with asyncio Message-ID: <1509619876.25.0.213398074469.issue31922@psf.upfronthosting.co.za> New submission from Vincent Michel : It's currently not possible to receive replies from multicast UDP with asyncio, as reported in the following issue: https://github.com/python/asyncio/issues/480 That's because asyncio connects the UDP socket to the broadcast address, causing all traffic from the receivers to be be dropped, as explained in this comment: https://github.com/python/asyncio/issues/480#issuecomment-278703828 I already submitted a PR on the cpython repository: https://github.com/python/cpython/pull/423 I figured it was better to report the issue here for better tracking. ---------- components: asyncio messages: 305415 nosy: vxgmichel, yselivanov priority: normal pull_requests: 4196 severity: normal status: open title: Can't receive replies from multicast UDP with asyncio type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 09:52:25 2017 From: report at bugs.python.org (Davy Wybiral) Date: Thu, 02 Nov 2017 13:52:25 +0000 Subject: [New-bugs-announce] [issue31923] Misspelled "loading" in Doc/includes/sqlite3/load_extension.py Message-ID: <1509630745.31.0.213398074469.issue31923@psf.upfronthosting.co.za> New submission from Davy Wybiral : Line #14 of Doc/includes/sqlite3/load_extension.py reads: # disable extension laoding again ---------- assignee: docs at python components: Documentation messages: 305423 nosy: davywtf, docs at python priority: normal severity: normal status: open title: Misspelled "loading" in Doc/includes/sqlite3/load_extension.py versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 10:01:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Nov 2017 14:01:32 +0000 Subject: [New-bugs-announce] [issue31924] Fix test_curses on NetBSD 8 Message-ID: <1509631292.16.0.213398074469.issue31924@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The NetBSD curses library in NetBSD 8 provides the panel extension. compatible with ncurses. But a panel can not be created from stdscr. This causes failing two tests in test_curses. These tests were added not long time ago, and there are not reasons to create panels from stdscr instead of other windows. Hence the proposed PR just makes these two tests creating panels from new windows, as in other two tests. ---------- assignee: serhiy.storchaka components: Tests messages: 305424 nosy: serhiy.storchaka, twouters priority: normal severity: normal status: open title: Fix test_curses on NetBSD 8 type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 10:16:30 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Nov 2017 14:16:30 +0000 Subject: [New-bugs-announce] [issue31925] test_socket creates too much locks Message-ID: <1509632190.98.0.213398074469.issue31925@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : test_socket creates a lock in the constructor of ThreadSafeCleanupTestCase. But since unittest creates an instance of test class for every test method, it creates around 400 locks. This exceeds the limit of 200 locks in NetBSD 8 and causes a failure. 0:00:00 load avg: 0.00 [1/1] test_socket sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 Traceback (most recent call last): File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/runtest.py", line 176, in runtest_inner sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/test_socket.py", line 5801, in test_main sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/support/__init__.py", line 1934, in run_unittest sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/unittest/loader.py", line 503, in makeSuite sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/unittest/loader.py", line 92, in loadTestsFromTestCase sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/unittest/suite.py", line 24, in __init__ sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/unittest/suite.py", line 57, in addTests sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/test_socket.py", line 544, in __init__ sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/test_socket.py", line 144, in __init__ sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/threading.py", line 86, in RLock sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 RuntimeError: can't allocate lock During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/serhiy/py/cpython3.7/Lib/runpy.py", line 193, in _run_module_as_main sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/runpy.py", line 85, in _run_code sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/__main__.py", line 2, in sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 585, in main sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 510, in main sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 536, in _main sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 458, in run_tests sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/main.py", line 379, in run_tests_sequential sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/runtest.py", line 140, in runtest sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/test/libregrtest/runtest.py", line 200, in runtest_inner sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 163, in format_exc sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 117, in format_exception sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 496, in __init__ sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 357, in extract sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/traceback.py", line 281, in line sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/linecache.py", line 16, in getline sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/linecache.py", line 47, in getlines sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/linecache.py", line 136, in updatecache sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 File "/home/serhiy/py/cpython3.7/Lib/tokenize.py", line 447, in open sem_init: Unknown error: 4294967295 sem_init: Unknown error: 4294967295 RuntimeError: can't allocate read lock ---------- components: Tests messages: 305425 nosy: ezio.melotti, michael.foord, rbcollins, serhiy.storchaka priority: normal severity: normal status: open title: test_socket creates too much locks type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 11:13:55 2017 From: report at bugs.python.org (Tal Einat) Date: Thu, 02 Nov 2017 15:13:55 +0000 Subject: [New-bugs-announce] [issue31926] compile error when converting selectmodule to AC due to missing #define-s Message-ID: <1509635635.43.0.213398074469.issue31926@psf.upfronthosting.co.za> New submission from Tal Einat : I'm converting Modules/selectmodule.c.h as part of issue #20182. After converting the code and running Tools/clinic/clinic.py, compilation is failing on Windows due to the following block *not* being generated by in the Modules/clinic/selectmodule.c.h file: #ifndef SELECT_POLL_METHODDEF #define SELECT_POLL_METHODDEF #endif /* !defined(SELECT_POLL_METHODDEF) */ Adding the block manually fixes the issue. This seems to be caused by a bug in clinic.py. Attaching PR fix a fix immediately. ---------- components: Argument Clinic messages: 305427 nosy: larry, taleinat priority: normal severity: normal status: open title: compile error when converting selectmodule to AC due to missing #define-s type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 12:15:22 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 02 Nov 2017 16:15:22 +0000 Subject: [New-bugs-announce] [issue31927] Fix compiling the socket module on NetBSD 8 and other issues Message-ID: <1509639322.53.0.213398074469.issue31927@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : NetBSD 8 adds support of AF_CAN (previously it was supported only on Linux). This causes a compilation error in socketmodule.c, because AF_CAN is defined in sys/socket.h, but sys/socket.h itself doesn't contain all necessary definitions for handling AF_CAN addresses. This also exposed other errors. The braces are not balanced if AF_CAN is defined, but CAN_RAW and CAN_BCM are not. PyBytes_AS_STRING() is called for non-bytes. The proposed patch balances #ifdef/#endif with braces, undefines AF_CAN if it is not usable (following the practice for other AF_* constants), separates support of CAN_RAW and CAN_BCM (only the former is defined on NetBSD 8), adds comments to #endif for helping with navigation, adds the const qualifier to char pointers that always point to constant data, fixes indentation. This fixed a compilation on NetBSD 8, and I hope this will fix a compilation on other platforms that will add AF_CAN. In a separate issue I'll add a support of AF_CAN on NetBSD (in 3.7 only). ---------- assignee: serhiy.storchaka components: Extension Modules messages: 305439 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Fix compiling the socket module on NetBSD 8 and other issues type: compile error versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 15:21:45 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 02 Nov 2017 19:21:45 +0000 Subject: [New-bugs-announce] [issue31928] DOC: Show sys.version_info as a named tuple Message-ID: <1509650505.83.0.213398074469.issue31928@psf.upfronthosting.co.za> New submission from Cheryl Sabella : Invoking sys.version_info displays results as a named tuple, but the documentation shows the results as a tuple. ---------- assignee: docs at python components: Documentation messages: 305446 nosy: csabella, docs at python priority: normal severity: normal status: open title: DOC: Show sys.version_info as a named tuple versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 17:27:46 2017 From: report at bugs.python.org (Barry) Date: Thu, 02 Nov 2017 21:27:46 +0000 Subject: [New-bugs-announce] [issue31929] Raw strings create syntax error when last character is a single backslash Message-ID: <1509658066.58.0.213398074469.issue31929@psf.upfronthosting.co.za> New submission from Barry : Raw strings create syntax error when last character is a backslash (\). This problem seems to exist across all versions of python (that I have access to) Sample Code: ------------------------------------------------------------- Under Windows Python 2.7.3 Works Correctly: >>> test = r'C:\Program Files\^%(x86)\Internet Explorer\iexplore.exe' >>> print test C:\Program Files\^%(x86)\Internet Explorer\iexplore.exe Fails because last character is backslash >>> test = r'C:\Program Files\^%(x86)\Internet Explorer\' SyntaxError: EOL while scanning string literal ------------------------------------------------------------- Under Linux Python 2.7.12 Works Correctly >>> j=r"\n" >>> print j \n Fails because last character is backslash >>> j=r"n\" SyntaxError: EOL while scanning string literal Works correctly: >>> j=r"n\n" >>> print j n\n Works correctly: >>> j=r"n\\" >>> print j n\\ ------------------------------------------------------------- Under Linux Python 3.5.2 Fails because last character is backslash >>> j=r"\' File "", line 1 j=r"\' ^ SyntaxError: EOL while scanning string literal ------------------------------------------------------------- ---------- components: Interpreter Core messages: 305448 nosy: mezzzmer priority: normal severity: normal status: open title: Raw strings create syntax error when last character is a single backslash type: compile error versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 2 18:09:41 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 02 Nov 2017 22:09:41 +0000 Subject: [New-bugs-announce] [issue31930] IDLE: Pressing "Home" on Windows places cursor before ">>>" Message-ID: <1509660581.35.0.213398074469.issue31930@psf.upfronthosting.co.za> New submission from Terry J. Reedy : If one enters text in Shell after a '>>> ' prompt, Home should initially send the cursor between the prompt and entered text and then to the beginning of the line, and so on as a toggle. On all current releases (and the final 3.5.4), on my Win10 machine, the cursor goes to the beginning of the line and stays there. This is nearly the same as #3851, which patched EditorWindow.home_callback on 2011-3-21 and -25. The problem then only affected Windows, because it involved event.state for keypresses, which is set differently on Windows and *nix. This issue is slightly different in that the Numlock key no longer matters. (See KBK's 2009-04-04 02:51 message.) Cherl or Louie, is this one also Windows-only or does it occur on Linux? According to hg annotate, the only subsequent patch to .home_callback before the git switch was 2012-12-24 for #16511. It changed the part of the function that adjusted selection, after moving the cursor, if Shift-Home was pressed. When the cursor moves to the beginning of the line, the selection includes the prompt. 3.5 has not been patched since the switch to git, so the problem must predate the switch. 2.7 on Windows runs with tk 8.5.15, so a later tk change cannot be the problem. So I suspect that the 'culprit' is either an earlier 'fix' to tk or a patch to tkinter since 2011, combined with the absence of a test in IDLE for correct behavior. Serhiy, do you have any ideas? ---------- assignee: terry.reedy components: IDLE messages: 305452 nosy: csabella, louielu, serhiy.storchaka, terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: Pressing "Home" on Windows places cursor before ">>>" type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 06:14:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 10:14:38 +0000 Subject: [New-bugs-announce] [issue31931] test_concurrent_futures: ProcessPoolSpawnExecutorTest.test_shutdown_race_issue12456() leaked dangling process on x86 Tiger 3.x Message-ID: <1509704078.7.0.213398074469.issue31931@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/30/builds/109/steps/4/logs/stdio 0:24:58 load avg: 2.01 [274/407/1] test_concurrent_futures failed (env changed) (279 sec) (...) test_shutdown_race_issue12456 (test.test_concurrent_futures.ProcessPoolSpawnExecutorTest) ... 7.42s Warning -- reap_children() reaped child process 3411 ok (...) Warning -- multiprocessing.process._dangling was modified by test_concurrent_futures Before: <_weakrefset.WeakSet object at 0x269fd54> After: <_weakrefset.WeakSet object at 0x26a64cc> ---------- components: Tests keywords: buildbot messages: 305468 nosy: haypo priority: normal severity: normal status: open title: test_concurrent_futures: ProcessPoolSpawnExecutorTest.test_shutdown_race_issue12456() leaked dangling process on x86 Tiger 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 06:44:13 2017 From: report at bugs.python.org (Hugh Fisher) Date: Fri, 03 Nov 2017 10:44:13 +0000 Subject: [New-bugs-announce] [issue31932] setup.py cannot find vcversall.bat on MSWin 8.1 if installed in user AppData Message-ID: <1509705853.38.0.213398074469.issue31932@psf.upfronthosting.co.za> New submission from Hugh Fisher : This was raised in issue #23246 but apparently not addressed at the time. The Visual C for Python 2.7 tools on my MS Windows 8.1 system installed themselves under the invisible AppData directory because I did not do so as Administrator. Running setup.py to build a (2.7) native extension then fails because it can't find VCVERSALL.BAT. Fix is a couple of extra lines in find_vcvarsall in msvc9compiler.py to search under AppData if it can't be found in the system location. I will submit a pull request. ---------- components: Distutils messages: 305470 nosy: dstufft, eric.araujo, laranzu priority: normal severity: normal status: open title: setup.py cannot find vcversall.bat on MSWin 8.1 if installed in user AppData type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 08:27:26 2017 From: report at bugs.python.org (Jack O'Connor) Date: Fri, 03 Nov 2017 12:27:26 +0000 Subject: [New-bugs-announce] [issue31933] some Blake2 parameters are encoded backwards on big-endian platforms Message-ID: <1509712046.35.0.213398074469.issue31933@psf.upfronthosting.co.za> New submission from Jack O'Connor : See https://github.com/BLAKE2/libb2/issues/12. All Blake2 params have to be encoded in little-endian byte order. For the two multi-byte integer params, leaf_length and node_offset, that means that assigning a native-endian integer to them appears to work on little-endian platforms, but gives the wrong result on big-endian. The current libb2 API doesn't make that very clear, and @sneves is working on new API functions in the GH issue above. In the meantime, we can work around the problem by explicitly assigning little-endian values to the parameter block. ---------- messages: 305473 nosy: oconnor663 priority: normal severity: normal status: open title: some Blake2 parameters are encoded backwards on big-endian platforms type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 10:10:57 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 03 Nov 2017 14:10:57 +0000 Subject: [New-bugs-announce] [issue31934] Failure to build out of source from a not clean source Message-ID: <1509718257.97.0.213398074469.issue31934@psf.upfronthosting.co.za> New submission from Xavier de Gaye : The error message when building out of a not clean source tree: renaming build/scripts-3.7/2to3 to build/scripts-3.7/2to3-3.7 renaming build/scripts-3.7/pyvenv to build/scripts-3.7/pyvenv-3.7 gcc -pthread -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o libpython3.7m.a -lpthread -ldl -lutil -lm gcc: error: Programs/_testembed.o: No such file or directory make[1]: *** [Makefile:707: Programs/_testembed] Error 1 ---------- components: Build messages: 305486 nosy: xdegaye priority: normal severity: normal status: open title: Failure to build out of source from a not clean source type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 11:01:32 2017 From: report at bugs.python.org (Martin Ritter) Date: Fri, 03 Nov 2017 15:01:32 +0000 Subject: [New-bugs-announce] [issue31935] subprocess.run() timeout not working with grandchildren and stdout=PIPE Message-ID: <1509721292.04.0.213398074469.issue31935@psf.upfronthosting.co.za> New submission from Martin Ritter : Hi, I tried to use subprocess.run(..., stdout=subprocess.PIPE, timeout=N) to run some test scripts with a given timeout. This works as expected with simple scripts. However if the script itself creates other children which write to stdout then `subprocess.run()` seems to wait for all of the children to finish. I've attached a minimal example. I looked into subprocess.py and `subprocess.run()` calls `process.communicate()` again without timeout when handling the TimeoutExpired exception which then in turn waits for the pipes to be closed by all children. If communicate() would check if the process is still alive while waiting for output and close the pipes once the process has finished the timeout feature should work as expected and descendants would get a SIGPIPE when writing to stdout/stderr. ---------- components: Library (Lib) files: test_killsub.py messages: 305487 nosy: Martin Ritter priority: normal severity: normal status: open title: subprocess.run() timeout not working with grandchildren and stdout=PIPE type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47251/test_killsub.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 13:19:46 2017 From: report at bugs.python.org (Daniel U. Thibault) Date: Fri, 03 Nov 2017 17:19:46 +0000 Subject: [New-bugs-announce] [issue31936] "5. The import system" grammatical error Message-ID: <1509729586.08.0.213398074469.issue31936@psf.upfronthosting.co.za> New submission from Daniel U. Thibault : https://docs.python.org/3/reference/import.html#importsystem "Other mechanisms for invoking the import system (such as importlib.import_module()) may choose to subvert __import__() and use its own solution to implement import semantics." should be "Other mechanisms for invoking the import system (such as importlib.import_module()) may choose to subvert __import__() and use their own solution to implement import semantics." ---------- assignee: docs at python components: Documentation messages: 305489 nosy: Daniel.U..Thibault, docs at python priority: normal severity: normal status: open title: "5. The import system" grammatical error type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 16:57:49 2017 From: report at bugs.python.org (Brett Cannon) Date: Fri, 03 Nov 2017 20:57:49 +0000 Subject: [New-bugs-announce] [issue31937] Add the term "dunder" to the glossary Message-ID: <1509742669.66.0.213398074469.issue31937@psf.upfronthosting.co.za> New submission from Brett Cannon : The term "dunder" is used out in the community regularly, but if you have never been exposed to it before it can seem a little odd without context. ---------- assignee: docs at python components: Documentation messages: 305509 nosy: brett.cannon, docs at python priority: normal severity: normal status: open title: Add the term "dunder" to the glossary _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 17:20:30 2017 From: report at bugs.python.org (Tal Einat) Date: Fri, 03 Nov 2017 21:20:30 +0000 Subject: [New-bugs-announce] [issue31938] Convert selectmodule.c to Argument Clinic Message-ID: <1509744030.41.0.213398074469.issue31938@psf.upfronthosting.co.za> New submission from Tal Einat : Continuing the work begun as part of issue #20182, this is regarding the Argument Clinic conversion of Modules/selectmodule.c.h. I have a complete conversion ready and will create a PR momentarily. ---------- components: Argument Clinic messages: 305514 nosy: haypo, larry, serhiy.storchaka, taleinat priority: normal severity: normal status: open title: Convert selectmodule.c to Argument Clinic type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 19:31:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 03 Nov 2017 23:31:32 +0000 Subject: [New-bugs-announce] [issue31939] Support return annotation in signature for Argument Clinic Message-ID: <1509751892.64.0.213398074469.issue31939@psf.upfronthosting.co.za> New submission from STINNER Victor : Argument Clinic supports a few return types like NoneType, int, bool, etc. But the return type is omitted in the private docstring used to build the __text_signature__, finally used to build a Signature object in inspect.signature(). For example, os.dup() is declared in Modules/posixmodule.c with: /*[clinic input] os.dup -> int fd: int / Return a duplicate of a file descriptor. [clinic start generated code]*/ Currently, Argument Clinic generates: PyDoc_STRVAR(os_dup__doc__, "dup($module, fd, /)\n" "--\n" "\n" "Return a duplicate of a file descriptor."); The return type is omitted in the first line. Finally, the return type is not documented in the signature: haypo at selma$ ./python -c "import os,inspect; print(inspect.signature(os.dup))" (fd, /) I noticed this limitation while reviewing the PR 4265 which converts the select module to Argument Clinic. Previously, the return type like "-> None" or "-> int" was documented. With Argument Clinic, it's not documented nor generated in the signature, the information is lost. ---------- messages: 305525 nosy: brett.cannon, haypo, larry, ncoghlan, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Support return annotation in signature for Argument Clinic type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 19:51:13 2017 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 03 Nov 2017 23:51:13 +0000 Subject: [New-bugs-announce] [issue31940] copystat on symlinks fails for alpine -- faulty lchmod implementation? Message-ID: <1509753073.77.0.213398074469.issue31940@psf.upfronthosting.co.za> New submission from Anthony Sottile : Fortunately, this can be reproduced with the testsuite: ``` ====================================================================== ERROR: test_copystat_symlinks (__main__.TestShutil) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python3.6/test/test_shutil.py", line 366, in test_copystat_symlinks os.lchmod(src_link, stat.S_IRWXO) OSError: [Errno 95] Not supported: '/tmp/tmplfli9msi/baz' ``` My simplest reproduction involves docker: ```dockerfile FROM alpine RUN apk update && apk add curl python3 RUN mkdir foo && ln -s /dev/null foo/bar CMD [ \ "python3", "-c", \ "import shutil; shutil.copytree('foo', 'bar', symlinks=True)" \ ] ``` ``` Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/shutil.py", line 359, in copytree raise Error(errors) shutil.Error: [('foo/bar', 'bar/bar', "[Errno 95] Not supported: 'bar/bar'")] ``` By looking at pyconfig, I get the following: ``` / # grep -E '(HAVE_FCHMODAT|HAVE_LCHMOD)' /usr/include/python3.6m/pyconfig.h #define HAVE_FCHMODAT 1 #define HAVE_LCHMOD 1 ``` But it seems lchmod is actually nonfunctional in this case. I think the fix is to augment `configure` to detect faulty `lchmod` and not set `HAVE_LCHMOD`? I'm not terribly familiar with the autotools pipeline but that's where I'm going to take a stab at it! I'm originally finding this issue via https://github.com/pre-commit/pre-commit/issues/655 ---------- components: Build, Library (Lib), Tests messages: 305527 nosy: Anthony Sottile priority: normal severity: normal status: open title: copystat on symlinks fails for alpine -- faulty lchmod implementation? versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 3 22:26:04 2017 From: report at bugs.python.org (xoviat) Date: Sat, 04 Nov 2017 02:26:04 +0000 Subject: [New-bugs-announce] [issue31941] ImportError: DLL Load Failure: The specified module cannot be found Message-ID: <1509762364.94.0.213398074469.issue31941@psf.upfronthosting.co.za> New submission from xoviat : Yes, I know that this isn't Python's fault. I know how to resolve the problem. But what's frustrating is that this error message is totally unhelpful, because it doesn't contain the DLL that Python is looking for. Yes, I know that the error message is just directly from windows. But there has to be some way to make this error message more helpful. There has to be some way to tell the user what the name of the DLL is. Because the current state of this error message is sad. ---------- messages: 305531 nosy: xoviat priority: normal severity: normal status: open title: ImportError: DLL Load Failure: The specified module cannot be found type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 05:10:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 04 Nov 2017 09:10:01 +0000 Subject: [New-bugs-announce] [issue31942] Document that support of start and stop parameters in the Sequence's index() is optional Message-ID: <1509786601.53.0.213398074469.issue31942@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Parameters start and stop were added to the Sequence.index() mixin method in 3.5 (see issue23086). But not all concrete implementations of the Sequence ABC support them (for example range.index() doesn't, see issue28197). This should be explicitly documented (including the docstring of Sequence.index). ---------- assignee: docs at python components: Documentation keywords: easy messages: 305547 nosy: docs at python, rhettinger, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Document that support of start and stop parameters in the Sequence's index() is optional type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 12:27:05 2017 From: report at bugs.python.org (Marat Sharafutdinov) Date: Sat, 04 Nov 2017 16:27:05 +0000 Subject: [New-bugs-announce] [issue31943] Add asyncio.Handle.cancelled() and asyncio.TimerHandle.when Message-ID: <1509812825.97.0.213398074469.issue31943@psf.upfronthosting.co.za> New submission from Marat Sharafutdinov : It would be handy to access the loop's time the Handle's callback will be called at if you are using delayed calls with "delay" (not "when") argument. Also it is useful to know whether the call was cancelled through the special attribute. ---------- assignee: docs at python components: Documentation, Library (Lib), asyncio messages: 305561 nosy: decaz, docs at python, yselivanov priority: normal pull_requests: 4238 severity: normal status: open title: Add asyncio.Handle.cancelled() and asyncio.TimerHandle.when type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 18:21:07 2017 From: report at bugs.python.org (Steve Dower) Date: Sat, 04 Nov 2017 22:21:07 +0000 Subject: [New-bugs-announce] [issue31944] Windows Apps and Features items only have "Uninstall" Message-ID: <1509834067.47.0.213398074469.issue31944@psf.upfronthosting.co.za> New submission from Steve Dower : The installed item entries on Windows (since some recent update, I believe) only display "Uninstall" and do not let you select "Modify". This is because we enabled the setting that used to display "Uninstall/Modify" as a single button. Clicking the Uninstall button (and confirming it) lets you modify or repair. We should just enable both buttons so it isn't so scary to repair/modify an install. ---------- assignee: steve.dower components: Windows messages: 305570 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Windows Apps and Features items only have "Uninstall" type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 18:32:30 2017 From: report at bugs.python.org (Nir Soffer) Date: Sat, 04 Nov 2017 22:32:30 +0000 Subject: [New-bugs-announce] [issue31945] Configurable blocksize in HTTP(S)Connection Message-ID: <1509834750.61.0.213398074469.issue31945@psf.upfronthosting.co.za> New submission from Nir Soffer : blocksize is hardcoded to 8192 in send() and _read_readable(), preventing efficient upload when using file-like body. Users of the module that are not interested in chunked encoding can rewrite the copy loop using HTTPConnection.send(): conn = HTTPSConnection(...) conn.putrequest(...) conn.putheader(...) conn.endheaders() while True: chunk = file.read(512*1024) if not chunk: break conn.send(chunk) But fixing send() to use a configurable blocksize seems more useful. Also, users of requests do not have access the underlying connection, so they cannot use preferred buffer size. When reading from /dev/zero and uploading to server that drop the received data, larger buffer size gives 3X more throughput *and* 1/3 of cpu time. With real storage and network, the effect will probably be much smaller. ---------- components: Library (Lib) messages: 305571 nosy: brett.cannon, haypo, nirs, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Configurable blocksize in HTTP(S)Connection versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 4 18:55:29 2017 From: report at bugs.python.org (Shai Berger) Date: Sat, 04 Nov 2017 22:55:29 +0000 Subject: [New-bugs-announce] [issue31946] mailbox.MH.add loses status info from other formats Message-ID: <1509836129.85.0.213398074469.issue31946@psf.upfronthosting.co.za> New submission from Shai Berger : In mailbox.py in the stdlib, the functions MH.add and MH.__setitem__ take a message object and dump it to a file in the MH folder, which is good and well. However, they only call self._dump_sequences() if the message was already an MHMessage. Since in the MH format, status details (whether the message was read, replied or flagged) are saved in these sequences, this effectively loses this information. This means that, if "folder" is an MH folder and "message" is a message of any class other than MHMessage, folder.add(message) loses the information, while folder.add(MHMEssage(message)) retains it. This seems surprising and suboptimal. ---------- components: Library (Lib), email messages: 305572 nosy: barry, r.david.murray, shai priority: normal severity: normal status: open title: mailbox.MH.add loses status info from other formats type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 06:21:06 2017 From: report at bugs.python.org (Paul) Date: Sun, 05 Nov 2017 11:21:06 +0000 Subject: [New-bugs-announce] [issue31947] names=None case is not handled by EnumMeta._create_ method Message-ID: <1509880866.58.0.213398074469.issue31947@psf.upfronthosting.co.za> New submission from Paul : It seems to me that this method should not have names=None default value in signature, because that case is not handled, nor is it described as a possible value in the docstring. Seems like maybe a copy and paste from __call__, which has basically same signature, but names=None is valid and handled there. ---------- messages: 305591 nosy: anentropic priority: normal pull_requests: 4251 severity: normal status: open title: names=None case is not handled by EnumMeta._create_ method type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 06:49:27 2017 From: report at bugs.python.org (Berker Peksag) Date: Sun, 05 Nov 2017 11:49:27 +0000 Subject: [New-bugs-announce] [issue31948] Broken MSDN links in msilib docs Message-ID: <1509882567.57.0.213398074469.issue31948@psf.upfronthosting.co.za> New submission from Berker Peksag : Most of the MSDN links in Doc/library/msilib.rst are broken: https://docs.python.org/3/library/msilib.html For example, the UuidToString link goes to https://msdn.microsoft.com/library?url=/library/en-us/rpc/rpc/uuidtostring.asp But I believe the correct link should be https://msdn.microsoft.com/en-us/library/windows/desktop/aa379352(v=vs.85).aspx ---------- assignee: docs at python components: Documentation keywords: easy messages: 305593 nosy: berker.peksag, docs at python priority: normal severity: normal stage: needs patch status: open title: Broken MSDN links in msilib docs type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 09:06:35 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 05 Nov 2017 14:06:35 +0000 Subject: [New-bugs-announce] [issue31949] Bugs in PyTraceBack_Print() Message-ID: <1509890795.04.0.213398074469.issue31949@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : 0fbab7ff8d2efd92e222fcc13c0aff0998c3c158 changed the semantic of PyTraceBack_Print and sys.tracebacklimit. It no longer match the documentation and the behavior of the traceback module. Setting sys.tracebacklimit to 0 or less no longer suppress printing tracebacks in PyTraceBack_Print(). Setting sys.tracebacklimit to None (as at shutdown stage) no longer makes PyTraceBack_Print() using default limit, but suppress printing tracebacks and sets a TypeError without returning failure from PyTraceBack_Print(). The proposed PR restores the initial purposed semantic and fixes several other bugs in PyTraceBack_Print(). * Setting sys.tracebacklimit to 0 or less now suppress printing tracebacks. * Setting sys.tracebacklimit to None now causes using the default limit. * Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using the limit LONG_MAX rather than the default limit. * Fixed integer overflows in the case of more than 2**31 items on Windows. * Fixed output errors handling. ---------- assignee: serhiy.storchaka components: Interpreter Core messages: 305595 nosy: christian.heimes, serhiy.storchaka priority: normal severity: normal status: open title: Bugs in PyTraceBack_Print() type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 13:16:09 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 05 Nov 2017 18:16:09 +0000 Subject: [New-bugs-announce] [issue31950] Default event loop policy doc lacks precision Message-ID: <1509905769.74.0.213398074469.issue31950@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The doc for the default event loop policy states that """the default policy defines context as the current thread, and manages an event loop per thread that interacts with asyncio""". What it doesn't mention, though, is that you get a RuntimeError if you call get_event_loop() in a non-main thread -- you first have to call set_event_loop(new_event_loop()) in that thread. This wasn't expected by me. As a side note, customizing the event loop policy isn't trivial either: it seems it's best to subclass DefaultEventLoopPolicy and make adjustments by overriding the API methods. Writing your own wouldn't work, as e.g. the Unix default policy has custom initialization code for child watchers. ---------- assignee: docs at python components: Documentation, asyncio messages: 305607 nosy: docs at python, giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov priority: normal severity: normal status: open title: Default event loop policy doc lacks precision type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 17:55:53 2017 From: report at bugs.python.org (joe m) Date: Sun, 05 Nov 2017 22:55:53 +0000 Subject: [New-bugs-announce] [issue31951] import curses is broken on windows Message-ID: <1509922553.69.0.213398074469.issue31951@psf.upfronthosting.co.za> New submission from joe m : Importing curses on Windows install calls the following: Traceback (most recent call last): File "", line 1, in File "C:\Users\user name\AppData\Local\Programs\Python\Python36-32\lib\curses\__init__.py", line 13, in from _curses import * ModuleNotFoundError: No module named '_curses' Importing curses as "_curses" does the same thing. I have tried the "repair" function and it has not worked. ---------- components: Windows messages: 305610 nosy: joe m2, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: import curses is broken on windows versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 21:26:35 2017 From: report at bugs.python.org (Lucas Bertoldo) Date: Mon, 06 Nov 2017 02:26:35 +0000 Subject: [New-bugs-announce] [issue31952] Weird behavior on tupple item assignment Message-ID: <1509935195.34.0.213398074469.issue31952@psf.upfronthosting.co.za> New submission from Lucas Bertoldo : Basically, I typed: >>> m = (list(), list()) then I got, this, as expected: >>> m[0] += [1] Traceback (most recent call last): File "", line 1, in m[0] += [1] TypeError: 'tuple' object does not support item assignment but, when I checked the variable... >>> m ([1], []) --------------------------------- Saying the least, one can kind of assing a value to a tuple of lists and get the expected result, but with the trackback still showing up. ---------- components: Interpreter Core files: python bug.png messages: 305613 nosy: Lucas Bertoldo priority: normal severity: normal status: open title: Weird behavior on tupple item assignment type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47252/python bug.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 5 21:26:50 2017 From: report at bugs.python.org (Jean-Philippe Ouellet) Date: Mon, 06 Nov 2017 02:26:50 +0000 Subject: [New-bugs-announce] [issue31953] Dedicated place for security announcements? Message-ID: <1509935210.34.0.213398074469.issue31953@psf.upfronthosting.co.za> New submission from Jean-Philippe Ouellet : Hello, My apologies if this is not the right place to discus this. I would like to ensure that I stay informed of any potential future security issues in python (specifically at least the cpython runtime and standard library, although select very-popular 3rd party libraries wouldn't hurt). I cannot find a single place where such announcements are guaranteed to land. Good examples of the type of thing I am looking for are the openssl-announce list [1][2] and the golang-announce list [3], where the projects pre-announce "Hey, we're going to have a release on which addresses a security issue in ." and then announces again when patches are available such that responsible maintainers (such as I am trying to be) can ensure that updates are available to our users ASAP. The python-announce-list [4] does not serve this purpose because it has lots of noise from initial release announcements about random 3rd party stuff, and the "security news" page [5] is really just a "how to disclose vulns" page. Note that I'm *not* advocating for the creation of a pre-disclosure list! Python is such a ubiquitous piece of software that I don't think it's reasonable to expect that such a list could contain all affected parties without also leaking details to those who would cause harm. I'm only asking for something public that I can subscribe to in order to be sure I'll have a heads up of when patching is imminently required. Regards, Jean-Philippe (a contributor to the Qubes OS project [6] whose security relies mostly on Python's and Xen's - and is on Xen's pre-disclosure list) [1]: https://mta.openssl.org/pipermail/openssl-announce/2017-October/thread.html [2]: https://mta.openssl.org/pipermail/openssl-announce/2017-November/thread.html [3]: https://groups.google.com/forum/#!forum/golang-announce [4]: https://mail.python.org/mailman/listinfo/python-announce-list [5]: https://www.python.org/news/security/ [6]: https://www.qubes-os.org/ ---------- assignee: docs at python components: Documentation, email messages: 305614 nosy: barry, docs at python, jpo, r.david.murray priority: normal severity: normal status: open title: Dedicated place for security announcements? type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 04:38:01 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 06 Nov 2017 09:38:01 +0000 Subject: [New-bugs-announce] [issue31954] Don't prevent dict optimization by coupling with OrderedDict Message-ID: <1509961081.05.0.213398074469.issue31954@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Currently OrderedDict uses a table of nodes that mirrors the dict table. For keeping it in sync it saves the size and address of the dict table. There are two issues with this. First, this prevent some kind of dict optimization. When dict is resized (after exhausting usable entries at the end of table) it should allocate a new table even if it's size isn't changed. Second, this doesn't guarantees that both tables are in sync. If the dict table was reallocated twice before using OrderedDict methods, it can have the same size and address, but totally different layout of elements. Proposed PR adds a new flag to dict object. It is set when OrderedDict creates its table, and is cleared when dict reallocates its table or moves items in the same table. ---------- components: Interpreter Core messages: 305623 nosy: inada.naoki, rhettinger, serhiy.storchaka, tim.peters priority: normal severity: normal status: open title: Don't prevent dict optimization by coupling with OrderedDict type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 05:34:35 2017 From: report at bugs.python.org (Dee Mee) Date: Mon, 06 Nov 2017 10:34:35 +0000 Subject: [New-bugs-announce] [issue31955] set_executables() incorrectly parse values with spaces Message-ID: <1509964475.73.0.213398074469.issue31955@psf.upfronthosting.co.za> New submission from Dee Mee : Function set_executable() in ccompiler.py does the following check: def set_executable(self, key, value): if isinstance(value, str): setattr(self, key, split_quoted(value)) else: setattr(self, key, value) The check "if isinstance(value, str)" is incorrect, because type of value can be unicode, while it should be splitted as well. ---------- components: Distutils messages: 305627 nosy: Dee Mee, dstufft, eric.araujo priority: normal severity: normal status: open title: set_executables() incorrectly parse values with spaces type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:13:47 2017 From: report at bugs.python.org (=?utf-8?b?0J3QuNC60L7Qu9Cw0Lkg0KHQv9Cw0YXQuNC10LI=?=) Date: Mon, 06 Nov 2017 11:13:47 +0000 Subject: [New-bugs-announce] [issue31956] Add start and stop parameters to the array.index() Message-ID: <1509966827.68.0.213398074469.issue31956@psf.upfronthosting.co.za> New submission from ??????? ??????? : Sequence protocol specifies 2 optional argument for index method: seq.index(value, [start, [stop]]) array.index(value) needs start and stop arguments too. ---------- components: Library (Lib) messages: 305629 nosy: ??????? ??????? priority: normal severity: normal status: open title: Add start and stop parameters to the array.index() versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:17:26 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 11:17:26 +0000 Subject: [New-bugs-announce] [issue31957] [Windows] PCbuild error: A numeric comparison was attempted Message-ID: <1509967046.04.0.213398074469.issue31957@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/58/builds/110 Build started 11/4/2017 7:30:21 PM. Project "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\pythoncore.vcxproj" on node 1 (KillPython target(s)). D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\python.props(77,31): error MSB4086: A numeric comparison was attempted on "$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0 at ProductVersion)" that evaluates to "" instead of a number, in condition "$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0 at ProductVersion) >= '10.0.15063'". [D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\pythoncore.vcxproj] Done Building Project "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\pythoncore.vcxproj" (KillPython target(s)) -- FAILED. Build FAILED. It's likely a regression caused by one of these commits: * 0d2a9088d16826343344b04461c8be44b4008710 * aed08562220974b5c67371b908f23caa1be07e38 ---------- components: Build, Windows messages: 305631 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] PCbuild error: A numeric comparison was attempted versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 06:31:27 2017 From: report at bugs.python.org (David MacIver) Date: Mon, 06 Nov 2017 11:31:27 +0000 Subject: [New-bugs-announce] [issue31958] UUID Message-ID: <1509967887.83.0.213398074469.issue31958@psf.upfronthosting.co.za> New submission from David MacIver : The documentation for the UUID module says the UUID.version field is "The UUID version number (1 through 5, meaningful only when the variant is RFC_4122)". However, the UUID constructor doesn't actually validate that the version lies in that range if you don't pass a version to the constructor and, as a result, this isn't actually true - the version number can be anything between 0 and 15. For an example consider the following: >>> from uuid import UUID >>> u = UUID(int=1133377179260751706062848) >>> u.variant 'specified in RFC 4122' >>> u.version 15 I have only actually run this example on Python 3.6, but inspection of the code suggests that it's been like this since its introduction. ---------- components: Library (Lib) messages: 305636 nosy: David MacIver priority: normal severity: normal status: open title: UUID versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 07:05:51 2017 From: report at bugs.python.org (Adam Dangoor) Date: Mon, 06 Nov 2017 12:05:51 +0000 Subject: [New-bugs-announce] [issue31959] Directory at `TemporaryDirectory().name` does not exist Message-ID: <1509969951.64.0.213398074469.issue31959@psf.upfronthosting.co.za> New submission from Adam Dangoor : Sample code: ``` import os from tempfile import TemporaryDirectory name = TemporaryDirectory().name print(os.path.exists(name)) # prints False td = TemporaryDirectory() name_2 = td.name print(os.path.exists(name_2)) # prints True ``` Expected behavior: `True` is printed for both print statements. I have run this example on: * CPython 3.6.3 * CPython 3.5.3 * pypy 3.5.3 The unexpected behavior occurs on CPython 3.5.3 and CPython 3.6.X but not on pypy. (bug found with Tim Weidner https://github.com/timaa2k). ---------- components: Library (Lib) messages: 305637 nosy: Adam Dangoor priority: normal severity: normal status: open title: Directory at `TemporaryDirectory().name` does not exist type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:24:09 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 06 Nov 2017 17:24:09 +0000 Subject: [New-bugs-announce] [issue31960] Protection against using a Future with another loop only works with await Message-ID: <1509989049.58.0.213398074469.issue31960@psf.upfronthosting.co.za> New submission from Antoine Pitrou : If you await a Future with another loop than a loop at instance creation (this is trivial to do accidentally when using threads), asyncio raises a RuntimeError. But if you use another part of the Future API, such as add_done_callback(), the situation isn't detected. For example, this snippet will run indefinitely: import asyncio import threading fut = asyncio.Future() async def coro(loop): fut.add_done_callback(lambda _: loop.stop()) loop.call_later(1, fut.set_result, None) while True: await asyncio.sleep(100000) def run(): loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) loop.run_until_complete(coro(loop)) loop.close() t = threading.Thread(target=run) t.start() t.join() ---------- components: asyncio messages: 305662 nosy: giampaolo.rodola, haypo, pitrou, yselivanov priority: normal severity: normal status: open title: Protection against using a Future with another loop only works with await type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 12:27:25 2017 From: report at bugs.python.org (Roy Williams) Date: Mon, 06 Nov 2017 17:27:25 +0000 Subject: [New-bugs-announce] [issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args Message-ID: <1509989245.86.0.213398074469.issue31961@psf.upfronthosting.co.za> New submission from Roy Williams : Repro: ```python from pathlib import Path import subprocess subprocess.run([Path('/bin/ls')]) # Works Fine subprocess.run(Path('/bin/ls')) # Fails ``` The problem seems to originate from here: https://github.com/python/cpython/blob/master/Lib/subprocess.py#L1237-L1240 This file auspiciously avoids importing pathlib, which I'm guessing is somewhat intentional? Would the correct fix be to check for the existence of a `__fspath__` attribute as per https://www.python.org/dev/peps/pep-0519/ ? ---------- components: Library (Lib) messages: 305663 nosy: Roy Williams priority: normal severity: normal status: open title: subprocess._execute_child doesn't accept a single PathLike argument for args versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 15:56:32 2017 From: report at bugs.python.org (Thomas Knox) Date: Mon, 06 Nov 2017 20:56:32 +0000 Subject: [New-bugs-announce] [issue31962] test_importlib double free or corruption Message-ID: <1510001792.72.0.213398074469.issue31962@psf.upfronthosting.co.za> New submission from Thomas Knox : On a Raspberry Pi 3 running Linux pi3 4.9.58-v7+ #1046 SMP Tue Oct 24 17:07:15 BST 2017 armv7l GNU/Linux C(PP)FLAGS="-O6 -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -ftree-vectorize" Built with ./configure --enable-loadable-sqlite-extensions --enable-optimizations --disable-shared --with-lto --enable-ipv6 --with-threads When the build phase is ... Running code to generate profile data (this can take a while): make run_profile_task make[1]: Entering directory '/home/pi/Downloads/Python-3.6.3' : # FIXME: can't run for a cross build ./python -m test.regrtest --pgo || true Run tests sequentially ... It errors and dies with 0:23:56 load avg: 0.87 [176/405] test_importlib *** Error in `./python': double free or corruption (!prev): 0x014166e0 *** Fatal Python error: Aborted Thread 0x685ff460 (most recent call first): File "", line 98 in acquire File "/home/pi/Downloads/Python-3.6.3/Lib/test/test_importlib/test_locks.py", line 83 in _acquire File "/home/pi/Downloads/Python-3.6.3/Lib/test/test_importlib/test_locks.py", line 93 in f File "/home/pi/Downloads/Python-3.6.3/Lib/test/lock_tests.py", line 38 in task Thread 0x76f04000 (most recent call first): File "/home/pi/Downloads/Python-3.6.3/Lib/test/lock_tests.py", line 17 in _wait File "/home/pi/Downloads/Python-3.6.3/Lib/test/lock_tests.py", line 56 in wait_for_finished File "/home/pi/Downloads/Python-3.6.3/Lib/test/test_importlib/test_locks.py", line 99 in run_deadlock_avoidance_test File "/home/pi/Downloads/Python-3.6.3/Lib/test/test_importlib/test_locks.py", line 113 in test_no_deadlock File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/case.py", line 605 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/case.py", line 653 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 122 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 84 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 122 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 84 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 122 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 84 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 122 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 84 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 122 in run File "/home/pi/Downloads/Python-3.6.3/Lib/unittest/suite.py", line 84 in __call__ File "/home/pi/Downloads/Python-3.6.3/Lib/test/support/__init__.py", line 1765 in run File "/home/pi/Downloads/Python-3.6.3/Lib/test/support/__init__.py", line 1889 in _run_suite File "/home/pi/Downloads/Python-3.6.3/Lib/test/support/__init__.py", line 1933 in run_unittest File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/runtest.py", line 172 in test_runner File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/runtest.py", line 173 in runtest_inner File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/runtest.py", line 137 in runtest File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/main.py", line 378 in run_tests_sequential File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/main.py", line 457 in run_tests File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/main.py", line 535 in _main File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/main.py", line 509 in main File "/home/pi/Downloads/Python-3.6.3/Lib/test/libregrtest/main.py", line 584 in main File "/home/pi/Downloads/Python-3.6.3/Lib/test/regrtest.py", line 46 in _main File "/home/pi/Downloads/Python-3.6.3/Lib/test/regrtest.py", line 50 in File "/home/pi/Downloads/Python-3.6.3/Lib/runpy.py", line 85 in _run_code File "/home/pi/Downloads/Python-3.6.3/Lib/runpy.py", line 193 in _run_module_as_main Aborted Every time. These exact same parameters and flags worked with 3.6.2 with no issue, but they die on 3.6.3 ---------- components: Build messages: 305676 nosy: DNSGeek priority: normal severity: normal status: open title: test_importlib double free or corruption type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 16:57:41 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 06 Nov 2017 21:57:41 +0000 Subject: [New-bugs-announce] [issue31963] AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge Message-ID: <1510005461.16.0.213398074469.issue31963@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/47/builds/127 (...) gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-use -fprofile-correction -I. -I./Include -DPy_BUILD_CORE -o Objects/setobject.o Objects/setobject.c Objects/setobject.c: In function ?PySet_Clear?: Objects/setobject.c:2579:1: internal compiler error: in create_edge, at cgraph.c:850 }; ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Makefile:1584: recipe for target 'Objects/setobject.o' failed make[1]: Leaving directory '/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build' make[1]: *** [Objects/setobject.o] Error 1 pythoninfo from the previous build: * GCC 6.3.0 20170516 * os.uname: posix.uname_result(sysname='Linux', nodename='enable-optimizations-bot', release='4.9.0-3-amd64', version='#1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26)', machine='x86_64') * platform.platform: Linux-4.9.0-3-amd64-x86_64-with-debian-9.1 http://buildbot.python.org/all/#/builders/47/builds/126/steps/3/logs/stdio ---------- components: Build messages: 305682 nosy: gregory.p.smith, haypo, nascheme priority: normal severity: normal status: open title: AMD64 Debian PGO 3.x buildbot: compilation failed with an internal compiler error in create_edge type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 6 20:09:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 01:09:44 +0000 Subject: [New-bugs-announce] [issue31964] [3.4][3.5] pyexpat: compilaton of libexpat fails with: ISO C90 forbids mixed declarations and code Message-ID: <1510016984.72.0.213398074469.issue31964@psf.upfronthosting.co.za> New submission from STINNER Victor : /home/haypo/prog/python/3.5/Modules/expat/xmltok.c: In function 'utf8_toUtf8': /home/haypo/prog/python/3.5/Modules/expat/xmltok.c:408:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] const char * const fromLimBefore = fromLim; ^~~~~ /home/haypo/prog/python/3.5/Modules/expat/xmltok.c:414:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] const ptrdiff_t bytesToCopy = fromLim - *fromP; ^~~~~ cc1: some warnings being treated as errors *** WARNING: renaming "_elementtree" since importing it failed: PyCapsule_Import could not import module "pyexpat" It's probably a regression caused by: * Python 3.5: commit f2492bb6aae061aea47e21fc7e56b7ab9bfdf543 * Python 3.4: commit 86a713cb0c110b6798ca7f9e630fc511ee0a4028 I don't understand why the issue wasn't catched before. Maybe test_xml_etree is simply skipped if pyexpat compilation fails on Linux. Or buildbots and Travis CI uses ./configure --with-system-expat on Linux. ---------- components: Build messages: 305705 nosy: haypo priority: normal severity: normal status: open title: [3.4][3.5] pyexpat: compilaton of libexpat fails with: ISO C90 forbids mixed declarations and code type: security versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 02:00:44 2017 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 07 Nov 2017 07:00:44 +0000 Subject: [New-bugs-announce] [issue31965] Incorrect documentation for multiprocessing.connection.{Client, Listener} Message-ID: <1510038044.25.0.213398074469.issue31965@psf.upfronthosting.co.za> New submission from Jelle Zijlstra : https://docs.python.org/3/library/multiprocessing.html#multiprocessing.connection.Client claims that there is an "authenticate" argument, but it does not exist in the implementation (https://github.com/python/cpython/blob/master/Lib/multiprocessing/connection.py#L487). ---------- assignee: Jelle Zijlstra components: Documentation messages: 305713 nosy: Jelle Zijlstra, davin, pitrou priority: normal pull_requests: 4267 severity: normal status: open title: Incorrect documentation for multiprocessing.connection.{Client,Listener} versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:40:05 2017 From: report at bugs.python.org (Guillaume Aldebert) Date: Tue, 07 Nov 2017 09:40:05 +0000 Subject: [New-bugs-announce] [issue31966] print('hello\n', end='', flush=True) raises OSError when ran with py -u Message-ID: <1510047605.77.0.213398074469.issue31966@psf.upfronthosting.co.za> New submission from Guillaume Aldebert : noticed on windows10, 3.6.3-64 and 3.7.0a2-64: using this test.py file: #!/usr/bin/env python3 print('hello\n', end='', flush=True) and running it in unbuffered mode: C:\Dev>py -u test.py hello Traceback (most recent call last): File "test.py", line 2, in print('hello\n', end='', flush=True) OSError: [WinError 87] The parameter is incorrect Note that (still using py -u): print('hello', end='', flush=True) # works fine print('', end='', flush=True) # raises OSError as well ---------- components: Windows messages: 305726 nosy: Guillaume Aldebert, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: print('hello\n', end='', flush=True) raises OSError when ran with py -u type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 04:53:23 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 09:53:23 +0000 Subject: [New-bugs-announce] [issue31967] [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe' Message-ID: <1510048403.67.0.213398074469.issue31967@psf.upfronthosting.co.za> New submission from STINNER Victor : test_distutils failed on AMD64 Windows10 3.x buildbot: http://buildbot.python.org/all/#/builders/3/builds/128 0:19:07 [165/407/1] test_distutils failed -- running: test_multiprocessing_spawn (377 sec) xxmodule.c xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; using first specification Creating library d:\temp\tmp4zg7rpix\Debug\temp\tmp4zg7rpix\xx_d.cp37-win_amd64.lib and object d:\temp\tmp4zg7rpix\Debug\temp\tmp4zg7rpix\xx_d.cp37-win_amd64.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance LINK : fatal error LNK1158: cannot run 'rc.exe' foo.c Creating library d:\temp\tmpy79shh6o\tempt\temp\tmpl63x182t\foo_d.cp37-win_amd64.lib and object d:\temp\tmpy79shh6o\tempt\temp\tmpl63x182t\foo_d.cp37-win_amd64.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance LINK : fatal error LNK1158: cannot run 'rc.exe' xxmodule.c xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; using first specification Creating library d:\temp\tmpkb4gpfw9\Debug\temp\tmpkb4gpfw9\xx_d.cp37-win_amd64.lib and object d:\temp\tmpkb4gpfw9\Debug\temp\tmpkb4gpfw9\xx_d.cp37-win_amd64.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance LINK : fatal error LNK1158: cannot run 'rc.exe' foo.c Creating library d:\temp\tmppmjpg5zh\tempt\temp\tmpi1x5uxdd\foo_d.cp37-win_amd64.lib and object d:\temp\tmppmjpg5zh\tempt\temp\tmpi1x5uxdd\foo_d.cp37-win_amd64.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance LINK : fatal error LNK1158: cannot run 'rc.exe' xxmodule.c xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; using first specification Creating library build\temp.win-amd64-3.7-pydebug\Debug\xx_d.cp37-win_amd64.lib and object build\temp.win-amd64-3.7-pydebug\Debug\xx_d.cp37-win_amd64.exp LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance LINK : fatal error LNK1158: cannot run 'rc.exe' D:\buildarea\3.x.bolen-windows10\build\build\test_python_2228>exit 1 D:\buildarea\3.x.bolen-windows10\build\build\test_python_2228>exit 0 (...) ====================================================================== ERROR: test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\_msvccompiler.py", line 519, in link self.spawn([self.linker] + ld_args) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\_msvccompiler.py", line 542, in spawn return super().spawn(cmd) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\spawn.py", line 38, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\spawn.py", line 81, in _spawn_nt "command %r failed with exit status %d" % (cmd, rc)) distutils.errors.DistutilsExecError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\tests\test_build_ext.py", line 82, in test_build_ext cmd.run() File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\command\build_ext.py", line 339, in run self.build_extensions() File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\command\build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\command\build_ext.py", line 558, in build_extension target_lang=language) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\ccompiler.py", line 717, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "D:\buildarea\3.x.bolen-windows10\build\lib\distutils\_msvccompiler.py", line 522, in link raise LinkError(msg) distutils.errors.LinkError: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158 ---------- components: Tests, Windows messages: 305728 nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] test_distutils: fatal error LNK1158: cannot run 'rc.exe' versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 07:49:16 2017 From: report at bugs.python.org (Ilya Polyakovskiy) Date: Tue, 07 Nov 2017 12:49:16 +0000 Subject: [New-bugs-announce] [issue31968] exec(): method's default arguments from dict-inherited globals Message-ID: <1510058956.93.0.213398074469.issue31968@psf.upfronthosting.co.za> New submission from Ilya Polyakovskiy : I'm using exec() to run code with globals object inherited from dict. The problem is overloaded __getitem__ doesn't called to load default argument for class methods. Here the example. Let's assume we create some variable storage for code execution class Env(dict): def __init__(self, external_storage): super().__init__() self._external_storage = external_storage def __setitem__(self, key, value): print('__setitem__: {}'.format(key)) self._external_storage[key] = value def __getitem__(self, key): print('__getitem__: {}'.format(key)) return self._external_storage[key] storage = {} env = Env(storage) env['var'] = 2 exec(""" class A: def foo(self, x=var): print('foo(): {}'.format(x)) a = A() a.foo() """, env) This code will fail with output: __setitem__: var Traceback (most recent call last): File "inheri-test.py", line 29, in """, env) File "", line 2, in File "", line 3, in A NameError: name 'var' is not defined As far as I understand the problem is Python/ceval.c:2120. There is only PyDict_GetItem used to load variable from f_globals, instead of PyObject_GetItem in case of f_globals is not exact dict. ---------- components: Interpreter Core messages: 305746 nosy: Ilya Polyakovskiy priority: normal severity: normal status: open title: exec(): method's default arguments from dict-inherited globals versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:14:30 2017 From: report at bugs.python.org (Narendra) Date: Tue, 07 Nov 2017 13:14:30 +0000 Subject: [New-bugs-announce] [issue31969] re.groups() is not checking the arguments Message-ID: <1510060470.46.0.213398074469.issue31969@psf.upfronthosting.co.za> New submission from Narendra : Hi Team, I have observed a bug in re.groups() function behavior in Python as below: Issue: re.groups() is not validating the arguments Example: >>> m = re.match(r'(\w+)@(\w+)\.(\w+)','username at hackerrank.com') >>> m.groups() ('username', 'hackerrank', 'com') >>> m.groups(1) ('username', 'hackerrank', 'com') >>> m.groups(100000000000) ('username', 'hackerrank', 'com') >>> >From the above, its clear that re.groups() and re.groups() both are same. I think re.groups() is not validating the arguments. Please review the same and provide your comments whether my views are correct or wrong ---------- components: Regular Expressions messages: 305751 nosy: ezio.melotti, mrabarnett, narendrac priority: normal severity: normal status: open title: re.groups() is not checking the arguments type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 08:15:04 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 07 Nov 2017 13:15:04 +0000 Subject: [New-bugs-announce] [issue31970] asyncio debug mode is very slow Message-ID: <1510060504.4.0.213398074469.issue31970@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Each time a new future, handle or task is created, asyncio with debug mode enabled will parse the whole call stack and create a StackSummary object for it. Imagine a recursive coroutine: with N nested calls, you get O(N**2) performance. Ideally debug mode wouldn't slow things too much, at least for development and testing setups. ---------- components: Library (Lib), asyncio messages: 305752 nosy: giampaolo.rodola, haypo, pitrou, yselivanov priority: normal severity: normal status: open title: asyncio debug mode is very slow type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 10:23:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 07 Nov 2017 15:23:17 +0000 Subject: [New-bugs-announce] [issue31971] idle_test: failures on x86 Windows7 3.x Message-ID: <1510068197.3.0.213398074469.issue31971@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/58/builds/122 ====================================================================== ERROR: tearDownClass (idlelib.idle_test.test_configdialog.KeysPageTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\idlelib\idle_test\test_configdialog.py", line 701, in tearDownClass del page.set_keys_type, page.load_keys_list AttributeError: set_keys_type ====================================================================== FAIL: test_set_keys_type (idlelib.idle_test.test_configdialog.KeysPageTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\idlelib\idle_test\test_configdialog.py", line 859, in test_set_keys_type eq(d.custom_keyset_on.state(), ('selected',)) AssertionError: Tuples differ: ('selected', 'hover') != ('selected',) First tuple contains 1 additional elements. First extra element 1: 'hover' - ('selected', 'hover') ? -------- + ('selected',) ---------- components: Tests messages: 305763 nosy: haypo, terry.reedy priority: normal severity: normal status: open title: idle_test: failures on x86 Windows7 3.x versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 14:05:43 2017 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 07 Nov 2017 19:05:43 +0000 Subject: [New-bugs-announce] [issue31972] Inherited docstrings for pathlib classes are confusing Message-ID: <1510081543.19.0.213398074469.issue31972@psf.upfronthosting.co.za> New submission from ?ric Araujo : pydoc pathlib.Path shows the docstring of PurePath: | PurePath represents a filesystem path and offers operations which | don't imply any actual filesystem I/O. But immediately after we see methods like chmod, exists and co which obviously aren?t pure. Looking at the reST docs or the source code, the reader can deduce that this is the docstring of PurePath inherited by Path, but I find it confusing. Solution: adding docstrings to all pathlib classes. PurePath and Path can have all the info, Posix/Windows* subclasses only one line with a reference. ---------- components: Library (Lib) keywords: easy messages: 305788 nosy: eric.araujo priority: normal severity: normal stage: needs patch status: open title: Inherited docstrings for pathlib classes are confusing type: enhancement versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 18:15:49 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 07 Nov 2017 23:15:49 +0000 Subject: [New-bugs-announce] [issue31973] Incomplete DeprecationWarning for async/await keywords Message-ID: <1510096549.91.0.213398074469.issue31973@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : Issue bpo-26182 added DeprecationWarnings for "import async" and "import await" since both of those pseudo-keywords were to become actual reserved keywords in Python 3.7. This latter has now happened, but the fix in bpo-26182 is incomplete. It does not trigger warnings on "from .async import foo". base/ __init__.py async.py good.py -----async.py x = 1 -----good.py from .async import x $ python3.6 -W error::DeprecationWarning -c "import base.good" $ python3.7 -c "import base.good" Traceback (most recent call last): File "", line 1, in File "/private/tmp/x1/base/good.py", line 1 from .async import x ^ SyntaxError: invalid syntax $ cd base $ python3.6 -W error::DeprecationWarning -c "import async" DeprecationWarning: 'async' and 'await' will become reserved keywords in Python 3.7 ---------- messages: 305798 nosy: barry priority: normal severity: normal status: open title: Incomplete DeprecationWarning for async/await keywords versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 20:56:55 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 08 Nov 2017 01:56:55 +0000 Subject: [New-bugs-announce] [issue31974] Cursor misbahavior with Tkinter 3.6.1/tk 8.5 Text on Mac Sierra Message-ID: <1510106215.52.0.213398074469.issue31974@psf.upfronthosting.co.za> New submission from Terry J. Reedy : MacOS Sierra 10.12.6, Python 3.6.1, tk 8.5.15 or .18. Consider this code with arbitrary compound statements and therefore indented lines. for i in range(10): if i%2: print(f(i)) Irv Kalb on idle-dev thread 'Bug in cursor placement in IDLE editor' windows reports the following obnoxious behavior: click just to left or on left side of 'p' and cursor appears on left margin. Keep clicking and cursor moves right one space at a time until arriving next to 'p', where it should immediately go, and does on Windows, and, I presume, elsewhere. (When the cursor first arrives at 'p', there is also the double-click selection highlight.) At my suggestion, he also tested with code inserted directly in a tk Test window with this: import tkinter as tk root = tk.Tk() text = tk.Text(root) sample = ''' ''' text.insert('1.0', sample) text.pack() root.mainloop() and encountered the same bug. (Hence, this is not an IDLE issue.)The only difference is that clicking beside keyword 'if' does not show bug in IDLE but does in Text. He also uploaded an unlisted video to YouTube. https://www.youtube.com/watch?v=Us8px0BY5rg Irv's current workaround is to click a letter or two to the right and use <-- key. I realize that this is likely not a tkinter issue either, but I wanted to record it and get you two's thoughts. Is this more likely to be a problem with a particular installation, or with at least one macOS release and even 8.5.18. If the latter, can Irv install Python compiled elsewhere to work with 8.6? Ned, do you have a recommendation? Kevin Walzer reported that he does not see the issue with Python built to run with 8.6 and using 8.6.7. He noted that 8.5.18 does not get bug fixes. I presume that this applies to 8.5 in general. Will 3.7.0 be compiled for 8.6? ---------- messages: 305800 nosy: IrvKalb, ned.deily, serhiy.storchaka, terry.reedy priority: normal severity: normal status: open title: Cursor misbahavior with Tkinter 3.6.1/tk 8.5 Text on Mac Sierra type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 21:55:09 2017 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 08 Nov 2017 02:55:09 +0000 Subject: [New-bugs-announce] [issue31975] Add a default filter for DeprecationWarning in __main__ Message-ID: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za> New submission from Nick Coghlan : As per the post at https://mail.python.org/pipermail/python-dev/2017-November/150366.html, this is an RFE to cover adding a new warning filter to the default set: once::DeprecationWarning:__main__ This means that all deprecation warnings triggered directly by code in __main__ will start being reported again, while deprecation warnings triggered by imported modules will continue to be ignored by default. Thus the following will start emitting DeprecationWarning by default again (as they did in 2.6 and earlier): - experiments at the REPL - directly executed scripts - modules executed with the -m switch - pkg.__main__ submodules executed with the -m switch - __main__.py files in executed directories and zip archives However, any code *imported* from these will not trigger warnings. This means that the following still won't trigger any warnings by default: - modules imported & functions called from entry point wrapper scripts - modules imported & functions called from pkg.__main__ submodules - modules imported & functions called from __main__.py files The intent behind the change is that it should be much harder for developers and educators to miss seeing a deprecation warning at least once for a deprecated API, while still silencing deprecation warnings by default for deployed Python applications. ---------- messages: 305801 nosy: alex, gvanrossum, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Add a default filter for DeprecationWarning in __main__ type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 7 23:27:27 2017 From: report at bugs.python.org (Benjamin Fogle) Date: Wed, 08 Nov 2017 04:27:27 +0000 Subject: [New-bugs-announce] [issue31976] Segfault when closing BufferedWriter from a different thread Message-ID: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za> New submission from Benjamin Fogle : To reproduce: ``` import threading import io import time import _pyio class MyFileIO(io.FileIO): def flush(self): # Simulate a slow flush. Slow disk, etc. time.sleep(0.25) super().flush() raw = MyFileIO('test.dat', 'wb') #fp = _pyio.BufferedWriter(raw) fp = io.BufferedWriter(raw) t1 = threading.Thread(target=fp.close) t1.start() time.sleep(0.1) # Ensure t1 is sleeping in fp.close()/raw.flush() fp.write(b'test') t1.join() ``` _pyio.BufferedWriter ignores the error completely rather than throwing a ValueError("write to closed file"). ---------- components: Interpreter Core messages: 305803 nosy: benfogle priority: normal severity: normal status: open title: Segfault when closing BufferedWriter from a different thread versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 00:12:05 2017 From: report at bugs.python.org (=?utf-8?b?5byg5pmT5p6X?=) Date: Wed, 08 Nov 2017 05:12:05 +0000 Subject: [New-bugs-announce] [issue31977] threading.Condition can not work with threading.Semaphore Message-ID: <1510117925.72.0.213398074469.issue31977@psf.upfronthosting.co.za> New submission from ??? : the python document say Condition work will Locks, like RLock... but i find it not work with Semaphore, because Condition._is_owned is like this def _is_owned(self): # Return True if lock is owned by current_thread. # This method is called only if _lock doesn't have _is_owned(). if self._lock.acquire(0): self._lock.release() return False else: return True this work for RLock, but not work for Semaphore, and Semaphore do not have it's own _is_owned implement. i spend a lot of time on this issue. maybe fix it, or document it out? ---------- messages: 305807 nosy: ??? priority: normal severity: normal status: open title: threading.Condition can not work with threading.Semaphore type: resource usage versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 05:13:02 2017 From: report at bugs.python.org (Wolfgang Maier) Date: Wed, 08 Nov 2017 10:13:02 +0000 Subject: [New-bugs-announce] [issue31978] make it simpler to round fractions Message-ID: <1510135982.93.0.213398074469.issue31978@psf.upfronthosting.co.za> New submission from Wolfgang Maier : Hi, because of floating point inaccuracies it is suboptimal to use round(int1/int2) for rounding of a fraction. fractions.Fraction, OTOH, offers exact rounding through its implementation of __round__, but using it requires users to create a fractions.Fraction instance from two ints first. The algorithm used by Fraction.__round__ is, essentially, the same as the one used in the pure-Python version of the datetime._divide_and_round module (which, in turn, is taken from a comment by Mark Dickinson in Objects/longobject.c). My suggestion is to promote this algorithm to an exposed function in the fractions module (actually, it may make sense to have it in the math module instead - compare the case of the gcd function, which started out in fractions, but is now in transition to math) so that it can be used by Fraction.__round__, but also any other code. Attached is a patch demonstrating the idea. In addition, to the above benefit, it turns out to actually speed up Fraction.__round__ substantially, when ndigits is not None because it then avoids the generation of temporary Fraction instances, and, in my hands at least, it even makes the general (ndigits=None) case slightly faster (apparently the copied datetime._divide_and_round code is more efficient than the original in Fraction.__round__). There is one slight additional tweak in the patch: in the case of ndigits < 0, it returns an int, not a Fraction (see test_fractions modification to make it pass). I think this is actually a mistake in the current Fraction.__round__, which already promotes the result to int in the general case. This change speeds up round to the next ndigits power of ten by ~ a factor of 5 in my hands because no new Fraction needs to be instantiated anymore. A full PR could include having pure-Python datetime import the function from fractions instead of rolling its own, but I'd first like to hear whether you think this should go into math instead. ---------- components: Library (Lib) files: fractions_divround.patch keywords: patch messages: 305817 nosy: mark.dickinson, wolma priority: normal severity: normal status: open title: make it simpler to round fractions type: enhancement versions: Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47254/fractions_divround.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 07:21:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 12:21:21 +0000 Subject: [New-bugs-announce] [issue31979] Simplify converting non-ASCII strings to int, float and complex Message-ID: <1510143681.24.0.213398074469.issue31979@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : This issue is inspired by the tweet https://twitter.com/dabeaz/status/925787482515533830 >>> a = 'n' >>> b = '?' >>> sys.getsizeof(a) 50 >>> sys.getsizeof(b) 74 >>> float(b) Traceback (most recent call last): File "", line 1, in ValueError: could not convert string to float: '?' >>> sys.getsizeof(b) 77 See also a discussion on Python-list (https://mail.python.org/pipermail/python-list/2017-November/728149.html) and Stack Overflow (https://stackoverflow.com/questions/47062184/why-does-the-size-of-this-python-string-change-on-a-failed-int-conversion). When convert a non-ASCII string which don't contain non-ASCII decimal digits and spaces, this will fail, but will change the size of the input string due to creating an internal UTF-8 representation. This can look surprising for beginners, but there is nothing wrong here. There are many cases in which an internal UTF-8 representation is created implicitly. But looking on the code I have found that it is too complicated. Parsers to int, float and complex call _PyUnicode_TransformDecimalAndSpaceToASCII() which transforms non-ASCII decimal digits and spaces to ASCII. This functions uses the general function fixup() which takes a transformation function, creates a new string object, apply the transformation. It checks if the transformation produces a string with larger maximal character code than the original string and creates a new string object and repeat the transformation in that case. Finally, if the resulting string is equal to the original string, destroy the resulting string and returns the original string. In the past fixup() was used for implementing methods like upper(). But now _PyUnicode_TransformDecimalAndSpaceToASCII() is only the user of fixup(), and it doesn't need all complicated logic of fixup(). For example, this transformation never produces wider strings. The proposed PR simplifies the code by getting rid of fixup() and fix_decimal_and_space_to_ascii(). The semantic of _PyUnicode_TransformDecimalAndSpaceToASCII() has been changed. It now always produces ASCII string (this also simplifies caller places). If non-ASCII characters which is not a decimal digit and is not a space is encountered, the rest of the string is replaced with '?' which will cause an error in parsers. The only visible behavior change (except not changing the size of the original string) is changing the exception raised by float() and complex() when the string contains lone surrogates from UnicodeEncodeError to ValueError (the same as for other malformed strings). int() already contained a special case for this and raised a ValueError. Unpatched: >>> int('\ud800') Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '\ud800' >>> float('\ud800') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 0: surrogates not allowed >>> complex('\ud800') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 0: surrogates not allowed Patched: >>> int('\ud800') Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '\ud800' >>> float('\ud800') Traceback (most recent call last): File "", line 1, in ValueError: could not convert string to float: '\ud800' >>> complex('\ud800') Traceback (most recent call last): File "", line 1, in ValueError: complex() arg is a malformed string This PR saves around 80 lines of code. ---------- assignee: serhiy.storchaka components: Unicode messages: 305824 nosy: ezio.melotti, haypo, serhiy.storchaka priority: normal severity: normal status: open title: Simplify converting non-ASCII strings to int, float and complex type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 07:59:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 12:59:05 +0000 Subject: [New-bugs-announce] [issue31980] Special case log(x, 2), log(x, 10) and pow(2, x) Message-ID: <1510145945.37.0.213398074469.issue31980@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : C99 provides functions log2(), log10() and exp2(). Is it worth to special case math.log(), math.pow() and built-in pow() for using these functions? log2(x) can be more accurate than log(x)/log(2). There are math.log2() and math.log10(), but not math.exp2(). ---------- components: Extension Modules messages: 305825 nosy: mark.dickinson, rhettinger, serhiy.storchaka, stutzbach priority: normal severity: normal status: open title: Special case log(x, 2), log(x, 10) and pow(2, x) type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 07:59:23 2017 From: report at bugs.python.org (Mikey D) Date: Wed, 08 Nov 2017 12:59:23 +0000 Subject: [New-bugs-announce] [issue31981] os.mkdirs does not exist on 2.7.5+ Message-ID: <1510145963.34.0.213398074469.issue31981@psf.upfronthosting.co.za> New submission from Mikey D : https://docs.python.org/2/library/os.html os.mkdirs('/tmp/folder') AttributeError: 'module' object has no attribute 'mkdirs'' os.makedirs('/tmp/folder') os.path.isdir('/tmp/folder') True ---------- assignee: docs at python components: Documentation messages: 305826 nosy: Mikey D, docs at python priority: normal severity: normal status: open title: os.mkdirs does not exist on 2.7.5+ versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:10:51 2017 From: report at bugs.python.org (Sasha Kacanski) Date: Wed, 08 Nov 2017 16:10:51 +0000 Subject: [New-bugs-announce] =?utf-8?q?=5Bissue31982=5D_8=2E3=2E_collecti?= =?utf-8?q?ons_=E2=80=94_Container_datatypes?= Message-ID: <1510157451.94.0.213398074469.issue31982@psf.upfronthosting.co.za> New submission from Sasha Kacanski : Hi, In ChainMap example c = ChainMap() # Create root context d = c.new_child() # Create nested child context e = c.new_child() # Child of c, independent from d e.maps[0] # Current context dictionary -- like Python's locals() e.maps[-1] # Root context -- like Python's globals() e.parents # Enclosing context chain -- like Python's nonlocals d['x'] # Get first key in the chain of contexts d['x'] = 1 # Set value in current context d['x'] - will raise key does not exist error so simple fix is to flip last two lines... I know, possibly anal but look love Python and would like to help new folks to not get confused if they play with example in cPython shell... --best ---------- assignee: docs at python components: Documentation messages: 305876 nosy: Sasha Kacanski, docs at python priority: normal severity: normal status: open title: 8.3. collections ? Container datatypes versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:24:41 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 16:24:41 +0000 Subject: [New-bugs-announce] [issue31983] Officially add Py_SETREF and Py_XSETREF Message-ID: <1510158281.4.0.213398074469.issue31983@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Private macros Py_SETREF and Py_XSETREF were introduced in 3.6 and backported to all maintained versions for fixing bugs (see issue20440 and issue26200). They are helpful and used not only for the primary purpose, but also for simplifying the code. Their names don't start from underscore because I planned to make them public and didn't want massive renaming and backporting conflicts. Now I think it is a time to add them officially to the stable C API. ---------- assignee: docs at python components: Documentation, Interpreter Core messages: 305878 nosy: docs at python, serhiy.storchaka priority: normal severity: normal status: open title: Officially add Py_SETREF and Py_XSETREF type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 11:59:43 2017 From: report at bugs.python.org (Ronan Lamy) Date: Wed, 08 Nov 2017 16:59:43 +0000 Subject: [New-bugs-announce] [issue31984] startswith and endswith leak implementation details Message-ID: <1510160383.84.0.213398074469.issue31984@psf.upfronthosting.co.za> New submission from Ronan Lamy : One would think that u.startswith(v, start, end) would be equivalent to u[start: end].startswith(v), but one would be wrong. And the same goes for endswith(). Here is the actual spec (for bytes, but str and bytearray are the same), in the form of passing pytest+hypothesis tests: from hypothesis import strategies as st, given def adjust_indices(u, start, end): if end < 0: end = max(end + len(u), 0) else: end = min(end, len(u)) if start < 0: start = max(start + len(u), 0) return start, end @given(st.binary(), st.binary(), st.integers(), st.integers()) def test_startswith_3(u, v, start, end): if v: expected = u[start:end].startswith(v) else: start0, end0 = adjust_indices(u, start, end) expected = start0 <= len(u) and start0 <= end0 assert u.startswith(v, start, end) is expected @given(st.binary(), st.binary(), st.integers(), st.integers()) def test_endswith_3(u, v, start, end): if v: expected = u[start:end].endswith(v) else: start0, end0 = adjust_indices(u, start, end) expected = start0 <= len(u) and start0 <= end0 assert u.endswith(v, start, end) is expected Fixing this behaviour to work in the "obvious" way would be simple: just add a check for len(v) == 0 and always return True in that case. ---------- messages: 305881 nosy: Ronan.Lamy priority: normal severity: normal status: open title: startswith and endswith leak implementation details type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 16:56:36 2017 From: report at bugs.python.org (Brian Curtin) Date: Wed, 08 Nov 2017 21:56:36 +0000 Subject: [New-bugs-announce] [issue31985] Deprecate/remove aifc.openfp Message-ID: <1510178196.39.0.213398074469.issue31985@psf.upfronthosting.co.za> New submission from Brian Curtin : Since 1993, aifc.openfp has simply pointed to aifc.open as a matter of backwards compatibility. See https://github.com/python/cpython/commit/7bc817d5ba917528e8bd07ec461c635291e7b06a for the exact change. aifc.openfp is both undocumented and untested, and in looking at doc coverage I decided it's better to deprecate it since it's silently been there for 25 years. ---------- assignee: brian.curtin components: Library (Lib) messages: 305912 nosy: brian.curtin priority: normal severity: normal stage: needs patch status: open title: Deprecate/remove aifc.openfp type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 17:20:43 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 08 Nov 2017 22:20:43 +0000 Subject: [New-bugs-announce] [issue31986] [2.7] test_urllib2net.test_sites_no_connection_close() randomly fails on Python 2.7 Message-ID: <1510179643.18.0.213398074469.issue31986@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/78/builds/20 ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/test/test_urllib2net.py", line 193, in test_sites_no_connection_close req = urllib2.urlopen(URL) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 435, in open response = meth(req, response) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 473, in error return self._call_chain(*args) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 407, in _call_chain result = func(*args) File "/buildbot/buildarea/2.7.ware-gentoo-x86.refleak/build/Lib/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) HTTPError: HTTP Error 503: Service Unavailable ---------- components: Tests messages: 305913 nosy: haypo priority: normal severity: normal status: open title: [2.7] test_urllib2net.test_sites_no_connection_close() randomly fails on Python 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 17:31:58 2017 From: report at bugs.python.org (Marc Le Roy) Date: Wed, 08 Nov 2017 22:31:58 +0000 Subject: [New-bugs-announce] [issue31987] Ctypes Packing Bitfields Incorrectly - GCC both Linux and Cygwin Message-ID: <1510180318.31.0.213398074469.issue31987@psf.upfronthosting.co.za> New submission from Marc Le Roy : The structure : typedef struct __attribute__ ((packed)) { unsigned int F0:24; unsigned int F3:24; unsigned int F6:24; unsigned int F9:24; } StructF_T; is mapped as expected by GCC under both Linux and Cygwin. As expected, the memory layout seen by the C program is : 0x111111222222333333444444 Using this definition : class StructF(ctypes.BigEndianStructure): _pack_ = 1 _fields_ = [ ('F0', ctypes.c_uint, 24), ('F3', ctypes.c_uint, 24), ('F6', ctypes.c_uint, 24), ('F9', ctypes.c_uint, 24), ] The memory layout seen from Python is not consistent : 0x11111100222222003333330044444400 It seems that the pack option is ignored by ctypes in such a case. I found the same problem using both ctypes.BigEndianStructure and ctypes.LittleEndianStructure ---------- components: ctypes messages: 305914 nosy: mleroy003 priority: normal severity: normal status: open title: Ctypes Packing Bitfields Incorrectly - GCC both Linux and Cygwin versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 18:20:21 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 08 Nov 2017 23:20:21 +0000 Subject: [New-bugs-announce] [issue31988] Saving bytearray to binary plist file doesn't work Message-ID: <1510183221.28.0.213398074469.issue31988@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : >>> import plistlib >>> plistlib.dumps(bytearray(), fmt=plistlib.FMT_BINARY) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/plistlib.py", line 962, in dumps dump(value, fp, fmt=fmt, skipkeys=skipkeys, sort_keys=sort_keys) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 955, in dump writer.write(value) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 703, in write self._flatten(value) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 741, in _flatten if (type(value), value) in self._objtable: TypeError: unhashable type: 'bytearray' ---------- components: Library (Lib) messages: 305921 nosy: ronaldoussoren, serhiy.storchaka priority: normal severity: normal status: open title: Saving bytearray to binary plist file doesn't work type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 8 23:11:26 2017 From: report at bugs.python.org (Mark Diekhans) Date: Thu, 09 Nov 2017 04:11:26 +0000 Subject: [New-bugs-announce] [issue31989] setattr on a property gives a very unhelpful exception Message-ID: <1510200686.12.0.213398074469.issue31989@psf.upfronthosting.co.za> New submission from Mark Diekhans : done a setattr on a property gives a very unhelpful error message AttributeError: can't set attribute it neither indicates the name of the attribute that failed or the cause. an error such as "can't set property attribute: the_attr_name" would be far more helpful. ---------- messages: 305933 nosy: diekhans priority: normal severity: normal status: open title: setattr on a property gives a very unhelpful exception type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 05:14:19 2017 From: report at bugs.python.org (Werner Smidt) Date: Thu, 09 Nov 2017 10:14:19 +0000 Subject: [New-bugs-announce] [issue31990] Pickling deadlocks in thread with python -m Message-ID: <1510222459.1.0.213398074469.issue31990@psf.upfronthosting.co.za> New submission from Werner Smidt : Hi there I recently stumbled on an interesting behaviour. I won't call it an error, because I think it's a mistake I made. BACKGROUND: I want to spawn threads that handle pickled data. This works really well. However, I would like to execute the python script in question as a module, i.e. python -m mymodule. This is merely for aesthetic purposes. The attached script has two functions: 1. Pickle/unpickle an instance of a `namedtuple` 2. Pickle/unpickle a string Each of these functions are run in the main thread and then in subsequent spawned threads. If I run the script attached with "python testqueuepickle.py", it works fine. I get the data pickled/unpickled in the respective functions and nothing deadlocks and everything is printed to screen. If, however, I run it with the "-m" option (python -m testqueuepickle.py) , the program deadlocks at the pickling of the "namedtuple" instance. The pickling/unpickling of the string appears to be unaffected. Programming practices aside, what do you think could be the cause of this? ---------- files: testqueuepickle.py messages: 305953 nosy: Werner Smidt priority: normal severity: normal status: open title: Pickling deadlocks in thread with python -m type: behavior versions: Python 2.7 Added file: https://bugs.python.org/file47255/testqueuepickle.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 08:48:13 2017 From: report at bugs.python.org (Thomas Moreau) Date: Thu, 09 Nov 2017 13:48:13 +0000 Subject: [New-bugs-announce] [issue31991] Race condition in wait with timeout for multiprocessing.Event Message-ID: <1510235293.99.0.213398074469.issue31991@psf.upfronthosting.co.za> New submission from Thomas Moreau : If the methods `set` and `clear` of `multiprocessing.Event` are called one after another, while a `multiprocessing.Process` calls `wait`, the `Event` does not match the documented behavior (https://docs.python.org/3.7/library/threading.html#threading.Event.wait) and the call to wait can return `False` even though the call to wait did not timeout (This happens both with `timeout=30` or `timeout=None`). Attached is a script reproducing this issue. The documentation should either be changed or the behavior should be updated. ---------- components: Library (Lib) files: concurrent_event.py messages: 305960 nosy: tomMoral priority: normal severity: normal status: open title: Race condition in wait with timeout for multiprocessing.Event type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47256/concurrent_event.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 11:24:13 2017 From: report at bugs.python.org (Richard Neumann) Date: Thu, 09 Nov 2017 16:24:13 +0000 Subject: [New-bugs-announce] [issue31992] Make iteration over dict_items yield namedtuples Message-ID: <1510244653.28.0.213398074469.issue31992@psf.upfronthosting.co.za> New submission from Richard Neumann : Currently, iterating over dict_items will yield plain tuples, where the first item will be the key and the second item will be the respective value. This has some disadvantages when e.g. sorting dict items by value and key: def sort_by_value_len(dictionary): return sorted(dictionary.items(), key=lambda item: (len(item[1]), item[0])) I find this index accessing extremely unelegant and unnecessarily hard to read. If dict_items would instead yield namedtuples like DictItem = namedtuple('DictItem', ('key', 'value')) this would make constructs like def sort_by_value_len(dictionary): return sorted(dictionary.items(), key=lambda item: (len(item.value), item.key)) possible and increase code clarity a lot. Also, namedtuples mimic the behaviour of plain tuples regarding unpacking and index accessing, so that backward-compatipility should exist. ---------- components: Library (Lib) messages: 305970 nosy: Richard Neumann priority: normal severity: normal status: open title: Make iteration over dict_items yield namedtuples type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 13:11:50 2017 From: report at bugs.python.org (Olivier Grisel) Date: Thu, 09 Nov 2017 18:11:50 +0000 Subject: [New-bugs-announce] [issue31993] pickle.dump allocates unnecessary temporary bytes / str Message-ID: <1510251110.85.0.213398074469.issue31993@psf.upfronthosting.co.za> New submission from Olivier Grisel : I noticed that both pickle.Pickler (C version) and pickle._Pickler (Python version) make unnecessary memory copies when dumping large str, bytes and bytearray objects. This is caused by unnecessary concatenation of the opcode and size header with the large bytes payload prior to calling self.write. For protocol 4, an additional copy is caused by the framing mechanism. I will submit a pull request to fix the issue for the Python version. I am not sure how to test this properly. The BigmemPickleTests seems to be skipped on my 16 GB laptop. ---------- components: Library (Lib) messages: 305975 nosy: Olivier.Grisel, pitrou priority: normal severity: normal status: open title: pickle.dump allocates unnecessary temporary bytes / str type: resource usage versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 14:05:23 2017 From: report at bugs.python.org (Jason Hihn) Date: Thu, 09 Nov 2017 19:05:23 +0000 Subject: [New-bugs-announce] [issue31994] json encoder exception could be better Message-ID: <1510254323.87.0.213398074469.issue31994@psf.upfronthosting.co.za> New submission from Jason Hihn : Given this traceback: File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: 7.0374198 is not JSON serializable It would actually be better to have the error reported as type(o)+ " is not JSON serializable." because at first glance, 7.0374198 *is* serializable. In this specific case, the issue can be fixed by attempting to serialize float(o), because it is a ndarray. Maybe there's a better way to do numpy types or some kind of automatic conversion but for now, this is only a request to alter the message, I'd hope to something like: repr(o) + " of type " + type(o) + " is not JSON serializable" It's it's really more about the type rather than the value being serialized. ---------- components: Extension Modules messages: 305980 nosy: Jason Hihn priority: normal severity: normal status: open title: json encoder exception could be better type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 14:06:10 2017 From: report at bugs.python.org (Alexander Mentis) Date: Thu, 09 Nov 2017 19:06:10 +0000 Subject: [New-bugs-announce] [issue31995] Set operations documentation error Message-ID: <1510254370.03.0.213398074469.issue31995@psf.upfronthosting.co.za> New submission from Alexander Mentis : Documentation for set/frozenset says |=, &=, -=, ^= operators do not apply to immutable instances of frozenset. This is incorrect. These operators can be used on frozenset; however, they behave differently on frozenset than on set. When used with set, they modify the target set in place. When used with frozenset, they return a new frozenset that replaces the target frozenset. ---------- assignee: docs at python components: Documentation messages: 305981 nosy: Alexander Mentis, docs at python priority: normal severity: normal status: open title: Set operations documentation error versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 18:34:14 2017 From: report at bugs.python.org (Luther Thompson) Date: Thu, 09 Nov 2017 23:34:14 +0000 Subject: [New-bugs-announce] [issue31996] `setuptools.setup` parameter `py_modules` is undocumented Message-ID: <1510270454.88.0.213398074469.issue31996@psf.upfronthosting.co.za> New submission from Luther Thompson : I wrote my own distribution package with only one module, but the module file was not being installed along with the dist info file. I found by looking up the code for the `six` module that `setup` has a `py_modules` parameter which apparently must be used to make the installation work. This module is not mentioned anywhere in https://packaging.python.org/tutorials/distributing-packages/. ---------- assignee: docs at python components: Documentation messages: 305997 nosy: Luther Thompson, docs at python priority: normal severity: normal status: open title: `setuptools.setup` parameter `py_modules` is undocumented type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 9 20:54:14 2017 From: report at bugs.python.org (Sam Napolitano) Date: Fri, 10 Nov 2017 01:54:14 +0000 Subject: [New-bugs-announce] [issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate Message-ID: <1510278854.68.0.213398074469.issue31997@psf.upfronthosting.co.za> New submission from Sam Napolitano : I recently came across an issue in the ssl library and have a simple fix to address it. When doing hostname verification against an X.509 certificate, a trailing dot (period) in the hostname is matched against the certificate. But the trailing dot should only be applied to the DNS lookup not the certificate match. Conversely, a certificate that has a trailing dot in its commonName (probably rare but allowed) should match a hostname without the trailing dot. As the ssl library is written now, both cases fail. The truth table below shows the current python ssl DNS matching behavior. +----------------------------------------+ | # hostname certificate MATCH | | +------------------------------------+ | | | dns dns. cname cname. | | | +------------------------------------+ | | 1 x x TRUE | | 2 x x FALSE | | 3 x x FALSE | | 4 x x TRUE | +----------------------------------------+ Case 1 and 4 currently match as both hostname and certificate strings match exactly when the trailing dot is either present or not. Case 2 is unlikely, as certificates are rarely signed with a trailing dot in the subject commonName and if they were, clients would ALWAYS have to enter the hostname with a trailing dot to get a match. Case 3 is more likely where the hostname has a trailing dot, but the certificate does not. For example, "www.example.com." is used for the DNS lookup, but then, "www.example.com." will not match the certificate due to the trailing dot missing from the certificate. I propose the truth table should be true in all cases and just ignore the trailing dot in both the hostname and certificate. As best I can tell, the RFCs [1] are silent on this issue. Although the hostname and commonName strings currently must match, there are a couple of precedents where ignoring the trailing dot is done in practice. Web browsers allow a trailing dot in the URI and will accept a certificate even when the certificate doesn't have a trailing dot. For example, visit Google with trailing dot (https://www.google.com./) from a browser of your choice and check certificate. It should check out as valid. [2] Also, at least two language SSL libraries, Ruby [3] and Go [4], match certificates when hostnames contain a trailing dot. Lastly cURL [5] ignores trailing dots in certs and hostnames. In summary, I don't feel the current python ssl library is wrong - it is following an interpretation of the RFC. But I think it can be more permissive, following the spirit of the RFC without sacrificing security. Patch attached with code change. If accepted, I can do a more formal PR, backport to 2.7 and add tests. Thoughts? -Sam Example of issue ================ Python 3.7.0a2+ (heads/master-dirty:cbe1756e3e, Nov 3 2017, 15:56:14) [Clang 8.1.0 (clang-802.0.42)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>> cert = {'subject': ((('commonName', 'example.com'),),)} >>> ssl.match_hostname(cert, "example.com") ## Case 1 from truth table >>> ssl.match_hostname(cert, "example.com.") ## Case 3 from truth table Traceback (most recent call last): File "", line 1, in File ".../cpython/Lib/ssl.py", line 330, in match_hostname % (hostname, dnsnames[0])) ssl.CertificateError: hostname 'example.com.' doesn't match 'example.com' >>> cert = {'subject': ((('commonName', 'example.com.'),),)} >>> ssl.match_hostname(cert, "example.com.") ## Case 4 from truth table >>> ssl.match_hostname(cert, "example.com") ## Case 2 from truth table Traceback (most recent call last): File "", line 1, in File ".../cpython/Lib/ssl.py", line 330, in match_hostname % (hostname, dnsnames[0])) ssl.CertificateError: hostname 'example.com' doesn't match 'example.com.' References ========== [1] RFCs - there may be other RFCs addressing X.509 certificates https://tools.ietf.org/html/rfc6125 https://tools.ietf.org/html/rfc5280 https://tools.ietf.org/html/rfc3986 [2] Old Mozilla thread discussing the trailing dot: https://bugzilla.mozilla.org/show_bug.cgi?id=134402#c36 I quote: Yes, it's ok to match "www.example.com." (trailing) to the cert with "www.example.com" (no trailing) It's also OK to match "www.example.com" (no trailing) to the cert with "www.example.com." (trailing) [3] Ruby Ironically Ruby doesn't even take the trailing dot into consideration as it splits the strings using dot as the delimiter. irb> "www.example.com".split('.') == "www.example.com.".split('.') => true https://github.com/ruby/openssl/blob/master/lib/openssl/ssl.rb#L295 [4] Go The trailing dot is explicitly removed in Go TLS library. https://github.com/golang/go/blob/master/src/crypto/x509/verify.go#L913 [5] cURL cURL strips trailing dot following behavior in browsers. https://github.com/curl/curl/blob/master/lib/hostcheck.c#L51 The cURL author discusses the trailing dot in a couple threads. https://github.com/curl/curl/issues/716 https://lists.w3.org/Archives/Public/ietf-http-wg/2016JanMar/0430.html ---------- assignee: christian.heimes components: SSL files: ssl_trailing_dot.patch keywords: patch messages: 306004 nosy: christian.heimes, samiam priority: normal severity: normal status: open title: SSL lib does not handle trailing dot (period) in hostname or certificate type: behavior versions: Python 2.7, Python 3.8 Added file: https://bugs.python.org/file47257/ssl_trailing_dot.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:25:53 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:25:53 +0000 Subject: [New-bugs-announce] [issue31998] test_zipapp failed when the zlib module is not available Message-ID: <1510305953.0.0.213398074469.issue31998@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : http://buildbot.python.org/all/#/builders/14/builds/160/steps/4/logs/stdio ====================================================================== ERROR: test_create_archive_with_compression (test.test_zipapp.ZipAppTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_zipapp.py", line 111, in test_create_archive_with_compression zipapp.create_archive(source, target, compressed=True) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/zipapp.py", line 138, in create_archive with zipfile.ZipFile(fd, 'w', compression=compression) as z: File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/zipfile.py", line 1061, in __init__ _check_compression(compression) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/zipfile.py", line 644, in _check_compression "Compression requires the (missing) zlib module") RuntimeError: Compression requires the (missing) zlib module ---------------------------------------------------------------------- ---------- assignee: serhiy.storchaka components: Tests messages: 306009 nosy: paul.moore, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: test_zipapp failed when the zlib module is not available type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:28:58 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:28:58 +0000 Subject: [New-bugs-announce] [issue31999] test_venv failed when the zlib module is not available Message-ID: <1510306138.21.0.213398074469.issue31999@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : http://buildbot.python.org/all/#/builders/14/builds/160/steps/4/logs/stdio ====================================================================== FAIL: test_with_pip (test.test_venv.EnsurePipTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_venv.py", line 363, in do_test_with_pip with_pip=True) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_venv.py", line 56, in run_with_capture func(*args, **kwargs) subprocess.CalledProcessError: Command '['/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmpljv28gk_/bin/python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_venv.py", line 421, in test_with_pip self.do_test_with_pip(False) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_venv.py", line 369, in do_test_with_pip self.fail(msg.format(exc, details)) AssertionError: Command '['/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmpljv28gk_/bin/python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. **Subprocess Output** Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/ensurepip/__main__.py", line 5, in sys.exit(ensurepip._main()) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 204, in _main default_pip=args.default_pip, File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 117, in _bootstrap return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 27, in _run_pip import pip zipimport.ZipImportError: can't decompress data; zlib not available ---------------------------------------------------------------------- ---------- assignee: serhiy.storchaka components: Tests messages: 306010 nosy: serhiy.storchaka, vinay.sajip priority: normal severity: normal stage: needs patch status: open title: test_venv failed when the zlib module is not available type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 04:42:08 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 10 Nov 2017 09:42:08 +0000 Subject: [New-bugs-announce] [issue32000] test_undecodable_filename in test_httpservers failed on Mac OS X Message-ID: <1510306928.27.0.213398074469.issue32000@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : http://buildbot.python.org/all/#/builders/14/builds/160/steps/4/logs/stdio ====================================================================== ERROR: test_undecodable_filename (test.test_httpservers.SimpleHTTPServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/support/__init__.py", line 598, in wrapper return func(*args, **kw) File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_httpservers.py", line 395, in test_undecodable_filename with open(os.path.join(self.tempdir, filename), 'wb') as f: OSError: [Errno 92] Illegal byte sequence: '/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmp0hrc3ckd/@test_54539_tmp\udce7w\udcf0.txt' ---------------------------------------------------------------------- ---------- components: Tests, macOS messages: 306011 nosy: ned.deily, ronaldoussoren, serhiy.storchaka priority: normal severity: normal status: open title: test_undecodable_filename in test_httpservers failed on Mac OS X type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:20:30 2017 From: report at bugs.python.org (Tom Hale) Date: Fri, 10 Nov 2017 10:20:30 +0000 Subject: [New-bugs-announce] [issue32001] @lru_cache needs to be called with () Message-ID: <1510309230.43.0.213398074469.issue32001@psf.upfronthosting.co.za> New submission from Tom Hale : This comes from a question I raised on StackOverflow: https://stackoverflow.com/q/47218313/5353461 I've copied the text below ===================================================================== ===================================================================== The [documentation for `lru_cache`](https://docs.python.org/3/library/functools.html#functools.lru_cache) gives the function definition: > @functools.lru_cache(maxsize=128, typed=False) This says to me that `maxsize` is optional. However, it doesn't like being called without an argument: Python 3.6.3 (default, Oct 24 2017, 14:48:20) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import functools >>> @functools.lru_cache ... def f(): ... ... Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/functools.py", line 477, in lru_cache raise TypeError('Expected maxsize to be an integer or None') TypeError: Expected maxsize to be an integer or None >>> Calling with an argument is fine: >>> @functools.lru_cache(8) ... def f(): ... ... >>> Am I misreading the documentation? ===================================================================== ===================================================================== The answer presented this solution: if callable(maxsize): def decorating_function(user_function): wrapper = _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo) return update_wrapper(wrapper, user_function) return decorating_function(max_size) # yes, max_size is the function in this case O:) ===================================================================== ===================================================================== Would you accept a PR based on this solution? ---------- messages: 306016 nosy: ataraxy priority: normal severity: normal status: open title: @lru_cache needs to be called with () _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 05:47:52 2017 From: report at bugs.python.org (Erik Bray) Date: Fri, 10 Nov 2017 10:47:52 +0000 Subject: [New-bugs-announce] [issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C" Message-ID: <1510310872.23.0.213398074469.issue32002@psf.upfronthosting.co.za> New submission from Erik Bray : Several of the tests in test_c_locale_coercion (particularly LocaleCoercionTests._check_c_locale_coercion) tend to assume that the system default locale used when setting setlocale(category, "") and when all the relevant environment variables are empty/blank will be the "C"/"POSIX" locale. While this is often true POSIX does not require this to be the case. For example on Cygwin it already defaults to "C.UTF-8", so these tests fail because they assume the legacy coercion will be used, when it isn't (e.g. the LC_CTYPE environment variable does not get forced to "C.UTF-8"). In principle this can affect any platform, however, that chooses a different default. ---------- components: Tests messages: 306019 nosy: erik.bray, ncoghlan priority: normal severity: normal status: open title: test_c_locale_coercion fails when the default LC_CTYPE != "C" type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 11:33:26 2017 From: report at bugs.python.org (Samuel Nwokenkwo) Date: Fri, 10 Nov 2017 16:33:26 +0000 Subject: [New-bugs-announce] [issue32003] multiprocessing.Array("b", 1), multiprocessing.Array("c", 1 ) wrong value returned Message-ID: <1510331606.87.0.213398074469.issue32003@psf.upfronthosting.co.za> New submission from Samuel Nwokenkwo : 1st sequence: arr = multiprocessing.Array("b", 1) # byte type arr[0] = 's'.encode() print(arr[:]) result is [115] ---- 2nd sequence: arr = multiprocessing.Array("c", 1) # character type arr[0] = 's'.encode() print(arr[:]) result is b's' ---------- Wrong values for given types. ---------- components: asyncio messages: 306037 nosy: snwokenk, yselivanov priority: normal severity: normal status: open title: multiprocessing.Array("b", 1), multiprocessing.Array("c",1 ) wrong value returned versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:40:07 2017 From: report at bugs.python.org (MosesofEgypt) Date: Fri, 10 Nov 2017 23:40:07 +0000 Subject: [New-bugs-announce] [issue32004] Allow specifying code packing order in audioop adpcm functions Message-ID: <1510357207.47.0.213398074469.issue32004@psf.upfronthosting.co.za> New submission from MosesofEgypt : --- Issue --- audioop.adpcm2lin and audioop.lin2adpcm currently treat the high 4 bits of each byte as the first code and the low 4 as the second code. In practice this is often the opposite. http://www.drdobbs.com/database/algorithm-alley/184410326 https://wiki.multimedia.cx/index.php/Microsoft_IMA_ADPCM --- Steps to reproduce --- Run the attached script to decompress the attached wav to two different 16bit signed pcm wav files. The "GOOD" one had the nibbles of each code swapped before being decoded, while the "BAD" one didnt. --- Suggested fix --- I propose an additional optional boolean parameter to these functions to specify which nibble is the first code and which is the second. NOTE: I haven't compiled my changes to test as I do not know how to set up a cpython build environment. This commit is more intended to show how to implement the fix. https://github.com/MosesofEgypt/cpython/commit/4a5ca65833ec79857f065546ae0d90661ce26f5f ---------- files: adpcm_test.zip messages: 306063 nosy: MosesofEgypt priority: normal severity: normal status: open title: Allow specifying code packing order in audioop adpcm functions type: enhancement versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47258/adpcm_test.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 18:53:08 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 10 Nov 2017 23:53:08 +0000 Subject: [New-bugs-announce] [issue32005] mutliprocessing.Array misleading error message in slice assignment Message-ID: <1510357988.91.0.213398074469.issue32005@psf.upfronthosting.co.za> New submission from Steven D'Aprano : multiprocessing.Array slice assignment claims to require a single character even if it requires more than one: py> arr = multiprocessing.Array('c', 3) py> arr[:] = b'xyz' # works py> arr[:] = 'xyz' Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.5/multiprocessing/sharedctypes.py", line 226, in __setitem__ self._obj[i] = value TypeError: one character bytes, bytearray or integer expected ---------- components: Library (Lib) messages: 306066 nosy: steven.daprano priority: normal severity: normal status: open title: mutliprocessing.Array misleading error message in slice assignment type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 10 19:10:10 2017 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 11 Nov 2017 00:10:10 +0000 Subject: [New-bugs-announce] [issue32006] multiprocessing.Array 'c' code is not documented Message-ID: <1510359010.74.0.213398074469.issue32006@psf.upfronthosting.co.za> New submission from Steven D'Aprano : multiprocessing.Array is documented as taking the same character codes as array.array, but it also takes 'c' which is not documented. https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Array https://docs.python.org/3/library/array.html#module-array ---------- assignee: docs at python components: Documentation messages: 306069 nosy: docs at python, steven.daprano priority: normal severity: normal status: open title: multiprocessing.Array 'c' code is not documented type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 12:06:23 2017 From: report at bugs.python.org (Mike Gilbert) Date: Sat, 11 Nov 2017 17:06:23 +0000 Subject: [New-bugs-announce] [issue32007] nis module fails to build against glibc-2.26 Message-ID: <1510419983.02.0.213398074469.issue32007@psf.upfronthosting.co.za> New submission from Mike Gilbert : The nis extension module fails to build against glibc-2.26 with the "obsolete-rpc" option disabled. Downstream bug report: https://bugs.gentoo.org/631488 glibc-2.26 release notes: https://sourceware.org/ml/libc-alpha/2017-08/msg00010.html The nis module is normally skipped since rpcsvc/yp_prot.h will not exist. However, if the external "libnsl" package is installed, compilation is attempted and fails as given below. building 'nis' extension x86_64-pc-linux-gnu-gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -march=native -O2 -pipe -g -fwrapv -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I./Include -I. -I/var/tmp/portage/dev-lang/python-3.6.3/work/Python-3.6.3/Include -I/var/tmp/portage/dev-lang/python-3.6.3/work/Python-3.6.3 -c /var/tmp/portage/dev-lang/python-3.6.3/work/Python-3.6.3/Modules/nismodule.c -o build/temp.linux-x86_64-3.6/var/tmp/portage/dev-lang/python-3.6.3/work/Python-3.6.3/Modules/nismodule.o /var/tmp/portage/dev-lang/python-3.6.3/work/Python-3.6.3/Modules/nismodule.c:17:21: fatal error: rpc/rpc.h: No such file or directory #include ^ compilation terminated. To summarize: glibc no longer provides rpc/rpc.h or rpcsvc/yp_prot.h. One must install a couple of external libraries to provide the same functionality. The missing rpcsvc/yp_prot.h file can be resolved by installing the "libnsl" package, which installs the header where setup.py expects to find it. The missing rpc/rpc.h file may be provided by the "libtirpc" package, but this installs the file under /usr/include/tirpc, which must be added to the include path (-I/usr/include/tirpc). Ideally, pkg-config would be used to find both libnsl and libtirpc. ---------- components: Build messages: 306090 nosy: floppymaster priority: normal severity: normal status: open title: nis module fails to build against glibc-2.26 type: compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 14:36:05 2017 From: report at bugs.python.org (Kurt Roeckx) Date: Sat, 11 Nov 2017 19:36:05 +0000 Subject: [New-bugs-announce] [issue32008] Example suggest to use a TLSv1 socket Message-ID: <1510428965.62.0.213398074469.issue32008@psf.upfronthosting.co.za> New submission from Kurt Roeckx : Here: https://docs.python.org/3/library/ssl.html#ssl.SSLContext.check_hostname And here: https://docs.python.org/2/library/ssl.html#ssl.SSLContext.check_hostname It uses ssl.PROTOCOL_TLSv1, which is a bad example. Please change it to PROTOCOL_SSLv23 or PROTOCOL_TLS. (Those were the first 2 examples I could find via google on how to create an ssl connection using python.) ---------- assignee: docs at python components: Documentation messages: 306093 nosy: docs at python, kroeckx priority: normal severity: normal status: open title: Example suggest to use a TLSv1 socket type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 11 17:18:02 2017 From: report at bugs.python.org (Britton Kerin) Date: Sat, 11 Nov 2017 22:18:02 +0000 Subject: [New-bugs-announce] [issue32009] seg fault when using Cntrl-q keymap to exit app Message-ID: <1510438682.67.0.213398074469.issue32009@psf.upfronthosting.co.za> New submission from Britton Kerin : This probably applies to more recent version also. It may be a readline bug, but I haven't seen it except when using the python interface, despite using this same .inputrc file with many different command line programs. I've attached the ~/.inputrc which are required to trigger the problem. This simple script will allow the problem to be reproduced: #!/usr/bin/python3.4-dbg import readline input('the_prompt> ') After launching test.py with the given ~/.inputrc in place, simply type Cntrl-q to trigger the seg fault. Perhaps if this can be confirmed to be a readline issue someone can submit a bug report to that project. Britton ---------- components: Library (Lib) files: the.inputrc messages: 306094 nosy: Britton Kerin priority: normal severity: normal status: open title: seg fault when using Cntrl-q keymap to exit app type: crash versions: Python 3.4 Added file: https://bugs.python.org/file47259/the.inputrc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 09:49:15 2017 From: report at bugs.python.org (Mario Corchero) Date: Sun, 12 Nov 2017 14:49:15 +0000 Subject: [New-bugs-announce] [issue32010] Multiple get "itemgetter" Message-ID: <1510498155.0.0.213398074469.issue32010@psf.upfronthosting.co.za> New submission from Mario Corchero : At the moment we can get an operator that performs multiple "gets" in object attributes. Example: >>> getter = operator.attrgetter("child1.child2") >>> o = mock.Mock() >>> getter(o) On the other hand, itemgetter -which can be used for mappings- can only access single level. a = itemgetter("a")(d) The proposal is to add a way to perform multiple fetches the say way attrgetter is doing it. The main worry here for me would be that it might break some existing callers if someone had "a.b" as a key in a dict and were using itemgetter. An option might be a new argument separator to split those so it'd look like: d = dict(a=dict(b=1), b=dict(c=2)) ab = itemgetter("a.b", separator=".")(d) This is effectively sugar for: itemgetter("b")(itemgetter("a")(d)) This should be available in the *args version as well so the following is valid: d = dict(a=dict(b=1), b=dict(c=2)) ab, ac = itemgetter("a.b", "b.c", separator=".")(d) This is coming from python-dev mailing list thread: "[Python-Dev] Analog of PEP 448 for dicts (unpacking in assignment with dict rhs)" I have a sample implementation on the py side. If this is interesting I can send a PR with the full impl (I havent started yet with the C one) If anyone is interested in the ongoing implementation: https://github.com/mariocj89/cpython/tree/multiple_itemgetter ---------- components: Library (Lib) messages: 306114 nosy: mariocj89 priority: normal severity: normal status: open title: Multiple get "itemgetter" type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 12:50:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Nov 2017 17:50:16 +0000 Subject: [New-bugs-announce] [issue32011] Restore loading of TYPE_INT64 in marshal Message-ID: <1510509016.94.0.213398074469.issue32011@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : TYPE_INT64 is supported in the marshal module since Python 1.5. Since its use causes instability of marhalled files produced on different platforms, the marshal module in Python 3.3 no longer use it when write new files (see issue15466). And in Python 3.4 it stopped reading files containing the TYPE_INT64 code (see issue15480). This is backward incompatible change. Python 2.7 still produce files containing the TYPE_INT64 code (though this code is rare, because integers in ranges -9223372036854775808..-2147483649 and 2147483648..9223372036854775807 are rare), and there may be marshal files produced by older versions of Python 3, Python 2 and Python 1. Formally Python 3 supports marshal formats produced by all previous versions, except the code objects and the TYPE_INT64 code. Supporting loading the TYPE_INT64 code don't create problems like using it for saving data. But it is needed for backward compatibility. I think that removing the TYPE_INT64 code was a mistake. ---------- assignee: serhiy.storchaka components: Extension Modules messages: 306128 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Restore loading of TYPE_INT64 in marshal type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 12 17:29:05 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 12 Nov 2017 22:29:05 +0000 Subject: [New-bugs-announce] [issue32012] Disallow ambiguous syntax f(x for x in [1], ) Message-ID: <1510525745.4.0.213398074469.issue32012@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The syntax f(x for x in [1],) is ambiguous and reasons that allow it (omitting parenthesis in generator expression and using trailing comma in call expression) are not applicable in this case. Rationales see on Python-Dev: https://mail.python.org/pipermail/python-dev/2017-November/150481.html. ---------- components: Interpreter Core messages: 306132 nosy: benjamin.peterson, brett.cannon, ncoghlan, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Disallow ambiguous syntax f(x for x in [1],) type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 00:08:34 2017 From: report at bugs.python.org (Mathew M.) Date: Mon, 13 Nov 2017 05:08:34 +0000 Subject: [New-bugs-announce] [issue32013] _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter() Message-ID: <1510549714.44.0.213398074469.issue32013@psf.upfronthosting.co.za> New submission from Mathew M. : Hey there! I'm fairly new to the development process for Python, so I figured I'd start off with something tiny and then work on up from there. I'm not sure if this sort of minor fix warrants an issue being created, but I made this just to err on the safe side of things. So, as far as I understand (by all means correct me if I'm wrong), a 'Py_DECREF(key);' should be present before the return in the conditional within fast_save_enter() (https://github.com/python/cpython/blob/d7d4fea4a39da4bfdea1de22fe040023eb4ddc17/Modules/_pickle.c#L1792) ---------- components: Extension Modules messages: 306139 nosy: Mathew M. priority: normal severity: normal status: open title: _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 01:00:30 2017 From: report at bugs.python.org (stevezh) Date: Mon, 13 Nov 2017 06:00:30 +0000 Subject: [New-bugs-announce] [issue32014] multiprocessing Server's shutdown method useless send message to manager Message-ID: <1510552830.41.0.213398074469.issue32014@psf.upfronthosting.co.za> New submission from stevezh : When shutdown the manager, Server's handle_request will send back message to the manager, so is useless for the Server's shutdown method send back "None" to the manager? Source code from Lib/multiprocessing/managers.py: def shutdown(self, c): ''' Shutdown this process ''' try: util.debug('manager received shutdown message') # Is useless here? c.send(('#RETURN', None)) except: import traceback traceback.print_exc() finally: self.stop_event.set() Server's handle_request may throw and catch exception because the conn is closed in _finalize_manager() after Server's shutdown method returns. code from handle_request(): try: c.send(msg) except Exception as e: try: c.send(('#TRACEBACK', format_exc())) except Exception: pass code from _finalize_manager(): try: conn = _Client(address, authkey=authkey) try: dispatch(conn, None, 'shutdown') finally: conn.close() except Exception: pass Also the Server's shutdown method only used by manager class. ---------- components: Library (Lib) messages: 306142 nosy: davin, jnoller, pitrou, sbt, stevezh priority: normal severity: normal status: open title: multiprocessing Server's shutdown method useless send message to manager type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 07:39:18 2017 From: report at bugs.python.org (Andrey) Date: Mon, 13 Nov 2017 12:39:18 +0000 Subject: [New-bugs-announce] [issue32015] Asyncio cycling during simultaneously socket read/write and reconnection Message-ID: <1510576758.61.0.213398074469.issue32015@psf.upfronthosting.co.za> New submission from Andrey : The bug is happened when the async reading/writing interrupted by other async method which reconnects the socket. The closed socket calls the appropriate handler in the loop due to cannot be removed due to wrong fileno of socket. ---------- components: asyncio files: raise.py messages: 306154 nosy: andr04, yselivanov priority: normal severity: normal status: open title: Asyncio cycling during simultaneously socket read/write and reconnection type: behavior versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47262/raise.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 14:18:46 2017 From: report at bugs.python.org (Larry Chen) Date: Mon, 13 Nov 2017 19:18:46 +0000 Subject: [New-bugs-announce] [issue32016] Python 3.6.3 venv FAILURE Message-ID: <1510600726.31.0.213398074469.issue32016@psf.upfronthosting.co.za> New submission from Larry Chen : Upgraded from 3.6.1 to 3.6.3; but got an error when trying to create my virtual environment. [larrchen at rslab239 Larry]$ /opt/python3.6.3/bin/python3.6 -m venv /u/larrchen/work2/SAN/Users/Larry/rslab239_myENV_363 Error: Command '['/u/larrchen/work2/SAN/Users/Larry/rslab239_myENV_363/bin/python3.6', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. I can create a virtual env for 3.6.1 and 3.6.2 but not for 3.6.3. This is a regression issue. Try this command. It fails every time. python3.6 -m venv myEnv Larry ---------- messages: 306165 nosy: nihon2000 priority: normal severity: normal status: open title: Python 3.6.3 venv FAILURE versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 16:17:19 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 13 Nov 2017 21:17:19 +0000 Subject: [New-bugs-announce] [issue32017] profile.Profile() has no method enable() Message-ID: <1510607839.08.0.213398074469.issue32017@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The section here is wrong as it claims that API is common to profile and cProfile. https://docs.python.org/3/library/profile.html#module-cProfile ---------- assignee: docs at python components: Documentation messages: 306169 nosy: docs at python, eric.araujo, ezio.melotti, pitrou, willingc priority: normal severity: normal status: open title: profile.Profile() has no method enable() type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 17:06:50 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Mon, 13 Nov 2017 22:06:50 +0000 Subject: [New-bugs-announce] [issue32018] inspect.signature does not respect PEP 8 Message-ID: <1510610810.77.0.213398074469.issue32018@psf.upfronthosting.co.za> New submission from Ivan Levkivskyi : The string representation of a function signature with annotations is currently like this: >>> def __init__(self, x: int = 1, y: int = 2) -> None: pass ... >>> import inspect >>> str(inspect.signature(__init__)) '(self, x:str=1, y:int=2) -> None' At the same time PEP 8 says: When combining an argument annotation with a default value, use spaces around the = sign (but only for those arguments that have both an annotation and a default). Yes: def munge(sep: AnyStr = None): ... def munge(input: AnyStr, sep: AnyStr = None, limit=1000): ... No: def munge(input: AnyStr=None): ... def munge(input: AnyStr, limit = 1000): ... I think there should be spaces in the signature repr. ---------- messages: 306171 nosy: levkivskyi, yselivanov priority: normal severity: normal status: open title: inspect.signature does not respect PEP 8 type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 18:02:31 2017 From: report at bugs.python.org (Aaron Meurer) Date: Mon, 13 Nov 2017 23:02:31 +0000 Subject: [New-bugs-announce] [issue32019] Interactive shell doesn't work with readline bracketed paste Message-ID: <1510614151.97.0.213398074469.issue32019@psf.upfronthosting.co.za> New submission from Aaron Meurer : Here are the steps to reproduce this: - Compile and link Python against readline version 7.0 or higher. - Add set enable-bracketed-paste on to your ~/.inputrc - Start python and paste the following two lines. Make sure to use a terminal emulator that supports bracketed paste (most modern ones do). You'll need to type enter after pasting the lines. a = 1 a You get something like >>> a = 1 a File "", line 1 a ^ SyntaxError: multiple statements found while compiling a single statement It does work, however, if you paste something that has a newline but is a single statement, like (1, 2) Fixing this in the right way might not be so easy, due to the way that compile('single') is over-engineered. A simple fix would be to disable bracketed paste in the Python shell. I tested this with Python 3.6.3. I was not able to get the git master to compile, so I couldn't test it there. ---------- messages: 306176 nosy: Aaron.Meurer priority: normal severity: normal status: open title: Interactive shell doesn't work with readline bracketed paste _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 13 23:46:30 2017 From: report at bugs.python.org (Mathew M.) Date: Tue, 14 Nov 2017 04:46:30 +0000 Subject: [New-bugs-announce] [issue32020] arraymodule: Missing Py_DECREF in failure case of make_array() Message-ID: <1510634790.37.0.213398074469.issue32020@psf.upfronthosting.co.za> New submission from Mathew M. : Similar to issue 32013, just in a different location. For reference: https://github.com/python/cpython/blob/28b624825eb92cb8c96fbf8da267d8d14a61a841/Modules/arraymodule.c#L1932 ---------- components: Extension Modules messages: 306183 nosy: Mathew M. priority: normal severity: normal status: open title: arraymodule: Missing Py_DECREF in failure case of make_array() type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 02:43:50 2017 From: report at bugs.python.org (Andrey Klinger) Date: Tue, 14 Nov 2017 07:43:50 +0000 Subject: [New-bugs-announce] [issue32021] Brotli encoding is not recognized by mimetypes Message-ID: <1510645430.68.0.213398074469.issue32021@psf.upfronthosting.co.za> New submission from Andrey Klinger : Brotli (.br) encoding is not recognized by mimetypes module. mimetypes doesn't have API for adding encodings. The encoding is supported by most browsers: https://caniuse.com/#feat=brotli ---------- components: Library (Lib) messages: 306188 nosy: Andrey Klinger priority: normal severity: normal status: open title: Brotli encoding is not recognized by mimetypes type: enhancement versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 04:02:41 2017 From: report at bugs.python.org (Shimon Malachi Cohen) Date: Tue, 14 Nov 2017 09:02:41 +0000 Subject: [New-bugs-announce] [issue32022] Python problem - == RESTART: Shell ===== Message-ID: <1510650161.13.0.213398074469.issue32022@psf.upfronthosting.co.za> New submission from Shimon Malachi Cohen : Dear Friends, It seems that I manage to find a problem with Python ... version 3.6.3 Attached is a PY file designed to solve a puzzle: see function makeGame1 To find a solution run: doFind() >>> doFind() ----> counter: 11735841 rec depth: 2367 86792-719 72581-938 916-398-- --9378-97 3985-4859 27-2879-- --819-698 937-69782 812-78561 ----> counter: 29203691 >>> It takes a few seconds to come up with a solution (deep recursive exhaustive search) if you switch between lines 109 <==> 110 then it restart Python !?!?!?!?! (see below) >>> doFind() =============================== RESTART: Shell =============================== >>> Dr. Shimon Cohen shamon51 at gmail.com ---------- components: Interpreter Core files: KAKURU.py messages: 306190 nosy: shamon51 priority: normal severity: normal status: open title: Python problem - == RESTART: Shell ===== type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47263/KAKURU.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 05:25:04 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 14 Nov 2017 10:25:04 +0000 Subject: [New-bugs-announce] [issue32023] Always require parentheses for genexps in base class lists Message-ID: <1510655104.02.0.213398074469.issue32023@psf.upfronthosting.co.za> New submission from Nick Coghlan : The compiler currently allows parentheses to be omitted if a generator expression is the sole entry in a base class list: >>> class C(x for x in []): pass ... Traceback (most recent call last): File "", line 1, in TypeError: cannot create 'generator' instances The language reference states that the parentheses around a generator expression are only optional for "calls with only one argument": https://docs.python.org/3/reference/expressions.html#generator-expressions A base class list is not a call, so this should be treated as a syntax error, rather than being handled as equivalent to `class C((x for x in [])): pass` ---------- components: Interpreter Core messages: 306197 nosy: ncoghlan, serhiy.storchaka priority: low severity: normal status: open title: Always require parentheses for genexps in base class lists type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:09:52 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 14 Nov 2017 13:09:52 +0000 Subject: [New-bugs-announce] [issue32024] Nominal decorator function call syntax is inconsistent with regular function calls Message-ID: <1510664992.07.0.213398074469.issue32024@psf.upfronthosting.co.za> New submission from Nick Coghlan : Function calls in decorators are implemented as regular function calls, and hence permit the use of generator expressions as their sole argument without a second pair of parentheses. However, https://docs.python.org/3/reference/compound_stmts.html#function-definitions defines the permitted arguments differently from the way https://docs.python.org/3/reference/expressions.html#calls defines them, and thus technically considers a "function call as a decorator" to be a different construct from "a function call". The actual implementation treats these as the same thing, so clarification is needed as to whether it is the implementation or the language specification that should be updated to resolve the inconsistency. ---------- assignee: docs at python components: Documentation messages: 306205 nosy: docs at python, gvanrossum, ncoghlan, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Nominal decorator function call syntax is inconsistent with regular function calls type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 08:50:20 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 14 Nov 2017 13:50:20 +0000 Subject: [New-bugs-announce] [issue32025] Add time.thread_time() Message-ID: <1510667420.17.0.213398074469.issue32025@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Currently, the time module has time.process_time(), a cross-platform function for getting per-process elapsed CPU time. Similarly, we could expose time.thread_time(), to get per-thread elapsed CPU time. On a modern POSIX platform, it can use clock_gettime(CLOCK_THREAD_CPUTIME_ID). On Windows, it can use GetThreadTimes(): https://msdn.microsoft.com/en-us/library/ms683237%28VS.85%29.aspx On other platforms, it can simply raise NotImplementedError. Currently, you would need ctypes hacks to call GetThreadTimes(), which is not very nice. ---------- components: Library (Lib) messages: 306210 nosy: belopolsky, haypo, pitrou priority: normal severity: normal status: open title: Add time.thread_time() type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 11:37:08 2017 From: report at bugs.python.org (PJ Naughter) Date: Tue, 14 Nov 2017 16:37:08 +0000 Subject: [New-bugs-announce] [issue32026] Memory leaks in Python on Windows Message-ID: <1510677428.51.0.213398074469.issue32026@psf.upfronthosting.co.za> New submission from PJ Naughter : I would like to report memory leaks in Python 3.6.3 when embedded in a C++ Windows app. I have download the Python 3.6.3 code and compiled a debug version of Python with my copy of Visual Studio 2017 Professional (have also confirmed the problem in Visual Studio 2015 Professional) and built the debug version of the Python DLL. With the following sample app I get memory leaks when compiled in debug mode: //Pull in the Windows header and the MSVC Debug C Runtime #include #define _CRTDBG_MAP_ALLOC #include #include //Pull in Python #include int __stdcall WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, _In_ LPTSTR /*lpCmdLine*/, int /*nCmdShow*/) { //Track memory leaks using the MSVC Debug CRT _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); //_CrtSetBreakAlloc(81); //Initialize Python Py_Initialize(); PyEval_InitThreads(); //Pretend this app does something! Sleep(2000); //Shutdown Python Py_FinalizeEx(); } Taking out the calls to Py_Initialize, PyEval_InitThreads & Py_FinalizeEx results in no memory leaks being reported. The actual reported memory leaks are reported to the output window in Visual Studio as follows: Detected memory leaks! Dumping objects -> {700} normal block at 0x014E0078, 2604 bytes long. Data: < r o > 00 00 0A 1C 72 FB FB FB 00 00 0A 0C 6F FB FB FB { 698 } normal block at 0x01502148, 2604 bytes long. Data : < r o > 00 00 0A 1C 72 FB FB FB 00 00 0A 0C 6F FB FB FB { 697 } normal block at 0x014DA350, 52 bytes long. Data : < $r > 00 00 00 24 72 FB FB FB FF FF FF FF FF FF FF FF { 458 } normal block at 0x01511A88, 81968 bytes long. Data : < @ r @ o > 00 01 40 20 72 FB FB FB 00 01 40 10 6F FB FB FB { 389 } normal block at 0x014F1270, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 359 } normal block at 0x014FA730, 5168 bytes long. Data : < r o > 00 00 14 20 72 FB FB FB 00 00 14 10 6F FB FB FB { 319 } normal block at 0x014EE120, 2604 bytes long. Data : < r o > 00 00 0A 1C 72 FB FB FB 00 00 0A 0C 6F FB FB FB { 315 } normal block at 0x014EC478, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 307 } normal block at 0x01500B98, 529 bytes long. Data : < r o > 00 00 02 01 72 FB FB FB 00 00 01 F1 6F FB FB FB { 281 } normal block at 0x01500350, 709 bytes long. Data : < r o > 00 00 02 B5 72 FB FB FB 00 00 02 A5 6F FB FB FB { 264 } normal block at 0x014FDAF8, 10284 bytes long. Data : < (r(o > 00 00 28 1C 72 FB FB FB 00 00 28 0C 6F FB FB FB { 253 } normal block at 0x014F89F0, 539 bytes long. Data : < r o > 00 00 02 0B 72 FB FB FB 00 00 01 FB 6F FB FB FB { 248 } normal block at 0x014F5448, 847 bytes long. Data: < ? r / o > 00 00 03 3F 72 FB FB FB 00 00 03 2F 6F FB FB FB { 247 } normal block at 0x014F0A78, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 235 } normal block at 0x014F2A58, 1409 bytes long. Data : < qr ao > 00 00 05 71 72 FB FB FB 00 00 05 61 6F FB FB FB { 234 } normal block at 0x014F1FB8, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 233 } normal block at 0x014F1A68, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 232 } normal block at 0x014F1518, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 231 } normal block at 0x014E2BE0, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 230 } normal block at 0x014EFFF8, 2604 bytes long. Data : < r o > 00 00 0A 1C 72 FB FB FB 00 00 0A 0C 6F FB FB FB { 229 } normal block at 0x014EFD60, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 228 } normal block at 0x014EF9E8, 843 bytes long. Data : <; r + o > 00 00 03 3B 72 FB FB FB 00 00 03 2B 6F FB FB FB { 227 } normal block at 0x014EF750, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 226 } normal block at 0x014E4410, 561 bytes long. Data : < !r o > 00 00 02 21 72 FB FB FB 00 00 02 11 6F FB FB FB { 225 } normal block at 0x014EF1D0, 1360 bytes long. Data : < @r 0o > 00 00 05 40 72 FB FB FB 00 00 05 30 6F FB FB FB { 224 } normal block at 0x014E49E0, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 206 } normal block at 0x014E3C88, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 205 } normal block at 0x014E3978, 734 bytes long. Data : < r o > 00 00 02 CE 72 FB FB FB 00 00 02 BE 6F FB FB FB { 204 } normal block at 0x014E3358, 1521 bytes long. Data : < r o > 00 00 05 E1 72 FB FB FB 00 00 05 D1 6F FB FB FB { 195 } normal block at 0x014E9890, 1553 bytes long. Data : < r o > 00 00 06 01 72 FB FB FB 00 00 05 F1 6F FB FB FB { 192 } normal block at 0x014E8648, 734 bytes long. Data : < r o > 00 00 02 CE 72 FB FB FB 00 00 02 BE 6F FB FB FB { 191 } normal block at 0x014E8508, 276 bytes long. Data : < r C : \ p > 00 00 01 04 72 FB FB FB 43 00 3A 00 5C 00 70 00 {118} normal block at 0x014E2948, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 117 } normal block at 0x014E26B0, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 116 } normal block at 0x014E1F38, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 115 } normal block at 0x014E21D0, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 113 } normal block at 0x014E1CA0, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 111 } normal block at 0x014E0DB0, 593 bytes long. Data : < Ar 1o > 00 00 02 41 72 FB FB FB 00 00 02 31 6F FB FB FB { 110 } normal block at 0x014E1528, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 108 } normal block at 0x014E1048, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 106 } normal block at 0x014E0B18, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 105 } normal block at 0x014DD3C0, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 104 } normal block at 0x014DD128, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 103 } normal block at 0x014DCE90, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 102 } normal block at 0x014DCBF8, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 101 } normal block at 0x014DC9B8, 532 bytes long. Data : < r o > 00 00 02 04 72 FB FB FB 00 00 01 F4 6F FB FB FB { 99 } normal block at 0x014DEF40, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 98 } normal block at 0x014DF1D8, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 96 } normal block at 0x014DD658, 577 bytes long. Data : < 1r !o > 00 00 02 31 72 FB FB FB 00 00 02 21 6F FB FB FB { 95 } normal block at 0x014DEA60, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 93 } normal block at 0x014DE790, 670 bytes long. Data : < r ~o > 00 00 02 8E 72 FB FB FB 00 00 02 7E 6F FB FB FB { 92 } normal block at 0x014DE2B0, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 90 } normal block at 0x014DDDD0, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 88 } normal block at 0x014DD8F0, 1200 bytes long. Data : < r o > 00 00 04 A0 72 FB FB FB 00 00 04 90 6F FB FB FB { 86 } normal block at 0x014DC720, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 85 } normal block at 0x014DC488, 620 bytes long. Data : < \r Lo > 00 00 02 5C 72 FB FB FB 00 00 02 4C 6F FB FB FB { 81 } normal block at 0x014DAC08, 464 bytes long. Data : < r : > > 00 00 01 C0 72 FB FB FB 00 00 3A 03 00 00 3E 03 Object dump complete. If you uncomment the call to _CrtSetBreakAlloc and set the parameter to this API to for example 81, the Visual Studio debugger will break where the memory allocation occurs. I have taken all the numbers and confirmed these are memory allocations which occur in the Python functions I am using. Most of these are due to memory allocations of static C variables in the Python source code. I would be most grateful if these issues can be fixed up in the Python codebase. I am available to answer any questions about the issue at any time if necessary. Regards, PJ Naughter ---------- components: Windows messages: 306223 nosy: paul.moore, pjna, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Memory leaks in Python on Windows type: resource usage versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:29:42 2017 From: report at bugs.python.org (=?utf-8?q?J=C3=B6rn_Hees?=) Date: Tue, 14 Nov 2017 17:29:42 +0000 Subject: [New-bugs-announce] [issue32027] argparse allow_abbrev option also controls short flag combinations Message-ID: <1510680582.36.0.213398074469.issue32027@psf.upfronthosting.co.za> New submission from J?rn Hees : The allow_abbrev option (default True) currently is documented like this (https://docs.python.org/3/library/argparse.html#allow-abbrev): > Normally, when you pass an argument list to the parse_args() method of an ArgumentParser, it recognizes abbreviations of long options. However, it also controls combinations of short options and especially the combination of flags (store_const) like `-a -b` as `-ab`. Example snippet for testing: import argparse import sys parser = argparse.ArgumentParser( allow_abbrev=False ) parser.add_argument('-a', action='store_true') parser.add_argument('-b', action='store_true') parser.add_argument('x', nargs='*') parser.parse_args('-a -b foo bar'.split()) parser.parse_args('-ab foo bar'.split()) As you can see the 2nd parse will fail if allow_abbrev=False. This issue is either a doc issue only or an unintended combination of long option shortening and (the way more common) flag combinations. When i deactivated this in my code, i wanted to disable the (nice to have) long option shortening, but i unintentionally also deactivated (MUST have) short flag combinations. ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 306229 nosy: docs at python, joern priority: normal severity: normal status: open title: argparse allow_abbrev option also controls short flag combinations versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 12:42:50 2017 From: report at bugs.python.org (Martin Drawitsch) Date: Tue, 14 Nov 2017 17:42:50 +0000 Subject: [New-bugs-announce] [issue32028] Syntactically wrong suggestions by the new custom print statement error message Message-ID: <1510681370.22.0.213398074469.issue32028@psf.upfronthosting.co.za> New submission from Martin Drawitsch : I think I found a bug in the new print syntax suggestion introduced by https://bugs.python.org/issue30597. When the following code is executed by Python 3.6.3 inside of a .py file: def f(): print '%d' % 2 , then Python gives the following error message: SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int '%d' % 2)? The "int" next to the left brace of the suggested print function is obviously wrong. The expected message would be: SyntaxError: Missing parentheses in call to 'print'. Did you mean print('%d' % 2)? Using other values or "%s" in the formatted string in a print statement produces the same wrong message. This bug only seems to happen when the print statement is inside of a function AND when it is is run inside of a .py file. At least I could not reproduce it in the python3 REPL or outside of a function. I am attaching the minimal example file in this bug report. Running it with "$ python3 print.py" should show the mentioned bug. ---------- components: Interpreter Core files: print.py messages: 306231 nosy: CuriousLearner, mdraw, ncoghlan priority: normal severity: normal status: open title: Syntactically wrong suggestions by the new custom print statement error message type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47265/print.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 19:31:53 2017 From: report at bugs.python.org (Sebastian Rittau) Date: Wed, 15 Nov 2017 00:31:53 +0000 Subject: [New-bugs-announce] [issue32029] cgi: TypeError Message-ID: <1510705913.6.0.213398074469.issue32029@psf.upfronthosting.co.za> New submission from Sebastian Rittau : Consider the following code: import cgi from io import BytesIO cgi.FieldStorage(BytesIO(b"{}"), environ={ "REQUEST_METHOD": "POST", "CONTENT_TYPE": "application/json", "CONTENT_LENGTH": "14", }) This will throw the following exception: Traceback (most recent call last): File "foo.py", line 7, in "CONTENT_LENGTH": "14", File "/usr/lib/python3.6/cgi.py", line 561, in __init__ self.read_single() File "/usr/lib/python3.6/cgi.py", line 740, in read_single self.read_binary() File "/usr/lib/python3.6/cgi.py", line 762, in read_binary self.file.write(data) TypeError: write() argument must be str, not bytes Of course, the input does not contain any argument string to be parsed by FieldStorage. Nevertheless, a TypeError in a totally unrelated part of the code seems like a bug. In my opinion, FieldStorage should just remain empty in this case, or - at best - throw a ValueError with a sensible error message. ---------- messages: 306244 nosy: srittau priority: normal severity: normal status: open title: cgi: TypeError versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 14 20:30:24 2017 From: report at bugs.python.org (STINNER Victor) Date: Wed, 15 Nov 2017 01:30:24 +0000 Subject: [New-bugs-announce] [issue32030] Rewrite Py_Main() Message-ID: <1510709424.02.0.213398074469.issue32030@psf.upfronthosting.co.za> New submission from STINNER Victor : Python has a lot of code for its initialization. It's very hard to touch this code without risking to break something. It's hard to move code since many parts of the code are interdepent. The code rely on global "Py_xxx" configuration variables like Py_IsolateFlag (set by -I command line option). Moreover, currently Python uses the "Python runtime" early. For example, the code to parse the -W command line option uses PyUnicode_FromWideChar() and PyList_Append(). We need a stricter separation for the code before the "Python runtime" is initialized, at least partially initialized. Nick Coghlan and Eric Snow are already working on all these issues as part of the implementation of PEP 432. They redesigned Py_Initialize() and Py_Finalize(). I would like to finish the work on the step before: the Py_Main() function. Attached PR is a work-in-progress to rework deeply the Py_Main() function. I have different goals: * Enhance error handling: * Avoid whenever possible calls to Py_FatalError() -- currently, Py_FatalError() is still called, but at a single place * My patch adds missing checks on PyDict_SetItem() or PyList_Append() calls, catch errors when adding warnings options and XOptions * Reorder code to initialize: initialize Python in the "correct" order * Better "finalization": pymain_free() is now responsible to free memory of all data used by Py_Main(). The ownership of strings is now better defined. For example, Py_SetProgramName() memory was not released before. * pymain_init() is now the code which must not use the Python runtime * pymain_core() uses the Python runtime. Its code to initialize the Python runtime should be easier to follow Since pymain_free() now wants to release the memory, we need to force a memory allocator for PyMem_RawMalloc(), since pymain_core() changes the memory allocator. The main() already does something similar, but with simpler code since main() is a private function, whereas Py_Main() seems to be part of the public C API! ---------- messages: 306245 nosy: haypo priority: normal severity: normal status: open title: Rewrite Py_Main() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 04:37:41 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 15 Nov 2017 09:37:41 +0000 Subject: [New-bugs-announce] [issue32031] Do not use the canonical path in pydoc test_mixed_case_module_names_are_lower_cased Message-ID: <1510738661.72.0.213398074469.issue32031@psf.upfronthosting.co.za> New submission from Xavier de Gaye : test_mixed_case_module_names_are_lower_cased fails when there is a symlink in the directory path of the installed standard library. ---------- components: Tests messages: 306259 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: Do not use the canonical path in pydoc test_mixed_case_module_names_are_lower_cased type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 05:10:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 10:10:18 +0000 Subject: [New-bugs-announce] [issue32032] Module-level pickle tests test only default implementation Message-ID: <1510740618.54.0.213398074469.issue32032@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : In Python 2 tests for module-level API test both implementations, pickle and cPickle. In Python 3 they test only the default implementation. If _pickle is available, the Python implementation of module-level functions is not tested. ---------- assignee: serhiy.storchaka components: Tests messages: 306260 nosy: serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Module-level pickle tests test only default implementation type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 05:34:19 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 15 Nov 2017 10:34:19 +0000 Subject: [New-bugs-announce] [issue32033] The pwd test test_values fails on Android Message-ID: <1510742059.52.0.213398074469.issue32033@psf.upfronthosting.co.za> New submission from Xavier de Gaye : On Android API 24: $ python -c "import pwd; print(pwd.getpwuid(0))" pwd.struct_passwd(pw_name='root', pw_passwd='', pw_uid=0, pw_gid=0, pw_gecos=None, pw_dir='/', pw_shell='/system/bin/sh') The pw_gecos member is None and the test_values test of pwd fails because it expects a string. The fix is either (1) to skip the pw_gecos check in test_values for Android or (2) to modify the sets() function in Modules/pwdmodule.c to set an empty string instead of None when the member of the passwd structure is a NULL pointer. POSIX [1] does not specify what are the possible values of the members of the struct passwd. GNU libc states that pw_dir and pw_shell may be NULL pointers so it seems that sets() is broken in these two cases. [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/getpwnam.html [2] https://www.gnu.org/software/libc/manual/html_node/User-Data-Structure.html#User-Data-Structure ---------- components: Extension Modules, Tests messages: 306261 nosy: haypo, serhiy.storchaka, xdegaye priority: normal severity: normal stage: needs patch status: open title: The pwd test test_values fails on Android type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 07:53:23 2017 From: report at bugs.python.org (badouxn) Date: Wed, 15 Nov 2017 12:53:23 +0000 Subject: [New-bugs-announce] [issue32034] Impossible to unpickle IncompleteReadError Message-ID: <1510750403.35.0.213398074469.issue32034@psf.upfronthosting.co.za> New submission from badouxn : When using asyncio in combination with multiprocessing, a TypeError occur when readuntil() encounter an EOF instead of the delimiter. readuntil return a IncompleteReadError exception which is pickled by the multiprocessing package. The unpickling failed due to an argument being None. As noted in the following links, it fails: https://stackoverflow.com/questions/16244923/how-to-make-a-custom-exception-class-with-multiple-init-args-pickleable The error trace is: Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib64/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.6/multiprocessing/pool.py", line 463, in _handle_results task = get() File "/usr/lib64/python3.6/multiprocessing/connection.py", line 252, in recv return _ForkingPickler.loads(r) TypeError: __init__() missing 1 required positional argument: 'expected' Fix proposed: Make the "expected" parameter of the IncompleteReadError exception class optional. ---------- components: asyncio files: Impossible_to_unpickle_IncompleteReadError.py messages: 306268 nosy: badouxn, yselivanov priority: normal severity: normal status: open title: Impossible to unpickle IncompleteReadError Added file: https://bugs.python.org/file47266/Impossible_to_unpickle_IncompleteReadError.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 09:54:20 2017 From: report at bugs.python.org (Daniel) Date: Wed, 15 Nov 2017 14:54:20 +0000 Subject: [New-bugs-announce] [issue32035] Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes Message-ID: <1510757660.91.0.213398074469.issue32035@psf.upfronthosting.co.za> New submission from Daniel : The documentation for "ZipFile.writestr(zinfo_or_arcname, data[, compress_type])" says: "Write the string data to the archive; [...]" --> https://docs.python.org/3/library/zipfile.html I fails to mention that data could also be bytes. The source code does mention it however, that is how I found out: def writestr(self, zinfo_or_arcname, data, compress_type=None): """Write a file into the archive. The contents is 'data', which may be either a 'str' or a 'bytes' instance; if it is a 'str', it is encoded as UTF-8 first. 'zinfo_or_arcname' is either a ZipInfo instance or the name of the file in the archive.""" I believe this should be added to the documentation as it's an important information to those who try to add non-UTF8 StringIO data to in-memory ZipFiles using BytesIO. ---------- assignee: docs at python components: Documentation messages: 306271 nosy: Daniel5148, docs at python priority: normal severity: normal status: open title: Documentation of zipfile.ZipFile().writestr() fails to mention that 'data' may also be bytes versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:36:45 2017 From: report at bugs.python.org (Stefan Seefeld) Date: Wed, 15 Nov 2017 16:36:45 +0000 Subject: [New-bugs-announce] [issue32036] error mixing positional and non-positional arguments with `argparse` Message-ID: <1510763805.17.0.213398074469.issue32036@psf.upfronthosting.co.za> New submission from Stefan Seefeld : I'm trying to mix positional and non-positional arguments with a script using `argparse`, but I observe inconsistent behaviour. The attached test runs fine when invoked with test_argparse.py --info a a=b test_argparse.py a a=b --info but produces the error `error: unrecognized arguments: a=b` when invoked as test_argparse.py a --info a=b Is this intended behaviour ? If yes, is this documented ? If not, is there a way to make this work with existing `argparse` versions ? ---------- components: Library (Lib) files: test_argparse.py messages: 306283 nosy: stefan priority: normal severity: normal status: open title: error mixing positional and non-positional arguments with `argparse` type: behavior Added file: https://bugs.python.org/file47268/test_argparse.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 11:59:49 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 15 Nov 2017 16:59:49 +0000 Subject: [New-bugs-announce] [issue32037] Pickle 32-bit integers with protocol 0 as INT instead of LONG Message-ID: <1510765189.73.0.213398074469.issue32037@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : In Python 3 different opcodes are used for pickling integers with protocol 1 and higher. But pickling with protocol 0 always uses the LONG opcode. In Python all such integers are unpickled to the long instances. Proposed PR makes integers that fit in a signed 32-bit integer be pickled with the INT opcode. This will decrease the size of a pickle (minus one byte 'L' per integer), speeds up pickling and unpickling, and makes these integers be unpickled to int instances in Python 2, that will save a memory. ---------- assignee: serhiy.storchaka components: Library (Lib) messages: 306285 nosy: alexandre.vassalotti, serhiy.storchaka priority: normal severity: normal status: open title: Pickle 32-bit integers with protocol 0 as INT instead of LONG type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:00:27 2017 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 15 Nov 2017 19:00:27 +0000 Subject: [New-bugs-announce] [issue32038] Add API to intercept socket.close() Message-ID: <1510772427.07.0.213398074469.issue32038@psf.upfronthosting.co.za> New submission from Yury Selivanov : asyncio has a few APIs that accept a Python socket object: loop.sock_recv(), loop.sock_accept() etc. asyncio (and event loops such as uvloop) expect that it controls the socket for the duration of the call. However, it cannot prevent the socket object from being closing *while* it is working with it: loop = asyncio.get_event_loop() sock = socket.socket() sock.connect(('google.com', 80)) sock.setblocking(0) f = loop.sock_recv(sock, 100) sock.close() await f The above snippet makes asyncio to forever try to read from 'sock' (resource leak). uvloop simply segfaults (at least on Linux) because libuv assumes that sockets can't be closed while it's working with them. Same problem exists when a user calls `loop.create_server(sock=sock)` and later manually calls `sock.close()`. My proposal is to add a new API: `socket.register_close(callback)`. `callback` will be called whenever a socket object is about to be closed. This will enable asyncio and uvloop to detect when sockets they are working with are about to be closed and to either raise an error, log a debug line, or/and to stop polling the socket. See also: https://github.com/MagicStack/uvloop/issues/100 ---------- components: IO, asyncio messages: 306298 nosy: asvetlov, gvanrossum, pitrou, yselivanov priority: normal severity: normal status: open title: Add API to intercept socket.close() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:43:16 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 15 Nov 2017 19:43:16 +0000 Subject: [New-bugs-announce] [issue32039] timeit documentation should describe caveats Message-ID: <1510774996.46.0.213398074469.issue32039@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : timeit is cool, but it's not appropriate for all performance testing. For example, since it uses only a single Python process, anything that's cached is not a good candidate for timeit profiling. The classic example is timing imports. E.g. these are not the stats you're looking for: $ python3 -mtimeit "import my.slow.module" The timeit documentation should describe this caveat (are there others?) and possibly point to both cProfile and the 3rd party perf package as alternative ways to gather performance information. ---------- assignee: barry components: Documentation messages: 306303 nosy: barry priority: normal severity: normal status: open title: timeit documentation should describe caveats versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 14:48:55 2017 From: report at bugs.python.org (QbLearningPython) Date: Wed, 15 Nov 2017 19:48:55 +0000 Subject: [New-bugs-announce] [issue32040] Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths Message-ID: <1510775335.55.0.213398074469.issue32040@psf.upfronthosting.co.za> New submission from QbLearningPython : While testing a module, I have found a weird behaviour of pathlib package. I have a list of pathlib.Paths and I sorted() it. I assumed that the order retrieved by sorting a list of Paths would be the same as the order retrieved by sorting the list of their corresponding (string) filenames. But it is not the case. I run the following example: ========================================================================== from pathlib import Path # order string filenames filenames_for_testing = ( '/spam/spams.txt', '/spam/spam.txt', '/spam/another.txt', '/spam/binary.bin', '/spam/spams/spam.ttt', '/spam/spams/spam01.txt', '/spam/spams/spam02.txt', '/spam/spams/spam03.ppp', '/spam/spams/spam04.doc', ) sorted_filenames = sorted(filenames_for_testing) # output ordered list of string filenames print() print("Ordered list of string filenames:") print() [print(f'\t{element}') for element in sorted_filenames] print() # order paths (build from same string filenames) paths_for_testing = [ Path(filename) for filename in filenames_for_testing ] sorted_paths = sorted(paths_for_testing) # outoput ordered list of pathlib.Paths print() print("Ordered list of pathlib.Paths:") print() [print(f'\t{element}') for element in sorted_paths] print() # compare print() if sorted_filenames == [str(path) for path in sorted_paths]: print('Ordered lists of string filenames and pathlib.Paths are EQUAL.') else: print('Ordered lists of string filenames and pathlib.Paths are DIFFERENT.') for element in range(0, len(sorted_filenames)): if sorted_filenames[element] != str(sorted_paths[element]): print() print('First different element:') print(f'\tElement #{element}') print(f'\t{sorted_filenames[element]} != {sorted_paths[element]}') break print() ========================================================================== The output of this script was: ========================================================================== Ordered list of string filenames: /spam/another.txt /spam/binary.bin /spam/spam.txt /spam/spams.txt /spam/spams/spam.ttt /spam/spams/spam01.txt /spam/spams/spam02.txt /spam/spams/spam03.ppp /spam/spams/spam04.doc Ordered list of pathlib.Paths: /spam/another.txt /spam/binary.bin /spam/spam.txt /spam/spams/spam.ttt /spam/spams/spam01.txt /spam/spams/spam02.txt /spam/spams/spam03.ppp /spam/spams/spam04.doc /spam/spams.txt Ordered lists of string filenames and pathlib.Paths are DIFFERENT. First different element: Element #3 /spam/spams.txt != /spam/spams/spam.ttt ========================================================================== As you can see, 'spam/spams.txt' goes in different places if you have sorted by pathlib.Paths than if you have sorted by string filenames. I think that it is weird that sorting pathlib.Paths yields a different result than sorting their string filenames. I think that pathlib.Paths should be ordered by alphabetical order of their corresponding filenames. Thank you. ---------- components: Extension Modules messages: 306304 nosy: QbLearningPython priority: normal severity: normal status: open title: Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:01:06 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Wed, 15 Nov 2017 21:01:06 +0000 Subject: [New-bugs-announce] [issue32041] Cannot cast '\0' to c_void_p Message-ID: <1510779666.78.0.213398074469.issue32041@psf.upfronthosting.co.za> New submission from Ilya Kulakov : Happens on 3.6.3 only: >>> import ctypes >>> ctypes.cast('\0', ctypes.c_void_p) ctypes.ArgumentError: argument 1: : embedded null character ---------- components: ctypes messages: 306307 nosy: Ilya.Kulakov priority: normal severity: normal status: open title: Cannot cast '\0' to c_void_p type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 16:39:32 2017 From: report at bugs.python.org (=?utf-8?b?VG9tw6HFoSBQZXTFmcOtxI1law==?=) Date: Wed, 15 Nov 2017 21:39:32 +0000 Subject: [New-bugs-announce] [issue32042] Option for comparing values instead of reprs in doctest Message-ID: <1510781972.21.0.213398074469.issue32042@psf.upfronthosting.co.za> New submission from Tom?? Pet???ek : Would there be an interest and possibility to add an option to the doctest module to compare values instead of reprs? The idea is that the expected value would be eval'ed prior to comparison if this option was enabled. Motivation for this option is to enable comparison of values (states) as defined in the respective classes and not by a representation which might vary ({'a', 'b'} vs {'b', 'a'}, 'value' vs "value" etc.). ---------- components: Library (Lib), Tests messages: 306311 nosy: Tom?? Pet???ek priority: normal severity: normal status: open title: Option for comparing values instead of reprs in doctest type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 15 21:43:27 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 02:43:27 +0000 Subject: [New-bugs-announce] [issue32043] Add a new -X dev option: "developer mode" Message-ID: <1510800207.44.0.213398074469.issue32043@psf.upfronthosting.co.za> New submission from STINNER Victor : I propose to add a new "developer mode": a new "-X dev" command line option. In short: python3 -X dev script.py behaves as: PYTHONMALLOC=debug python3 -W default -X faulthandler script.py For the rationale, please see: https://mail.python.org/pipermail/python-dev/2017-November/150514.html ---------- components: Interpreter Core messages: 306330 nosy: haypo priority: normal severity: normal status: open title: Add a new -X dev option: "developer mode" type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 00:01:02 2017 From: report at bugs.python.org (Daniel E Platt) Date: Thu, 16 Nov 2017 05:01:02 +0000 Subject: [New-bugs-announce] [issue32044] pip3 install 3.6.3 crashes on startup; 3.5.4 works; on OS X 10.13.1 Message-ID: <1510808462.98.0.213398074469.issue32044@psf.upfronthosting.co.za> New submission from Daniel E Platt : pip3 installed with 3.6.3 crashes on startup. pip3 installed with 3.5.4 works. Appears on OS X 10.13.1 ---------- components: Installation messages: 306336 nosy: DanPlatt priority: normal severity: normal status: open title: pip3 install 3.6.3 crashes on startup; 3.5.4 works; on OS X 10.13.1 type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 03:20:19 2017 From: report at bugs.python.org (Rohan D'Sa) Date: Thu, 16 Nov 2017 08:20:19 +0000 Subject: [New-bugs-announce] [issue32045] Does json.dumps have a memory leak? Message-ID: <1510820419.37.0.213398074469.issue32045@psf.upfronthosting.co.za> New submission from Rohan D'Sa : import gc, json class leak(object): def __init__(self): pass gc.set_debug(gc.DEBUG_LEAK) while True: leak_ = leak() json.dumps(leak_.__dict__, indent=True) gc.collect() print(f"garbage count: {len(gc.garbage)}") Using the following code under Python 3.6.3, the garbage count keeps increasing and windows task manager records steady memory increase. However without indent json.dumps(self.__dict__), no leak is observed. ---------- components: Library (Lib) messages: 306344 nosy: rohandsa priority: normal severity: normal status: open title: Does json.dumps have a memory leak? versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 04:09:32 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 09:09:32 +0000 Subject: [New-bugs-announce] [issue32046] 2to3 fix for operator.isCallable() Message-ID: <1510823372.85.0.213398074469.issue32046@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Currently 2to3 converts `operator.isCallable(obj)` to `hasattr(obj, '__call__')`. This looks cumbersome, and can be deceived by instance attribute __call__. The more correct way is to use `isinstance(obj, collections.abc.Callable)`. Starting from Python 3.2 it can use the callable() builtin. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 306346 nosy: benjamin.peterson, levkivskyi, serhiy.storchaka priority: normal severity: normal status: open title: 2to3 fix for operator.isCallable() type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 06:50:52 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 11:50:52 +0000 Subject: [New-bugs-announce] [issue32047] asyncio: enable debug mode when -X dev is used Message-ID: <1510833052.89.0.213398074469.issue32047@psf.upfronthosting.co.za> New submission from STINNER Victor : The bpo-32043 added a new "developer mode" enabled with the new -X dev command line option. I propose to enable asyncio debug mode with the global Python "developer mode". If an asyncio application is correctly written, the single side effect of -X dev would be to log "Executing ... took ... seconds" if a handle took longer than 100 ms. Well, a handle should *not* take longer than 100 ms. So maybe it's ok to start logging such events in the "developer mode", no? Example with attached block_loop.py script which blocks the event loop. (1) This command doesn't display anything: haypo at selma$ ./python block_loop.py (2) In developer mode, the warning a emitted to warn the developer about the bug: $ ./python -X dev block_loop.py Executing result=None created at /home/haypo/prog/python/master/Lib/asyncio/base_events.py:444> took 1.002 seconds ---------- components: asyncio files: block_loop.py messages: 306353 nosy: haypo, yselivanov priority: normal severity: normal status: open title: asyncio: enable debug mode when -X dev is used versions: Python 3.7 Added file: https://bugs.python.org/file47269/block_loop.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 07:36:27 2017 From: report at bugs.python.org (=?utf-8?b?0JDRgNGC0LXQvNC40Lkg0KDQvtC00LjQvtC90L7Qsg==?=) Date: Thu, 16 Nov 2017 12:36:27 +0000 Subject: [New-bugs-announce] [issue32048] Misprint in the unittest.mock documentation. Message-ID: <1510835787.98.0.213398074469.issue32048@psf.upfronthosting.co.za> Change by ??????? ???????? : ---------- assignee: docs at python components: Documentation nosy: docs at python, ??????? ???????? priority: normal severity: normal status: open title: Misprint in the unittest.mock documentation. type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 08:39:17 2017 From: report at bugs.python.org (Sven Pagel) Date: Thu, 16 Nov 2017 13:39:17 +0000 Subject: [New-bugs-announce] [issue32049] 2.7.14 does not uninstall cleanly if installation was run as SYSTEM account (SCCM) Message-ID: <1510839557.93.0.213398074469.issue32049@psf.upfronthosting.co.za> New submission from Sven Pagel : If I install Python 2.7.14 on Windows (using the MSI) using the SYSTEM account, as is done by SCCM, uninstalling fails to clean up the registry so Python is still showing up as installed in the control panel (and still detected by SCCM). SCCM runs the following command line to install Python: msiexec /i "python-2.7.14.amd64.msi" ADDLOCAL=ALL /qn For uninstallation I use the following command line: msiexec /x {0398A685-FD8D-46B3-9816-C47319B0CF5F} Both are run as the SYSTEM account. ---------- components: Installation, Windows messages: 306359 nosy: niemalsnever, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: 2.7.14 does not uninstall cleanly if installation was run as SYSTEM account (SCCM) type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 10:49:19 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 16 Nov 2017 15:49:19 +0000 Subject: [New-bugs-announce] [issue32050] Deprecated python3 -x option Message-ID: <1510847359.74.0.213398074469.issue32050@psf.upfronthosting.co.za> New submission from STINNER Victor : Python has a -x option documented as a "DOS specific hack only": https://docs.python.org/dev/using/cmdline.html#cmdoption-x Python doesn't support MS-DOS since Python 2.1: https://www.python.org/dev/peps/pep-0011/#no-longer-supported-platforms I propose to deprecate the option in Python 3.7: using it emits a DeprecationWarning, option deprecated in the documentation; and remove the option in Python 3.8. ---------- components: Interpreter Core messages: 306365 nosy: haypo priority: normal severity: normal status: open title: Deprecated python3 -x option versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 12:27:04 2017 From: report at bugs.python.org (jason) Date: Thu, 16 Nov 2017 17:27:04 +0000 Subject: [New-bugs-announce] [issue32051] Possible issue in multiprocessing doc Message-ID: <1510853224.34.0.213398074469.issue32051@psf.upfronthosting.co.za> New submission from jason : in multiprocessing doc https://docs.python.org/3.6/library/multiprocessing.html under 17.2.2.7.2. Using a remote manager, >>> from multiprocessing.managers import BaseManager >>> import queue >>> queue = queue.Queue() >>> class QueueManager(BaseManager): pass >>> QueueManager.register('get_queue', callable=lambda:queue) >>> m = QueueManager(address=('', 50000), authkey=b'abracadabra') >>> s = m.get_server() >>> s.serve_forever() queue is used as both module name and variable name, should this be avoided? ---------- assignee: docs at python components: Documentation messages: 306389 nosy: 1a1a11a, docs at python priority: normal severity: normal status: open title: Possible issue in multiprocessing doc type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 14:09:48 2017 From: report at bugs.python.org (Bruce Merry) Date: Thu, 16 Nov 2017 19:09:48 +0000 Subject: [New-bugs-announce] [issue32052] Provide access to buffer of asyncio.StreamReader Message-ID: <1510859388.33.0.213398074469.issue32052@psf.upfronthosting.co.za> New submission from Bruce Merry : While asyncio.StreamReader.readuntil is an improvement on only having readline, it is still quite limited e.g. you cannot have multiple possible terminators. The real problem is that it's not possible to roll your own without accessing _underscore fields (other than by reading one byte at a time, which I'm guessing would be bad for performance). I'm not sure exactly what a public API to assist would look like, but I think the following would be a good start: 1. A get_buffer method, that returns (self._buffer, self._eof); the caller must treat the buffer as readonly. 2. A wait_for_data method to wait for the return value of get_buffer to change (basically like current _wait_for_data) 3. Access to the _limit attribute. With that available, I think readuntil or more complex variants of it could be implemented externally using only the public interface (consumption of data from the buffer would be via readexactly rather than by messing with the buffer array directly). ---------- components: asyncio messages: 306397 nosy: Bruce Merry, yselivanov priority: normal severity: normal status: open title: Provide access to buffer of asyncio.StreamReader type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 16:36:43 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 16 Nov 2017 21:36:43 +0000 Subject: [New-bugs-announce] [issue32053] Inconsistent use of tabs and spaces in indentation not always detected Message-ID: <1510868203.24.0.213398074469.issue32053@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : >>> exec('''if 1: ... print(1) ... \tprint(2) ... ''') 1 2 The first indented line uses 8 spaces. The second indented line uses 7 spaces + tabulation. Indentations are different, but TabError is not raised. ---------- components: Interpreter Core messages: 306399 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: Inconsistent use of tabs and spaces in indentation not always detected type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 16 17:07:02 2017 From: report at bugs.python.org (Pedro) Date: Thu, 16 Nov 2017 22:07:02 +0000 Subject: [New-bugs-announce] [issue32054] Creating RPM on Python 2 works, but Python 3 fails because of sys.implementation.cache_tag Message-ID: <1510870022.27.0.213398074469.issue32054@psf.upfronthosting.co.za> New submission from Pedro : I am trying to create an RPM on SLES12 SP2. (I think that corresponds to OpenSUSE 42.2.) This is my setup.py file, nothing special: import setuptools setuptools.setup(name='MyApp', version='1.2.3', options={'bdist_rpm': {'post_install': 'post_install.sh', 'post_uninstall': 'post_uninstall.sh'}}) Running `python setup.py bdist_rpm` with Python 2 works. However, running `python3 setup.py bdist_rpm` outputs the following: running bdist_rpm running egg_info writing top-level names to MyApp.egg-info/top_level.txt ... byte-compiling /home/pedro/MyApp/build/bdist.linux-x86_64/rpm/BUILDROOT/MyApp-1.2.3-1.x86_64/usr/lib/python3.4/site-packages/MyApp/my_file.py to my_file.cpython-34.pyc ... Processing files: MyApp-1.2.3-1.noarch error: File not found: /home/pedro/MyApp/build/bdist.linux-x86_64/rpm/BUILDROOT/MyApp-1.2.3-1.x86_64/usr/lib/python3.4/site-packages/MyApp/my_file.py RPM build errors: File not found: /home/pedro/MyApp/build/bdist.linux-x86_64/rpm/BUILDROOT/MyApp-1.2.3-1.x86_64/usr/lib/python3.4/site-packages/MyApp/my_file.py error: command 'rpmbuild' failed with exit status 1 The problem appears to be that setuptools is generating a file that ends in `.cpython-34.pyc`, and later looks for a file without the `.cpython-34` but can't find it. The RPM generation process on Python 3 goes through `distutils.util.byte_compile()`, which in turn calls `importlib.util.cache_from_source(path)`, where `path` is the file to be byte-compiled. `cache_from_source()` injects the value of `sys.implementation.cache_tag` (which is equal to 'cpython-34' on SLES12 SP2) into the filename of the compiled file. This attribute of `sys` does not exist in Python 2. So it looks like `setuptools` alters the filename with that tag during byte compilation, but later forgets that it modified the filename and fails because it's looking for the original name. I ended up working around this by patching `distutils.file_util.write_file` to eliminate the .pyc entries from INSTALLED_FILES: orig_bytecode_var = os.environ.get('PYTHONDONTWRITEBYTECODE', '') os.environ['PYTHONDONTWRITEBYTECODE'] = '1' orig_write_file = distutils.file_util.write_file def my_patch(*args, **kwargs): new_args = list(args) if args[0] == 'INSTALLED_FILES': new_args[1] = [fname for fname in args[1] if fname[-4:] not in ('.pyc', '.pyo')] orig_write_file(*new_args, **kwargs) distutils.file_util.write_file = my_patch setuptools.setup(name='MyApp', version='1.2.3', options={'bdist_rpm': {'post_install': 'post_install.sh', 'post_uninstall': 'post_uninstall.sh'}}) os.environ['PYTHONDONTWRITEBYTECODE'] = orig_bytecode_var distutils.file_util.write_file = orig_write_file But I don't think I should have to do anything special to build an RPM on Python 3 vs. Python 2. Is this expected behavior? ---------- components: Distutils messages: 306400 nosy: dstufft, eric.araujo, pgacv2 priority: normal severity: normal status: open title: Creating RPM on Python 2 works, but Python 3 fails because of sys.implementation.cache_tag type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 02:43:17 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 17 Nov 2017 07:43:17 +0000 Subject: [New-bugs-announce] [issue32055] Reconsider comparison chaining for containment tests Message-ID: <1510904597.47.0.213398074469.issue32055@psf.upfronthosting.co.za> New submission from Nick Coghlan : (I thought there was an open low priority issue for this, but I can't find it, so filing a new one) Currently, "in" and "not in" are classified as comparison operations in the language grammar, even though they're not actually documented as such (see https://bugs.python.org/issue28617 in relation to the latter point). Issue reports like https://bugs.python.org/issue30965, user questions like https://stackoverflow.com/questions/45180899/unexpected-result-from-in-operator-python/45180967, and behaviour puzzles like https://github.com/cosmologicon/pywat#operator-precedence suggest that the existing behaviour isn't particular intuitive to users. At the language design level (as far as I am aware), the benefit of treating "in" and "not in" as comparison operators is to ensure they share a precedence level with the other comparisons. While this is mostly a pretty harmless quirk, I think it's weird enough and useless enough for us to at least consider refining the Grammar such that "in" and "not in" live at the same level as other comparison operators, but *don't* participate in comparison chaining (i.e. "a == b in c" and "a in c == b" would both be syntax errors that required parentheses to disambiguate the desired associativity). ---------- messages: 306411 nosy: ncoghlan priority: low severity: normal status: open title: Reconsider comparison chaining for containment tests type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 04:42:26 2017 From: report at bugs.python.org (=?utf-8?b?5byg5b635bKz?=) Date: Fri, 17 Nov 2017 09:42:26 +0000 Subject: [New-bugs-announce] [issue32056] bug in Lib/wave.py Message-ID: <1510911746.81.0.213398074469.issue32056@psf.upfronthosting.co.za> New submission from ??? : I found a bug in wave.py because there is no check for self._channel in _read_fmt_chunk function. When I try to open a wav file which channel is zero, it will crash bacause of divided by zero in initfp function. ---------- components: Library (Lib) files: audio-testcase.wav messages: 306420 nosy: BT123 priority: normal pull_requests: 4381 severity: normal status: open title: bug in Lib/wave.py type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47270/audio-testcase.wav _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 05:17:40 2017 From: report at bugs.python.org (Bogdan Popa) Date: Fri, 17 Nov 2017 10:17:40 +0000 Subject: [New-bugs-announce] [issue32057] time.sleep(n) interrupted by signal Message-ID: <1510913860.03.0.213398074469.issue32057@psf.upfronthosting.co.za> New submission from Bogdan Popa : I ran into this while backporting some code from 3.6 to 3.5 and 3.4. The following piece of code prints one line every second, as expected, on 3.6 and 3.5, but it doesn't on 3.4. It looks like the signal is able to wake up the main thread from sleeping: ``` import time import signal def handle(signum, mask): print("received signal at", time.time()) signal.setitimer(signal.ITIMER_REAL, 1, 1) signal.signal(signal.SIGALRM, handle) for _ in range(2): now = time.time() delta = 1 - (time.time() - int(time.time())) time.sleep(delta) print(now, delta, time.time()) ``` If I remove the timer, then everything works as expected on 3.4. Here is some sample output from 3.6: ``` 1510913832.4726589 0.5273411273956299 1510913833.000339 received signal at 1510913833.477888 1510913833.000449 0.9995510578155518 1510913834.000187 ``` And some from 3.4: ``` 1510913813.525479 0.4745209217071533 1510913814.004106 received signal at 1510913814.529313 1510913814.004233 0.9957659244537354 1510913814.529413 ``` ---------- components: Interpreter Core messages: 306427 nosy: Bogdan Popa priority: normal severity: normal status: open title: time.sleep(n) interrupted by signal versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 06:06:43 2017 From: report at bugs.python.org (tom de wulf) Date: Fri, 17 Nov 2017 11:06:43 +0000 Subject: [New-bugs-announce] [issue32058] Faulty behaviour in email.utils.parseaddr if square brackets in subject Message-ID: <1510916803.84.0.213398074469.issue32058@psf.upfronthosting.co.za> New submission from tom de wulf : Probably a parsing bug in email.utils.parseaddr. How to recreate: >>> import email.utils >>> test = 'Subject: I am a bug [Random]\r\nFrom: someone \r\n\r\n' >>> email.utils.parseaddr(test) ('', 'I') >>> email.utils.parseaddr(test.replace('[', '').replace(']','')) ('someone', 'some at email.address') Expected behaviour: no need to remove the []'s ---------- components: email messages: 306431 nosy: barry, r.david.murray, tom de wulf priority: normal severity: normal status: open title: Faulty behaviour in email.utils.parseaddr if square brackets in subject type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 06:19:21 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 17 Nov 2017 11:19:21 +0000 Subject: [New-bugs-announce] [issue32059] detect_modules() in setup.py must also search the sysroot paths Message-ID: <1510917561.84.0.213398074469.issue32059@psf.upfronthosting.co.za> New submission from Xavier de Gaye : When cross-compiling, the gcc and clang `--sysroot=` compiler option may be used to change the logical path of the system headers and libraries to a path located within the install path of the cross-compiler tool chain. Android is a special case: -------------------------- With Unified Headers [1], the most recent versions of the Android NDK add an additional constraint: the root paths of usr/include and usr/lib are distinct. For example when cross-compiling for API 24 and the x86_64 architecture the full paths are: * headers: ANDROID_NDK_ROOT/sysroot/usr/include * libraries: ANDROID_NDK_ROOT/platforms/android-24/arch-x86_64/usr/lib64 To use sysroot in this example one needs to set sysroot to ANDROID_NDK_ROOT/sysroot in CFLAGS or CPPFLAGS and to set sysroot to ANDROID_NDK_ROOT/platforms/android-24/arch-x86_64 in LDFLAGS, while on a standard platform where the root path of usr/include and usr/lib is common, one would only need to set sysroot to this root path in CFLAGS. [1] https://android.googlesource.com/platform/ndk.git/+/master/docs/UnifiedHeaders.md ---------- components: Cross-Build messages: 306432 nosy: Alex.Willmer, xdegaye priority: normal severity: normal stage: needs patch status: open title: detect_modules() in setup.py must also search the sysroot paths type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 07:35:55 2017 From: report at bugs.python.org (Alex Corcoles) Date: Fri, 17 Nov 2017 12:35:55 +0000 Subject: [New-bugs-announce] [issue32060] Should an ABC fail if no abstract methods are defined? Message-ID: <1510922155.04.0.213398074469.issue32060@psf.upfronthosting.co.za> New submission from Alex Corcoles : Hi, $ python3 Python 3.5.3 (default, Jan 19 2017, 14:11:04) >>> import abc >>> class Foo(abc.ABC): ... pass ... >>> Foo() <__main__.Foo object at 0x7f253e6dcb38> I think declaring a class as ABC without declaring any abstract method is an error. I've tried searching if this was already discussed, but did not find it. Maybe it is related to https://bugs.python.org/issue9731 Cheers, ?lex ---------- messages: 306433 nosy: Alex Corcoles priority: normal severity: normal status: open title: Should an ABC fail if no abstract methods are defined? type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:44:50 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 14:44:50 +0000 Subject: [New-bugs-announce] [issue32061] test_httpservers.test_undecodable_filename() fails with [Errno 92] Illegal byte sequence on macOS Sierra Message-ID: <1510929890.31.0.213398074469.issue32061@psf.upfronthosting.co.za> New submission from STINNER Victor : x86-64 Sierra 3.6 failure: http://buildbot.python.org/all/#/builders/20/builds/81 ====================================================================== ERROR: test_undecodable_filename (test.test_httpservers.SimpleHTTPServerTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/support/__init__.py", line 601, in wrapper return func(*args, **kw) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_httpservers.py", line 381, in test_undecodable_filename with open(os.path.join(self.tempdir, filename), 'wb') as f: OSError: [Errno 92] Illegal byte sequence: '/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmp19j_8j75/@test_98516_tmp\udce7w\udcf0.txt' ---------- components: Tests, macOS messages: 306441 nosy: haypo, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: test_httpservers.test_undecodable_filename() fails with [Errno 92] Illegal byte sequence on macOS Sierra versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:46:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 14:46:32 +0000 Subject: [New-bugs-announce] [issue32062] test_venv fails if zlib is not available Message-ID: <1510929992.88.0.213398074469.issue32062@psf.upfronthosting.co.za> New submission from STINNER Victor : test_venv should skip test_with_pip() test when the zlib module is missing. x86-64 Sierra 3.6 failure: http://buildbot.python.org/all/#/builders/20/builds/62 test_with_pip (test.test_venv.EnsurePipTest) ... FAIL ====================================================================== FAIL: test_with_pip (test.test_venv.EnsurePipTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_venv.py", line 368, in do_test_with_pip with_pip=True) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_venv.py", line 61, in run_with_capture func(*args, **kwargs) subprocess.CalledProcessError: Command '['/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmpzg_lamk1/bin/python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_venv.py", line 428, in test_with_pip self.do_test_with_pip(False) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/test_venv.py", line 374, in do_test_with_pip self.fail(msg.format(exc, details)) AssertionError: Command '['/private/var/folders/sy/9hwmqyx14s11577cvgzwf2v40000gt/T/tmpzg_lamk1/bin/python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. **Subprocess Output** Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/ensurepip/__main__.py", line 5, in sys.exit(ensurepip._main()) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 204, in _main default_pip=args.default_pip, File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 117, in _bootstrap return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/ensurepip/__init__.py", line 27, in _run_pip import pip zipimport.ZipImportError: can't decompress data; zlib not available ---------- components: Tests messages: 306442 nosy: haypo, vinay.sajip priority: normal severity: normal status: open title: test_venv fails if zlib is not available versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 09:48:44 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 17 Nov 2017 14:48:44 +0000 Subject: [New-bugs-announce] [issue32063] test_multiprocessing_forkserver failed with OSError: [Errno 48] Address already in use Message-ID: <1510930124.82.0.213398074469.issue32063@psf.upfronthosting.co.za> New submission from STINNER Victor : x86-64 Sierra 3.6: http://buildbot.python.org/all/#/builders/20/builds/62 0:06:16 load avg: 3.45 [ 87/405/1] test_multiprocessing_forkserver failed -- running: test_tokenize (77 sec) Process QueueManager-260: Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/managers.py", line 539, in _run_server server = cls._Server(registry, address, authkey, serializer) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/managers.py", line 139, in __init__ self.listener = Listener(address=address, backlog=16) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/connection.py", line 438, in __init__ self._listener = SocketListener(address, family, backlog) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/connection.py", line 576, in __init__ self._socket.bind(address) OSError: [Errno 48] Address already in use (...) test_rlock (test.test_multiprocessing_forkserver.WithThreadsTestLock) ... ok test_rapid_restart (test.test_multiprocessing_forkserver.WithThreadsTestManagerRestart) ... ERROR Warning -- Dangling processes: {} test_boundaries (test.test_multiprocessing_forkserver.WithThreadsTestPoll) ... ok test_dont_merge (test.test_multiprocessing_forkserver.WithThreadsTestPoll) ... ok (...) test_timeout (test.test_multiprocessing_forkserver.WithThreadsTestSemaphore) ... skipped 'test not appropriate for threads' test_import (test.test_multiprocessing_forkserver._TestImportStar) ... ok Warning -- Dangling processes: {} ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing_forkserver.WithThreadsTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/test/_test_multiprocessing.py", line 2508, in test_rapid_restart manager.start() File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/managers.py", line 517, in start self._address = reader.recv() File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/connection.py", line 250, in recv buf = self._recv_bytes() File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/connection.py", line 407, in _recv_bytes buf = self._recv(4) File "/Users/buildbot/buildarea/3.6.billenstein-sierra/build/Lib/multiprocessing/connection.py", line 383, in _recv raise EOFError EOFError ---------- components: Tests messages: 306443 nosy: haypo priority: normal severity: normal status: open title: test_multiprocessing_forkserver failed with OSError: [Errno 48] Address already in use versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 15:37:30 2017 From: report at bugs.python.org (uday kiran) Date: Fri, 17 Nov 2017 20:37:30 +0000 Subject: [New-bugs-announce] [issue32064] python msilib view.fetch is not returning none Message-ID: <1510951050.2.0.213398074469.issue32064@psf.upfronthosting.co.za> New submission from uday kiran : Please see my script attached. Once the records are completed, the View.Fetch() function should give a none value but intsead giving runtime error: _msi.MSIError: unknown error 103 It is already mentioned in the bugs. https://bugs.python.org/issue29364 https://bugs.python.org/issue1102 The comments mentioned as it will be fixed in the coming release. But it is a long back comment,but still not fixed. Any update on this? ---------- components: Windows files: MSIFileRead.py messages: 306456 nosy: paul.moore, steve.dower, tim.golden, uday kiran, zach.ware priority: normal severity: normal status: open title: python msilib view.fetch is not returning none type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47271/MSIFileRead.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 18:11:12 2017 From: report at bugs.python.org (yegle) Date: Fri, 17 Nov 2017 23:11:12 +0000 Subject: [New-bugs-announce] [issue32065] range_iterator doesn't have length, leads to surprised result Message-ID: <1510960272.2.0.213398074469.issue32065@psf.upfronthosting.co.za> New submission from yegle : This also affects xrange in Python2, so I chose the affected version as python27. range object (and xrange in Python2) has __len__(), but the range_iterator object created from __reversed__() doesn't have __len__. Python2: >>> x = xrange(10) >>> len(x) 10 >>> reversed(x) >>> y = reversed(x) >>> len(y) Traceback (most recent call last): File "", line 1, in TypeError: object of type 'rangeiterator' has no len() Python3.6 >>> x = range(10) >>> len(x) 10 >>> len(reversed(x)) Traceback (most recent call last): File "", line 1, in TypeError: object of type 'range_iterator' has no len() ---------- components: Interpreter Core messages: 306458 nosy: yegle priority: normal severity: normal status: open title: range_iterator doesn't have length, leads to surprised result versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 17 18:27:14 2017 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 17 Nov 2017 23:27:14 +0000 Subject: [New-bugs-announce] [issue32066] asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional Message-ID: <1510961234.41.0.213398074469.issue32066@psf.upfronthosting.co.za> Change by Yury Selivanov : ---------- components: asyncio nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio: Support pathlib.Path in create_unix_connection; sock arg should be optional versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 06:12:27 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 11:12:27 +0000 Subject: [New-bugs-announce] [issue32067] Deprecate accepting Message-ID: <1511003547.89.0.213398074469.issue32067@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Currently `{m}`, `{m,n}`, `{m,}` and `{,n}` where m and n are non-negative decimal numbers are accepted in regular expressions as quantifiers that mean repeating the previous RE from m (0 by default) to n (infinity by default) times. But if the opening brace '{'is not followed by one of the above patterns, it means just the literal '{'. >>> import re >>> re.search('(foobar){e}', 'xirefoabralfobarxie') >>> re.search('(foobar){e}', 'foobar{e}') This conflicts with the regex module which uses braces for defining the "fuzzy" matching. >>> import regex >>> regex.search('(foobar){e}', 'xirefoabralfobarxie') >>> regex.search('(foobar){e}', 'foobar{e}') I don't think it is worth to add support of fuzzy matching in the re module, but for compatibility it would be better to raise an error or a warning in case of '{' not following by the one of the recognized patterns. This could also help to catch typos and errors in regular expressions, i.e. in '-{1.2}' or '-{1, 2}' instead of '-{1,2}'. Possible variants: 1. Emit a DeprecationWarning in 3.7 (and 2.7.15 with the -3 option), raise a re.error in 3.8 or 3.9. 2. Emit a PendingDeprecationWarning in 3.7, a DeprecationWarning in 3.8, and raise a re.error in 3.9 or 3.10. 3. Emit a RuntimeWarning or SyntaxWarning in 3.7 and forever. 4. Emit a FutureWarning in 3.7, and implement the fuzzy matching or replace re with regex sometimes in future. Unlikely. ---------- assignee: serhiy.storchaka components: Library (Lib), Regular Expressions messages: 306479 nosy: ezio.melotti, mrabarnett, serhiy.storchaka priority: normal severity: normal status: open title: Deprecate accepting type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 09:20:36 2017 From: report at bugs.python.org (Slava Bacherikov) Date: Sat, 18 Nov 2017 14:20:36 +0000 Subject: [New-bugs-announce] [issue32068] textpad from curses package isn't handling backspace key Message-ID: <1511014836.54.0.213398074469.issue32068@psf.upfronthosting.co.za> New submission from Slava Bacherikov : textpad isn't handling backspace key on my system and seems on others too. When I press backspace key, terminal sends `ascii.DEL` (127) and it isn't handled by textpad. I've attached patch that fixes this, should I also create PR for this or patch is enough ? ---------- components: Library (Lib) files: textpad.patch keywords: patch messages: 306481 nosy: bacher09 priority: normal severity: normal status: open title: textpad from curses package isn't handling backspace key type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file47272/textpad.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 09:44:11 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Sat, 18 Nov 2017 14:44:11 +0000 Subject: [New-bugs-announce] [issue32069] Drop loop._make_legacy_ssl_transport Message-ID: <1511016251.23.0.213398074469.issue32069@psf.upfronthosting.co.za> New submission from Andrew Svetlov : It uses `wrap_socket` and exists only for backward compatibility with Python without ssl.MemoryBIO, which is Python 3.4 Let's cut it out from Python 3.7 and 3.6 -- it's safe, pretty sure. ---------- components: Library (Lib), asyncio messages: 306482 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Drop loop._make_legacy_ssl_transport versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 13:04:15 2017 From: report at bugs.python.org (Jesse SHapiro) Date: Sat, 18 Nov 2017 18:04:15 +0000 Subject: [New-bugs-announce] [issue32070] Clarify the behavior of the staticmethod builtin Message-ID: <1511028255.0.0.213398074469.issue32070@psf.upfronthosting.co.za> New submission from Jesse SHapiro : It looks like the original staticmethod docstring might have been based on the classmethod docstring, and it seems like the current description might not be accurate. Current string: ...It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()); the instance is ignored except for its class... Proposed change: It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). Both the class and the instance are ignored, and neither is passed implicitly as the first argument to the method. ---------- assignee: docs at python components: Documentation messages: 306489 nosy: docs at python, haikuginger priority: normal pull_requests: 4391 severity: normal status: open title: Clarify the behavior of the staticmethod builtin type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 13:12:40 2017 From: report at bugs.python.org (Jonas H.) Date: Sat, 18 Nov 2017 18:12:40 +0000 Subject: [New-bugs-announce] [issue32071] Add py.test-like "-k" test selection to unittest Message-ID: <1511028760.96.0.213398074469.issue32071@psf.upfronthosting.co.za> New submission from Jonas H. : I'd like to add test selection based on parts of the test class/method name to unittest. Similar to py.test's "-k" option: https://docs.pytest.org/en/latest/example/markers.html#using-k-expr-to-select-tests-based-on-their-name Here's a proof of concept implementation: https://github.com/jonashaag/cpython/compare/master...unittest-select Is this something others find useful as well? If so, I'd like to work on getting this into Python stdlib proper. This is my first time contributing to the unittest framework; is the general approach taken in my PoC implementation correct in terms of abstractions? How can I improve the implementation? Jonas ---------- components: Library (Lib) messages: 306490 nosy: jonash priority: normal severity: normal status: open title: Add py.test-like "-k" test selection to unittest type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 14:06:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 18 Nov 2017 19:06:16 +0000 Subject: [New-bugs-announce] [issue32072] Issues with binary plists Message-ID: <1511031976.48.0.213398074469.issue32072@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : plistlib creates a new objects when read references instead of using already read object. As result it doesn't preserve identity: >>> import plistlib >>> a = [['spam']]*2 >>> a[0] is a[1] True >>> b = plistlib.loads(plistlib.dumps(a, fmt=plistlib.FMT_BINARY)) >>> b == a True >>> b[0] is b[1] False And plistlib.loads() is vulnerable to plists containing cyclic references (as was exposed in issue31897). For example, plistlib.loads(b'bplist00\xa1\x00\x08\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a') could return a list containing itself, but it is failed with RecursionError. plistlib.dumps() preserves reference in the output, but it saves redundant copies. For example plistlib.dumps([[]]*5, fmt=plistlib.FMT_BINARY) saves a list containing 5 identical empty lists, but it saves an empty list 5 times, and only the last copy is used. The other 4 copies are not referenced and just spent the file volume and the space of reference numbers. Saving [[[[['spam']*100]*100]*100]*100]*100 will result in a multigigabyte, while less than a kilobyte would be enough for saving it. Loading properly saved [[[[['spam']*100]*100]*100]*100]*100 withe the current plistlib.loads() will cause consuming many gigabytes of memory. 1. The issues with plistlib.dumps() are: 1a) Inefficient saving data with references. This is minor resource usage issue. 1b) Impossibility to save a data with cyclic references. This is a lack of a feature. 2. The issues with plistlib.loads() are: 2a) Inefficient loading data with references. This can be not just a resource usage issue, but a security issue. Loading an malicious input data smaller than 100 byte ([[[...]*2]*2]*2) can cause consuming many gigabytes of memory. 2b) Impossibility to load a data with cyclic references. This is a lack of a feature, but can be lesser security issue. Small malicious input can cause RecursionError. If the recursion limit is set high and you are unlucky it can cause a stack overflow. Security issues affect you only when you load plists from untrusted sources. Adding the proper support of references could be considered a new feature, but taking to account security issues it should be backported up to 3.4 when the support of binary plists was added. ---------- assignee: serhiy.storchaka components: Library (Lib) messages: 306493 nosy: ned.deily, ronaldoussoren, serhiy.storchaka priority: normal severity: normal status: open title: Issues with binary plists type: security versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 18 14:13:27 2017 From: report at bugs.python.org (desbma) Date: Sat, 18 Nov 2017 19:13:27 +0000 Subject: [New-bugs-announce] [issue32073] Add copy_directory_metadata parameter to shutil.copytree Message-ID: <1511032407.02.0.213398074469.issue32073@psf.upfronthosting.co.za> New submission from desbma : I am sometimes using shutil.copytree to copy a directory to a destination that does not support setting metadata (like MTP mounts of Android devices). Using the copy_function parameter allows passing shutil.copy or a custom function to ignore file metadata, however currently shutil.copytree always tries to call copystat on directories, which can fail with OSError (errno set to ENOTSUPP). The code assumes copystat can fail on Windows, but propagates the error on other OS, even though the tree copy actually succeeds. See https://github.com/python/cpython/blob/9bb6fe52742340f6c92f0dda18599a4577a94e18/Lib/shutil.py#L352-L357 ---------- components: Library (Lib) messages: 306494 nosy: desbma priority: normal severity: normal status: open title: Add copy_directory_metadata parameter to shutil.copytree type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 04:08:49 2017 From: report at bugs.python.org (Sai Bhargava Ramu) Date: Sun, 19 Nov 2017 09:08:49 +0000 Subject: [New-bugs-announce] [issue32074] Might be a wrong implementation Message-ID: <1511082529.04.0.213398074469.issue32074@psf.upfronthosting.co.za> New submission from Sai Bhargava Ramu : https://docs.python.org/2/library/itertools.html#itertools.combinations #The behaviour of combinations function in documentation is different and I think identation is missing with `else` #I didn't get the logic right is point out anything further. This might not be a real issue ---------- assignee: docs at python components: Documentation files: combinations.py messages: 306499 nosy: Sai Bhargava Ramu, docs at python priority: normal severity: normal status: open title: Might be a wrong implementation type: behavior versions: Python 3.5 Added file: https://bugs.python.org/file47273/combinations.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 14:56:09 2017 From: report at bugs.python.org (Decorater) Date: Sun, 19 Nov 2017 19:56:09 +0000 Subject: [New-bugs-announce] [issue32075] Expose ZipImporter Type Object in the include header files. Message-ID: <1511121369.3.0.213398074469.issue32075@psf.upfronthosting.co.za> New submission from Decorater : I would like to make an C extension module which basically would have the ZipImporter type defined in the ``zipimport.c`` which defines most things related to ZipImporter to be public so that way one can set it to ``.tp_base`` on their C extension. That should hopefully in the C side of things allow subclassing the zipimporter class outside of the Python layer as well. Otherwise I would have to manually copy the said definition from zipimport.c and that could be a huge risk if a bug or something in the ZipImporter was fixed that it wont automatically be fixed in the C version of the subclass. I want precisely this and for it to be exposed to other people who might want to subclass the zipimporter class outside of the Python layer as well. ---------- components: Extension Modules, Interpreter Core, Library (Lib) messages: 306513 nosy: Decorater priority: normal severity: normal status: open title: Expose ZipImporter Type Object in the include header files. versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 15:21:43 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 19 Nov 2017 20:21:43 +0000 Subject: [New-bugs-announce] [issue32076] Expose LockFile on Windows Message-ID: <1511122903.69.0.213398074469.issue32076@psf.upfronthosting.co.za> New submission from Antoine Pitrou : msvcrt.locking() is sometimes practically useless since its so-called "non-blocking" mode will still block for 1 second. Instead, the Windows API LockFile() function (and its companion UnlockFile()) allows real non-blocking locking. Right now you have to call LockFile() using ctypes (see https://github.com/mwilliamson/locket.py/pull/8/files for an example). It would be nice to expose it somewhere, for example in msvcrt or another module. ---------- components: Library (Lib), Windows messages: 306514 nosy: paul.moore, pitrou, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Expose LockFile on Windows type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 19:00:14 2017 From: report at bugs.python.org (Mathew M.) Date: Mon, 20 Nov 2017 00:00:14 +0000 Subject: [New-bugs-announce] [issue32077] Documentation: Some Unicode object functions don't indicate whether they return a new reference Message-ID: <1511136014.35.0.213398074469.issue32077@psf.upfronthosting.co.za> New submission from Mathew M. : This is just something I've noticed when browsing the C API documentation for Unicode objects. For example, the documentation entry for PyUnicode_DecodeMBCSStateful lacks the "Return value: New reference", etc. ---------- assignee: docs at python components: Documentation messages: 306516 nosy: Mathew M., docs at python priority: normal severity: normal status: open title: Documentation: Some Unicode object functions don't indicate whether they return a new reference type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 19 20:26:16 2017 From: report at bugs.python.org (Arno-Can Uestuensoez) Date: Mon, 20 Nov 2017 01:26:16 +0000 Subject: [New-bugs-announce] [issue32078] string result of str(bytes()) in Python3 Message-ID: <1511141176.94.0.213398074469.issue32078@psf.upfronthosting.co.za> New submission from Arno-Can Uestuensoez : Hello, I am currently writing some dual-version libraries and have to deal with str/unicode. The attached code example contains the str/unicode handling. The Python3.6.2 release behaves as I did not expected for all of the following the conversions: unicode = str # @ReservedAssignment # it is intentional mystring = "abc" u0 = unicode(bytes(mystring.encode())) # == str(mystring) mystring = "abc" u0 = unicode(bytes(mystring.encode('utf-8'))) # == str(mystring) mystring = "abc" u0 = unicode(bytes(mystring.encode('ascii'))) # == str(mystring) mystring = b"abc" u0 = unicode(mystring) # == str(mystring) results for Python3 in: type: len: 6 b'abc' while in Python2: type: len: 3 abc I am not sure whether this is the intended behavior because the manual could eventually be misinterpreted: 4.8.1. Bytes Objects Bytes objects are immutable sequences of single bytes. Since many major binary protocols are based on the ASCII text encoding, bytes objects offer several methods that are only valid when working with ASCII compatible data and are closely related to string objects in a variety of other ways. class bytes([source[, encoding[, errors]]]) Firstly, the syntax for bytes literals is largely the same as that for string literals, except that a b prefix is added: I expected the 'b'-prefix to be added to the input only, but I expect the output without a type-prefix, because it is just an attribute/property. The result for Python3 should be similar to Python2: type: len: 3 abc Regards Arno ---------- components: Unicode files: source_and_output.tar.gz messages: 306521 nosy: acue, ezio.melotti, vstinner priority: normal severity: normal status: open title: string result of str(bytes()) in Python3 type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47274/source_and_output.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 00:25:15 2017 From: report at bugs.python.org (=?utf-8?q?Ra=C3=BAl_Alvarez?=) Date: Mon, 20 Nov 2017 05:25:15 +0000 Subject: [New-bugs-announce] [issue32079] version install 3.6.3 hangs in test_socket Message-ID: <1511155515.69.0.213398074469.issue32079@psf.upfronthosting.co.za> New submission from Ra?l Alvarez : I'm trying to install python 3.6.3 from sources in Fedora 3.19.8-100.fc20.x86_64+debug x86_64 GNU/Linux, I did ./configure, then run make as normal user and then as root, in these two cases the installation hangs over more than 6 hours with no progress in step 298/405: 0:14:02 load avg: 1.32 [298/405] test_socket I can interrupt the process pressing CTRL-C, then the screen shows me: test_subprocess test_sunau test_sundry test_super test_symbol test_symtable test_syntax test_sys test_sys_setprofile test_sys_settrace test_sysconfig test_syslog test_tarfile test_tcl test_telnetlib test_tempfile test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading test_threading_local test_threadsignals test_time test_timeit test_timeout test_tix test_tk test_tokenize test_tools test_trace test_traceback test_tracemalloc test_ttk_guionly test_ttk_textonly test_tuple test_turtle test_typechecks test_typing test_ucn test_unary test_unicode test_unicode_file test_unicode_file_functions test_unicode_identifiers test_unicodedata test_univnewlines test_unpack test_unpack_ex test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib_response test_urllibnet test_urlparse test_userdict test_userlist test_userstring test_utf8source test_uu test_uuid test_venv test_wait3 test_wait4 test_warnings test_wave test_weakref test_weakset test_webbrowser test_winconsoleio test_winreg test_winsound test_with test_wsgiref test_xdrlib test_xml_dom_minicompat test_xml_etree test_xml_etree_c test_xmlrpc test_xmlrpc_net test_yield_from test_zipapp test_zipfile test_zipfile64 test_zipimport test_zipimport_support test_zlib Total duration: 449 min 55 sec Tests result: FAILURE make: *** [profile-opt] Interrupci?n ---------- components: Installation messages: 306526 nosy: Ra?l Alvarez priority: normal severity: normal status: open title: version install 3.6.3 hangs in test_socket type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 01:05:49 2017 From: report at bugs.python.org (Sachin Pathave) Date: Mon, 20 Nov 2017 06:05:49 +0000 Subject: [New-bugs-announce] [issue32080] Error Installing Python 3.6.3 on ubuntu 16.04 Message-ID: <1511157949.99.0.213398074469.issue32080@psf.upfronthosting.co.za> New submission from Sachin Pathave : test failed when I run command $make test FAILED (failures=1, skipped=1) test test_re failed 2 tests failed again: test_re test_venv ---------- components: 2to3 (2.x to 3.x conversion tool) files: test.Screenshot from 2017-11-20 11-12-41.png messages: 306529 nosy: sachin priority: normal severity: normal status: open title: Error Installing Python 3.6.3 on ubuntu 16.04 type: resource usage versions: Python 3.6 Added file: https://bugs.python.org/file47277/test.Screenshot from 2017-11-20 11-12-41.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 03:57:18 2017 From: report at bugs.python.org (Attila Nagy) Date: Mon, 20 Nov 2017 08:57:18 +0000 Subject: [New-bugs-announce] [issue32081] ipaddress should support fast IP lookups Message-ID: <1511168238.6.0.213398074469.issue32081@psf.upfronthosting.co.za> New submission from Attila Nagy : It would be nice if ipaddress could support fast IP lookups, like this: https://github.com/jsommers/pytricia ---------- components: Library (Lib) messages: 306535 nosy: Attila Nagy priority: normal severity: normal status: open title: ipaddress should support fast IP lookups type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 04:54:41 2017 From: report at bugs.python.org (Erik Bray) Date: Mon, 20 Nov 2017 09:54:41 +0000 Subject: [New-bugs-announce] [issue32082] atexit module: allow getting/setting list of handlers directly Message-ID: <1511171681.08.0.213398074469.issue32082@psf.upfronthosting.co.za> New submission from Erik Bray : In Python 2 it was possible to directly manipulate the list of registered atexit handlers through atexit._exithandlers. Obviously I'm not complaining that this went away, as it was an underscored attribute. But this possibility was still useful in the context of testing. For example, we have a test suite that runs many test cases in subprocesses run with multiprocessing.Process. Since these call os._exit() any atexit handlers registered by the code under test are not run. It's useful, however, to test that either a) Expected atexit handlers ran correctly or b) No unexpected atexit handlers were registered To this end we would save and clear atexit._exithandlers, call atexit._run_exitfuncs(), then restore the original atexit._exithandlers. This is not possible on Python 3 since that all lives in the C module state for sub-interpreter support. For the time being it was necessary to work around this with a Cython module, but coding around internal extension module structures is hardly ideal: https://git.sagemath.org/sage.git/diff/src/sage/misc/_context_py3.pyx?id=85b17201255e9919eaa7b5cff367e8bc271c2a3f I think it would be useful--for testing purposes *only*--to add a _get_exitfuncs() function that returns a tuple of the registered handlers, and likewise a _set_exitfuncs(handlers) with sets the registered handlers from an iterable (the latter being little more than a shortcut for `atexit._clear(); for h in handlers: atexit.register(*h)`). I would propose that these be undocumented internal functions to emphasize that they are not how the module should be used in normal circumstances. At the same time it might be worth addressing https://bugs.python.org/issue22867 I can provide a patch if this idea is acceptable. ---------- components: Library (Lib) messages: 306537 nosy: erik.bray priority: normal severity: normal status: open title: atexit module: allow getting/setting list of handlers directly type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 08:08:43 2017 From: report at bugs.python.org (Katsuhiko YOSHIDA) Date: Mon, 20 Nov 2017 13:08:43 +0000 Subject: [New-bugs-announce] [issue32083] sqlite3 Cursor.description can't return column types Message-ID: <1511183323.28.0.213398074469.issue32083@psf.upfronthosting.co.za> New submission from Katsuhiko YOSHIDA : My schema of sqlite3 table is the following. --- schema check start --- % sqlite3 sample.db SQLite version 3.16.0 2016-11-04 19:09:39 Enter ".help" for usage hints. sqlite> PRAGMA table_info(Employees); 0|EmployeeID|int|1||1 1|LastName|varchar(20)|1||0 2|FirstName|varchar(10)|1||0 (ommiting) sqlite> --- schema check end --- Then, I tried to output column types by calling Cursor.description. Like this. --- sample code start --- import sqlite3 con = sqlite3.connect("sample.db", detect_types=sqlite3.PARSE_DECLTYPES) cursor = con.cursor() cursor.execute("select LastName, FirstName from Employees limit 1;") print cursor.description cursor.close() con.close() --- sample code end --- The output is the following. (('LastName', None, None, None, None, None, None), ('FirstName', None, None, None, None, None, None)) When changing detect_types parameter to detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES the result is same. I expect to output a column type in second element. Could you tell me why? ---------- components: Library (Lib) messages: 306539 nosy: kyoshidajp priority: normal severity: normal status: open title: sqlite3 Cursor.description can't return column types type: behavior versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 08:49:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 13:49:16 +0000 Subject: [New-bugs-announce] [issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL Message-ID: <1511185756.0.0.213398074469.issue32084@psf.upfronthosting.co.za> New submission from STINNER Victor : iDer reported a vulnerability in the HTTP server. (1) Start a local HTTP server (listen to tcp/8000): python3 -m http.server 8000 (2) Open a web browser and to go: http://localhost:8000//www.python.org/%2f.. => the browser is redirected to http://www.python.org/%2f../ (on this example, the python.org web server redirects to https://www.python.org/%2f../ ) Raw HTTP to see the HTTP redirection using netcat: --- $ echo -ne "GET //www.python.org/%2f.. HTTP/1.0\n\n" | nc localhost 8000 HTTP/1.0 301 Moved Permanently Server: SimpleHTTP/0.6 Python/3.6.2 Date: Mon, 20 Nov 2017 13:31:42 GMT Location: //www.python.org/%2f../ --- The problem is in the SimpleHTTPRequestHandler.send_head() function: * self.path = '//www.python.org/%2f..' * translate_path() translates '//www.python.org//..' path to self.directory (the current directory by default). * isdir(self.directory) is True but self.path doesn't send with '/', so send_head() creates a HTTP redirection (HTTP 301) * The redirection URL is '//www.python.org/%2f../'. Extract of the raw HTTP: "Location: //www.python.org/%2f../" The web browsers translates the URL '//www.python.org/%2f../' to "http://www.python.org/%2f../"... It surprised me, but ok, it's a fact. I'm not sure what is the best way to fix this vulnerability without rejecting valid HTTP requests. IMHO the root issue is the redirection URL starting with "//". I would expect something like "localhost//". The problem is that I'm not sure that the HTTP server knows its own "external" hostname. "localhost" is wrong is the server is accessed from the outside. Maybe the server must just fail on that case? This vulnerabilility was reported to the Python Security Response Team (PSRT) at October 18, 2017 (one month ago). Since no obvious fix was found, it was decided to make the vulnerability public to get more eyes on it to find a quick fix. Note: I'm not sure that this vulnerability is important, since the redirected URL ends with "/%2f../" which should be rejected by any correct HTTP Server (say, not the Python builtin "simple" HTTP server...). ---------- components: Library (Lib) messages: 306540 nosy: vstinner priority: normal severity: normal status: open title: [Security] http.server can be abused to redirect to (almost) arbitrary URL type: security versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:15:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:15:17 +0000 Subject: [New-bugs-announce] [issue32085] [Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! Message-ID: <1511187317.56.0.213398074469.issue32085@psf.upfronthosting.co.za> New submission from STINNER Victor : Vulnerabilities described below are likely these ones reported in bpo-30500, but it would be nice to double check if *all* reported vulnerabilities have been fixed! http://python-security.readthedocs.io/vuln/bpo-30500_urllib_connects_to_a_wrong_host.html -- At July 27, 2017, Orange Tsai (Security Consultant, DEVCORE) reported vulnerabilities in Python, in the code parsing URLs. Conference: https://www.blackhat.com/us-17/briefings/schedule/#a-new-era-of-ssrf---exploiting-url-parser-in-trending-programming-languages-6292 Slides: https://www.blackhat.com/docs/us-17/thursday/us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-Languages.pdf His following blog post only contains the vulnerabilities in Python: http://blog.orange.tw/2017/07/how-i-chained-4-vulnerabilities-on.html Note: His twitter account, https://twitter.com/orange_8361 == Issue 1 == * CR-LF Injection on HTTP protocol * Smuggling SMTP protocol over HTTP protocol http://127.0.0.1:25/%0D%0AHELO orange.tw%0D%0AMAIL FROM >> GET / << 421 4.7.0 ubuntu Rejecting open proxy localhost [127.0.0.1] >> HELO orange.tw Connection closed => "SMTP Hates HTTP Protocol It Seems Unexploitable" "Gopher Is Good What If There Is No Gopher Support?" "HTTPS What Won't Be Encrypted in a SSL Handshake?" == Issue 2 == * HTTPS: What Won't Be Encrypted in a SSL Handshake? * Exploit the Unexploitable - Smuggling SMTP over TLS SNI https://127.0.0.1?%0D%0AHELO?orange.tw%0D%0AMAIL?FROM...:25/ (...) >< HELO orange.tw << 250 ubuntu Hello localhost [127.0.0.1], please meet you >> MAIL FROM: << 250 2.1.0 ... Sender ok == Big Picture == Python vulnerable to: * Python httplib: * CR-LF Injection: Path, Host and SNI * Python urllib: * CR-LF Injection: Host and SNI * Host Injection * Python urllib2 * CR-LF Injection: Host and SNI ---------- messages: 306543 nosy: vstinner priority: normal severity: normal status: open title: [Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:21:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:21:16 +0000 Subject: [New-bugs-announce] [issue32086] C API: Clarify which C functions are safe to be called before Py_Initialize() Message-ID: <1511187676.4.0.213398074469.issue32086@psf.upfronthosting.co.za> New submission from STINNER Victor : See the python-dev thread: https://mail.python.org/pipermail/python-dev/2017-November/150605.html ---------- components: Interpreter Core messages: 306544 nosy: vstinner priority: normal severity: normal status: open title: C API: Clarify which C functions are safe to be called before Py_Initialize() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:24:40 2017 From: report at bugs.python.org (KINEBUCHI Tomohiko) Date: Mon, 20 Nov 2017 14:24:40 +0000 Subject: [New-bugs-announce] [issue32087] deprecated-removed directive generates overlapping msgids in .pot files Message-ID: <1511187880.98.0.213398074469.issue32087@psf.upfronthosting.co.za> New submission from KINEBUCHI Tomohiko : When gettext builder is invoked, deprecated-removed directive which is defined in Doc/tools/extensions/pyspecific.py generates overlapping msgids in .pot files. For example, the following .rst source (taken from Doc/library/dmb.rst L354):: .. deprecated-removed:: 3.6 3.8 Creating database in ``'r'`` and ``'w'`` modes. Modifying database in ``'r'`` mode. results to following .pot file entries:: #: ../../library/dbm.rst:357 msgid "Deprecated since version 3.6, will be removed in version 3.8: Creating database in 'r' and 'w' modes. Modifying database in 'r' mode." msgstr "" #: ../../library/dbm.rst:357 msgid "Creating database in ``'r'`` and ``'w'`` modes. Modifying database in ``'r'`` mode." msgstr "" using the command:: sphinx-build -E -b gettext -D gettext_compact=0 -w warnings.txt -d build/.doctrees . locale/pot The root cause is deprecated-removed directive constructs inappropriate sub-doctree for translation. First, above .rst source is compiled into following tree structure:: Deprecated since version 3.6, will be removed in version 3.8: Creating database in... and gettext builder picks up paragraph node and the second inline node as translation targets. Expected result is that two inline nodes are picked up as translation targets and the paragraph node is not, and expected .pot file entries are such as following:: #: ../../library/dbm.rst:357 msgid "Deprecated since version 3.6, will be removed in version 3.8:" msgstr "" #: ../../library/dbm.rst:357 msgid "Creating database in ``'r'`` and ``'w'`` modes. Modifying database in ``'r'`` mode." msgstr "" ---------- assignee: docs at python components: Documentation messages: 306546 nosy: cocoatomo, docs at python priority: normal severity: normal status: open title: deprecated-removed directive generates overlapping msgids in .pot files versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:26:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:26:42 +0000 Subject: [New-bugs-announce] [issue32088] Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode Message-ID: <1511188002.91.0.213398074469.issue32088@psf.upfronthosting.co.za> New submission from STINNER Victor : Related python-dev thread: https://mail.python.org/pipermail/python-dev/2017-November/150608.html "[Python-Dev] Show DeprecationWarning in debug mode?" I propose to display Display DeprecationWarning, PendingDeprecationWarning and ImportWarning when Python is compiled in debug mode. Attached PR implements proposed change. ---------- components: Library (Lib) messages: 306547 nosy: vstinner priority: normal severity: normal status: open title: Display DeprecationWarning, PendingDeprecationWarning and ImportWarning in debug mode type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 09:57:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 14:57:20 +0000 Subject: [New-bugs-announce] [issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers Message-ID: <1511189840.42.0.213398074469.issue32089@psf.upfronthosting.co.za> New submission from STINNER Victor : The -X dev mode currently *hides* some ResourceWarning warnings: $ cat x.py def func(): open('/etc/issue') func() func() $ ./python x.py x.py:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'> open('/etc/issue') x.py:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'> open('/etc/issue') haypo at selma$ ./python -X dev x.py x.py:2: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'> open('/etc/issue') The problem is that the "-W default" inserted by -X dev overrides the final filter on ResourceWarning: $ ./python -X dev -c 'import warnings, pprint; pprint.pprint(warnings.filters)' [('default', re.compile('', re.IGNORECASE), , re.compile(''), 0), ('ignore', None, , None, 0), ('always', None, , None, 0)] ---------- messages: 306548 nosy: ncoghlan, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: In developer mode (-X dev), ResourceWarning is only emited once per line numbers versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:32:21 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:32:21 +0000 Subject: [New-bugs-announce] [issue32090] test_put() Message-ID: <1511191941.25.0.213398074469.issue32090@psf.upfronthosting.co.za> New submission from STINNER Victor : The test failed on AMD64 FreeBSD 10.x Shared 3.x: http://buildbot.python.org/all/#/builders/87/builds/200/steps/4/logs/stdio FAIL: test_put (test.test_multiprocessing_fork.WithProcessesTestQueue) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/_test_multiprocessing.py", line 809, in test_put self.assertEqual(queue_empty(queue), False) AssertionError: True != False -- I succeeded to reproduce the issue on Linux with this change: diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index dbca2d89ed..0754ac0d52 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -804,7 +804,7 @@ class _TestQueue(BaseTestCase): queue.put_nowait(6) # the values may be in buffer but not yet in pipe so sleep a bit - time.sleep(DELTA) + time.sleep(0) self.assertEqual(queue_empty(queue), False) self.assertEqual(queue_full(queue, MAXSIZE), True) ---------- components: Tests messages: 306553 nosy: vstinner priority: normal severity: normal status: open title: test_put() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:35:38 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 15:35:38 +0000 Subject: [New-bugs-announce] [issue32091] test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo Refleaks 3.6 Message-ID: <1511192138.79.0.213398074469.issue32091@psf.upfronthosting.co.za> New submission from STINNER Victor : Failure on x86 Gentoo Refleaks 3.6: http://buildbot.python.org/all/#/builders/72/builds/43 0:58:35 load avg: 5.21 [135/406/1] test_site failed -- running: test_multiprocessing_forkserver (483 sec) beginning 6 repetitions 123456 test test_site failed -- Traceback (most recent call last): File "/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib/test/test_site.py", line 186, in test_s_option self.assertIn(usersite, sys.path) AssertionError: '/buildbot/buildarea/.local/lib/python3.6/site-packages' not found in ['', '/usr/local/lib/python36.zip', '/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib', '/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/build/lib.linux-i686-3.6-pydebug', '/usr/local/lib/python3.6/site-packages'] (...) Re-running test 'test_site' in verbose mode (...) FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib/test/test_site.py", line 186, in test_s_option self.assertIn(usersite, sys.path) AssertionError: '/buildbot/buildarea/.local/lib/python3.6/site-packages' not found in ['', '/usr/local/lib/python36.zip', '/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/Lib', '/buildbot/buildarea/3.6.ware-gentoo-x86.refleak/build/build/lib.linux-i686-3.6-pydebug', '/usr/local/lib/python3.6/site-packages'] ---------- components: Tests messages: 306554 nosy: vstinner priority: normal severity: normal status: open title: test_s_option() of test_site.HelperFunctionsTests failed on x86 Gentoo Refleaks 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 10:50:21 2017 From: report at bugs.python.org (Claudiu Belu) Date: Mon, 20 Nov 2017 15:50:21 +0000 Subject: [New-bugs-announce] [issue32092] mock.patch with autospec does not consume self / cls argument Message-ID: <1511193021.31.0.213398074469.issue32092@psf.upfronthosting.co.za> New submission from Claudiu Belu : Currently, the autospec=True argument can be passed to mock.patch, but when trying to make assertions on the call and its arguments, it can fail, as it expects an instance / class instance reference as the first argument (self / cls arguments are not consumed when autospec-ing). Steps to reproduce: >>> import mock >>> from mock.tests import testmock >>> >>> with mock.patch.object(testmock.Something, 'meth', autospec=True): ... smth = testmock.Something() ... smth.meth(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, mock.sentinel.d) ... smth.meth.assert_called_once_with(mock.sentinel.a, mock.sentinel.b, mock.sentinel.c, mock.sentinel.d) ... Traceback (most recent call last): File "", line 4, in File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 318, in assert_called_once_with return mock.assert_called_once_with(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 948, in assert_called_once_with return self.assert_called_with(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 937, in assert_called_with six.raise_from(AssertionError(_error_message(cause)), cause) File "/usr/local/lib/python2.7/dist-packages/six.py", line 718, in raise_from raise value AssertionError: Expected call: meth(sentinel.a, sentinel.b, sentinel.c, sentinel.d) Actual call: meth(, sentinel.a, sentinel.b, sentinel.c, sentinel.d) Expected result: no AssertionError. ---------- messages: 306559 nosy: cbelu priority: normal severity: normal status: open title: mock.patch with autospec does not consume self / cls argument versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 12:20:53 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 20 Nov 2017 17:20:53 +0000 Subject: [New-bugs-announce] [issue32093] macOS: implement time.thread_time() using thread_info() Message-ID: <1511198453.26.0.213398074469.issue32093@psf.upfronthosting.co.za> New submission from STINNER Victor : bpo-32025 added time.thread_time() function. On macOS, CLOCK_THREAD_CPUTIME_ID is not available. I propose to add a macOS implementation using thread_info(): return the sum of user and system times. ---------- components: macOS messages: 306569 nosy: ned.deily, pitrou, ronaldoussoren, vstinner priority: normal severity: normal status: open title: macOS: implement time.thread_time() using thread_info() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 13:18:46 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 20 Nov 2017 18:18:46 +0000 Subject: [New-bugs-announce] [issue32094] _args_from_interpreter_flags() doesn't keep -X options Message-ID: <1511201926.73.0.213398074469.issue32094@psf.upfronthosting.co.za> New submission from Antoine Pitrou : `subprocess._args_from_interpreter_flags()` is used to control the flags passed to child Python processes, for example launched by multiprocessing. Unfortunately, not all flags are actually recognized by this function: $ ./python -X dev Python 3.7.0a2+ (heads/master:895862a, Nov 20 2017, 19:15:23) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys._xoptions {'dev': True} >>> import subprocess >>> subprocess._args_from_interpreter_flags() ['-Wdefault'] ---------- components: Library (Lib) messages: 306574 nosy: barry, davin, pitrou, vstinner priority: normal severity: normal status: open title: _args_from_interpreter_flags() doesn't keep -X options type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 15:38:04 2017 From: report at bugs.python.org (Michael Felt) Date: Mon, 20 Nov 2017 20:38:04 +0000 Subject: [New-bugs-announce] [issue32095] AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails Message-ID: <1511210284.67.0.213398074469.issue32095@psf.upfronthosting.co.za> New submission from Michael Felt : after git clone from master: make install fails to complete with: Important - python is not installed already. FYI: also note - build completes successfully with 2.7.14 (will download and check other python3 versions) if test "xupgrade" != "xno" ; then case upgrade in upgrade) ensurepip="--upgrade" ;; install|*) ensurepip="" ;; esac; ./python -E -m ensurepip $ensurepip --root=/ ; fi Traceback (most recent call last): File "/data/prj/python/git/src/python3-3.7.0.1/Lib/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/data/prj/python/git/src/python3-3.7.0.1/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__main__.py", line 5, in sys.exit(ensurepip._main()) File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", line 204, in _main default_pip=args.default_pip, File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", line 117, in _bootstrap return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ensurepip/__init__.py", line 27, in _run_pip import pip File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 28, in File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/vcs/mercurial.py", line 9, in File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 36, in File "/tmp/tmpg0jc_9p6/pip-9.0.1-py2.py3-none-any.whl/pip/utils/glibc.py", line 4, in File "/data/prj/python/git/src/python3-3.7.0.1/Lib/ctypes/__init__.py", line 7, in from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes' make: 1254-004 The error code from the last command is 1. ---------- components: Build messages: 306581 nosy: Michael.Felt priority: normal severity: normal status: open title: AIX: ModuleNotFoundError: No module named '_ctypes' - make install fails versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 16:28:36 2017 From: report at bugs.python.org (Eric Snow) Date: Mon, 20 Nov 2017 21:28:36 +0000 Subject: [New-bugs-announce] [issue32096] Py_DecodeLocale() fails if used before the runtime is initialized. Message-ID: <1511213316.33.0.213398074469.issue32096@psf.upfronthosting.co.za> New submission from Eric Snow : (see the python-dev thread [1]) (related: issue #32086) When I consolidated the global runtime state into a single global, _PyRuntime, calls Py_DecodeLocale() started to break if the runtime hadn't been intialized yet. This is because that function relies on PyMem_RawMalloc() and PyMem_RawFree(), which rely on the raw allocator having been initialized as part of the runtime (it used to be intialized statically). The documentation for various "Process-wide parameters" [2] explicitly directs users to call Py_DecodeLocale() where necessary. The docs for Py_DecodeLocale(), in turn, explicitly refer to calling PyMem_RawFree(). So changing the pre-runtime-init behavior of Py_DecodeLocale() and PyMem_RawFree() is a regression that should be fixed. [1] https://mail.python.org/pipermail/python-dev/2017-November/150605.html [2] https://docs.python.org/3/c-api/init.html#process-wide-parameters ---------- assignee: eric.snow messages: 306585 nosy: eric.snow, ncoghlan, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Py_DecodeLocale() fails if used before the runtime is initialized. type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 17:58:10 2017 From: report at bugs.python.org (Bert JW Regeer) Date: Mon, 20 Nov 2017 22:58:10 +0000 Subject: [New-bugs-announce] [issue32097] doctest does not consider \r\n a Message-ID: <1511218690.8.0.213398074469.issue32097@psf.upfronthosting.co.za> New submission from Bert JW Regeer : doctest fails to consider `\r\n` as a blank line. ---------- components: Library (Lib) files: test.py messages: 306595 nosy: X-Istence priority: normal severity: normal status: open title: doctest does not consider \r\n a versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47280/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 19:06:38 2017 From: report at bugs.python.org (hackan) Date: Tue, 21 Nov 2017 00:06:38 +0000 Subject: [New-bugs-announce] [issue32098] Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess() Message-ID: <1511222798.09.0.213398074469.issue32098@psf.upfronthosting.co.za> New submission from hackan : The value of `count` is hardcoded to 16 in https://github.com/python/cpython/blob/6a55d09573e5c35c9e4a24a6f811120b41a2a994/Lib/test/test_os.py#L1324 ---------- messages: 306602 nosy: hackan priority: normal severity: normal status: open title: Hardcoded value in Lib/test/test_os.py:L1324:URandomTests.get_urandom_subprocess() type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 19:54:27 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 21 Nov 2017 00:54:27 +0000 Subject: [New-bugs-announce] [issue32099] Use range in itertools roundrobin recipe Message-ID: <1511225667.31.0.213398074469.issue32099@psf.upfronthosting.co.za> New submission from Terry J. Reedy : The itertools roundrobin recipe has an outer loop executed a preset number of times. It is currently implemented with two assignments and a while loop. https://docs.python.org/3/library/itertools.html#itertools-recipes These can be replaced with a for loop using a reversed range. def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" nexts = cycle(iter(it).__next__ for it in iterables) for current_len in reversed(range(1, len(iterables)+1)): try: for next in nexts: yield next() except StopIteration: nexts = cycle(islice(nexts, current_len - 1)) I think this is easier to understand. So do some other participants in the current python-ideas thread 'Rewriting the "roundrobin" recipe in the itertools documentation'. I changed 'pending' to 'current_len' because, to me, 'pending' should be the set of iter_nexts and not their number. I originally avoided the '-1' in the islice call by decrementing both range arguments by 1 and calling the loop variable 'reduced_len'. But having the loop variable be the size of the nexts iterable in the next outer iteration seemed confusing and not worth the trivial efficiency gain. An independent change would be to replace 'next' with 'iter' on the basis that reusing the builtin name is not good and because 'nexts' is awkward to pronounce. I will produce a PR if any version is preferred to the current one. --- The OP proposed, and some participants like, an accept-reject algorithm based on zip_longest. def roundrobin(*iters): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" # Perhaps "flat_zip_nofill" is a better name, or something similar sentinel = object() for tup in it.zip_longest(*iters, fillvalue=sentinel): yield from (x for x in tup if x is not sentinel) I dislike creating tuples we don't want, with values we don't want, with an arbitrarily small acceptance ratio. I also note that zip_longest is properly used in grouper, whereas roundrobin is the only recipe using cycle. ---------- assignee: docs at python components: Documentation messages: 306605 nosy: docs at python, rhettinger, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Use range in itertools roundrobin recipe type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 20:14:15 2017 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 21 Nov 2017 01:14:15 +0000 Subject: [New-bugs-announce] [issue32100] IDLE: PathBrowser isn't working Message-ID: <1511226855.83.0.213398074469.issue32100@psf.upfronthosting.co.za> New submission from Cheryl Sabella : Clicking on Path Browser in the File menu gives an error instead of opening the Path Browser. ---------- assignee: terry.reedy components: IDLE messages: 306606 nosy: csabella, terry.reedy priority: normal severity: normal status: open title: IDLE: PathBrowser isn't working type: crash versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 20 21:58:57 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 21 Nov 2017 02:58:57 +0000 Subject: [New-bugs-announce] [issue32101] Add PYTHONDEVMODE=1 to enable the developer mode Message-ID: <1511233137.85.0.213398074469.issue32101@psf.upfronthosting.co.za> New submission from STINNER Victor : In the review of the PR 4478, Antoine Pitrou proposed to add an environment variable to enable the new Python "developer mode" to inherit the developer mode in child Python processes. I proposed to add PYTHONDEVMODE=1. Nick Coghlan proposed PYTHONXOPTIONS=dev. While -X is a new "catch all" for new CPython options, Python got new PYTHONxxx environment variables to enable new options: * -X faulthandler: PYTHONFAULTHANDLER=1 * -X tracemalloc=N: PYTHONTRACEMALLOC=n * -X importtime: PYTHONPROFILEIMPORTTIME=1 -- note that the names are different in this case, I don't know why I have a preference for PYTHONDEVMODE=1. If we start to use PYTHONXOPTIONS, users may want to use PYTHONXOPTIONS=tracemalloc, and then we have to decide which environment variable has the preference :-( Moreover, tracemalloc takes an argument, whereas environment variables with a value containing '=' are rare and so likely to cause issues in programs not carefully written to handle such variables. (Environment variables are inherited by all processes, not only Python processes.) ---------- messages: 306618 nosy: ncoghlan, pitrou, vstinner priority: normal severity: normal status: open title: Add PYTHONDEVMODE=1 to enable the developer mode type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 01:13:47 2017 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 21 Nov 2017 06:13:47 +0000 Subject: [New-bugs-announce] [issue32102] Add "capture_output=True" option to subprocess.run Message-ID: <1511244827.04.0.213398074469.issue32102@psf.upfronthosting.co.za> New submission from Nick Coghlan : I'm hesitant to suggest adding yet-another-option to any subprocess API, but I'm thinking it may be worth it in this case. The idea is to make it possible to replace: result = subprocess.run(cmd, stdout=PIPE, stderr=PIPE) with: result = subprocess.run(cmd, capture_output=True) That way, it would be possible for the raw stdin/stdout/stderr parameters to be treated as low level implementation details most of the time, since the most common configurations would be: # Use parent's stdin/stdout/stderr result = subprocess.run(cmd) # Use pipe for stdin, use parent's stdout/stderr result = subprocess.run(cmd, input=data) # Use parent's stdin, use pipe for stdout/stderr result = subprocess.run(cmd, capture_output=True) # Use pipe for stdin/stdout/stderr result = subprocess.run(cmd, input=data, capture_output=True) ---------- messages: 306627 nosy: gregory.p.smith, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Add "capture_output=True" option to subprocess.run type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 09:13:55 2017 From: report at bugs.python.org (Carl) Date: Tue, 21 Nov 2017 14:13:55 +0000 Subject: [New-bugs-announce] [issue32103] Inconsistent text at TypeError in concatenation Message-ID: <1511273635.4.0.213398074469.issue32103@psf.upfronthosting.co.za> New submission from Carl : >>> a = b"jan" >>> b = "jan" >>> a+b Traceback (most recent call last): File "", line 1, in TypeError: can't concat str to bytes >>> b+a Traceback (most recent call last): File "", line 1, in TypeError: must be str, not bytes >>> IMHO The latter TypeError text should be "TypeError: can't concat bytes to str" ---------- components: Interpreter Core messages: 306642 nosy: wolfc01 priority: normal severity: normal status: open title: Inconsistent text at TypeError in concatenation type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 09:44:12 2017 From: report at bugs.python.org (Oleg K) Date: Tue, 21 Nov 2017 14:44:12 +0000 Subject: [New-bugs-announce] [issue32104] add method throw() to asyncio.Task Message-ID: <1511275452.66.0.213398074469.issue32104@psf.upfronthosting.co.za> New submission from Oleg K : currently there is no other way to interrupt task but to call cancel() which will: "This arranges for a CancelledError to be thrown into the wrapped coroutine on the next cycle through the event loop." in order to write advanced Tasks there should be a way to throw custom exceptions into active Task. so it can react accordingly. i am looking for the same thing as "generator.throw()" is providing, allowing to interrupt generators different way. ---------- components: asyncio messages: 306644 nosy: Oleg K2, yselivanov priority: normal severity: normal status: open title: add method throw() to asyncio.Task type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 10:25:13 2017 From: report at bugs.python.org (Thomas Eldon Allred) Date: Tue, 21 Nov 2017 15:25:13 +0000 Subject: [New-bugs-announce] [issue32105] Please add asyncio.BaseEventLoop.connect_accepted_socket Version Added to documentation Message-ID: <1511277913.62.0.213398074469.issue32105@psf.upfronthosting.co.za> New submission from Thomas Eldon Allred : asyncio.BaseEventLoop.connect_accepted_socket was added in v3.5.3 Please add a note to the documentation. ---------- assignee: docs at python components: Documentation messages: 306650 nosy: Thomas Eldon Allred, docs at python priority: normal severity: normal status: open title: Please add asyncio.BaseEventLoop.connect_accepted_socket Version Added to documentation type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:04:45 2017 From: report at bugs.python.org (Decorater) Date: Tue, 21 Nov 2017 17:04:45 +0000 Subject: [New-bugs-announce] [issue32106] Move sysmodule.c to Modules? Message-ID: <1511283885.9.0.213398074469.issue32106@psf.upfronthosting.co.za> New submission from Decorater : After looking in the folder Python sysmodule.c is in there instead of in Modules. I am wondering if it has any reason to be in that folder instead of in Modules/* with the other builtin modules in python. If not I think it is best to move it so that way it is easier to find for those who think sysmodule is in the Modules folder because it is an builtin module. ---------- messages: 306671 nosy: Decorater priority: normal severity: normal status: open title: Move sysmodule.c to Modules? versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:10:23 2017 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 21 Nov 2017 17:10:23 +0000 Subject: [New-bugs-announce] [issue32107] test_uuid uses the incorrect bitmask Message-ID: <1511284223.14.0.213398074469.issue32107@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : The check_node() function in test_uuid.py uses the wrong bitmask, causing the tests to fail on valid MAC addresses. Also, the description in the comment is incorrect. From my reading of the wikipedia page, the test is trying to ensure that the MAC address is "universally administered", which is designated by a zero value in "the second least significant digit of the first octet". Thus the bitmask value *and* the comment are both wrong AFAICT, given that the original value is: % ./python.exe -c "from math import log2; print(log2(0x010000000000))" 40.0 I have a fix that passes on my machine, so I'll PR that and see if it passes on CI. ---------- assignee: barry components: Tests messages: 306672 nosy: barry priority: normal severity: normal status: open title: test_uuid uses the incorrect bitmask versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 21 12:46:10 2017 From: report at bugs.python.org (Simon Lambourn) Date: Tue, 21 Nov 2017 17:46:10 +0000 Subject: [New-bugs-announce] [issue32108] configparser bug: section is emptied if you assign a section to itself Message-ID: <1511286370.98.0.213398074469.issue32108@psf.upfronthosting.co.za> New submission from Simon Lambourn : If you assign a ConfigParser section back to the parent ConfigParser object (say after updating the section), the section is emptied. (I realise now that you don't need to assign the section back to the parent as it's a proxy for the section in the parent already - but still it does not behave as you would expect): code: from configparser import ConfigParser config = ConfigParser() config['test'] = {'key': 'value'} section = config['test'] section['key'] = 'different' print("before: config['test'] is %s" % dict(config['test'])) config['test'] = section print("after: config['test'] is %s" % dict(config['test'])) # the section is now printed as {} ---------- components: Library (Lib) messages: 306675 nosy: simonltwick priority: normal severity: normal status: open title: configparser bug: section is emptied if you assign a section to itself type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 01:46:32 2017 From: report at bugs.python.org (YCmove) Date: Wed, 22 Nov 2017 06:46:32 +0000 Subject: [New-bugs-announce] [issue32109] Separated square brackets will generate a tuple instead of a list. Message-ID: <1511333192.34.0.213398074469.issue32109@psf.upfronthosting.co.za> Change by YCmove : ---------- assignee: docs at python components: Documentation nosy: YCmove, docs at python priority: normal severity: normal status: open title: Separated square brackets will generate a tuple instead of a list. type: enhancement versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 02:40:16 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 22 Nov 2017 07:40:16 +0000 Subject: [New-bugs-announce] [issue32110] Make codecs.StreamReader.read() more compatible with read() of other files Message-ID: <1511336416.94.0.213398074469.issue32110@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Usually the read() method of a file-like object takes one optional argument which limits the amount of data (the number of bytes or characters) returned if specified. codecs.StreamReader.read() also has such parameter. But this is the second parameter. The first parameter limits the number of bytes read for decoding. read(1) can return 70 characters, that will confuse most callers which expect either a single character or an empty string (at the end of stream). Some times ago codecs.open() was recommended as a replacement for the builtin open() in programs that should work in 2.x and 3.x (this was before adding io.open()), and it is still used in many programs. But this peculiarity makes it bad replacement of builtin open(). I wanted to fix this issue long time ago, but forgot, and the question on Stack Overflow has reminded me about this. https://stackoverflow.com/questions/46437761/codecs-openutf-8-fails-to-read-plain-ascii-file ---------- assignee: serhiy.storchaka components: IO, Library (Lib) messages: 306701 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Make codecs.StreamReader.read() more compatible with read() of other files type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 04:46:06 2017 From: report at bugs.python.org (Balakrishnan Unnithan) Date: Wed, 22 Nov 2017 09:46:06 +0000 Subject: [New-bugs-announce] [issue32111] ObjectListView crashes on python3.5 Message-ID: <1511343966.35.0.213398074469.issue32111@psf.upfronthosting.co.za> Change by Balakrishnan Unnithan : ---------- components: Extension Modules nosy: Balakrishnan Unnithan priority: normal severity: normal status: open title: ObjectListView crashes on python3.5 type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 05:52:36 2017 From: report at bugs.python.org (Martijn Pieters) Date: Wed, 22 Nov 2017 10:52:36 +0000 Subject: [New-bugs-announce] [issue32112] Should uuid.UUID() accept another UUID() instance? Message-ID: <1511347956.68.0.213398074469.issue32112@psf.upfronthosting.co.za> New submission from Martijn Pieters : When someone accidentally passes in an existing uuid.UUID() instance into uuid.UUID(), an attribute error is thrown because it is not a hex string: >>> import uuid >>> value = uuid.uuid4() >>> uuid.UUID(value) Traceback (most recent call last): File "", line 1, in File "/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python2.7/uuid.py", line 133, in __init__ hex = hex.replace('urn:', '').replace('uuid:', '') AttributeError: 'UUID' object has no attribute 'replace' This happened in the Stack Overflow question at https://stackoverflow.com/q/47429929/100297, because the code there didn't take into account that some database drivers may already have mapped the PostgreSQL UUID column to a Python uuid.UUID() object. The fix could be as simple as: if hex is not None: if isinstance(hex, uuid.UUID): int = hex.int else: hex = hex.replace('urn:', '').replace('uuid:', '') hex = hex.strip('{}').replace('-', '') if len(hex) != 32: raise ValueError('badly formed hexadecimal UUID string') int = int_(hex, 16) Or we could add a uuid=None keyword argument, and use if hex is not None: if isinstance(hex, uuid.UUID): uuid = hex else: hex = hex.replace('urn:', '').replace('uuid:', '') hex = hex.strip('{}').replace('-', '') if len(hex) != 32: raise ValueError('badly formed hexadecimal UUID string') int = int_(hex, 16) if uuid is not None: int = uuid.int ---------- messages: 306719 nosy: mjpieters priority: normal severity: normal status: open title: Should uuid.UUID() accept another UUID() instance? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 09:42:41 2017 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 22 Nov 2017 14:42:41 +0000 Subject: [New-bugs-announce] [issue32113] Strange behavior with await in a generator expression Message-ID: <1511361761.52.0.213398074469.issue32113@psf.upfronthosting.co.za> New submission from Ivan Levkivskyi : PEP 530 is not very clear about `await` in generator expressions. But when I try it, the error is a bit confusing: >>> async def g(i): ... print(i) ... >>> async def f(): ... result = list(await g(i) for i in range(3)) ... print(result) ... >>> f().send(None) Traceback (most recent call last): File "", line 1, in File "", line 2, in f TypeError: 'async_generator' object is not iterable At the same time a (seemingly) equivalent list comprehension works fine: >>> async def f(): ... result = [await g(i) for i in range(3)] ... print(result) ... >>> f().send(None) 0 1 2 [None, None, None] Traceback (most recent call last): File "", line 1, in StopIteration I would say that the first case should either behave as a second one, or raise a syntax error. Or is it actually an intended behavior? ---------- components: Interpreter Core messages: 306732 nosy: levkivskyi, yselivanov priority: normal severity: normal status: open title: Strange behavior with await in a generator expression type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 13:28:35 2017 From: report at bugs.python.org (R. David Murray) Date: Wed, 22 Nov 2017 18:28:35 +0000 Subject: [New-bugs-announce] [issue32114] The get_event_loop change in bpo28613 did not update the documentation Message-ID: <1511375315.05.0.213398074469.issue32114@psf.upfronthosting.co.za> New submission from R. David Murray : No changes were made to the documentation of get_event_loop when its behavior was modified to return the loop running the future/coroutine when called from that context. The documentation still says it gets the loop associated with the thread unconditionally. ---------- components: Demos and Tools messages: 306744 nosy: r.david.murray, yselivanov priority: normal severity: normal stage: needs patch status: open title: The get_event_loop change in bpo28613 did not update the documentation type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 13:32:12 2017 From: report at bugs.python.org (rogpeppe) Date: Wed, 22 Nov 2017 18:32:12 +0000 Subject: [New-bugs-announce] [issue32115] Ignored SIGCHLD causes asyncio.Process.wait to hang forever Message-ID: <1511375532.97.0.213398074469.issue32115@psf.upfronthosting.co.za> New submission from rogpeppe : If some parent process has disabled SIGCHLD, that signal is inherited and stops that signal being delivered, which means that asyncio.Process.wait will never complete. As an example, the plan9port terminal window, 9term, (https://9fans.github.io/plan9port/man/man1/9term.html) does this, and hence causes async Python processes to hang forever. Python should probably code defensively against this and ensure that SIGCHLD is enabled regardless. Attached is some C code that demonstrates the issue when the following python code is saved to "tst.py". #!/usr/bin/env python3 import asyncio async def do_exec(): cmd = ['echo', 'hello, world'] process = await asyncio.create_subprocess_exec(*cmd, env={}) await process.wait() loop=asyncio.get_event_loop() try: loop.run_until_complete(do_exec()) finally: loop.close() demonstration of the issue. ---------- components: asyncio files: tst.c messages: 306745 nosy: rogpeppe, yselivanov priority: normal severity: normal status: open title: Ignored SIGCHLD causes asyncio.Process.wait to hang forever type: behavior versions: Python 3.5 Added file: https://bugs.python.org/file47283/tst.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 13:36:31 2017 From: report at bugs.python.org (Paul Long) Date: Wed, 22 Nov 2017 18:36:31 +0000 Subject: [New-bugs-announce] [issue32116] CSV import and export simplified Message-ID: <1511375791.45.0.213398074469.issue32116@psf.upfronthosting.co.za> New submission from Paul Long : It would be helpful if the CSV module included standard functions that simplify the import of CSV files to a list and the export of CSV files to a list. Here's an example of what they could be: def csv2list(file_name): list_name=[] with open(file_name) as csvfile: readerfile = reader(csvfile) for row in readerfile: list_name.append(row) return list_name def list2csv(list_name,file_name): with open(file_name, 'w', newline='') as csvfile: writerfile = csv.writer(csvfile) writerfile.writerows(list_name) ---------- components: Library (Lib) messages: 306746 nosy: paullongnet priority: normal severity: normal status: open title: CSV import and export simplified type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 18:31:49 2017 From: report at bugs.python.org (David Cuthbert) Date: Wed, 22 Nov 2017 23:31:49 +0000 Subject: [New-bugs-announce] [issue32117] Tuple unpacking in return and yield statements Message-ID: <1511393509.38.0.213398074469.issue32117@psf.upfronthosting.co.za> New submission from David Cuthbert : This stems from a query on StackOverflow: https://stackoverflow.com/questions/47272460/python-tuple-unpacking-in-return-statement/ Specifically, the following syntax is allowed: def f(): rest = (4, 5, 6) t = 1, 2, 3, *rest While the following result in SyntaxError: def g(): rest = (4, 5, 6) return 1, 2, 3, *rest def h(): rest = (4, 5, 6) yield 1, 2, 3, *rest Looking at the original commit that enabled tuple unpacking in assignment statements: https://github.com/python/cpython/commit/4905e80c3d2f6abb613d212f0313d1dfe09475dc I don't believe this difference is intentional. My GitHub repo incorporates a fix for this; I'll file a pull request momentarily. ---------- components: Interpreter Core messages: 306761 nosy: dacut priority: normal severity: normal status: open title: Tuple unpacking in return and yield statements type: behavior versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 22 23:27:01 2017 From: report at bugs.python.org (Dubslow) Date: Thu, 23 Nov 2017 04:27:01 +0000 Subject: [New-bugs-announce] [issue32118] Docs: add note about sequence comparisons containing non-orderable elements Message-ID: <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za> New submission from Dubslow : In sequence comparisons, the enforcement of reflexivity of elements means that only non-identical elements are actually compared. The docs then note, with example, that non-reflexive elements thus always "compare" equal inside the sequence. This patch adds a second corollary, that non-orderable singletons (e.g. None) will also not break sequence comparison. Yes, the consequence is logically derivable from the statement "element identity is compared first, and element comparison is performed only for distinct elements", but the first example is given because "For non-reflexive elements, the result is different than for strict element comparison, and may be surprising", which also holds for the example I add here: different from strict element comparison, which may lead to otherwise surprising results (it sure was surprising to me when I expected a list with Nones to fail to compare, hence why I went trawling through the docs). In the manner of the first example, explicit is better than implicit, and (I believe) it will be helpful for readers to have this second consequence demonstrated. ---------- assignee: docs at python components: Documentation messages: 306780 nosy: Dubslow, docs at python priority: normal severity: normal status: open title: Docs: add note about sequence comparisons containing non-orderable elements versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 03:32:46 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 23 Nov 2017 08:32:46 +0000 Subject: [New-bugs-announce] [issue32119] test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" Message-ID: <1511425966.52.0.213398074469.issue32119@psf.upfronthosting.co.za> New submission from STINNER Victor : test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer": http://buildbot.python.org/all/#/builders/46/builds/60 0:52:21 load avg: 1.46 [378/406/1] test_multiprocessing_forkserver crashed (Exit code 1) Traceback (most recent call last): File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/forkserver.py", line 196, in main _serve_one(s, listener, alive_r, old_handlers) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/forkserver.py", line 231, in _serve_one code = spawn._main(child_r) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/spawn.py", line 114, in _main prepare(preparation_data) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/spawn.py", line 223, in prepare _fixup_main_from_name(data['init_main_from_name']) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/spawn.py", line 249, in _fixup_main_from_name alter_sys=True) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/runpy.py", line 201, in run_module mod_name, mod_spec, code = _get_module_details(mod_name) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/runpy.py", line 153, in _get_module_details code = loader.get_code(mod_name) File "", line 762, in get_code ValueError: cannot convert float NaN to integer Timeout (0:25:00)! Thread 0xa000d000 (most recent call first): File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/connection.py", line 379 in _recv File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/connection.py", line 407 in _recv_bytes File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/connection.py", line 250 in recv File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/managers.py", line 757 in _callmethod File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/managers.py", line 987 in acquire File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 1044 in test_notify_all File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/case.py", line 605 in run File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/case.py", line 653 in __call__ File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 122 in run File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 122 in run File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 122 in run File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/suite.py", line 84 in __call__ File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/unittest/runner.py", line 176 in run File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/support/__init__.py", line 1888 in _run_suite File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/support/__init__.py", line 1932 in run_unittest File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/runtest.py", line 172 in test_runner File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/runtest.py", line 173 in runtest_inner File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/runtest.py", line 127 in runtest File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/runtest_mp.py", line 71 in run_tests_slave File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/main.py", line 516 in _main File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/main.py", line 509 in main File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/libregrtest/main.py", line 584 in main File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/regrtest.py", line 46 in _main File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/regrtest.py", line 50 in File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/runpy.py", line 85 in _run_code File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/runpy.py", line 193 in _run_module_as_main Moreover, when test_multiprocessing_forkserver was run a second time, a different test failed, test_forkserver_sigkill(): Re-running test 'test_multiprocessing_forkserver' in verbose mode (...) test_forkserver_sigint (test.test_multiprocessing_forkserver.WithProcessesTestProcess) ... ok test_forkserver_sigkill (test.test_multiprocessing_forkserver.WithProcessesTestProcess) ... FAIL test_lose_target_ref (test.test_multiprocessing_forkserver.WithProcessesTestProcess) ... ok (...) ====================================================================== FAIL: test_forkserver_sigkill (test.test_multiprocessing_forkserver.WithProcessesTestProcess) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 496, in test_forkserver_sigkill self.check_forkserver_death(signal.SIGKILL) File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 486, in check_forkserver_death self.assertTrue(evt.is_set()) AssertionError: False is not true ---------- components: Tests messages: 306787 nosy: vstinner priority: normal severity: normal status: open title: test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 06:14:19 2017 From: report at bugs.python.org (Abinaya) Date: Thu, 23 Nov 2017 11:14:19 +0000 Subject: [New-bugs-announce] [issue32120] python 3.6.0 is not importing sqlite3 Message-ID: <1511435659.03.0.213398074469.issue32120@psf.upfronthosting.co.za> New submission from Abinaya : Hi, We have installed python-3.6.0 on our RedHat 6 machine. when we are trying to import sqlite module in python_v36 we could see below issue, [root at euca-10-254-72-197 rpmbuild]$ python Python 3.6.0 (default, Nov 23 2017, 12:46:54) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux Type "help", "copyright", "credits" or "license" for more information. import sqlite3 Traceback (most recent call last): File "", line 1, in File "/opt/python/x86_64/3.6.0-1/lib/python3.6/sqlite3/init.py", line 23, in from sqlite3.dbapi2 import * File "/opt/python/x86_64/3.6.0-1/lib/python3.6/sqlite3/dbapi2.py", line 27, in from _sqlite3 import * ModuleNotFoundError: No module named '_sqlite3' While installing the python manually we could see below line on installation log **************************************** Failed to build these modules: _hashlib _ssl Following modules built successfully but were removed because they could not be imported: _sqlite3 **************************************** It seems to be sqlite is getting broken. Below sqlite versions are already installed on my machine: ******************************************** [root at euca-10-254-72-197 rpmbuild]$ rpm -qa | grep sqlite qt-sqlite-4.6.2-28.el6_5.x86_64 sqlite-devel-3.6.20-1.el6_7.2.x86_64 sqlite-3.6.20-1.el6_7.2.x86_64 libdbi-dbd-sqlite-0.8.3-5.1.el6.x86_64 ********************************************** Also sqlite3 seems to be working fine without any issue on python2. Can anyone please help me on this. Regards, Abinaya ---------- components: Build messages: 306803 nosy: abinaya priority: normal severity: normal status: open title: python 3.6.0 is not importing sqlite3 type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 23 15:10:20 2017 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 23 Nov 2017 20:10:20 +0000 Subject: [New-bugs-announce] [issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback Message-ID: <1511467820.73.0.213398074469.issue32121@psf.upfronthosting.co.za> New submission from Antoine Pitrou : Right now tracemalloc.Traceback.format() returns the frames in "most recent call first" order. This is not intuitive since ordinary Python tracebacks are displayed in "most recent call last" order. It would be nice to add a `reverse` argument to change that. ---------- components: Library (Lib) messages: 306856 nosy: pitrou, vstinner priority: normal severity: normal stage: needs patch status: open title: tracemalloc.Traceback.format() should have an option to reverse the traceback type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 01:26:48 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 24 Nov 2017 06:26:48 +0000 Subject: [New-bugs-announce] [issue32122] Improve -x option documentation Message-ID: <1511504808.14.0.213398074469.issue32122@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The documentation of the -x option is virtually not existing. The current short line of the description was enough to me for understanding what is the purpose of this option and how it can be used (I didn't use Windows for more than 10 years). But I was surprised not founding more detailed information about this feature in the documentation. Definitely it should be better documented. Most of users will have no ideas about this feature. The purpose of this option is turning Python scripts into Windows batch files which can be ran as other executables. Similarly as adding she-bang and setting the executable bit allows to run them on Unix. The extension of the Python script should be changed to ".bat", and the following line should be added at the start of the script: @path\to\python -x %0 %* & exit /b Or @py -3 -x %0 %* & exit /b Unlike a she-bang line which is a Python comment, this line is not valid Python syntax, and the -x option is used for skipping it. ---------- assignee: docs at python components: Documentation, Windows messages: 306878 nosy: docs at python, paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Improve -x option documentation type: enhancement versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 04:53:23 2017 From: report at bugs.python.org (Bernhard10) Date: Fri, 24 Nov 2017 09:53:23 +0000 Subject: [New-bugs-announce] [issue32123] Make the API of argparse.HelpFormatter public Message-ID: <1511517203.18.0.213398074469.issue32123@psf.upfronthosting.co.za> New submission from Bernhard10 : Since there have not been any significant change to the code of argparse.HelpFormatter in the last few years but there are still some open issues where people want to customize formatting, I would like to ask: What is required before parts of the API of argparse.HelpFormatter can be made public? Related issues: https://bugs.python.org/issue17113 RawDescriptionHelpFormatter removes blank lines https://bugs.python.org/issue12806 and https://bugs.python.org/issue22029 request a formatter that (partly) wraps lines but keeps newlines. https://bugs.python.org/issue11695 costumize usage https://bugs.python.org/issue28742 Improve ArgumentDefaultsHelpFormatter All this issues could be fixed outside the standard library by sub-classing HelpFormatter, which would require a public and documented API for it. So my question: What is missing before HelpFormatter can get a public API and how can I help? ---------- components: Library (Lib) messages: 306879 nosy: Bernhard10 priority: normal severity: normal status: open title: Make the API of argparse.HelpFormatter public type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 08:19:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 13:19:16 +0000 Subject: [New-bugs-announce] [issue32124] Document functions safe to be called before Py_Initialize() Message-ID: <1511529556.02.0.213398074469.issue32124@psf.upfronthosting.co.za> New submission from STINNER Victor : Follow-up of bpo-32086, bpo-32096 and "[Python-Dev] Python initialization and embedded Python" thread: https://mail.python.org/pipermail/python-dev/2017-November/150605.html I propose to explicitly list functions that can be safetely called before Py_Initialize(). This safety warranty must be part of the C API. Maybe we should even test all tests function in test_capi using Programs/_testembed, as we did for Py_DecodeLocale() and Py_SetProgramName() in commit 9e87e7776f7ace66baaf7247233afdabd00c2b44 ("pre_initialization_api" test). Attached PR adds proposed documentation. It also documents "global configuration variables" like Py_DebugFlag. ---------- assignee: docs at python components: Documentation messages: 306894 nosy: docs at python, eric.snow, ncoghlan, vstinner priority: normal severity: normal status: open title: Document functions safe to be called before Py_Initialize() versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 10:20:05 2017 From: report at bugs.python.org (STINNER Victor) Date: Fri, 24 Nov 2017 15:20:05 +0000 Subject: [New-bugs-announce] [issue32125] Remove global configuration variable Py_UseClassExceptionsFlag Message-ID: <1511536805.74.0.213398074469.issue32125@psf.upfronthosting.co.za> New submission from STINNER Victor : The Py_UseClassExceptionsFlag flag was added by the commit 035574d755bfc306704e9975dc10e4e05a47b3bb. The commit 757af0e7bb7c7d56670fbc84f1f5b0182a54e3d5 started to use this flag: + /* if Python was started with -X, initialize the class exceptions */ + if (Py_UseClassExceptionsFlag) + init_class_exc(dict); Later followed by commit 98b6246c0c60f2831b0c7a66d8c0659ebac1ec32. The flag was finally deprecated in the commit 3ce096459e348c95c2c3348f8d84720f25c1a4c9 in 2000. All these changes are older than Python 2.0. In Python 2.7 and 3.6, the flag is not used at all. I think that it's time to remove it :-) ---------- components: Interpreter Core messages: 306900 nosy: vstinner priority: normal severity: normal status: open title: Remove global configuration variable Py_UseClassExceptionsFlag versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 12:02:05 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 24 Nov 2017 17:02:05 +0000 Subject: [New-bugs-announce] [issue32126] [asyncio] test failure when the platform lacks a functional sem_open() Message-ID: <1511542925.3.0.213398074469.issue32126@psf.upfronthosting.co.za> New submission from Xavier de Gaye : test_get_event_loop_new_process fails on Android API 24 with the error: ====================================================================== ERROR: test_get_event_loop_new_process (test.test_asyncio.test_events.EPollEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/multiprocessing/synchronize.py", line 29, in from _multiprocessing import SemLock, sem_unlink ImportError: cannot import name 'sem_unlink' from '_multiprocessing' (/data/local/tmp/python/lib/pyt hon3.7/lib-dynload/_multiprocessing.cpython-37dm.so) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/test/test_asyncio/test_events.py", line 2239, in test_get_e vent_loop_new_process self.loop.run_until_complete(main()), File "/sdcard/org.python/lib/python3.7/asyncio/base_events.py", line 466, in run_until_complete return future.result() File "/sdcard/org.python/lib/python3.7/test/test_asyncio/test_events.py", line 2230, in main pool = concurrent.futures.ProcessPoolExecutor() File "/sdcard/org.python/lib/python3.7/concurrent/futures/process.py", line 410, in __init__ self._call_queue = mp_context.Queue(queue_size) File "/sdcard/org.python/lib/python3.7/multiprocessing/context.py", line 102, in Queue return Queue(maxsize, ctx=self.get_context()) File "/sdcard/org.python/lib/python3.7/multiprocessing/queues.py", line 42, in __init__ self._rlock = ctx.Lock() File "/sdcard/org.python/lib/python3.7/multiprocessing/context.py", line 66, in Lock from .synchronize import Lock File "/sdcard/org.python/lib/python3.7/multiprocessing/synchronize.py", line 34, in " function, see issue 3770.") ImportError: This platform lacks a functioning sem_open implementation, therefore, the required sync hronization primitives needed will not function, see issue 3770. ---------- components: Tests, asyncio messages: 306906 nosy: xdegaye, yselivanov priority: normal severity: normal stage: needs patch status: open title: [asyncio] test failure when the platform lacks a functional sem_open() type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 14:14:29 2017 From: report at bugs.python.org (Toby Berla) Date: Fri, 24 Nov 2017 19:14:29 +0000 Subject: [New-bugs-announce] [issue32127] tutorial on dictionaries has error in example Message-ID: <1511550869.58.0.213398074469.issue32127@psf.upfronthosting.co.za> New submission from Toby Berla : in https://docs.python.org/3/tutorial/datastructures.html: ----- 5.5. Dictionaries ... Here is a small example using a dictionary: >>> >>> tel = {'jack': 4098, 'sape': 4139} >>> tel['guido'] = 4127 >>> tel {'sape': 4139, 'guido': 4127, 'jack': 4098} ----- I think the order of dictionary elements shown after 'guido' is inserted is wrong. The correct order is: {'jack': 4098, 'sape': 4139, 'guido': 4127} ---------- assignee: docs at python components: Documentation messages: 306913 nosy: docs at python, tberla priority: normal severity: normal status: open title: tutorial on dictionaries has error in example versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 20:23:42 2017 From: report at bugs.python.org (STINNER Victor) Date: Sat, 25 Nov 2017 01:23:42 +0000 Subject: [New-bugs-announce] [issue32128] test_nntplib: test_article_head_body() fails in SSL mode Message-ID: <1511573022.36.0.213398074469.issue32128@psf.upfronthosting.co.za> New submission from STINNER Victor : The news.trigofacile.com NNTP server used by test_nntplib currently has troubles on SSL: $ ./python -m test -u all -v test_nntplib -m test_article_head_body ====================================================================== FAIL: test_article_head_body (test.test_nntplib.NetworkedNNTP_SSLTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/haypo/prog/python/3.6/Lib/test/test_nntplib.py", line 242, in wrapped meth(self) File "/home/haypo/prog/python/3.6/Lib/test/test_nntplib.py", line 187, in test_article_head_body self.check_article_resp(resp, body, art_num) File "/home/haypo/prog/python/3.6/Lib/test/test_nntplib.py", line 167, in check_article_resp self.assertNotIn(article.lines[-1], (b".", b".\n", b".\r\n")) AssertionError: b'.' unexpectedly found in (b'.', b'.\n', b'.\r\n') See also bpo-19613. ---------- components: Tests messages: 306930 nosy: vstinner priority: normal severity: normal status: open title: test_nntplib: test_article_head_body() fails in SSL mode versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Nov 24 23:49:36 2017 From: report at bugs.python.org (Kevin Walzer) Date: Sat, 25 Nov 2017 04:49:36 +0000 Subject: [New-bugs-announce] [issue32129] Icon on macOS Message-ID: <1511585376.3.0.213398074469.issue32129@psf.upfronthosting.co.za> New submission from Kevin Walzer : The trunk and 8.6.7 branch of Tk on macOS have recently implemented the wm_iconphoto command, which had not previously been supported on macOS. This means that versions of IDLE that link to this version of Tk will inherit the iconphoto behavior on Windows and X11, which results in a extremely blurry icon image in the Dock. It would probably be best to make this command conditional on macOS to just retain the standard app icon, or else add a sharper image. ---------- assignee: terry.reedy components: IDLE files: Screen Shot 2017-11-24 at 11.44.31 PM.png messages: 306941 nosy: terry.reedy, wordtech priority: normal severity: normal status: open title: Icon on macOS type: behavior Added file: https://bugs.python.org/file47288/Screen Shot 2017-11-24 at 11.44.31 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 06:05:53 2017 From: report at bugs.python.org (Shamal Faily) Date: Sat, 25 Nov 2017 11:05:53 +0000 Subject: [New-bugs-announce] [issue32130] xml.sax parser validation sometimes fails when obtaining DTDs from https sites Message-ID: <1511607953.88.0.213398074469.issue32130@psf.upfronthosting.co.za> New submission from Shamal Faily : If an XML document is externally validated against a DTD from a https site then, depending on the security posture of the hosting site, validation might fail. This seems to be due to the lack of user agent information received by the host when the request for the DTD is sent. Relaxing the security rules on the host does get around this problem, but this might not always be a solution for some. I've observed with this issue with xml.sax. I don't know how general this problem is in other XML handling components of Python2 or Python 3. ---------- components: XML messages: 306952 nosy: failys priority: normal severity: normal status: open title: xml.sax parser validation sometimes fails when obtaining DTDs from https sites versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 06:48:22 2017 From: report at bugs.python.org (Jean-Michel) Date: Sat, 25 Nov 2017 11:48:22 +0000 Subject: [New-bugs-announce] [issue32131] Missing encoding parameter in urllib/parse.py Message-ID: <1511610502.45.0.213398074469.issue32131@psf.upfronthosting.co.za> New submission from Jean-Michel : Here is the patch, working for me in Python 3.4.2 610,611c703 < #~ value = _coerce_result(value) < value = _coerce_result(value,encoding=encoding) --- > value = _coerce_result(value) ---------- messages: 306953 nosy: jmbc priority: normal severity: normal status: open title: Missing encoding parameter in urllib/parse.py type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 08:31:46 2017 From: report at bugs.python.org (Klon666) Date: Sat, 25 Nov 2017 13:31:46 +0000 Subject: [New-bugs-announce] [issue32132] Android5 Message-ID: <1511616706.91.0.213398074469.issue32132@psf.upfronthosting.co.za> Change by Klon666 : ---------- components: Demos and Tools, Extension Modules, IO, Installation files: 18.7z nosy: Tu madre priority: normal severity: normal status: open title: Android5 type: resource usage versions: Python 3.5 Added file: https://bugs.python.org/file47289/18.7z _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 13:31:43 2017 From: report at bugs.python.org (abcdef) Date: Sat, 25 Nov 2017 18:31:43 +0000 Subject: [New-bugs-announce] [issue32133] documentation: numbers module nitpick Message-ID: <1511634703.59.0.213398074469.issue32133@psf.upfronthosting.co.za> New submission from abcdef : Documentation of the numbers module: https://docs.python.org/3/library/numbers.html states "None of the types defined in this module can be instantiated." This is true for Complex, Real, Rational, Integral but not for Number: >>> numbers.Number() >>> numbers.Real() Traceback (most recent call last): File "", line 1, in TypeError: Can't instantiate abstract class Real... Since Number doesn't have any abstract methods, the correct fix seems to be changing the documentation. I would try to convey something like this: "The types defined in this module can be used for subclassing and checking whether a specific class is in the numeric hierarchy; they are not used directly for instantiation. For this, you can use types such as `complex` or `fractions.Fraction`". ---------- assignee: docs at python components: Documentation messages: 306970 nosy: abcdef, docs at python priority: normal severity: normal status: open title: documentation: numbers module nitpick type: enhancement versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 13:39:44 2017 From: report at bugs.python.org (Jonas) Date: Sat, 25 Nov 2017 18:39:44 +0000 Subject: [New-bugs-announce] [issue32134] Crash on OSX Message-ID: <1511635184.55.0.213398074469.issue32134@psf.upfronthosting.co.za> New submission from Jonas : The Idle Editor or Idle Python Shell crashes if ` character is typed in. Character looks like an ` with underscore. How to repeat this problem: 1. In OSX open any .py file or the Idle Shell with Idle. 2. Switch to german keyboard layout 3. Type the letter by pressing shift and the += button, left of the delete button. (Keyboard hardware layout is US) I attached only the crash report of version 3.6.3. This issue happens also to all previous versions. I didn't checked with versions higher than 3.6.3. Info from shell (not crashed yet): Python 3.6.3 (v3.6.3:2c5fed86e0, Oct 3 2017, 00:32:08) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or "license()" for more information. >>> ---------- assignee: terry.reedy components: IDLE files: Idle363_crash_report.txt messages: 306971 nosy: jonasfinke at aol.com, terry.reedy priority: normal severity: normal status: open title: Crash on OSX type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47297/Idle363_crash_report.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 17:56:23 2017 From: report at bugs.python.org (Martin) Date: Sat, 25 Nov 2017 22:56:23 +0000 Subject: [New-bugs-announce] [issue32135] Dict creation with update will result to NoneType Message-ID: <1511650583.53.0.213398074469.issue32135@psf.upfronthosting.co.za> New submission from Martin : >>> x = {"x":123}.update({"abc":123}) >>> type(x) ---------- messages: 306977 nosy: thedemz priority: normal severity: normal status: open title: Dict creation with update will result to NoneType type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Nov 25 23:37:15 2017 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 26 Nov 2017 04:37:15 +0000 Subject: [New-bugs-announce] [issue32136] Move embedding tests to their own test module Message-ID: <1511671035.85.0.213398074469.issue32136@psf.upfronthosting.co.za> New submission from Nick Coghlan : We currently run the runtime embedding tests as a subsection of "test_capi". I'm thinking it may make more sense to clearly separate them out as their own CPython-only test file, "test_runtime_embedding". I'm also thinking we should add a new "Runtime embedding" entry to the experts index, with myself, Victor Stinner, Eric Snow, and Steve Dower as the initial members. ---------- components: Tests messages: 306988 nosy: eric.snow, ncoghlan, steve.dower, vstinner priority: normal severity: normal stage: needs patch status: open title: Move embedding tests to their own test module type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 03:53:30 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 26 Nov 2017 08:53:30 +0000 Subject: [New-bugs-announce] [issue32137] Stack overflow in repr of deeply nested dicts Message-ID: <1511686410.56.0.213398074469.issue32137@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : repr() of deeply nested dicts and dictviews can cause a stack overflow. >>> x = {} >>> for i in range(100000): ... x = {1: x} ... >>> repr(x) Segmentation fault >>> x = {} >>> for i in range(100000): ... x = {1: x} ... >>> repr(x.values()) Segmentation fault repr() of virtually all other deeply nested collections are guarded by using Py_EnterRecursiveCall(). >>> x = () >>> for i in range(100000): ... x = (x,) ... >>> repr(x) Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded while getting the repr of a tuple >>> x = [] >>> for i in range(100000): ... x = [x] ... >>> repr(x) Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded while getting the repr of a list >>> x = frozenset() >>> for i in range(100000): ... x = frozenset({x}) ... >>> repr(x) Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded while getting the repr of a list >>> from collections import OrderedDict >>> x = {} >>> for i in range(100000): ... x = OrderedDict({1: x}) ... >>> repr(x) Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded while getting the repr of a list >>> from collections import deque >>> x = deque() >>> for i in range(100000): ... x = deque([x]) ... >>> repr(x) Traceback (most recent call last): File "", line 1, in RecursionError: maximum recursion depth exceeded while getting the repr of a list But the case of infinite recursion already is handled: >>> x = {} >>> x[1] = x >>> repr(x) '{1: {...}}' Only finite but very deep recursion causes a crash. The one possible solution -- add Py_EnterRecursiveCall() in the implementation of dict.__repr__(), like it already is added in list.__repr__() and tuple.__repr__(). The more general solution -- add Py_EnterRecursiveCall() in PyObject_Repr(). In any case it is called before calling PyObject_Repr() for every item in the repr of most collections except dict. And it is already added in PyObject_Str(). Therefore adding it will not add much overhead, but can handle more corner cases. See also issue18533 and issue25240. ---------- components: Interpreter Core messages: 306997 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Stack overflow in repr of deeply nested dicts type: crash versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 04:58:59 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 26 Nov 2017 09:58:59 +0000 Subject: [New-bugs-announce] [issue32138] android: test_faulthandler fails also on API 24 Message-ID: <1511690339.03.0.213398074469.issue32138@psf.upfronthosting.co.za> New submission from Xavier de Gaye : Issue 26934 skipped some tests of test_faulthandler on Android API < 24 to fix the problem that python does not crash upon _sigsegv(). But the same problem occurs on API 24 except randomly, you need to run test_faulthandler many times before reproducing it, see below few results in that case. I propose to skip those tests whatever the value of the Android API level. In that case the test.support.requires_android_level decorator is not used anymore and should be removed. 1 test failed: test_faulthandler generic_x86_64:/data/local/tmp/python $ python -m test test_faulthandler Run tests sequentially 0:00:00 [1/1] test_faulthandler test test_faulthandler failed -- Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 265, in test_enable_file filename=filename) File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 114, in check_fatal_error self.check_error(code, line_number, fatal_error, **kw) File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 107, in check_error output, exitcode = self.get_output(code, filename=filename, fd=fd) File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 67, in get_output self.assertEqual(output, '') AssertionError: "sys:1: ResourceWarning: unclosed file <_[49 chars]c3'>" != '' - sys:1: ResourceWarning: unclosed file <_io.BufferedWriter name='/data/local/tmp/tmp17fv9xc3'> + ====================================================================== FAIL: test_disable (test.test_faulthandler.FaultHandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 307, in test_disable self.assertNotEqual(exitcode, 0) AssertionError: 0 == 0 ====================================================================== FAIL: test_gil_released (test.test_faulthandler.FaultHandlerTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 252, in test_gil_released 'Segmentation fault') File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 114, in check_fatal_error self.check_error(code, line_number, fatal_error, **kw) File "/sdcard/org.python/lib/python3.7/test/test_faulthandler.py", line 110, in check_error self.assertNotEqual(exitcode, 0) AssertionError: 0 == 0 ---------- components: Tests messages: 306999 nosy: vstinner, xdegaye priority: normal severity: normal stage: needs patch status: open title: android: test_faulthandler fails also on API 24 type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 05:44:43 2017 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 26 Nov 2017 10:44:43 +0000 Subject: [New-bugs-announce] [issue32139] android: locale is modified by test_strftime Message-ID: <1511693083.37.0.213398074469.issue32139@psf.upfronthosting.co.za> New submission from Xavier de Gaye : Test results: ------------ 1 test altered the execution environment: test_strftime Warning -- locale was modified by test_strftime Before: [(6, 'C.UTF-8'), (3, 'C.UTF-8'), (0, 'C.UTF-8'), (5, 'C.UTF-8'), (4, 'C.UTF-8'), (1, 'C.UTF-8'), (2, 'C.UTF-8')] After: [(6, 'C'), (3, 'C'), (0, 'C'), (5, 'C'), (4, 'C'), (1, 'C'), (2, 'C')] test_strftime failed (env changed) It seems that the tests indeed modify the environment. To understand the above results one must be aware that the implementation of setlocale() is broken on Android: generic_x86_64:/data/local/tmp/python $ python Python 3.7.0a2+ (heads/bpo-30386:ebb493ac4e, Nov 25 2017, 18:58:20) [Clang 3.8.275480 ] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from locale import setlocale, LC_TIME, LC_ALL >>> setlocale(LC_TIME) 'C.UTF-8' >>> setlocale(LC_ALL) 'C.UTF-8' >>> setlocale(LC_TIME, 'C') 'C' >>> setlocale(LC_TIME) 'C' >>> setlocale(LC_ALL) 'C' >>> setlocale(LC_TIME, 'C.UTF-8') 'C.UTF-8' >>> setlocale(LC_ALL) 'C.UTF-8' ---------- components: Tests messages: 307000 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: android: locale is modified by test_strftime type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 06:46:13 2017 From: report at bugs.python.org (Camion) Date: Sun, 26 Nov 2017 11:46:13 +0000 Subject: [New-bugs-announce] [issue32140] Probable bug in all python3 / idle3 debugger Message-ID: <1511696773.06.0.213398074469.issue32140@psf.upfronthosting.co.za> New submission from Camion : Hello all, I have been investigating a bug with a generator, which crashed, reporting that "TypeError: 'Fraction' object is not iterable". Then I have tried to find it with the debugger and/or to reproduce it with a simpler program, but, I have not managed to reproduce the bug in my test program and I have been stopped by the fact that the debugger crashes with another error: I have reproduced it on version 3.4.2 ans 3.6.3, BUT NOT on version 2.7.9. So I suspect it has been introduced with version 3. Here is how to reproduce it : 1/ Open Idle 2/ create and save this text program (or open if you already did - or don't do anything if it's already opened X-D) from fractions import Fraction U=Fraction(1) def test(x): for i in range(1, x.denominator): x*=x yield i, i*x for m, n in test(U*3/5): print (m, n) 3/ Run/check module (F5) in Idle editors window : it works perfectly 4/ start the debugger from Idle menus 5/ activate the "source" checkbox 6/ Run/check module (F5) in Idle editors window 7/ Click 3 times on [over] to get to the "for m, n in test(U*3/5):" line 8/ Click 6 times on [step], to get to the line 116 ("for m, n in test(U*3/5):") in the fractions.py files 9/ Click a seventh time on [step] and your program will crash with the folowing error (here with 3.6.3) Traceback (most recent call last): File "/raid/ArcFolder/Mes documents/Mes Textes/Mes programmes/Machin/Test_it?rateur_et_fractions.py", line 12, in for m, n in test(U*3/5): File "/usr/local/lib/python3.6/fractions.py", line 376, in forward return monomorphic_operator(a, b) File "/usr/local/lib/python3.6/fractions.py", line 419, in _mul return Fraction(a.numerator * b.numerator, a.denominator * b.denominator) File "/usr/local/lib/python3.6/fractions.py", line 117, in __new__ if denominator is None: File "/usr/local/lib/python3.6/fractions.py", line 117, in __new__ if denominator is None: File "/usr/local/lib/python3.6/bdb.py", line 48, in trace_dispatch return self.dispatch_line(frame) File "/usr/local/lib/python3.6/bdb.py", line 66, in dispatch_line self.user_line(frame) File "/usr/local/lib/python3.6/idlelib/debugger.py", line 24, in user_line self.gui.interaction(message, frame) AttributeError: _numerator5/ Run/check module (F5) in Idle editors window I have observed once 3.4.2 that the same operation without activating the source checkbox, lead to a full idle freeze, but I have not been able to reproduce it. ---------- assignee: terry.reedy components: IDLE messages: 307001 nosy: Camion, terry.reedy priority: normal severity: normal status: open title: Probable bug in all python3 / idle3 debugger type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 07:37:52 2017 From: report at bugs.python.org (Phil Thompson) Date: Sun, 26 Nov 2017 12:37:52 +0000 Subject: [New-bugs-announce] [issue32141] configure with Spaces in Directory Name on macOS Message-ID: <1511699872.51.0.213398074469.issue32141@psf.upfronthosting.co.za> New submission from Phil Thompson : When configure searches for a C compiler on macOS it fails to handle spaces in directory name on PATH. The fix is to enclose $as_dir in quotes. ---------- components: Build messages: 307004 nosy: philthompson10 priority: normal severity: normal status: open title: configure with Spaces in Directory Name on macOS type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 11:05:48 2017 From: report at bugs.python.org (Scott Queen) Date: Sun, 26 Nov 2017 16:05:48 +0000 Subject: [New-bugs-announce] [issue32142] heapq.heappop - documentation misleading or doesn't work Message-ID: <1511712348.11.0.213398074469.issue32142@psf.upfronthosting.co.za> New submission from Scott Queen : The documentation for heapq.heappop(heap) says: "Pop and return the smallest item from the heap, maintaining the heap invariant. If the heap is empty, IndexError is raised. To access the smallest item without popping it, use heap[0]." yet, in the following code, the resultant heap doesn't reflect the heap invariant: import heapq li = [5, 7, 9, 1, 4, 3] heapq.heapify(li) #change a couple values in the heap li[3] = 16 li[4] = 2 print (heapq.heappop(li)) print ("The heap after pop is : ",end="") print (list(li)) This prints: The heap after pop is : [3, 4, 9, 16, 2] The documentation implies to me that heapify would be called internally after heappop, but I may be misreading. Perhaps heappop could say that the heap invariant is maintained if the heap is properly sorted before the heappop invocation. ---------- assignee: docs at python components: Documentation messages: 307006 nosy: docs at python, scooter4j priority: normal severity: normal status: open title: heapq.heappop - documentation misleading or doesn't work type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 11:17:33 2017 From: report at bugs.python.org (Giuseppe Scrivano) Date: Sun, 26 Nov 2017 16:17:33 +0000 Subject: [New-bugs-announce] [issue32143] os.statvfs lacks f_fsid Message-ID: <1511713053.6.0.213398074469.issue32143@psf.upfronthosting.co.za> New submission from Giuseppe Scrivano : the os.statvfs() function doesn't return f_fsid. The POSIX definition of statvfs() has f_fsid: http://pubs.opengroup.org/onlinepubs/009604599/basedefs/sys/statvfs.h.html ---------- components: Library (Lib) messages: 307007 nosy: gscrivano priority: normal severity: normal status: open title: os.statvfs lacks f_fsid type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Nov 26 19:03:08 2017 From: report at bugs.python.org (Abhilash Raj) Date: Mon, 27 Nov 2017 00:03:08 +0000 Subject: [New-bugs-announce] [issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value Message-ID: <1511740988.25.0.213398074469.issue32144@psf.upfronthosting.co.za> New submission from Abhilash Raj : According to the documentation, email.policy.SMTP and .SMTPUTF8 should have CRLF (`\r\n`) as line endings for text/plain parts. However, a new message parsed using message_from_binary_file with policy.SMTPUTF8 has `\n` as line endings for text/plain parts. This happens when I use get_content() on the new EmailMessage API. Just to mention, in Python 2.7, the old `get_payload(decode=True)` returns the body with CRLF as line endings. However, in Python 3, `get_payload()` also returns '\n' as line endings. Am I reading the documentation wrong? ---------- components: email messages: 307029 nosy: barry, maxking, r.david.murray priority: normal severity: normal status: open title: email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 03:34:13 2017 From: report at bugs.python.org (Maurizio Zucchelli) Date: Mon, 27 Nov 2017 08:34:13 +0000 Subject: [New-bugs-announce] [issue32145] Wrong ExitStack Callback recipe Message-ID: <1511771653.67.0.213398074469.issue32145@psf.upfronthosting.co.za> New submission from Maurizio Zucchelli : The documentation for contextlib.ExitStack (https://docs.python.org/3.7/library/contextlib.html#replacing-any-use-of-try-finally-and-flag-variables) shows an helper class (Callback) to perform cleanup using a callback. Problem is, Callback.cancel() calls ExitStack.pop_all(), which in turn calls type(self)(), this is not a valid constructor for Callback, since it always expects at least one element. (I have marked only Python 3.4 and 3.6 since those are the versions where I verified this, but it likely applies to every version.) ---------- assignee: docs at python components: Documentation messages: 307037 nosy: Denaun, docs at python priority: normal severity: normal status: open title: Wrong ExitStack Callback recipe type: crash versions: Python 3.4, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 05:33:55 2017 From: report at bugs.python.org (Daniel Colascione) Date: Mon, 27 Nov 2017 10:33:55 +0000 Subject: [New-bugs-announce] [issue32146] multiprocessing freeze_support needed outside win32 Message-ID: <1511778835.66.0.213398074469.issue32146@psf.upfronthosting.co.za> New submission from Daniel Colascione : multiprocessing's freeze_support makes freshly-launched subprocesses integrate correctly until the multiprocessing ecosystem even when the main executable is some application binary instead of a Python interpreter. The documentation and code assume that this support is needed only on win32, but it's equally applicable to POSIX systems using the spawn strategy in combination with systems like cx_freeze. In particular: 1) The special case in context.py's version of freeze_support() for win32 should be removed 2) The semaphore tracker should correctly tickle the freeze support 3) The documentation should be updated to be platform-neutral ---------- components: Library (Lib) messages: 307043 nosy: dancol priority: normal severity: normal status: open title: multiprocessing freeze_support needed outside win32 type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 07:14:29 2017 From: report at bugs.python.org (Sergey Fedoseev) Date: Mon, 27 Nov 2017 12:14:29 +0000 Subject: [New-bugs-announce] [issue32147] improve performance of binascii.unhexlify() by using conversion table Message-ID: <1511784869.56.0.213398074469.issue32147@psf.upfronthosting.co.za> New submission from Sergey Fedoseev : Before: $ ./python -m timeit -s "from binascii import unhexlify; b = b'aa'*2**20" "unhexlify(b)" 50 loops, best of 5: 5.68 msec per loop After: $ ./python -m timeit -s "from binascii import unhexlify; b = b'aa'*2**20" "unhexlify(b)" 100 loops, best of 5: 2.06 msec per loop ---------- messages: 307053 nosy: sir-sigurd priority: normal severity: normal status: open title: improve performance of binascii.unhexlify() by using conversion table type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 10:48:07 2017 From: report at bugs.python.org (Hasan Mahmood) Date: Mon, 27 Nov 2017 15:48:07 +0000 Subject: [New-bugs-announce] [issue32148] Python 2.7.14 has Tkinter with big T letter. Message-ID: <1511797687.13.0.213398074469.issue32148@psf.upfronthosting.co.za> New submission from Hasan Mahmood : Using python 2.7.14. Importing Dialogs Got problem in importing tkinter. In doccumentation of tkinter, it is stated the big letter T in Tkinter is used only used in python 3 but. It is expected that it is possible to use tkinter with small letter T beccause I use python 2.7.14 ---------- components: Tkinter files: Tkinter.PNG messages: 307055 nosy: HMahmood priority: normal severity: normal status: open title: Python 2.7.14 has Tkinter with big T letter. versions: Python 2.7 Added file: https://bugs.python.org/file47299/Tkinter.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:29:29 2017 From: report at bugs.python.org (STINNER Victor) Date: Mon, 27 Nov 2017 16:29:29 +0000 Subject: [New-bugs-announce] [issue32149] bolen-dmg-3.x: compiled failed with: blurb: command not found Message-ID: <1511800169.52.0.213398074469.issue32149@psf.upfronthosting.co.za> New submission from STINNER Victor : /bin/sh: line 1: blurb: command not found http://buildbot.python.org/all/#/builders/69/builds/51 Running make frameworkinstallextras (...) copy /Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/../Tools/unittestgui/README.txt /Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/dmg/_root/Library/Frameworks/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/unittestgui/README.txt copy /Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/../Tools/unittestgui/unittestgui.py /Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/dmg/_root/Library/Frameworks/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/unittestgui/unittestgui.py Copying required shared libraries Fix file modes Install python documentation rm -rf build/* ./venv/* make: `venv' is up to date. /bin/sh: line 1: blurb: command not found make: *** [build] Error 127 Traceback (most recent call last): mkdir -p build Building NEWS from Misc/NEWS.d with blurb File "/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py", line 1659, in main() File "/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py", line 1621, in main buildPythonDocs() File "/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py", line 1094, in buildPythonDocs runCommand('make html PYTHON=venv/bin/python') File "/Users/db3l/buildarea.dmg/bolen-dmg-3.x/build/Mac/BuildScript/build-installer.py", line 531, in runCommand raise RuntimeError("command failed: %s"%(commandline,)) RuntimeError: command failed: make html PYTHON=venv/bin/python program finished with exit code 1 elapsedTime=1288.975592 ---------- components: Build keywords: buildbot messages: 307065 nosy: vstinner priority: normal severity: normal status: open title: bolen-dmg-3.x: compiled failed with: blurb: command not found versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 11:40:18 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 27 Nov 2017 16:40:18 +0000 Subject: [New-bugs-announce] [issue32150] Expand tabs to spaces in C files Message-ID: <1511800818.44.0.213398074469.issue32150@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : While most C files use spaces for indenting and aligning, there are few sites in which tabs are left. Sometimes mixed tabs and spaces are used in the same file. This adds a noise in the diff if the committer uses an editor which doesn't preserve tabs (see for example PR 4390). This can hide semantic changes in tab expansion changes. I reviewed many patches with accidentally expanded tabs to spaces. Usually I request removing unrelated changes from the patch. But this still happened, and tabs slowly are disappeared from the sources. There are less tabs in the current default branch than in any maintained branch. I think it is better to make the expansion in a single not so large commit that allow them be mixed with semantical changes. PR 4583 does this. The changes first were made automatically, and after that I have edited them manually for removing excessive indentations in some files (4 spaces are enough). Tabs have been kept only in generated file Modules/unicodedata_db.h and in imported files Modules/_ctypes/* and Modules/expat/siphash.h. ---------- components: Interpreter Core messages: 307068 nosy: gvanrossum, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Expand tabs to spaces in C files versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Nov 27 12:46:19 2017 From: report at bugs.python.org (Ric Anderson) Date: Mon, 27 Nov 2017 17:46:19 +0000 Subject: [New-bugs-announce] [issue32151] -mvenv vs minor python version updates Message-ID: <1511804779.33.0.213398074469.issue32151@psf.upfronthosting.co.za> New submission from Ric Anderson : When a site updates python3 from 3.5 to 3.6 (based on https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work, this is would be a minor version update),pre-upgrade venv setups created with "python3 -menv ..." break because "python3" in the venv is really 3.5, and needs the system libpython3.5m.so.1.0, which is no longer in the library search list. Should "python -mvenv ..." copy the libpython3.5m.so.1.0 to the venv directory/lib, or add the system path to libpython3.5m.so.1.0 to LD_LIBRARY_PATH, or should the minor version number (.5 ,or .6) be excluded from the library name, so that minor version updates don't break existing venv setups or ??? ---------- components: Installation, Interpreter Core, Library (Lib) messages: 307072 nosy: Ric Anderson priority: normal severity: normal status: open title: -mvenv vs minor python version updates type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 03:45:04 2017 From: report at bugs.python.org (Nikhil Hegde) Date: Tue, 28 Nov 2017 08:45:04 +0000 Subject: [New-bugs-announce] [issue32152] Add pid to .cover filename in lib/trace.py Message-ID: <1511858704.48.0.213398074469.issue32152@psf.upfronthosting.co.za> New submission from Nikhil Hegde : Adding pid to filenames will avoid file write error when multiple processes (specifically, multiple tests) are writing to the same .cover file ---------- components: Library (Lib) messages: 307110 nosy: nikhilh priority: normal severity: normal status: open title: Add pid to .cover filename in lib/trace.py type: enhancement versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 05:23:15 2017 From: report at bugs.python.org (Claudiu Belu) Date: Tue, 28 Nov 2017 10:23:15 +0000 Subject: [New-bugs-announce] [issue32153] mock.create_autospec fails if an attribute is a partial function Message-ID: <1511864595.09.0.213398074469.issue32153@psf.upfronthosting.co.za> New submission from Claudiu Belu : If an object's attribute is a partial function, mock.create_autospec will fail while trying to copy the partial functions' details to the mocked function, as the partial function does not have the __name__ attribute. Example: import functools from unittest import mock class Proxy(object): def __init__(self, obj): self.obj def __getattr__(self, name): return functools.partial(self.__run_method, name) def __run_method(self, name, *args, **kwargs): return getattr(self.obj, name)(*args, **kwargs) a = mock.Mock() proxy = Proxy(a) mock.create_autospec(proxy) Output: Traceback (most recent call last): File "py3_mock_functools.py", line 20, in mock.create_autospec(proxy) File "/usr/lib/python3.5/unittest/mock.py", line 2156, in create_autospec _check_signature(spec, mock, is_type, instance) File "/usr/lib/python3.5/unittest/mock.py", line 112, in _check_signature _copy_func_details(func, checksig) File "/usr/lib/python3.5/unittest/mock.py", line 117, in _copy_func_details funcopy.__name__ = func.__name__ AttributeError: 'functools.partial' object has no attribute '__name__' ---------- components: Library (Lib) messages: 307115 nosy: cbelu priority: normal severity: normal status: open title: mock.create_autospec fails if an attribute is a partial function versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 05:29:10 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 10:29:10 +0000 Subject: [New-bugs-announce] [issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace Message-ID: <1511864950.13.0.213398074469.issue32154@psf.upfronthosting.co.za> New submission from STINNER Victor : For backward compatibility with Python 3.3, Lib/asyncio/__init__.py exports asyncio.selectors and asyncio._overlapped symbols. Python 3.3 reached it's end of line last september, it's time to move on: https://devguide.python.org/#status-of-python-branches This change is backward incompatible. Attached PR removes asyncio.selectors and asyncio._overlapped symbols, and use directly modules from the standard library. It documents the change in the "Porting to Python 3.7" section of the "What's New in Python 3.7" document. ---------- components: asyncio messages: 307117 nosy: vstinner, yselivanov priority: normal severity: normal status: open title: asyncio: Don't export selectors and _overlapped in asyncio namespace versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 09:03:17 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 14:03:17 +0000 Subject: [New-bugs-announce] [issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used Message-ID: <1511877797.63.0.213398074469.issue32155@psf.upfronthosting.co.za> New submission from STINNER Victor : Using flake8, I found some bugs in the standard libraries and tools. I already fixed another flake8 error: --- commit 28e61650b23119b68cd7943ccc01b8b9af1b4103 Author: Victor Stinner Date: Tue Nov 28 00:34:08 2017 +0100 bpo-31245: asyncio: Fix typo, isistance => isinstance (#4594) --- Attached patch fix 3 bugs found by the flake8 F841 warning. Note: Python 2.7 is not impacted by the turtledemo bug, but it's impacted by the two other bugs. ---------- components: Library (Lib) messages: 307120 nosy: vstinner priority: normal severity: normal status: open title: Fix flake8 warning F841: local variable ... is assigned to but never used versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 10:07:16 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 15:07:16 +0000 Subject: [New-bugs-announce] [issue32156] Fix flake8 warning F401: ... imported but unused Message-ID: <1511881636.03.0.213398074469.issue32156@psf.upfronthosting.co.za> New submission from STINNER Victor : Attached PR removes unused imports. ---------- components: Library (Lib) messages: 307126 nosy: vstinner priority: normal severity: normal status: open title: Fix flake8 warning F401: ... imported but unused versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 12:17:54 2017 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 28 Nov 2017 17:17:54 +0000 Subject: [New-bugs-announce] [issue32157] Remove explicit quotes around %r and {!r} Message-ID: <1511889474.38.0.213398074469.issue32157@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : It is common to use quotes around %s. If the formatted argument is a string this will produce a string in qoutes, that look as a string literal in Python and other programming languages or just as a quoted string in English. But if quotes surround %r this looks like error. If the argument is a string this will lead to doubling qoutes. If its repr is in the form <...>, the angular parenthesis serve a role of qoutes, and additional qoutes are not needed. PR 4582 removes qoutes around %r and {!r} in format strings. ---------- components: Library (Lib) messages: 307146 nosy: barry, davin, pitrou, r.david.murray, serhiy.storchaka, yselivanov priority: normal severity: normal stage: patch review status: open title: Remove explicit quotes around %r and {!r} versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 14:39:46 2017 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 28 Nov 2017 19:39:46 +0000 Subject: [New-bugs-announce] [issue32158] Suppress (and other contextlib context managers) should work as decorators (where appropriate) Message-ID: <1511897986.14.0.213398074469.issue32158@psf.upfronthosting.co.za> New submission from Jason R. Coombs : The contextlib docs explain why a decorator is nice: > It makes it clear that the cm applies to the whole function, rather than just a piece of it (and saving an indentation level is nice, too). However, the built-in context managers that could readily supply this interface don't derive from DecoratorContext. In jaraco.context, I [added decorator support by simply deriving from the two base classes](https://github.com/jaraco/jaraco.context/commit/5aa7b0bb222cff5009a2f0dc3ea49db9e7a6b71a#diff-efbedfbbcb7f61268cfeff04a32fa59d). But it got me thinking - couldn't suppress (and possibly other) contextlib decorators support this usage out of the box? If there's interest, I'll put together a patch with test. ---------- components: Library (Lib) messages: 307155 nosy: jason.coombs priority: normal severity: normal status: open title: Suppress (and other contextlib context managers) should work as decorators (where appropriate) versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:22:20 2017 From: report at bugs.python.org (STINNER Victor) Date: Tue, 28 Nov 2017 20:22:20 +0000 Subject: [New-bugs-announce] [issue32159] Remove tools for CVS and Subversion Message-ID: <1511900540.76.0.213398074469.issue32159@psf.upfronthosting.co.za> New submission from STINNER Victor : CPython migrated from CVS to Subversion, to Mercurial, and then to Git. CVS and Subversion are no more used to develop CPython. Changes of attached PR: * platform module: drop support for sys.subversion. The sys.subversion attribute has been removed in Python 3.3. * Remove Misc/svnmap.txt * Remove Tools/scripts/svneol.py * Remove Tools/scripts/treesync.py ---------- components: Build messages: 307159 nosy: vstinner priority: normal severity: normal status: open title: Remove tools for CVS and Subversion versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 15:41:15 2017 From: report at bugs.python.org (Daniel Himmelstein) Date: Tue, 28 Nov 2017 20:41:15 +0000 Subject: [New-bugs-announce] [issue32160] lzma documentation: example to XZ compress file on disk Message-ID: <1511901675.08.0.213398074469.issue32160@psf.upfronthosting.co.za> New submission from Daniel Himmelstein : The documentation for the lzma module currently contains 6 examples (https://docs.python.org/3.6/library/lzma.html#examples). However, it does not include an example to XZ compress a file on disk. The functionality I'm envisioning would be similar to the command: ```sh xz --compress --keep path ``` I believe this is possible in python with: ```python with open(in_path) as in_file, lzma.open(out_path, 'w') as out_file: shutil.copyfileobj(in_path, out_file) ``` Note gzip has a similar example (https://docs.python.org/3.6/library/gzip.html#examples-of-usage). Compressing an existing file on disk is a use case I commonly encounter. Python is ideal for the task because it provides a cross-platform solution that doesn't require installing additional command line utilities. Before finding shutil.copyfileobj, I assumed memory-efficient on-disk XZ compression was not possible in Python, due to its omission from the docs. I'm happy to propose example code for the documentation. Alternatively, if this feature is considered useful, we could consider an API addition to provide a one-line command for on-disk compressing/decompressing files. Since this would be a major addition that should be consistent across compression modules, perhaps we should just start with a lzma doc example? ---------- components: IO messages: 307163 nosy: dhimmel priority: normal severity: normal status: open title: lzma documentation: example to XZ compress file on disk versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 16:59:42 2017 From: report at bugs.python.org (Rahul) Date: Tue, 28 Nov 2017 21:59:42 +0000 Subject: [New-bugs-announce] [issue32161] Python 2.7.14 installation on Ubuntu 16.04/GCC 5.4 throws "internal compiler error" in "PyFloat_GetMax" function Message-ID: <1511906382.07.0.213398074469.issue32161@psf.upfronthosting.co.za> New submission from Rahul : Attempt to `make` Python 2.7.14 on Ubuntu 16.04/GCC 5.4 throws the following error: Objects/floatobject.c: In function ?PyFloat_GetMax?: Objects/floatobject.c:59:5: internal compiler error: Illegal instruction return DBL_MAX; ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Makefile:1359: recipe for target 'Objects/floatobject.o' failed make: *** [Objects/floatobject.o] Error 1 ---------- components: Installation files: python_2_7_14__configure_output messages: 307176 nosy: rahulrajaram priority: normal severity: normal status: open title: Python 2.7.14 installation on Ubuntu 16.04/GCC 5.4 throws "internal compiler error" in "PyFloat_GetMax" function versions: Python 2.7 Added file: https://bugs.python.org/file47301/python_2_7_14__configure_output _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 17:27:43 2017 From: report at bugs.python.org (Ilya Kulakov) Date: Tue, 28 Nov 2017 22:27:43 +0000 Subject: [New-bugs-announce] [issue32162] typing.Generic breaks __init_subclass__ Message-ID: <1511908063.67.0.213398074469.issue32162@psf.upfronthosting.co.za> New submission from Ilya Kulakov : When superclass inherits from Generic, attributes set for a subclass are incorrectly propagated to its superclass. Without Generic attribute access raises an exception: class X: def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) cls.attr = 42 class Y(X): pass Y.attr # 42 X.attr # AttributeError With Generic it does not: import typing T = typing.TypeVar('T') class X(typing.Generic[T]): def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) cls.attr = 42 class Y(X): pass Y.attr # 42 X.attr # 42 ---------- messages: 307182 nosy: Ilya.Kulakov priority: normal severity: normal status: open title: typing.Generic breaks __init_subclass__ type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:18:28 2017 From: report at bugs.python.org (darkdragon-001) Date: Wed, 29 Nov 2017 02:18:28 +0000 Subject: [New-bugs-announce] [issue32163] getattr() returns None even when default is given Message-ID: <1511921908.2.0.213398074469.issue32163@psf.upfronthosting.co.za> New submission from darkdragon-001 : # fail.py def main(): patch = './a' f = open(patch, 'r') a = getattr(f,'encoding','ascii') print(str(a)) if __name__ == "__main__": main() --- $ touch a $ python fail.py It still prints out 'None' instead of 'ascii'. This issue is fixed in python3. ---------- messages: 307197 nosy: darkdragon-001 priority: normal severity: normal status: open title: getattr() returns None even when default is given versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:41:53 2017 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 29 Nov 2017 02:41:53 +0000 Subject: [New-bugs-announce] [issue32164] IDLE: delete tabbedpages.py Message-ID: <1511923313.57.0.213398074469.issue32164@psf.upfronthosting.co.za> New submission from Terry J. Reedy : idlelib.tabbedpages.TabbedPageSet is a custom widget only used for the tabbed config dialog. #30781 converted to using tkinter.ttk.Notebook. The latter has proven to be an improvement and the former has no other use, nor would I recommend its use. Time to delete the file. ---------- assignee: terry.reedy components: IDLE messages: 307199 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: delete tabbedpages.py type: resource usage versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Nov 28 21:56:08 2017 From: report at bugs.python.org (Kenta Murata) Date: Wed, 29 Nov 2017 02:56:08 +0000 Subject: [New-bugs-announce] [issue32165] PyEval_InitThreads is called before Py_Initialize in LoadPython in Modules/_ctypes/callbacks.c Message-ID: <1511924168.1.0.213398074469.issue32165@psf.upfronthosting.co.za> New submission from Kenta Murata : As described in Doc/c-api/init.rst, PyEval_InitThreads() cannot be called before Py_Initialize() function. But in Modules/_ctypes/callbacks.c, PyEval_InitThreds() is called before Py_Initialize() in LoadPython function. ---------- components: ctypes messages: 307202 nosy: mrkn priority: normal pull_requests: 4546 severity: normal status: open title: PyEval_InitThreads is called before Py_Initialize in LoadPython in Modules/_ctypes/callbacks.c versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 04:46:45 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 09:46:45 +0000 Subject: [New-bugs-announce] [issue32166] Drop python 3.4 code from asyncio.coroutines Message-ID: <1511948805.45.0.213398074469.issue32166@psf.upfronthosting.co.za> New submission from Andrew Svetlov : Dropped lines are never executed by supported Python versions. The code exists for sake of keeping the same code base for stdlib asyncio and third-party library with the same name. Since Python 3.4 asyncio is a part of stdlib, asyncio on PyPI is not supported/updated for 2.5 years. Removing is safe. The change keeps backward compatibility with old libraries written for `yield from` syntax, both awaiting old-styled coroutines and yielding from new styles async functions are supported. async def f(): ... yield from f() @asyncio.coroutine def g(): ... await g() Thus no regressions/deprecations, just removing non-public never executed implementation details. ---------- assignee: asvetlov components: Library (Lib), asyncio messages: 307214 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Drop python 3.4 code from asyncio.coroutines versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 05:18:48 2017 From: report at bugs.python.org (Du Phan) Date: Wed, 29 Nov 2017 10:18:48 +0000 Subject: [New-bugs-announce] [issue32167] "Improve" random.choice function for FiFa purpose Message-ID: <1511950728.05.0.213398074469.issue32167@psf.upfronthosting.co.za> Change by Du Phan : ---------- components: Build nosy: duphan priority: normal severity: normal status: open title: "Improve" random.choice function for FiFa purpose type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 06:15:04 2017 From: report at bugs.python.org (=?utf-8?q?Ertu=C4=9Frul_Karademir?=) Date: Wed, 29 Nov 2017 11:15:04 +0000 Subject: [New-bugs-announce] [issue32168] Mutable instance variables don't get new references with args. Message-ID: <1511954104.7.0.213398074469.issue32168@psf.upfronthosting.co.za> New submission from Ertu?rul Karademir : Hello, I've searched all over Google and this bug tracker with all combinations of keywords that I can associate with this issue, but I couldn't find an explanation that makes sense or fits the issue. I know that when dealing with mutable variables, class variables share the same reference with all instances, so to assign separate attributes for instances, mutable variables should be instance level variables. However when I create a class like the following, class Base: def __init__(self, props=list(), foo='foo base'): self.props = props self.foo = foo def insert_prop(self, i): self.props.append(i) and run this: if __name__ == '__main__': base = Base() base.insert_prop(1) base.insert_prop(2) print('base props before base2, 3 creation:', base.props) base2 = Base() base3 = Base([41, 42]) print('base props after base2, 3 creation:', base.props) print('base2 props after base2, 3 creation:', base2.props) print('base3 props after base2, 3 creation:', base3.props) base2.insert_prop(51) base3.insert_prop(61) print('base props after insertion:', base.props) print('base2 props after insertion:', base2.props) print('base3 props after insertion:', base3.props) the output is this: base props before base2, 3 creation: [1, 2] base props after base2, 3 creation: [1, 2] base2 props after base2, 3 creation: [1, 2] base3 props after base2, 3 creation: [41, 42] base props after insertion: [1, 2, 51] base2 props after insertion: [1, 2, 51] base3 props after insertion: [41, 42, 61] So initiating base3 with explicit args gives it a new reference to the props variable but base and base2 share the same reference. So suddenly props is hoisted to class level. I actually encountered this behaviour when trying to do the same thing with child classes with no __init__ method like: class Sub1(Base): pass The whole code is attached. Is this an expected behaviour? If so I couldn't find a gotcha anywhere. Regards, Ertugrul ---------- components: Interpreter Core files: bug.py messages: 307219 nosy: ekarademir priority: normal severity: normal status: open title: Mutable instance variables don't get new references with args. type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47303/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 07:03:48 2017 From: report at bugs.python.org (Andrew Svetlov) Date: Wed, 29 Nov 2017 12:03:48 +0000 Subject: [New-bugs-announce] [issue32169] Drop python 3.4 code from asyncio.unix_events Message-ID: <1511957028.4.0.213398074469.issue32169@psf.upfronthosting.co.za> Change by Andrew Svetlov : ---------- assignee: asvetlov components: Library (Lib), asyncio nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Drop python 3.4 code from asyncio.unix_events versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 14:51:55 2017 From: report at bugs.python.org (Malcolm Smith) Date: Wed, 29 Nov 2017 19:51:55 +0000 Subject: [New-bugs-announce] [issue32170] Contrary to documentation, ZipFile.extract does not extract timestamps or other metadata Message-ID: <1511985115.6.0.213398074469.issue32170@psf.upfronthosting.co.za> New submission from Malcolm Smith : The documentation explicitly says "file information is extracted as accurately as possible". But the `zipfile` module doesn't actually extract any metadata at all. I assume this text was copied and pasted from the `tarfile` module, which does implement this. Fixing the code is preferred to fixing the documentation. ---------- components: Library (Lib) messages: 307255 nosy: Malcolm Smith priority: normal severity: normal status: open title: Contrary to documentation, ZipFile.extract does not extract timestamps or other metadata type: behavior versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 16:29:52 2017 From: report at bugs.python.org (Pierre Denis) Date: Wed, 29 Nov 2017 21:29:52 +0000 Subject: [New-bugs-announce] [issue32171] Inconsistent results for fractional power of -infinity Message-ID: <1511990992.11.0.213398074469.issue32171@psf.upfronthosting.co.za> New submission from Pierre Denis : Python returns inconsistent results when negative infinity is raised to a non-integer power. This happens with the ** operator as well as with the pow and math.pow functions. The most blatant symptom occurs with power 0.5, which is expectedly equivalent to a square root: >>> float('-inf') ** 0.5 inf >>> pow(float('-inf'), 0.5) inf >>> import math >>> math.pow(float('-inf'), 0.5) inf Mathematically, these operations are invalid if we restrict to real numbers. Also, if we extend to complex numbers, the results are wrong since the result should be infj, which is the value returned by cmath.sqrt(float('-inf')). IMHO, there are three possible ways to fix this: 1) raise an exception ValueError 2) return nan 3) return (nan + nanj) Discussion: - Solution 1) is consistent with current handling of *finite* negative base with non-integer exponent; also, it is consistent with math.sqrt(float('-inf')), which raises ValueError. - I expected solution 2) to be more in line with IEEE754 ? until I read the following statement in this specification: "pow(x, y) signals the invalid operation exception for finite x<0 and finite non-integer y". I?m not an expert of this topic but I think that there is miss here since IEEE754 does not state what happens for *infinite* x<0 and finite non-integer y. - Solution 3) emphasizes the fact that, although the result is generally undefined, it belongs to complex type. - In any case, the solution should be consistent also with the case with negative fractional exponent? even if I would tend to accept that (float('-inf')**-0.5) == 0.0 is mathematically sensible! - The test assertions shall be updated in Python standard test suite (test_float.py). Note that Python 2.6 behaves consistently for all negative bases, finite or not finite: it raises ValueError exception with the message "negative number cannot be raised to a fractional power". The behavior described here seems to be introduced in this commit: https://github.com/python/cpython/commit/9ab44b509a935011beb8e9108a2271ee728e8ad4#diff-b7e3652f51768cec742ef07326413ad0 ---------- messages: 307256 nosy: pdenis priority: normal severity: normal status: open title: Inconsistent results for fractional power of -infinity type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 18:00:53 2017 From: report at bugs.python.org (bugale bugale) Date: Wed, 29 Nov 2017 23:00:53 +0000 Subject: [New-bugs-announce] [issue32172] Add length counter for iterables Message-ID: <1511996453.35.0.213398074469.issue32172@psf.upfronthosting.co.za> New submission from bugale bugale : I have noticed that there is no convenient way in python to get the number of items in a generator. For example: my_iterable = iter(range(1000)) len(my_iterable) # Would not work Of course, something like this would ruin the generator, and it will no longer be usable, but in some use cases one would like to know only the count of something. It is possible to do it today using this line: sum(1 for x in my_iterable) but it seems odd to me that there is no function like: itertools.count_iterable(my_iterable) that does exactly this ---------- components: Demos and Tools messages: 307271 nosy: bugale bugale priority: normal severity: normal status: open title: Add length counter for iterables type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 21:57:02 2017 From: report at bugs.python.org (GanZiQim) Date: Thu, 30 Nov 2017 02:57:02 +0000 Subject: [New-bugs-announce] [issue32173] linecache.py add lazycache to __all__ and use dict.clear to clear the cache Message-ID: <1512010622.75.0.213398074469.issue32173@psf.upfronthosting.co.za> Change by GanZiQim : ---------- components: Library (Lib) nosy: ganziqim priority: normal pull_requests: 4554 severity: normal status: open title: linecache.py add lazycache to __all__ and use dict.clear to clear the cache type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Nov 29 22:45:30 2017 From: report at bugs.python.org (zaazbb) Date: Thu, 30 Nov 2017 03:45:30 +0000 Subject: [New-bugs-announce] [issue32174] nonASCII punctuation characters can not display in python363.chm. Message-ID: <1512013530.29.0.213398074469.issue32174@psf.upfronthosting.co.za> New submission from zaazbb : In chm(python363.chm) documents, some unicode chars (non ascii chars) can not display. for example: asyncio ? Asynchronous I/O, event loop, coroutines and tasks displayed as asyncio ? Asynchronous I/O, event loop, coroutines and tasks and Asynchronous programming is more complex than classical ?sequential? programming display as Asynchronous programming is more complex than classical ?equential? programming windows 10, simplified chinese language. python3.6.3, python363.chm. ---------- components: Windows files: 1512013191(1).jpg messages: 307277 nosy: paul.moore, steve.dower, tim.golden, zaazbb, zach.ware priority: normal severity: normal status: open title: nonASCII punctuation characters can not display in python363.chm. type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47304/1512013191(1).jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 00:39:15 2017 From: report at bugs.python.org (Brian Jarvis) Date: Thu, 30 Nov 2017 05:39:15 +0000 Subject: [New-bugs-announce] [issue32175] Add hash auto-randomization Message-ID: <1512020355.45.0.213398074469.issue32175@psf.upfronthosting.co.za> New submission from Brian Jarvis : Hash auto-randomization is a mechanism to detect when a collision attack is underway and switch to a randomized keying scheme at that point. This patch is for the 2.7 branch, where hash randomization is not on by default. Using collided strings from https://github.com/Storyyeller/fnv-collider/tree/master/collided_strings, 10 "attacks" of roughly 50,000 collided strings were launched against this. The unmodified Python had a median insert time of roughly 4.32 seconds and a median retrieve time of roughly 4.40 seconds. With the auto-randomized version of Python, the median insert time was roughly 3.99 seconds and median retrieve time was roughly 3.57 seconds. This is a 7.7% and 18.9% savings, respectively. ---------- files: auto_rand_2.7.patch keywords: patch messages: 307278 nosy: bjarvis priority: normal severity: normal status: open title: Add hash auto-randomization type: enhancement versions: Python 2.7 Added file: https://bugs.python.org/file47305/auto_rand_2.7.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 02:39:35 2017 From: report at bugs.python.org (Dan Snider) Date: Thu, 30 Nov 2017 07:39:35 +0000 Subject: [New-bugs-announce] [issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell Message-ID: <1512027575.04.0.213398074469.issue32176@psf.upfronthosting.co.za> New submission from Dan Snider : The following code works in 3.3, 3.4, and 3.5, but in 3.6 it throws RuntimeError: super(): bad __class__ cell. from types import FunctionType, CodeType def create_closure(__class__): return (lambda: __class__).__closure__ def new_code(c_or_f): '''A new code object with a __class__ cell added to freevars''' c = c_or_f.__code__ if isinstance(c_or_f, FunctionType) else c_or_f return CodeType( c.co_argcount, c.co_kwonlyargcount, c.co_nlocals, c.co_stacksize, c.co_flags, c.co_code, c.co_consts, c.co_names, c.co_varnames, c.co_filename, c.co_name, c.co_firstlineno, c.co_lnotab, c.co_freevars + ('__class__',), c.co_cellvars) def add_foreign_method(cls, f): code = new_code(f.__code__) name = f.__name__ defaults = f.__defaults__ closure = (f.__closure__ or ()) + create_closure(cls) setattr(cls, name, FunctionType(code, globals(), name, defaults, closure)) class List(list): def append(self, elem): super().append(elem) def extend(self, elems): super().extend(elems) def __getitem__(self, i): print('foreign getitem') return super().__getitem__(i) add_foreign_method(List, __getitem__) self = List([1,2,3]) self[0] ---------- components: Interpreter Core messages: 307279 nosy: bup priority: normal severity: normal status: open title: Zero argument super is broken in 3.6 for methods with a hacked __class__ cell type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 03:00:17 2017 From: report at bugs.python.org (=?utf-8?q?J=C3=B6rn_Hees?=) Date: Thu, 30 Nov 2017 08:00:17 +0000 Subject: [New-bugs-announce] [issue32177] spammers mine emails from bugs.python.org Message-ID: <1512028817.25.0.213398074469.issue32177@psf.upfronthosting.co.za> New submission from J?rn Hees : On every platform that i create an account on, i use a new randomized email address. This allows me to track which platforms sell my account info to spammers. The one i used for bugs.python.org now receives astonishing amounts of spam (mostly bitcoin spam atm). I hope you don't sell the account information of your contributors to third parties, but instead believe in a design flaw of your bug tracking system and some way that spammers can currently harvest the email addresses of all of your contributors. Please investigate how this is possible and ways to protect your user's data. ---------- components: email messages: 307280 nosy: barry, joern, r.david.murray priority: normal severity: normal status: open title: spammers mine emails from bugs.python.org type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 05:40:34 2017 From: report at bugs.python.org (Massimiliano Torromeo) Date: Thu, 30 Nov 2017 10:40:34 +0000 Subject: [New-bugs-announce] [issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError Message-ID: <1512038434.94.0.213398074469.issue32178@psf.upfronthosting.co.za> New submission from Massimiliano Torromeo : With some malformed email address list, the parser for email groups raises an `IndexError` instead of the correct `HeaderParseError`. This results in a complete failure to parse the email while it is still preferable to just ignore the malformed header. An example of such a malformed list is this: `To: :Foo ` ---------- components: email messages: 307285 nosy: Massimiliano Torromeo, barry, r.david.murray priority: normal pull_requests: 4556 severity: normal status: open title: Some invalid email address groups cause an IndexError instead of a HeaderParseError type: behavior versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:27:18 2017 From: report at bugs.python.org (Massimiliano Torromeo) Date: Thu, 30 Nov 2017 11:27:18 +0000 Subject: [New-bugs-announce] [issue32179] Empty email address in headers triggers an IndexError Message-ID: <1512041238.12.0.213398074469.issue32179@psf.upfronthosting.co.za> New submission from Massimiliano Torromeo : In case an address email header contains and empty string, the tokenizer return a BareQuotedString which is also a TokenList, but this list is empty and the parser fails to check this and insteads raises an IndexError. For example an email with this header will trigger the IndexError: ReplyTo: "" ---------- components: email messages: 307292 nosy: barry, mtorromeo, r.david.murray priority: normal pull_requests: 4559 severity: normal status: open title: Empty email address in headers triggers an IndexError type: behavior versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 06:31:47 2017 From: report at bugs.python.org (=?utf-8?b?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=) Date: Thu, 30 Nov 2017 11:31:47 +0000 Subject: [New-bugs-announce] [issue32180] bool() vs len() > 0 on lists Message-ID: <1512041507.48.0.213398074469.issue32180@psf.upfronthosting.co.za> New submission from ????? ???????? : Please make bool() on lists at least as fast as len() > 0 on lists is. The trivial approach would be to define __bool__ on lists, that do something like "True if self else False". python3 Python 3.6.3+ (heads/3.6-dirty:2b5cbbb13c, Nov 1 2017, 19:03:09) [GCC 6.4.1 20171025] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import timeit >>> timeit.timeit('len([]) > 0') 0.0983404889702797 >>> timeit.timeit('bool([])') 0.15502946823835373 >>> timeit.timeit('True if [] else False') 0.03108721226453781 >>> timeit.timeit('len([1]) > 0') 0.11656427383422852 >>> timeit.timeit('bool([1])') 0.19317257404327393 >>> timeit.timeit('True if [1] else False') 0.057590410113334656 ---------- messages: 307294 nosy: dilyan.palauzov priority: normal severity: normal status: open title: bool() vs len() > 0 on lists type: performance versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 08:29:19 2017 From: report at bugs.python.org (Oleg K) Date: Thu, 30 Nov 2017 13:29:19 +0000 Subject: [New-bugs-announce] [issue32181] runaway Tasks with Task.cancel() ignored. Message-ID: <1512048559.34.0.213398074469.issue32181@psf.upfronthosting.co.za> New submission from Oleg K : (tested in VM and in real linux) there is an issue with Task, in some cases task will ignore cancellation and will keep running for a while. there is some explanation needed regarding the python_task_cancel.py example. 1)there is a async Integer Generator (my_generator) it has sleep() inside, and produces integers. 2)there is async coro test(), which is consumer of integers , it has several while True: consume = yield 3) there are tasks "a_task()", the job task is doing: it reads from generator, and pushes integer to active "async coro test()" my_generator -iterated by-> a_task() -sends Int to-> test() 4) "async coro test()" is protected by lock, so only one task may push value to it at a time. 5) "task_context" is a context manager, a helper which starts tasks and cancels them __aenter__ -> loop.create_task(self.task) __aexit__ -> self.running_task.cancel() here is how is it used async with task_context( async-coro-to-be-started-as-a-task ): # task is created while True: consume = yield if consume > 10 :break # task is CANCELLED ------------------------------------------------------ The Case: the issue is there when there is sequential aenters and aexits async with task_context( async-coro-to-be-started-as-a-task ): # task #1 is created while True: consume = yield if consume > 10 :break # task #1 is CANCELLED async with task_context( async-coro-to-be-started-as-a-task ): # task #2 is created while True: consume = yield if consume > 20 :break # task #2 is CANCELLED async with task_context( async-coro-to-be-started-as-a-task ): # task #3 is created while True: consume = yield if consume > 10 :break # task #3 is CANCELLED what may go wrong here? - at the end there will be 3 live task reading from same generator! 2 tasks have clearly got cancel() call but, according to output they still there and working: there is part of output as a proof: my_generator: [0.3] PRODUCE VALUE 28 send done: 20 task id= 1 will send : 28 task id= 4 consume 3 28 my_generator: [0.3] PRODUCE VALUE 29 send done: 28 task id= 4 will send : 29 task id= 2 consume 3 29 send done: 29 task id= 2 my_generator: [0.4] PRODUCE VALUE 21 will send : 21 task id= 1 consume 3 21 send done: 21 task id= 1 my_generator: [0.3] PRODUCE VALUE 30 will send : 30 task id= 3 consume 3 30 send done: 30 task id= 3 my_generator: [0.3] PRODUCE VALUE 31 will send : 31 task id= 3 "task id= 3" "task id= 2" "task id= 4" that means that all tasks are there!, which should not happen. but, these tasks WILL GET cancellation call execute just after "async coro test()" will exit, that exit somehow will trigger pending exit of tasks, which should have happened long ago!. also, there is no reliable way to wait task termination, which is also major issue with real life asyncio usage, i need to have a mean to wait for task to complete wait until its "finally:" is done and all resources are free. ---------- components: asyncio files: python_task_cancel.py messages: 307307 nosy: Oleg K2, yselivanov priority: normal severity: normal status: open title: runaway Tasks with Task.cancel() ignored. type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47307/python_task_cancel.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 09:59:00 2017 From: report at bugs.python.org (Silla Rizzoli) Date: Thu, 30 Nov 2017 14:59:00 +0000 Subject: [New-bugs-announce] [issue32182] Infinite recursion in email.message.as_string() Message-ID: <1512053940.47.0.213398074469.issue32182@psf.upfronthosting.co.za> New submission from Silla Rizzoli : Sometimes RFC-correct email headers do not get folded correctly; the example code below results in an infinite recursion exception. import sys import mailbox from email.message import EmailMessage from email.headerregistry import Address from email import policy ePol = policy.SMTP.clone(refold_source='long',max_line_length=78) msg = EmailMessage(ePol) msg['From'] = Address("abcdefgh ijklnopq","a.ijklnopq","antani.com") msg['To'] = (Address("abcdef.ghijklmno at pqrstuvwxyz12345678.it","abcdef.ghijklmnop","pqrstuvwxyz12345678.it"), Address("Jane Doe", "jane", "doe.com")) msg['Subject'] = "Test" msg.set_content("Body") finalMail = msg.as_string() Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/email/message.py", line 968, in as_string return super().as_string(maxheaderlen=maxheaderlen, policy=policy) File "/usr/lib/python3.6/email/message.py", line 158, in as_string g.flatten(self, unixfrom=unixfrom) File "/usr/lib/python3.6/email/generator.py", line 116, in flatten self._write(msg) File "/usr/lib/python3.6/email/generator.py", line 195, in _write self._write_headers(msg) File "/usr/lib/python3.6/email/generator.py", line 222, in _write_headers self.write(self.policy.fold(h, v)) File "/usr/lib/python3.6/email/policy.py", line 183, in fold return self._fold(name, value, refold_binary=True) File "/usr/lib/python3.6/email/policy.py", line 205, in _fold return value.fold(policy=self) File "/usr/lib/python3.6/email/headerregistry.py", line 255, in fold return header.fold(policy=policy) File "/usr/lib/python3.6/email/_header_value_parser.py", line 300, in fold self._fold(folded) File "/usr/lib/python3.6/email/_header_value_parser.py", line 1226, in _fold rest._fold(folded) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 338, in _fold if folded.append_if_fits(part, tstr): File "/usr/lib/python3.6/email/_header_value_parser.py", line 149, in append_if_fits token._fold(self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 325, in _fold tstr = str(part) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in __str__ return ''.join(str(x) for x in self) File "/usr/lib/python3.6/email/_header_value_parser.py", line 196, in return ''.join(str(x) for x in self) RecursionError: maximum recursion depth exceeded while calling a Python object ---------- components: email messages: 307319 nosy: Silla Rizzoli, barry, r.david.murray priority: normal severity: normal status: open title: Infinite recursion in email.message.as_string() type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 10:33:32 2017 From: report at bugs.python.org (STINNER Victor) Date: Thu, 30 Nov 2017 15:33:32 +0000 Subject: [New-bugs-announce] [issue32183] Coverity: CID 1423264: Insecure data handling (TAINTED_SCALAR) Message-ID: <1512056012.34.0.213398074469.issue32183@psf.upfronthosting.co.za> New submission from STINNER Victor : I got a new report from Coverity: CID 1423264: Insecure data handling (TAINTED_SCALAR) ** CID 1423265: Insecure data handling (TAINTED_SCALAR) /Modules/main.c: 1393 in pymain_get_env_var_dup() ________________________________________________________________________________________________________ *** CID 1423265: Insecure data handling (TAINTED_SCALAR) /Modules/main.c: 1393 in pymain_get_env_var_dup() 1387 if (!var || var[0] == '\0') { 1388 *dest = NULL; 1389 return 0; 1390 } 1391 1392 size_t len; >>> CID 1423265: Insecure data handling (TAINTED_SCALAR) >>> Passing tainted variable "var" to a tainted sink. [Note: The source code implementation of the function has been overridden by a user model.] 1393 wchar_t *wvar = Py_DecodeLocale(var, &len); 1394 if (!wvar) { 1395 if (len == (size_t)-2) { 1396 /* don't set pymain->err */ 1397 return -2; 1398 } ** CID 1423264: Insecure data handling (TAINTED_SCALAR) /Modules/getpath.c: 909 in calculate_init() ________________________________________________________________________________________________________ *** CID 1423264: Insecure data handling (TAINTED_SCALAR) /Modules/getpath.c: 909 in calculate_init() 903 return err; 904 } 905 906 size_t len; 907 char *path = getenv("PATH"); 908 if (path) { >>> CID 1423264: Insecure data handling (TAINTED_SCALAR) >>> Passing tainted variable "path" to a tainted sink. [Note: The source code implementation of the function has been overridden by a user model.] 909 calculate->path_env = Py_DecodeLocale(path, &len); 910 if (!calculate->path_env) { 911 return DECODE_FAILED("PATH environment variable", len); 912 } 913 } 914 Christian Heimes told me on IRC that Coverity "thinks that all values from getenv are bad". Ok. __coverity_tainted_data_sink__() is supposed to say that we sanitized data, and this is what Py_DecodeLocale() model does: wchar_t *Py_DecodeLocale(const char* arg, size_t *size) { wchar_t *w; __coverity_tainted_data_sink__(arg); __coverity_tainted_data_sink__(size); return w; } I refactored recently Modules/main.c, Modules/getpath.c and PC/getpathp.c code, but the code isn't really new, I mostly "moved" code. Maybe these warnings were simply ignored previously? ---------- components: Interpreter Core messages: 307321 nosy: christian.heimes, vstinner priority: normal severity: normal status: open title: Coverity: CID 1423264: Insecure data handling (TAINTED_SCALAR) type: security versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 12:55:13 2017 From: report at bugs.python.org (nartes) Date: Thu, 30 Nov 2017 17:55:13 +0000 Subject: [New-bugs-announce] [issue32184] pdb/ipdb is not usable on Linux (which works on Windows) from a single multiprocessing.Process when the main process is stuck at process.join() Message-ID: <1512064513.87.0.213398074469.issue32184@psf.upfronthosting.co.za> New submission from nartes : https://asciinema.org/a/Sl7BTmS4krLdrLb9c4YeMgAG1 ---------- components: Interpreter Core, Library (Lib) files: parallel_sandbox.py messages: 307332 nosy: nartes priority: normal severity: normal status: open title: pdb/ipdb is not usable on Linux (which works on Windows) from a single multiprocessing.Process when the main process is stuck at process.join() type: behavior versions: Python 2.7, Python 3.6 Added file: https://bugs.python.org/file47308/parallel_sandbox.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 13:05:09 2017 From: report at bugs.python.org (Matt Davis) Date: Thu, 30 Nov 2017 18:05:09 +0000 Subject: [New-bugs-announce] [issue32185] SSLContext.wrap_socket sends SNI Extension when server_hostname is IP Message-ID: <1512065109.64.0.213398074469.issue32185@psf.upfronthosting.co.za> New submission from Matt Davis : The current implementation of SSLContext.wrap_socket blindly sends whatever is passed in server_hostname in the SNI extension, assuming it's a DNS hostname. RFC6066 describes the SNI TLS extension, and specifically states that 'Literal IPv4 and IPv6 addresses are not permitted in "HostName".' The RFC makes no recommendation on how a server implementation that violates this requirement should behave; Microsoft's kernel HTTP listener (http.sys) chooses to abort the connection if SNI has been enabled. In the http.sys case, SNI is a global setting, currently off by default, but if any registered listener has SNI enabled, the connection abort behavior applies to all listeners. SSLContext.wrap_socket() should determine whether server_hostname is an IP address before including the SNI extension. I've submitted a PR to work around this issue in urllib3 (https://github.com/shazow/urllib3/pull/1287) in the meantime, but would be good to get this fixed, especially if Microsoft decides to enable SNI by default at some point. ---------- assignee: christian.heimes components: SSL messages: 307333 nosy: christian.heimes, nitzmahone priority: normal severity: normal status: open title: SSLContext.wrap_socket sends SNI Extension when server_hostname is IP versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 13:23:25 2017 From: report at bugs.python.org (Nir Soffer) Date: Thu, 30 Nov 2017 18:23:25 +0000 Subject: [New-bugs-announce] [issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server Message-ID: <1512066205.79.0.213398074469.issue32186@psf.upfronthosting.co.za> New submission from Nir Soffer : Using io.FileIO can hang all threads when accessing an inaccessible NFS server. To reproduce this, you need to open the file like this: fd = os.open(filename, ...) fio = io.FileIO(fd, "r+", closefd=True) Inside fileio_init, there is a checkfd call, calling fstat without releasing the GIL. This will hang all threads. The expected behavior is blocking only the thread blocked on the system call, so a system stay responsive and can serve other tasks. Here is the log showing this issue, created with the attached reproducer script (fileio_nfs_test.py). # python fileio_nfs_test.py mnt/fileio.out dumbo.tlv.redhat.com 2017-11-30 18:41:49,159 - (MainThread) - pid=3436 2017-11-30 18:41:49,159 - (MainThread) - Opening mnt/fileio.out 2017-11-30 18:41:49,160 - (MainThread) - OK fd=3 2017-11-30 18:41:49,161 - (MainThread) - Starting canary thread 2017-11-30 18:41:49,161 - (Canary) - Blocking access to storage 2017-11-30 18:41:49,169 - (Canary) - If this test is hang, please run: iptables -D OUTPUT -p tcp -d dumbo.tlv.redhat.com --dport 2049 -j DROP 2017-11-30 18:41:49,169 - (Canary) - check 0 2017-11-30 18:41:49,169 - (MainThread) - Waiting until storage is blocked... 2017-11-30 18:41:50,170 - (Canary) - check 1 2017-11-30 18:41:51,170 - (Canary) - check 2 2017-11-30 18:41:52,171 - (Canary) - check 3 2017-11-30 18:41:53,171 - (Canary) - check 4 2017-11-30 18:41:54,172 - (Canary) - check 5 2017-11-30 18:41:55,172 - (Canary) - check 6 2017-11-30 18:41:56,172 - (Canary) - check 7 2017-11-30 18:41:57,173 - (Canary) - check 8 2017-11-30 18:41:58,173 - (Canary) - check 9 2017-11-30 18:41:59,174 - (MainThread) - Opening io.FileIO Everything is hang now! After some time I run this from another shell: iptables -D OUTPUT -p tcp -d dumbo.tlv.redhat.com --dport 2049 -j DROP And now the script is unblocked and finish. 2017-11-30 18:45:29,683 - (MainThread) - OK 2017-11-30 18:45:29,684 - (MainThread) - Creating mmap 2017-11-30 18:45:29,684 - (Canary) - check 10 2017-11-30 18:45:29,684 - (MainThread) - OK 2017-11-30 18:45:29,685 - (MainThread) - Filling mmap 2017-11-30 18:45:29,685 - (MainThread) - OK 2017-11-30 18:45:29,685 - (MainThread) - Writing mmap to storage 2017-11-30 18:45:29,719 - (MainThread) - OK 2017-11-30 18:45:29,719 - (MainThread) - Syncing 2017-11-30 18:45:29,719 - (MainThread) - OK 2017-11-30 18:45:29,720 - (MainThread) - Done We have a canary thread logging every second. Once we tried to open the FileIO, the canary thread stopped - this is possible only if the io extension module was holding the GIL during a blocking call. And here is the backtrace of the hang process in the kernel: # cat /proc/3436/stack [] rpc_wait_bit_killable+0x24/0xb0 [sunrpc] [] __rpc_execute+0x154/0x410 [sunrpc] [] rpc_execute+0x68/0xb0 [sunrpc] [] rpc_run_task+0xf6/0x150 [sunrpc] [] nfs4_call_sync_sequence+0x63/0xa0 [nfsv4] [] _nfs4_proc_getattr+0xcc/0xf0 [nfsv4] [] nfs4_proc_getattr+0x72/0xf0 [nfsv4] [] __nfs_revalidate_inode+0xbf/0x310 [nfs] [] nfs_getattr+0x95/0x250 [nfs] [] vfs_getattr+0x46/0x80 [] vfs_fstat+0x45/0x80 [] SYSC_newfstat+0x24/0x60 [] SyS_newfstat+0xe/0x10 [] system_call_fastpath+0x16/0x1b [] 0xffffffffffffffff You cannot attach to the process with gdb, since it is in D state, but once the process is unblocked, gbd takes control, and we see: Thread 2 (Thread 0x7f97a2ea5700 (LWP 4799)): #0 0x00007f97ab925a0b in do_futex_wait.constprop.1 () from /lib64/libpthread.so.0 #1 0x00007f97ab925a9f in __new_sem_wait_slow.constprop.0 () from /lib64/libpthread.so.0 #2 0x00007f97ab925b3b in sem_wait@@GLIBC_2.2.5 () from /lib64/libpthread.so.0 #3 0x00007f97abc455f5 in PyThread_acquire_lock () from /lib64/libpython2.7.so.1.0 #4 0x00007f97abc11156 in PyEval_RestoreThread () from /lib64/libpython2.7.so.1.0 #5 0x00007f97a44f9086 in time_sleep () from /usr/lib64/python2.7/lib-dynload/timemodule.so #6 0x00007f97abc18bb0 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #7 0x00007f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0 #8 0x00007f97abc183fc in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #9 0x00007f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0 #10 0x00007f97abc183fc in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #11 0x00007f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0 #12 0x00007f97abba494d in function_call () from /lib64/libpython2.7.so.1.0 #13 0x00007f97abb7f9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0 #14 0x00007f97abc135bd in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #15 0x00007f97abc1857d in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #16 0x00007f97abc1857d in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #17 0x00007f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0 #18 0x00007f97abba4858 in function_call () from /lib64/libpython2.7.so.1.0 #19 0x00007f97abb7f9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0 #20 0x00007f97abb8e995 in instancemethod_call () from /lib64/libpython2.7.so.1.0 #21 0x00007f97abb7f9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0 #22 0x00007f97abc117b7 in PyEval_CallObjectWithKeywords () from /lib64/libpython2.7.so.1.0 #23 0x00007f97abc496e2 in t_bootstrap () from /lib64/libpython2.7.so.1.0 #24 0x00007f97ab91fe25 in start_thread () from /lib64/libpthread.so.0 #25 0x00007f97aaf4434d in clone () from /lib64/libc.so.6 Thread 1 (Thread 0x7f97ac10d740 (LWP 4798)): #0 0x00007f97aaf35154 in _fxstat () from /lib64/libc.so.6 #1 0x00007f97a470ad32 in fileio_init () from /usr/lib64/python2.7/lib-dynload/_io.so #2 0x00007f97abbd565f in type_call () from /lib64/libpython2.7.so.1.0 #3 0x00007f97abb7f9a3 in PyObject_Call () from /lib64/libpython2.7.so.1.0 #4 0x00007f97abc140f6 in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0 #5 0x00007f97abc1aefd in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0 Missing separate debuginfos, use: debuginfo-install python-2.7.5-58.el7.x86_64 ---Type to continue, or q to quit--- #6 0x00007f97abc1b002 in PyEval_EvalCode () from /lib64/libpython2.7.so.1.0 #7 0x00007f97abc3443f in run_mod () from /lib64/libpython2.7.so.1.0 #8 0x00007f97abc355fe in PyRun_FileExFlags () from /lib64/libpython2.7.so.1.0 #9 0x00007f97abc36889 in PyRun_SimpleFileExFlags () from /lib64/libpython2.7.so.1.0 #10 0x00007f97abc47a3f in Py_Main () from /lib64/libpython2.7.so.1.0 #11 0x00007f97aae6dc05 in __libc_start_main () from /lib64/libc.so.6 #12 0x000000000040071e in _start () Looking at python code - there are two helpers in fileio.c that call fstat without releasing the GIL during the call: - https://github.com/python/cpython/blob/2.7/Modules/_io/fileio.c#L145 - https://github.com/python/cpython/blob/2.7/Modules/_io/fileio.c#L161 And both helpers are called from fileio_init (the implementation of io.FileIO()) - https://github.com/python/cpython/blob/2.7/Modules/_io/fileio.c#L332 - https://github.com/python/cpython/blob/2.7/Modules/_io/fileio.c#L366 Reported by RHV user, see https://bugzilla.redhat.com/1518676 (the bug may be private, sorry if you cannot access it). ---------- components: Extension Modules files: fileio_nfs_test.py messages: 307335 nosy: nirs priority: normal severity: normal status: open title: io.FileIO hang all threads if fstat blocks on inaccessible NFS server versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47309/fileio_nfs_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 15:06:47 2017 From: report at bugs.python.org (nartes) Date: Thu, 30 Nov 2017 20:06:47 +0000 Subject: [New-bugs-announce] [issue32187] tab completion fails in pdb/ipdb/ipython for python3.8 Message-ID: <1512072407.44.0.213398074469.issue32187@psf.upfronthosting.co.za> New submission from nartes : Python 3.7.0a2+ (heads/master:bc8ac6b00e, Nov 30 2017, 22:14:00) Type 'copyright', 'credits' or 'license' for more information IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: import multiException in thread Thread-38: Traceback (most recent call last): File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py", line 265, in load_grammar return _loaded_grammars[path] KeyError: '/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/python/grammar37.txt' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py", line 268, in load_grammar with open(path) as f: FileNotFoundError: [Errno 2] No such file or directory: '/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/python/grammar37.txt' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/prompt_toolkit/interface.py", line 865, in run completions = list(buffer.completer.get_completions(document, complete_event)) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/terminal/ptutils.py", line 84, in get_completions yield from self._get_completions(body, offset, cursor_position, self.ipy_completer) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/terminal/ptutils.py", line 94, in _get_completions for c in completions: File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py", line 438, in _deduplicate_completions completions = list(completions) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py", line 1791, in completions for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000): File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py", line 1831, in _completions full_text=full_text, cursor_line=cursor_line, cursor_pos=cursor_column) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py", line 1998, in _complete cursor_pos, cursor_line, full_text) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/IPython/core/completer.py", line 1348, in _jedi_matches text, namespaces, column=cursor_column, line=cursor_line + 1) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/jedi/api/__init__.py", line 386, in __init__ super(Interpreter, self).__init__(source, **kwds) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/jedi/api/__init__.py", line 110, in __init__ self._grammar = parso.load_grammar() File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py", line 283, in load_grammar return load_grammar(**kwargs) File "/home/nartes/Documents/current/cpython/tmp/install/lib/python3.7/site-packages/parso/grammar.py", line 275, in load_grammar raise NotImplementedError(message) NotImplementedError: Python version None is currently not supported. ---------- files: Screenshot from 2017-11-30 23-04-28.png messages: 307339 nosy: nartes priority: normal severity: normal status: open title: tab completion fails in pdb/ipdb/ipython for python3.8 type: crash versions: Python 3.7 Added file: https://bugs.python.org/file47310/Screenshot from 2017-11-30 23-04-28.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 19:10:50 2017 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Fri, 01 Dec 2017 00:10:50 +0000 Subject: [New-bugs-announce] [issue32188] ImpImporter.find_modules removes symlinks in paths Message-ID: <1512087050.24.0.213398074469.issue32188@psf.upfronthosting.co.za> New submission from Henk-Jaap Wagenaar : ImpImporter.find_modules calls os.path.real on the path used: https://github.com/python/cpython/blob/be6b74c0795b709c7a04e2187a7e32d08f5155f6/Lib/pkgutil.py#L181 This means if there is a submodule (foo.bar) which first appears on the path involving a symlink that pkgutil.find_loader('foo').get_filename() has the path with the symlinks removed whereas import foo foo.__file__ does have the symlinks. Note that is in the absence of any PEP302 import hooks. This behaviour comes up in pytest test/plugin collection in virtual environments in Py2.7 on linux where they have a symlinked venv/local/lib before venv/lib on the path and creates problems. There might very well be a good reason the path is made absolute here, however the test suite passes when it is reverted to path = [self.path]. ---------- components: Library (Lib) messages: 307353 nosy: Henk-Jaap Wagenaar priority: normal severity: normal status: open title: ImpImporter.find_modules removes symlinks in paths type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Nov 30 23:57:38 2017 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 01 Dec 2017 04:57:38 +0000 Subject: [New-bugs-announce] [issue32189] SyntaxError for yield expressions inside comprehensions & genexps Message-ID: <1512104258.87.0.213398074469.issue32189@psf.upfronthosting.co.za> New submission from Nick Coghlan : This is the Python 3.8 follow-up to turn the DeprecationWarning from https://bugs.python.org/issue10544 into an unconditional SyntaxError. ---------- messages: 307360 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: SyntaxError for yield expressions inside comprehensions & genexps type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________