From report at bugs.python.org Thu Dec 1 00:43:38 2016 From: report at bugs.python.org (wim glenn) Date: Thu, 01 Dec 2016 05:43:38 +0000 Subject: [New-bugs-announce] [issue28848] Add CopyingMock to mock.py Message-ID: <1480571018.23.0.434543002887.issue28848@psf.upfronthosting.co.za> New submission from wim glenn: Would people be interested to consider adding the CopyingMock example shown in the documentation section "coping with mutable arguments" into the mock module? https://docs.python.org/3/library/unittest.mock-examples.html#coping-with-mutable-arguments It seems like a useful and simple enough feature to add. ---------- components: Library (Lib) messages: 282136 nosy: wim.glenn priority: normal severity: normal status: open title: Add CopyingMock to mock.py versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 1 03:06:07 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Thu, 01 Dec 2016 08:06:07 +0000 Subject: [New-bugs-announce] [issue28849] do not define sys.implementation._multiarch on Android Message-ID: <1480579567.9.0.848858013461.issue28849@psf.upfronthosting.co.za> New submission from Xavier de Gaye: Android is not a multiarch system and the unix build system can cross compile non-multiarch systems as well as multiarch systems. This is a follow up of the decisions implemented in issue 28046 and the patch fixes also an oversight made in this issue in Makefile.pre.in. Also tested with the patch in issue 28833 that implements cross compilation of third-party extension modules. Please run autoconf after installing the patch. ---------- assignee: xdegaye components: Cross-Build files: android_multiarch.patch keywords: patch messages: 282140 nosy: Alex.Willmer, Chi Hsuan Yen, doko, haypo, ned.deily, xdegaye, zach.ware priority: normal severity: normal stage: patch review status: open title: do not define sys.implementation._multiarch on Android type: behavior versions: Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45717/android_multiarch.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 1 06:45:23 2016 From: report at bugs.python.org (=?utf-8?q?Michael_En=C3=9Flin?=) Date: Thu, 01 Dec 2016 11:45:23 +0000 Subject: [New-bugs-announce] [issue28850] Regression in Python 3: Subclassing PrettyPrinter.format doesn't work anymore Message-ID: <1480592723.97.0.369129599105.issue28850@psf.upfronthosting.co.za> New submission from Michael En?lin: This issue was previously addressed and fixed here: http://bugs.python.org/issue1351692 When subclassing PrettyPrinter, overriding the format() method should allow users to define custom pretty-printers. However, for objects whose repr is short, format() is not called for the individual members. Example code that reproduces the issue is as follows: import pprint import sys pprint.pprint(sys.version_info) class MyPrettyPrinter(pprint.PrettyPrinter): def format(self, object, context, maxlevels, level): if isinstance(object, int): return hex(object), True, False else: return pprint.PrettyPrinter.format(self, object, context, maxlevels, level) MyPrettyPrinter().pprint(10) MyPrettyPrinter().pprint([10]) When run with different versions of Python: sys.version_info(major=2, minor=7, micro=11, releaselevel='final', serial=0) 0xa [0xa] (3, 0, 1, 'final', 0) 0xa [10] sys.version_info(major=3, minor=2, micro=5, releaselevel='final', serial=0) 0xa [10] sys.version_info(major=3, minor=4, micro=4, releaselevel='final', serial=0) 0xa [10] sys.version_info(major=3, minor=6, micro=0, releaselevel='beta', serial=4) 0xa [10] You'll notice that the regression exists in all versions >= 3.0, even though the commit that fixed the issue is still in the log (2008-01-20): https://hg.python.org/cpython/log/3.0/Lib/pprint.py I have not had the time to look at the source of the issue or provide a fix; I might do so tonight. ---------- components: Library (Lib) messages: 282159 nosy: anthonybaxter, doerwalter, georg.brandl, gvanrossum, markhirota, mic_e, rhettinger priority: normal severity: normal status: open title: Regression in Python 3: Subclassing PrettyPrinter.format doesn't work anymore type: behavior versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 1 09:05:35 2016 From: report at bugs.python.org (Francesco Grondona) Date: Thu, 01 Dec 2016 14:05:35 +0000 Subject: [New-bugs-announce] [issue28851] namedtuples field_names sequence preferred Message-ID: <1480601135.13.0.00871251418973.issue28851@psf.upfronthosting.co.za> New submission from Francesco Grondona: A change by mhettinger in the doc of Python 2 years ago implicitely stated a sequence of strings as preferred way to provide 'field_names' to a namedtuple: https://github.com/python/cpython/commit/7be6326e09f2062315f995a18ab54baedfd0c0ff Same change should be integrated in Python 3, I see no reason to prefer the single string version. ---------- assignee: docs at python components: Documentation messages: 282177 nosy: docs at python, peentoon priority: normal severity: normal status: open title: namedtuples field_names sequence preferred type: enhancement versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 1 11:21:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Dec 2016 16:21:27 +0000 Subject: [New-bugs-announce] [issue28852] sorted(range(1000)) is slower in Python 3.7 compared to Python 3.5 Message-ID: <1480609287.7.0.199610846669.issue28852@psf.upfronthosting.co.za> New submission from STINNER Victor: Follow-up of my comment http://bugs.python.org/issue23507#msg282187 : "sorted(list): Median +- std dev: [3.5] 17.5 us +- 1.0 us -> [3.7] 19.7 us +- 1.1 us: 1.12x slower (+12%)" "(...) sorted(list) is slower. I don't know why sorted(list) is slower. It doesn't use a key function, and so should not be impacted by FASTCALL changes made since Python 3.6." ---------- messages: 282194 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: sorted(range(1000)) is slower in Python 3.7 compared to Python 3.5 type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 1 11:54:37 2016 From: report at bugs.python.org (Marco Buttu) Date: Thu, 01 Dec 2016 16:54:37 +0000 Subject: [New-bugs-announce] [issue28853] locals() and free variables Message-ID: <1480611277.06.0.950152525221.issue28853@psf.upfronthosting.co.za> New submission from Marco Buttu: The locals() documentation [1] says that "Free variables are returned by locals() when it is called in function blocks". A free variable inside a function has a global scope, and in fact it is not returned by locals():: >>> x = 33 >>> def foo(): ... print(x) ... print(locals()) ... >>> foo() 33 {} Maybe "function blocks" here means "closure"? Does the doc mean this? >>> def foo(): ... x = 33 ... def moo(): ... print(x) ... print(locals()) ... return moo ... >>> moo = foo() >>> moo() 33 {'x': 33} In that case, I think it is better to write "closures" instead of "function blocks". [1] https://docs.python.org/3/library/functions.html#locals ---------- assignee: docs at python components: Documentation messages: 282200 nosy: docs at python, marco.buttu priority: normal severity: normal status: open title: locals() and free variables type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 1 15:22:40 2016 From: report at bugs.python.org (Christian Heimes) Date: Thu, 01 Dec 2016 20:22:40 +0000 Subject: [New-bugs-announce] [issue28854] FIPS mode causes dead-lock in ssl module Message-ID: <1480623760.67.0.622140819943.issue28854@psf.upfronthosting.co.za> New submission from Christian Heimes: Python's ssl module is dead-locking when OpenSSL is running in FIPS mode. I first noticed it with pip. The issue is also reproducible with Python's test suite. $ sudo touch /etc/system-fips $ OPENSSL_FORCE_FIPS_MODE=1 ./python -m test.regrtest -v test_ssl == CPython 2.7.12+ (2.7:adb296e4bcaa, Dec 1 2016, 21:14:20) [GCC 6.2.1 20160916 (Red Hat 6.2.1-2)] == Linux-4.8.8-200.fc24.x86_64-x86_64-with-fedora-24-Twenty_Four little-endian == /home/heimes/dev/python/2.7/build/test_python_29991 Testing with flags: sys.flags(debug=0, py3k_warning=0, division_warning=0, division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, verbose=0, unicode=0, bytes_warning=0, hash_randomization=0) [1/1] test_ssl test_ssl: testing with 'OpenSSL 1.0.2j-fips 26 Sep 2016' (1, 0, 2, 10, 15) under Linux ('Fedora', '24', 'Twenty Four') HAS_SNI = True OP_ALL = 0x800003ff OP_NO_TLSv1_1 = 0x10000000 test__create_stdlib_context (test.test_ssl.ContextTests) ... ok test__https_verify_certificates (test.test_ssl.ContextTests) ... ok test__https_verify_envvar (test.test_ssl.ContextTests) ... ok test_cert_store_stats (test.test_ssl.ContextTests) ... ok test_check_hostname (test.test_ssl.ContextTests) ... ok test_ciphers (test.test_ssl.ContextTests) ... ok test_constructor (test.test_ssl.ContextTests) ... ERROR test_create_default_context (test.test_ssl.ContextTests) ... ok test_get_ca_certs (test.test_ssl.ContextTests) ... ok test_load_cert_chain (test.test_ssl.ContextTests) ... ERROR test_load_default_certs (test.test_ssl.ContextTests) ... ok test_load_default_certs_env (test.test_ssl.ContextTests) ... ok test_load_default_certs_env_windows (test.test_ssl.ContextTests) ... skipped 'Windows specific' test_load_dh_params (test.test_ssl.ContextTests) ... ok test_load_verify_cadata (test.test_ssl.ContextTests) ... ok test_load_verify_locations (test.test_ssl.ContextTests) ... ok test_options (test.test_ssl.ContextTests) ... ok test_protocol (test.test_ssl.ContextTests) ... ERROR test_session_stats (test.test_ssl.ContextTests) ... ERROR test_set_default_verify_paths (test.test_ssl.ContextTests) ... ok test_set_ecdh_curve (test.test_ssl.ContextTests) ... (gdb) bt #0 0x00007f0d9f8470c7 in do_futex_wait.constprop () from /lib64/libpthread.so.0 #1 0x00007f0d9f847174 in __new_sem_wait_slow.constprop.0 () from /lib64/libpthread.so.0 #2 0x00007f0d9f84721a in sem_wait@@GLIBC_2.2.5 () from /lib64/libpthread.so.0 #3 0x000000000051e013 in PyThread_acquire_lock (lock=0x27433a0, waitflag=1) at Python/thread_pthread.h:324 #4 0x00007f0d937b0dce in _ssl_thread_locking_function (mode=5, n=18, file=0x7f0d96e417ac "fips_drbg_rand.c", line=124) at /home/heimes/dev/python/2.7/Modules/_ssl.c:4000 #5 0x00007f0d96df1d7e in fips_drbg_status () from /lib64/libcrypto.so.10 #6 0x00007f0d96d75b0e in drbg_rand_add () from /lib64/libcrypto.so.10 #7 0x00007f0d96d76645 in RAND_poll () from /lib64/libcrypto.so.10 #8 0x00007f0d96d75237 in ssleay_rand_bytes () from /lib64/libcrypto.so.10 #9 0x00007f0d96d75c33 in drbg_get_entropy () from /lib64/libcrypto.so.10 #10 0x00007f0d96df10c8 in fips_get_entropy () from /lib64/libcrypto.so.10 #11 0x00007f0d96df1226 in drbg_reseed () from /lib64/libcrypto.so.10 #12 0x00007f0d96d75bb8 in drbg_rand_seed () from /lib64/libcrypto.so.10 #13 0x00007f0d96d5da84 in ECDSA_sign_ex () from /lib64/libcrypto.so.10 #14 0x00007f0d96d5db00 in ECDSA_sign () from /lib64/libcrypto.so.10 #15 0x00007f0d96d3bc10 in pkey_ec_sign () from /lib64/libcrypto.so.10 #16 0x00007f0d96d81359 in EVP_SignFinal () from /lib64/libcrypto.so.10 #17 0x00007f0d96def373 in fips_pkey_signature_test () from /lib64/libcrypto.so.10 #18 0x00007f0d96d38fe0 in EC_KEY_generate_key () from /lib64/libcrypto.so.10 #19 0x00007f0d970d7d7c in ssl3_ctx_ctrl () from /lib64/libssl.so.10 #20 0x00007f0d937af934 in set_ecdh_curve (self=0x7f0d92a23f78, name='prime256v1') at /home/heimes/dev/python/2.7/Modules/_ssl.c:3110 #21 0x00000000004d8acc in call_function (pp_stack=0x7ffcc0334730, oparg=1) at Python/ceval.c:4340 #22 0x00000000004d37a9 in PyEval_EvalFrameEx ( f=Frame 0x7f0d929bf460, for file /home/heimes/dev/python/2.7/Lib/test/test_ssl.py, line 1023, in test_set_ecdh_curve (self=, dots=False, skipped=[(, _type_equality_funcs={: 'assertMultiLineEqual', : 'assertTupleEqual', : 'assertSetEqual', : 'assertListEqual', : 'assertDictEqual', : 'assertSetEqual'}, _testMethodDoc=None, _testMethodName='test_load_default_certs_env_windows', _cleanups=[]) at remote 0x7f0d92a80ae0>, 'Windows specific')], _mirrorOutput=False, stream=<_WritelnDecorator(stream=) at remote 0x7f0d93747450>, testsRun=21, buffer=False, _original_stderr=, showAll=True, _stdout_buffer=None, _stderr_buffer=None, _moduleSetUpFailed=False, expectedFailures=[], er...(truncated), throwflag=0) at Python/ceval.c:2989 Python 3's test suite is dead locking in a different test: #0 0x00007f2be93dc0c7 in do_futex_wait.constprop () from /lib64/libpthread.so.0 #1 0x00007f2be93dc174 in __new_sem_wait_slow.constprop.0 () from /lib64/libpthread.so.0 #2 0x00007f2be93dc21a in sem_wait@@GLIBC_2.2.5 () from /lib64/libpthread.so.0 #3 0x0000000000433e5c in PyThread_acquire_lock_timed (lock=0x17c0b40, microseconds=-1, intr_flag=intr_flag at entry=0) at Python/thread_pthread.h:352 #4 0x0000000000433f5e in PyThread_acquire_lock (lock=, waitflag=waitflag at entry=1) at Python/thread_pthread.h:556 #5 0x00007f2be0870945 in _ssl_thread_locking_function (mode=, n=, file=, line=) at /home/heimes/dev/python/cpython/Modules/_ssl.c:5069 #6 0x00007f2be02f4d7e in fips_drbg_status () from /lib64/libcrypto.so.10 #7 0x00007f2be0278b0e in drbg_rand_add () from /lib64/libcrypto.so.10 #8 0x00007f2be0279645 in RAND_poll () from /lib64/libcrypto.so.10 #9 0x00007f2be0278237 in ssleay_rand_bytes () from /lib64/libcrypto.so.10 #10 0x00007f2be0278c33 in drbg_get_entropy () from /lib64/libcrypto.so.10 #11 0x00007f2be02f40c8 in fips_get_entropy () from /lib64/libcrypto.so.10 #12 0x00007f2be02f4226 in drbg_reseed () from /lib64/libcrypto.so.10 #13 0x00007f2be0278b39 in drbg_rand_add () from /lib64/libcrypto.so.10 #14 0x00007f2be0868870 in _ssl_RAND_add_impl (module=module at entry=, view=view at entry=0x7ffd106c1420, entropy=75) at /home/heimes/dev/python/cpython/Modules/_ssl.c:4499 #15 0x00007f2be08688f2 in _ssl_RAND_add (module=, args=) at /home/heimes/dev/python/cpython/Modules/clinic/_ssl.c.h:861 #16 0x00000000004984d3 in _PyCFunction_FastCallDict ( func_obj=func_obj at entry=, args=args at entry=0x18d54b8, nargs=nargs at entry=2, kwargs=kwargs at entry=0x0) at Objects/methodobject.c:234 #17 0x000000000049872a in _PyCFunction_FastCallKeywords ( func=func at entry=, stack=stack at entry=0x18d54b8, nargs=nargs at entry=2, kwnames=kwnames at entry=0x0) at Objects/methodobject.c:295 #18 0x000000000052ad5b in call_function (pp_stack=pp_stack at entry=0x7ffd106c15d8, oparg=oparg at entry=2, kwnames=kwnames at entry=0x0) at Python/ceval.c:4735 ---------- assignee: christian.heimes components: SSL messages: 282202 nosy: christian.heimes priority: normal severity: normal status: open title: FIPS mode causes dead-lock in ssl module type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 1 19:38:43 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Dec 2016 00:38:43 +0000 Subject: [New-bugs-announce] [issue28855] Compiler warnings in _PyObject_CallArg1() Message-ID: <1480639123.61.0.549454845371.issue28855@psf.upfronthosting.co.za> New submission from STINNER Victor: _PyObject_CallArg1() is the following macro: --- #define _PyObject_CallArg1(func, arg) \ _PyObject_FastCall((func), &(arg), 1) --- It works well in most cases, but my change 8f258245c391 or change b9c9691c72c5 added compiler warnings, because an argument which is not directly a PyObject* type is passed as "arg". I tried to cast in the caller: _PyObject_CallArg1(func, (PyObject*)arg), but sadly it doesn't work :-( I get a compiler error. Another option is to cast after "&" in the macro: --- #define _PyObject_CallArg1(func, arg) \ - _PyObject_FastCall((func), &(arg), 1) + _PyObject_FastCall((func), (PyObject **)&(arg), 1) --- This option may hide real bugs, so I dislike it. A better option is to stop using ugly C macros and use a modern static inline function: see attached static_inline.patch. This patch casts to PyObject* before calling _PyObject_CallArg1() to fix warnings. The question is if compilers are able to emit efficient code for static inline functions using "&" on an argument. I wrote the macro to implement the "&" optimization: convert a PyObject* to a stack of arguments: C array of PyObject* objects. ---------- files: static_inline.patch keywords: patch messages: 282212 nosy: benjamin.peterson, haypo, serhiy.storchaka priority: normal severity: normal status: open title: Compiler warnings in _PyObject_CallArg1() versions: Python 3.7 Added file: http://bugs.python.org/file45729/static_inline.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 1 21:30:44 2016 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 02 Dec 2016 02:30:44 +0000 Subject: [New-bugs-announce] [issue28856] %b format for bytes does not support objects that follow the buffer protocol Message-ID: <1480645844.32.0.506545914898.issue28856@psf.upfronthosting.co.za> New submission from Alexander Belopolsky: Python 3.7.0a0 (default:be70d64bbf88, Dec 1 2016, 21:21:25) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from array import array >>> a = array('B', [1, 2]) >>> b'%b' % a Traceback (most recent call last): File "", line 1, in TypeError: %b requires bytes, or an object that implements __bytes__, not 'array.array' >>> m = memoryview(a) >>> b'%b' % m Traceback (most recent call last): File "", line 1, in TypeError: %b requires bytes, or an object that implements __bytes__, not 'memoryview' Accorfing to documentation [1] objects that follow the buffer protocol should be supported. Both array.array and memoryview follow the buffer protocol. [1]: https://docs.python.org/3/library/stdtypes.html#printf-style-bytes-formatting See also issue 20284 and PEP 461. ---------- messages: 282215 nosy: belopolsky priority: normal severity: normal stage: test needed status: open title: %b format for bytes does not support objects that follow the buffer protocol type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 2 01:42:52 2016 From: report at bugs.python.org (Nagarjuna Arigapudi) Date: Fri, 02 Dec 2016 06:42:52 +0000 Subject: [New-bugs-announce] [issue28857] SyncManager and Main Process fail to communicate after reboot or stoping with Ctrl - C Message-ID: <1480660972.34.0.757124295552.issue28857@psf.upfronthosting.co.za> New submission from Nagarjuna Arigapudi: "SyncManager" and "Main Process" and main process look at different directories and fail to communicate, causing shutdown of all process, immediately after start of program. This behavior is seen in both 2.7 and 3.5. The logging of 2.7 is more clear, It tells the file name it is looking for. Extract of Program: manager = Manager() lst1 = manager.list([[]]*V1) lst2 = manager.list(range(v2)) lst3 = manager.list([0]*V3) lst4 = manager.list([0]*V3) lst5 = manager.list([0]*V3) initializeData(lst1,lst2,lst3,lst4,lst5) procs = [] for indx in range(noOfProcs): procs.append(Process(target=workerProc, args=(lst1,lst2,lst3,lst4,lst5))) procs[indx].start() bContinueWorking = True while (bContinueWorking): logger.debug("Main thread about to sleep") time.sleep(300) globLOCK.acquire() if(not lst1): bContinueWorking = False try: doPickle(lst1) except Exception, ep: logger.error("failed to pickle" +str(ep)) finally: globLOCK.release() ________________________________________________________ The program works well. but if the program is terminated, it will not start back. rebooting or cleaning temporary files does not fix the issue. below is log when it fails. ( beneath the log is other log where it runs successfully) FAIL LOG [DEBUG/MainProcess] Star of Application [DEBUG/MainProcess] created semlock with handle 139965318860800 [DEBUG/MainProcess] created semlock with handle 139965318856704 [DEBUG/MainProcess] created semlock with handle 139965318852608 [DEBUG/MainProcess] created semlock with handle 139965318848512 [DEBUG/MainProcess] created semlock with handle 139965318844416 [DEBUG/MainProcess] created semlock with handle 139965318840320 [INFO/SyncManager-1] child process calling self.run() ***[INFO/SyncManager-1] created temp directory /tmp/pymp-xTqdkd*** [DEBUG/MainProcess] requesting creation of a shared 'list' object [INFO/SyncManager-1] manager serving at '/tmp/pymp-xTqdkd/listener-eDG1yJ' [DEBUG/SyncManager-1] 'list' callable returned object with id '7f4c34316f80' [DEBUG/MainProcess] INCREF '7f4c34316f80' [DEBUG/MainProcess] requesting creation of a shared 'list' object [DEBUG/SyncManager-1] 'list' callable returned object with id '7f4c3432a758' [DEBUG/MainProcess] INCREF '7f4c3432a758' [DEBUG/MainProcess] requesting creation of a shared 'list' object [DEBUG/SyncManager-1] 'list' callable returned object with id '7f4c3432a7a0' [DEBUG/MainProcess] INCREF '7f4c3432a7a0' [DEBUG/MainProcess] requesting creation of a shared 'list' object [DEBUG/SyncManager-1] 'list' callable returned object with id '7f4c3432a7e8' [DEBUG/MainProcess] INCREF '7f4c3432a7e8' [DEBUG/MainProcess] requesting creation of a shared 'list' object [DEBUG/SyncManager-1] 'list' callable returned object with id '7f4c3432a830' [DEBUG/MainProcess] INCREF '7f4c3432a830' [DEBUG/MainProcess] thread 'MainThread' does not own a connection [DEBUG/MainProcess] making connection to manager [DEBUG/SyncManager-1] starting server thread to service 'MainProcess' ***[DEBUG/MainProcess] failed to connect to address /tmp/pymp-LOMHoT/listener-EbLeup*** [Errno 2] No such file or directory Initialization failed Exiting [INFO/MainProcess] process shutting down SUCCESS LOG [DEBUG/MainProcess] Star of Application [DEBUG/MainProcess] created semlock with handle 139830888992768 [DEBUG/MainProcess] created semlock with handle 139830888988672 [DEBUG/MainProcess] created semlock with handle 139830888984576 [DEBUG/MainProcess] created semlock with handle 139830888980480 [DEBUG/MainProcess] created semlock with handle 139830888976384 [DEBUG/MainProcess] created semlock with handle 139830888972288 [INFO/SyncManager-1] child process calling self.run() [INFO/SyncManager-1] created temp directory /tmp/pymp-UiHuij [DEBUG/MainProcess] requesting creation of a shared 'list' object [INFO/SyncManager-1] manager serving at '/tmp/pymp-UiHuij/listener-lS7hf5' [DEBUG/SyncManager-1] 'list' callable returned object with id '7f2ce78c6f80' [DEBUG/MainProcess] INCREF '7f2ce78c6f80' [DEBUG/MainProcess] requesting creation of a shared 'list' object [DEBUG/SyncManager-1] 'list' callable returned object with id '7f2ce78da758' [DEBUG/MainProcess] INCREF '7f2ce78da758' [DEBUG/MainProcess] requesting creation of a shared 'list' object [DEBUG/SyncManager-1] 'list' callable returned object with id '7f2ce78da7a0' [DEBUG/MainProcess] INCREF '7f2ce78da7a0' [DEBUG/MainProcess] requesting creation of a shared 'list' object [DEBUG/SyncManager-1] 'list' callable returned object with id '7f2ce78da7e8' [DEBUG/MainProcess] INCREF '7f2ce78da7e8' [DEBUG/MainProcess] requesting creation of a shared 'list' object [DEBUG/SyncManager-1] 'list' callable returned object with id '7f2ce78da830' [DEBUG/MainProcess] INCREF '7f2ce78da830' [DEBUG/MainProcess] thread 'MainThread' does not own a connection [DEBUG/MainProcess] making connection to manager [DEBUG/SyncManager-1] starting server thread to service 'MainProcess' [DEBUG/MainProcess] Main thread about to sleep [DEBUG/Process-7] INCREF '7f2ce78c6f80' [DEBUG/Process-6] INCREF '7f2ce78c6f80' [DEBUG/Process-5] INCREF '7f2ce78c6f80' [DEBUG/Process-4] INCREF '7f2ce78c6f80' [DEBUG/Process-3] INCREF '7f2ce78c6f80' [DEBUG/Process-2] INCREF '7f2ce78c6f80' [DEBUG/Process-6] INCREF '7f2ce78da758' [DEBUG/Process-7] INCREF '7f2ce78da758' [DEBUG/Process-5] INCREF '7f2ce78da758' [DEBUG/Process-4] INCREF '7f2ce78da758' [DEBUG/Process-3] INCREF '7f2ce78da758' [DEBUG/Process-2] INCREF '7f2ce78da758' [DEBUG/Process-6] INCREF '7f2ce78da7a0' [DEBUG/Process-7] INCREF '7f2ce78da7a0' [DEBUG/Process-5] INCREF '7f2ce78da7a0' [DEBUG/Process-4] INCREF '7f2ce78da7a0' [DEBUG/Process-3] INCREF '7f2ce78da7a0' [DEBUG/Process-2] INCREF '7f2ce78da7a0' [DEBUG/Process-6] INCREF '7f2ce78da7e8' [DEBUG/Process-7] INCREF '7f2ce78da7e8' [DEBUG/Process-5] INCREF '7f2ce78da7e8' [DEBUG/Process-4] INCREF '7f2ce78da7e8' [DEBUG/Process-3] INCREF '7f2ce78da7e8' [DEBUG/Process-2] INCREF '7f2ce78da7e8' [DEBUG/Process-6] INCREF '7f2ce78da830' [INFO/Process-6] child process calling self.run() [DEBUG/Process-6] thread 'MainThread' does not own a connection [DEBUG/Process-6] making connection to manager [DEBUG/Process-7] INCREF '7f2ce78da830' [INFO/Process-7] child process calling self.run() ---------- components: Extension Modules, Interpreter Core messages: 282223 nosy: Nagarjuna Arigapudi priority: normal severity: normal status: open title: SyncManager and Main Process fail to communicate after reboot or stoping with Ctrl - C type: crash versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 2 02:54:27 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Dec 2016 07:54:27 +0000 Subject: [New-bugs-announce] [issue28858] Fastcall uses more C stack Message-ID: <1480665267.65.0.416366810047.issue28858@psf.upfronthosting.co.za> New submission from STINNER Victor: Serhiy Storchaka reported that Python 3.6 crashs earlier than Python 3.5 on calling json.dumps() when sys.setrecursionlimit() is increased. I tested the script he wrote. Results on Python built in release mode: Python 3.7: ... 58100 116204 Segmentation fault (core dumped) Python 3.6: ... 74800 149604 Segmentation fault (core dumped) Python 3.5: ... 74700 149404 Segmentation fault (core dumped) Oh, it seems like Python 3.7 does crash earlier. But to be clear, it's hard to control the usage of the C stack. ---------- files: stack_overflow.py messages: 282228 nosy: haypo priority: normal severity: normal status: open title: Fastcall uses more C stack versions: Python 3.7 Added file: http://bugs.python.org/file45731/stack_overflow.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 2 09:39:20 2016 From: report at bugs.python.org (Christoph Reiter) Date: Fri, 02 Dec 2016 14:39:20 +0000 Subject: [New-bugs-announce] [issue28859] os.path.mount sometimes raises FileNotFoundError on Windows Message-ID: <1480689560.28.0.129916928722.issue28859@psf.upfronthosting.co.za> New submission from Christoph Reiter: It returns True for drives which don't exist and raises for paths starting with drives which don't exist. >>> os.path.exists("C:\\") True >>> os.path.ismount("C:\\") True >>> os.path.ismount("C:\\doesnotexist") False >>> os.path.exists("F:\\") False >>> os.path.ismount("F:\\") True >>> os.path.ismount("F:\\doesnotexist") Traceback (most recent call last): File "", line 1, in File "C:\Users\lazka\AppData\Local\Programs\Python\Python35\lib\ntpath.py", line 290, in ismount return path.rstrip(seps) == _getvolumepathname(path).rstrip(seps) FileNotFoundError: [WinError 2] The system cannot find the file specified: 'F:\\doesnotexist' ---------- components: Windows messages: 282241 nosy: lazka, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: os.path.mount sometimes raises FileNotFoundError on Windows versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 2 17:28:32 2016 From: report at bugs.python.org (Marco Buttu) Date: Fri, 02 Dec 2016 22:28:32 +0000 Subject: [New-bugs-announce] [issue28860] Fixed all the doctest failures in Doc/library/configparser.rst Message-ID: <1480717712.23.0.651677304063.issue28860@psf.upfronthosting.co.za> New submission from Marco Buttu: With Python 3.7.0a0 and sphinx-build 1.4.9, this was the result before applying the patch: Doctest summary =============== 80 tests 8 failures in tests 0 failures in setup code 0 failures in cleanup code build finished with problems, 139 warnings. After applaying the patch there are 0 failures in 84 tests. All the doctests also pass with Python 3.6 and 3.5. I skipped three tests (doctest: +SKIP) because their output is random (iterating over dictionary keys). ---------- assignee: docs at python components: Documentation files: configparser.patch keywords: patch messages: 282258 nosy: docs at python, marco.buttu priority: normal severity: normal status: open title: Fixed all the doctest failures in Doc/library/configparser.rst type: enhancement versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45733/configparser.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 3 15:48:45 2016 From: report at bugs.python.org (YoSTEALTH) Date: Sat, 03 Dec 2016 20:48:45 +0000 Subject: [New-bugs-announce] [issue28861] Type Hints Syntax Message-ID: <1480798125.09.0.140898215567.issue28861@psf.upfronthosting.co.za> New submission from YoSTEALTH: Type Hints Syntax ----------------- Goal: Is to make it easy to read function/methods arguments, yet keep the new and cool Type Hints. For example this is a code from one of my function. Its getting to that point of what the heck is going on here? def find_replace(string: str, find: (str, dict, list, tuple, set), replace: (str, list, tuple, set)='') -> str: pass I know it can be rewritten as: T = (str, dict, list, tuple, set) def find_replace(string: str, find: T, replace: T='') -> str: pass But when you start using variable to represent another variables type... maybe we are losing the plot here! What if we could have both? Readability and type reference, what if it could be written as: def find_replace(string, find, replace): targ str, *(str, dict, list, tuple, set) -> str # code here ... targ = type argument (like *args and **kwargs) Calling a "targ" like we call "global" but to represent types. Simple Examples: def Redirect(url='', code=301): targ (str, int) -> None Just think about it... ---------- messages: 282304 nosy: YoSTEALTH priority: normal severity: normal status: open title: Type Hints Syntax type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 3 16:32:18 2016 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 03 Dec 2016 21:32:18 +0000 Subject: [New-bugs-announce] [issue28862] test_import.py leaks on 2.7 Message-ID: <1480800738.41.0.861957002748.issue28862@psf.upfronthosting.co.za> New submission from Benjamin Peterson: It looks like the test if not the fix for #15578 reveals a reference leak somewhere in the import system: $ ./python Lib/test/regrtest.py -R :: test_import [1/1] test_import beginning 9 repetitions 123456789 ......... test_import leaked [1, 1, 1, 1] references, sum=4 Warning -- sys.path was modified by test_import 1 test failed: test_import [57131 refs] ---------- messages: 282305 nosy: benjamin.peterson, eric.snow priority: normal severity: normal status: open title: test_import.py leaks on 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 3 16:48:05 2016 From: report at bugs.python.org (Marco Buttu) Date: Sat, 03 Dec 2016 21:48:05 +0000 Subject: [New-bugs-announce] [issue28863] Doc/includes/*.py files and doctests Message-ID: <1480801685.13.0.102040139052.issue28863@psf.upfronthosting.co.za> New submission from Marco Buttu: In the Doc/includes directory, some of the *.py file names have a dash character. For instance: Doc/includes/tzinfo-examples.py. I am trying to make all of the code examples pass the doctests, and I usually need to import from these files some code. Importing from these modules also allow us to test them, and I think that is important because their code is included in the documentation. There are two problems: 1) I can not directly import them, because of the - character, so I have to use __import__('file-name') and write other ugly tricks. I can import them in the setuptests, so the reader will not see these imports, but it is still ugly, and in addition the code examples will be not complete, and the reader will not be able to try the code 2) the dash in the file names is un-pythonic. As the PEP 0008 says, the preferred way is to use underscores: "Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability." In conclusion, I propose to change the Doc/includes/*.py file names, replacing the dash character with an underscore. If you agree, I will do it step by step: I will change each file name only when I will work with the related documentation and code examples. PS. To include these files in the code examples, I also need to add the Doc/includes directory to the sys.path (in conf.py). ---------- assignee: docs at python components: Documentation messages: 282307 nosy: docs at python, marco.buttu priority: normal severity: normal status: open title: Doc/includes/*.py files and doctests type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 3 22:36:35 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Dec 2016 03:36:35 +0000 Subject: [New-bugs-announce] [issue28864] Add devnull file-like object Message-ID: <1480822595.87.0.853337900572.issue28864@psf.upfronthosting.co.za> New submission from Raymond Hettinger: Uses cases are the same as /dev/null: with redirect_stderr(io.DevNull()): some_func_using_stdout_and_stderr() ---------- messages: 282314 nosy: ncoghlan, pitrou, rhettinger priority: low severity: normal status: open title: Add devnull file-like object type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 4 07:14:37 2016 From: report at bugs.python.org (Mikhail) Date: Sun, 04 Dec 2016 12:14:37 +0000 Subject: [New-bugs-announce] [issue28865] [MinGW32-x64]-PyList_Check PyDict_Check does not work Message-ID: <1480853677.86.0.114330805471.issue28865@psf.upfronthosting.co.za> New submission from Mikhail: Windows 10 x64 Python 3.4, 3.5, Anaconda3 4.2 - x64 SWIG 3.0.8, 3.0.10 MinGW32/64 - TDM-GCC-64 5.1.0-2, x86_64-5.3.0-win32-sjlj-rt_v4-rev0, x86_64-6.2.0-win32-sjlj-rt_v5-rev1 The code in C compiles fine, there are no warnings. But then, in the finished module, do not work C-API functions such as: PyList_Check PyDict_Check PyDict_Next PyObject *result = PyList_New(1); printf("%i \n", PyList_Check(result)); Check always returns zero, even if the object is created in the previous line. But PyMapping_Check works fine ---------- components: Build, Distutils, Windows messages: 282333 nosy: dstufft, eric.araujo, mifik, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [MinGW32-x64]-PyList_Check PyDict_Check does not work type: resource usage versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 4 09:35:45 2016 From: report at bugs.python.org (sjpalt) Date: Sun, 04 Dec 2016 14:35:45 +0000 Subject: [New-bugs-announce] [issue28866] Unexpected behavior resulting from mro() and __setattr__ in interactive mode Message-ID: <1480862145.72.0.468660451957.issue28866@psf.upfronthosting.co.za> New submission from sjpalt: I ran into a strange bug while experimenting with metaclasses that implement a custom mro() method. It only seems to occur in interactive mode, either returning completely unrelated values or causing a segfault. Python 2 appears unaffected. I have been able to reproduce this with the following code: # $ python -i weird.py # >>> proxy.x # 52011448 # >>> proxy.x # 6160 # ... class Foo: pass class Meta(type): def mro(cls): return (cls, Foo, object) def __setattr__(cls, name, value): setattr(Foo, name, value) proxy = Meta('FooProxy', (), {}) proxy.x = 300 proxy.x # don't omit proxy.x = 0 ---------- components: Interpreter Core files: weird.py messages: 282344 nosy: sjpalt priority: normal severity: normal status: open title: Unexpected behavior resulting from mro() and __setattr__ in interactive mode type: crash versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file45752/weird.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 4 12:47:27 2016 From: report at bugs.python.org (Jon Dufresne) Date: Sun, 04 Dec 2016 17:47:27 +0000 Subject: [New-bugs-announce] [issue28867] NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile) Message-ID: <1480873647.39.0.877280517926.issue28867@psf.upfronthosting.co.za> New submission from Jon Dufresne: When using unittest, I'll frequently enable -Wall to help catch code smells and potential bugs. One feature of this, I'm told when files aren't explicitly closed with an error like: "ResourceWarning: unclosed file <...>". I've noticed this warning is generated for an unclosed tempfile.TemporaryFile (good), but not for an unclosed tempfile.NamedTemporaryFile (possible bug). I've verified this on Python 3.5 and 3.6. Example test: ``` import tempfile import unittest class MyTest(unittest.TestCase): def test_temporary_file(self): tempfile.TemporaryFile() def test_named_temporary_file(self): tempfile.NamedTemporaryFile() ``` Actual output: ``` $ Python-3.6.0b4/python --version Python 3.6.0b4 $ Python-3.6.0b4/python -Wall -m unittest -v test test_named_temporary_file (test.MyTest) ... ok test_temporary_file (test.MyTest) ... /home/jon/test.py:7: ResourceWarning: unclosed file <_io.BufferedRandom name=3> tempfile.TemporaryFile() ok ---------------------------------------------------------------------- Ran 2 tests in 0.004s OK ``` Expected: I expect both tests to generate a ResourceWarning, as neither test explicitly closes the file. ---------- components: Library (Lib) messages: 282352 nosy: jdufresne priority: normal severity: normal status: open title: NamedTemporaryFile does not generate a ResourceWarning for unclosed files (unlike TemporaryFile) type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 4 15:58:50 2016 From: report at bugs.python.org (rm) Date: Sun, 04 Dec 2016 20:58:50 +0000 Subject: [New-bugs-announce] [issue28868] Python advertising BeOpen.com domain Message-ID: <1480885130.58.0.883426761296.issue28868@psf.upfronthosting.co.za> New submission from rm: There is BeOpen attribution in __builtins__() call, that may confuse users and generate some traffic to unrelated domain. For example: >>> import smtplib >>> smtplib.__builtins__ <...> Copyright (c) 2000 BeOpen.com. All Rights Reserved. <...> but beopen.com resolves to domain hosting stub page. May be this string should be changed to just BeOpen, or removed altogether. ---------- assignee: docs at python components: Documentation messages: 282361 nosy: cvs-src, docs at python priority: normal severity: normal status: open title: Python advertising BeOpen.com domain versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 4 16:09:34 2016 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sun, 04 Dec 2016 21:09:34 +0000 Subject: [New-bugs-announce] [issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call Message-ID: <1480885774.84.0.670239959771.issue28869@psf.upfronthosting.co.za> New submission from Ivan Levkivskyi: __module__ attribute is set differently depending on whether a metaclass is explicitly called or invoked in a class statement: >>> A = ABCMeta('A', (), {}) >>> A.__module__ 'abc' >>> class B(metaclass=ABCMeta): ... ... >>> B.__module__ '__main__' Documentation on data model says that "__module__ is the module name in which the class was defined", so that the second behaviour seems right, while the first behaviour seems wrong to me. ---------- components: Interpreter Core messages: 282363 nosy: levkivskyi priority: normal severity: normal status: open title: __module__ attribute is not set correctly for a class created by direct metaclass call versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 4 17:50:13 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Dec 2016 22:50:13 +0000 Subject: [New-bugs-announce] [issue28870] Refactor PyObject_CallFunctionObjArgs() and like Message-ID: <1480891813.94.0.54795440575.issue28870@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Following patch I wrote in attempt to decrease a stack consumption of PyObject_CallFunctionObjArgs(), PyObject_CallMethodObjArgs() and _PyObject_CallMethodIdObjArgs(). But it doesn't affect a stack consumption. I still didn't measured what performance effect it has. Seems it makes a code a little cleaner. ---------- components: Interpreter Core files: PyObject_CallFunctionObjArgs.patch keywords: patch messages: 282374 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: Refactor PyObject_CallFunctionObjArgs() and like type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45758/PyObject_CallFunctionObjArgs.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 4 18:03:24 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Dec 2016 23:03:24 +0000 Subject: [New-bugs-announce] [issue28871] Destructor of ElementTree.Element is recursive Message-ID: <1480892604.34.0.360751620771.issue28871@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: The Element class in the xml.etree.ElementTree module is a collection. It can contain other Element's. But unlike to common Python collections (list, dict, etc) and pure Python classes, C implementation of Element doesn't support unlimited recursion. As result, destroying very deep Element tree can cause stack overflow. Example: import xml.etree.cElementTree as ElementTree y = x = ElementTree.Element('x') for i in range(200000): y = ElementTree.SubElement(y, 'x') del x ---------- components: Extension Modules messages: 282376 nosy: eli.bendersky, scoder, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Destructor of ElementTree.Element is recursive type: crash versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 5 02:08:43 2016 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 05 Dec 2016 07:08:43 +0000 Subject: [New-bugs-announce] [issue28872] test_builtin failures when refleak hunting Message-ID: <1480921723.59.0.457276441152.issue28872@psf.upfronthosting.co.za> New submission from Nick Coghlan: test_builtin currently fails for me when hunting refleaks (Fedora 25): $ ./python -m test -R 3:3 -v test_builtin [snip] ====================================================================== FAIL: test_input_tty_non_ascii (test.test_builtin.PtyTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ncoghlan/devel/py36/Lib/test/test_builtin.py", line 1592, in test_input_tty_non_ascii self.check_input_tty("prompt?", b"quux\xe9", "utf-8") File "/home/ncoghlan/devel/py36/Lib/test/test_builtin.py", line 1583, in check_input_tty self.assertEqual(input_result, expected) AssertionError: 'quux' != 'quux\udce9' - quux + quux\udce9 ? + ====================================================================== FAIL: test_input_tty_non_ascii_unicode_errors (test.test_builtin.PtyTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ncoghlan/devel/py36/Lib/test/test_builtin.py", line 1596, in test_input_tty_non_ascii_unicode_errors self.check_input_tty("prompt?", b"quux\xe9", "ascii") File "/home/ncoghlan/devel/py36/Lib/test/test_builtin.py", line 1583, in check_input_tty self.assertEqual(input_result, expected) AssertionError: 'quux' != 'quux\udce9' - quux + quux\udce9 ? + ---------------------------------------------------------------------- Ran 78 tests in 0.066s FAILED (failures=2) ---------- messages: 282389 nosy: ncoghlan, ned.deily priority: normal severity: normal stage: needs patch status: open title: test_builtin failures when refleak hunting type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 5 02:10:24 2016 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 05 Dec 2016 07:10:24 +0000 Subject: [New-bugs-announce] [issue28873] test_unittest failures when refleak hunting Message-ID: <1480921824.58.0.630803385181.issue28873@psf.upfronthosting.co.za> New submission from Nick Coghlan: test_unittest currently fails for me when hunting refleaks (Fedora 25): $ ./python -m test -R 3:3 -v test_unittest ====================================================================== ERROR: test_discover_with_init_module_that_raises_SkipTest_on_import (unittest.test.test_discovery.TestDiscovery) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ncoghlan/devel/py36/Lib/unittest/test/test_discovery.py", line 572, in test_discover_with_init_module_that_raises_SkipTest_on_import pickle.loads(pickle.dumps(suite, proto)) _pickle.PicklingError: Can't pickle : attribute lookup ModuleSkipped on unittest.loader failed ====================================================================== ERROR: test_discover_with_module_that_raises_SkipTest_on_import (unittest.test.test_discovery.TestDiscovery) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ncoghlan/devel/py36/Lib/unittest/test/test_discovery.py", line 548, in test_discover_with_module_that_raises_SkipTest_on_import pickle.loads(pickle.dumps(suite, proto)) _pickle.PicklingError: Can't pickle : attribute lookup ModuleSkipped on unittest.loader failed ---------------------------------------------------------------------- Ran 715 tests in 1.898s FAILED (errors=2, skipped=7) ---------- messages: 282390 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: test_unittest failures when refleak hunting type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 5 02:41:22 2016 From: report at bugs.python.org (Whitequill Riclo) Date: Mon, 05 Dec 2016 07:41:22 +0000 Subject: [New-bugs-announce] [issue28874] test_logging fails Message-ID: <1480923682.41.0.106352881958.issue28874@psf.upfronthosting.co.za> New submission from Whitequill Riclo: while testing my build of cpython it hangs on test 198/404 and will not continue unless interrupted with ctrl-C. the build is fairly sound, but I can't test anything after test 198/404 cause it gets stuck. ---------- components: Tests files: cpython-testlogging.log hgrepos: 364 messages: 282396 nosy: Whitequill Riclo priority: normal severity: normal status: open title: test_logging fails versions: Python 3.7 Added file: http://bugs.python.org/file45760/cpython-testlogging.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 5 02:44:27 2016 From: report at bugs.python.org (Whitequill Riclo) Date: Mon, 05 Dec 2016 07:44:27 +0000 Subject: [New-bugs-announce] [issue28875] test fails and freezes Message-ID: <1480923867.51.0.993366895906.issue28875@psf.upfronthosting.co.za> New submission from Whitequill Riclo: while testing my build of cpython it hangs on test 198/404 and will not continue unless interrupted with ctrl-C. the build is fairly sound, but I can't test anything after test 198/404 cause it gets stuck. ---------- components: Tests files: cpython-testlogging.log hgrepos: 365 messages: 282397 nosy: Whitequill Riclo priority: normal severity: normal status: open title: test fails and freezes type: behavior versions: Python 3.7 Added file: http://bugs.python.org/file45761/cpython-testlogging.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 5 04:37:42 2016 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 05 Dec 2016 09:37:42 +0000 Subject: [New-bugs-announce] [issue28876] bool of large range raises OverflowError Message-ID: <1480930662.45.0.497603219066.issue28876@psf.upfronthosting.co.za> New submission from Mark Dickinson: The bool of a large range raises OverflowError: >>> bool(range(2**63)) Traceback (most recent call last): File "", line 1, in OverflowError: Python int too large to convert to C ssize_t This is a side-effect of len raising OverflowError, which is a general problem that's nontrivial to fix (the sq_length slot is constrained to return a ssize_t). In theory, though, it would be possible to implement nb_bool for range objects to do the right thing. In practice, this may well not be worth fixing, though I think it's at least worth reporting. ---------- components: Interpreter Core messages: 282402 nosy: mark.dickinson priority: normal severity: normal status: open title: bool of large range raises OverflowError type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 5 04:58:40 2016 From: report at bugs.python.org (James Matthews) Date: Mon, 05 Dec 2016 09:58:40 +0000 Subject: [New-bugs-announce] [issue28877] Cannot compile _ssl.o on HP-UX Message-ID: <1480931920.31.0.868439629841.issue28877@psf.upfronthosting.co.za> New submission from James Matthews: Cannot build Python 2.7.12 on HP-UX due to the following error: /opt/hp-gcc64-4.7.1/bin/gcc -pthread -shared build/temp.hp-ux-B.11.31-9000-800-2.7/root/build/Python-2.7.12/Modules/_ssl.o -L/usr/local/lib -lssl -lcrypto -o build/lib.hp-ux-B.11.31-9000-800-2.7/_ssl.sl /usr/lib/pa20_64/dld.sl: Unsatisfied code symbol 'CRYPTO_THREADID_set_callback' in load module 'build/lib.hp-ux-B.11.31-9000-800-2.7/_ssl.sl'. /bin/sh: 23510 Killed gmake: *** [sharedmods] Error 137 ---------- components: Build messages: 282406 nosy: James Matthews priority: normal severity: normal status: open title: Cannot compile _ssl.o on HP-UX versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 5 07:52:20 2016 From: report at bugs.python.org (sergem) Date: Mon, 05 Dec 2016 12:52:20 +0000 Subject: [New-bugs-announce] [issue28878] datetime should not be a subclass of date Message-ID: <1480942340.78.0.750693942086.issue28878@psf.upfronthosting.co.za> New submission from sergem: I have Python 3.5.2. datetime is implemented as a subclass of date (isinstance(datetime.datetime(2015,1,1), datetime.date) == True) I suppose that violates Liskov substitution principle: 1. datetime and date cannot be compared via "<". 2. both of these classes have "isoformat()" method. And the meaning of these methods differ. It means one cannot pass datetime to the function that expects date. Also one cannot say that datetime "is a" date. I suppose datetime must not be a subclass of date. ---------- messages: 282416 nosy: sergem priority: normal severity: normal status: open title: datetime should not be a subclass of date versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 5 10:48:15 2016 From: report at bugs.python.org (Henning von Bargen) Date: Mon, 05 Dec 2016 15:48:15 +0000 Subject: [New-bugs-announce] [issue28879] smtplib RFC 5322 date header missing Message-ID: <1480952895.22.0.418354723664.issue28879@psf.upfronthosting.co.za> New submission from Henning von Bargen: I'm using CPython 2.7 with the smtplib and email modules to send emails with SMTP. Today, one of our clients complained that the email sent is not RFC 5322 compliant because the required Date header is missing. The RFC states in section 3.6.: "The only required header fields are the origination date field and the originator address field(s). All other header fields are syntactically optional." Our program has been sending millions of email message this way and this is the first complaint. I guess that the library doesn't add the header field automatically. ---------- components: Library (Lib) messages: 282425 nosy: Henning.von.Bargen priority: normal severity: normal status: open title: smtplib RFC 5322 date header missing versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 5 13:22:00 2016 From: report at bugs.python.org (John Henning) Date: Mon, 05 Dec 2016 18:22:00 +0000 Subject: [New-bugs-announce] [issue28880] range(i, j) doesn't work Message-ID: <1480962120.7.0.536761585872.issue28880@psf.upfronthosting.co.za> New submission from John Henning: When attempting to use range(I, j) command in Windows 10 command prompt, the latest version of Python would simply echo what was typed. See below: >>> range(7) range(0, 7) >>> range(0, 9) range(0, 9) >>> range(1, 10, 3) range(1, 10, 3) >>> ---------- components: Regular Expressions messages: 282449 nosy: ezio.melotti, genetics_jo, mrabarnett priority: normal severity: normal status: open title: range(i, j) doesn't work type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 5 14:04:09 2016 From: report at bugs.python.org (Vitold S) Date: Mon, 05 Dec 2016 19:04:09 +0000 Subject: [New-bugs-announce] [issue28881] int no attribute 'lower' Message-ID: <1480964649.95.0.801978620213.issue28881@psf.upfronthosting.co.za> New submission from Vitold S: I have MIME message and parse content. Later I walk on message headers by call for and receive follow traceback: Traceback (most recent call last): ... for m in msg: (msg is email.message.Message instance) File "C:\Python27\lib\email\message.py", line 294, in __getitem__ return self.get(name) File "C:\Python27\lib\email\message.py", line 360, in get name = name.lower() AttributeError: 'int' object has no attribute 'lower' But with items() all work properly. ---------- components: email messages: 282454 nosy: Vitold S, barry, r.david.murray priority: normal severity: normal status: open title: int no attribute 'lower' versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 00:06:40 2016 From: report at bugs.python.org (steven Michalske) Date: Tue, 06 Dec 2016 05:06:40 +0000 Subject: [New-bugs-announce] [issue28882] RFC: Slice confusing with negative strides and the 0th element. Message-ID: <1481000800.36.0.0535087899648.issue28882@psf.upfronthosting.co.za> New submission from steven Michalske: The slicing and using inputed math is is necessary to provide a special case to make the code behave as expected. Unless I'm missing something. Like we can't do this, as we loose negative indexing from the end of the file? Let's take the following example, byte swapping 32bit integers. a = [0,1,2,3,4,5,6,7] print([a[x] for x in [slice(y+3, y-1 if y > 1 else None, -1) for y in range(0, len(a), 4)]]) [[], [7, 7, 6, 5]] Catching my explicit case, I changed my code to: print([a[x] for x in [slice(y+3, y-1 if y > 1 else None, -1) for y in range(0, len(a), 4)]]) [[3, 2, 1, 0], [7, 6, 5, 4]] Life proceeds as I am explicit, but now I have a conditional check that is slowing me down... It appears that -1 is being considered the last element in the set. This was surprising, as I couldn't use simple math to byte swap, I needed to pass None instead of -1 It appears PySlice_GetIndices in file cpython/Objects/sliceobject.c always adds length if stop < 0 regardless to start and step. if (r->stop == Py_None) { *stop = *step < 0 ? -1 : length; } else { if (!PyLong_Check(r->stop)) return -1; *stop = PyLong_AsSsize_t(r->stop); if (*stop < 0) *stop += length; # <-- Issue here? } It seems that there is some undocumented logic and behavioral decisions. Was it explicitly decided that a negative stop and negative stride e.g. In [46]: a[3:0:-1] Out[46]: [3, 2, 1] In [47]: a[3:-1:-1] Out[47]: [] Not [3,2,1,0] (My least surprising value...) Because -1 is based on len(a). I expected that with a positive start, and a negative stride that the -1 case would be considered include 0. In other code... [4:-1:-1] == [4:None:-1] Not [4:-1:-1] == [4:len(a)-1:-1] Especially when len(a)-1 > start I understand that this is behavioral, but it is confusing... Discussion? ---------- messages: 282500 nosy: hardkrash priority: normal severity: normal status: open title: RFC: Slice confusing with negative strides and the 0th element. type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 06:49:47 2016 From: report at bugs.python.org (Armin Rigo) Date: Tue, 06 Dec 2016 11:49:47 +0000 Subject: [New-bugs-announce] [issue28883] Python 3.5.2 crashers (from PyPy) Message-ID: <1481024987.78.0.673131645253.issue28883@psf.upfronthosting.co.za> New submission from Armin Rigo: As discussed on python-dev, I am creating omnibus issues from the lists of crashers, of wrong-according-to-the-docs, and of strange-behavior-only issues that I found while developing Python 3.5.2 support for PyPy. These occur with CPython 3.5.2 but most of them are likely still here in trunk. This is the issue containing the crashers. ---------- messages: 282518 nosy: arigo priority: normal severity: normal status: open title: Python 3.5.2 crashers (from PyPy) versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 06:55:03 2016 From: report at bugs.python.org (Armin Rigo) Date: Tue, 06 Dec 2016 11:55:03 +0000 Subject: [New-bugs-announce] [issue28884] Python 3.5.2 non-segfaulting bugs (from PyPy) Message-ID: <1481025303.32.0.218031723176.issue28884@psf.upfronthosting.co.za> New submission from Armin Rigo: As discussed on python-dev, I am creating omnibus issues from the lists of crashers, of wrong-according-to-the-docs, and of strange-behavior-only issues that I found while developing Python 3.5.2 support for PyPy. These occur with CPython 3.5.2 but most of them are likely still here in trunk. This is the issue containing the bugs that are wrong according to documentation, or at least clearly (imo) unexpected behavior. ---------- messages: 282526 nosy: arigo priority: normal severity: normal status: open title: Python 3.5.2 non-segfaulting bugs (from PyPy) versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 07:02:48 2016 From: report at bugs.python.org (Armin Rigo) Date: Tue, 06 Dec 2016 12:02:48 +0000 Subject: [New-bugs-announce] [issue28885] Python 3.5.2 strange-behavior issues (from PyPy) Message-ID: <1481025768.53.0.205646799997.issue28885@psf.upfronthosting.co.za> New submission from Armin Rigo: As discussed on python-dev, I am creating omnibus issues from the lists of crashers, of wrong-according-to-the-docs, and of strange-behavior-only issues that I found while developing Python 3.5.2 support for PyPy. These occur with CPython 3.5.2 but most of them are likely still here in trunk. This is the issue containing the "strange behaviors" and some of them, or possibly most, will turn out to be my own feelings only and not python-dev's, which is fine by me. ---------- messages: 282537 nosy: arigo priority: normal severity: normal status: open title: Python 3.5.2 strange-behavior issues (from PyPy) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 08:43:37 2016 From: report at bugs.python.org (John Hagen) Date: Tue, 06 Dec 2016 13:43:37 +0000 Subject: [New-bugs-announce] [issue28886] Deprecated abstract base class (abc) decorators do not raise DeprecationWarning Message-ID: <1481031817.69.0.735601842725.issue28886@psf.upfronthosting.co.za> New submission from John Hagen: In the abc module (https://docs.python.org/3/library/abc.html) the following decorators have been deprecated since Python 3.3: - abstractclassmethod - abstractstaticmethod - abstractproperty But if you run the following example code using Python 3.5.2 with -Werror, no DeprecationWarnings are thrown. Throwing DeprecationWarnings will help make it more clear that these properties should not be used. PyCharm, for example, will strikethrough the usage of methods that throw DeprecationWarning so that even new users will be notified quickly even if they don't run with -Werror. import abc class Base(abc.ABC): @abc.abstractclassmethod def abstract_class(cls): pass @abc.abstractstaticmethod def abstract_static(): pass @abc.abstractproperty def abstract_property(self): pass class Child(Base): @classmethod def abstract_class(cls): print('Abstract class method') @staticmethod def abstract_static(): print('Abstract static method') @property def abstract_property(self): return 'Abstract property' child = Child() child.abstract_class() child.abstract_static() print(child.abstract_property) ---------- components: Library (Lib) messages: 282548 nosy: John Hagen priority: normal severity: normal status: open title: Deprecated abstract base class (abc) decorators do not raise DeprecationWarning type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 09:39:07 2016 From: report at bugs.python.org (WayEasy Corporation) Date: Tue, 06 Dec 2016 14:39:07 +0000 Subject: [New-bugs-announce] [issue28887] Login with Google not working on PyPi site Message-ID: <1481035147.21.0.438294076255.issue28887@psf.upfronthosting.co.za> New submission from WayEasy Corporation: When I try to login with Google I don't get an error but I'm not logged in either. ---------- messages: 282550 nosy: WayEasy Corporation priority: normal severity: normal status: open title: Login with Google not working on PyPi site type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 12:39:51 2016 From: report at bugs.python.org (Steve Dower) Date: Tue, 06 Dec 2016 17:39:51 +0000 Subject: [New-bugs-announce] [issue28888] Installer fails when newer version of CRT is pending installation Message-ID: <1481045991.8.0.918552180321.issue28888@psf.upfronthosting.co.za> New submission from Steve Dower: We just discovered an issue where CPython install can fail on Windows 8, 8.1 and Server 2012. * do not install the recommended UCRT update * install any other Windows Update that requires a reboot * install the *latest* VC Redist and do not reboot * install CPython Because of the pending reboot, the UCRT update in the VC Redist will be queued but not installed. When we install CPython, because we don't find the UCRT we will try and install it, but because we install a slightly older version than the latest VC Redist we get 0x80240017 WU_E_NOT_APPLICABLE returned. Since this is an error code, we abort installation. However, the correct action to take here is to continue installation, but trigger a mid-setup reboot before doing any of the custom actions that require Python to be installed (bootstrap pip, precompile stdlib) or require a reboot after install. We also need to do a reboot if our own installation of the UCRT requests it, since we may be the ones to queue the update. At the very least, continuing with installation, failing the custom actions and telling the user to reboot and repair Python would also be less impactful than aborting. But I believe we can set it up to do that automatically. Ned FYI, but I won't be forcing this in to 3.6.0. The workaround is fine for interactive installs (reboot your machine and try again) - it's only a problem when Python is being chained into a larger install (e.g. Visual Studio, or an automated deployment). ---------- assignee: steve.dower components: Windows messages: 282560 nosy: ned.deily, paul.moore, steve.dower, tim.golden, zach.ware priority: high severity: normal stage: needs patch status: open title: Installer fails when newer version of CRT is pending installation type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 14:02:26 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 06 Dec 2016 19:02:26 +0000 Subject: [New-bugs-announce] [issue28889] IDLE needs the ability to pass in command-line arguments Message-ID: <1481050946.76.0.826535117808.issue28889@psf.upfronthosting.co.za> New submission from Raymond Hettinger: [--- Feature request posted on behalf of Balakrishnan Sakthidharan ---] IDLE lets you run scripts with F5. What is needs is an F6 that opens a dialog box and asks for command-line arguments. This will help develop and test command line scripts in the IDE. F6 -q5 -v=8 somefile.txt ---------- assignee: terry.reedy components: IDLE messages: 282567 nosy: rhettinger, terry.reedy priority: normal severity: normal status: open title: IDLE needs the ability to pass in command-line arguments type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 15:27:33 2016 From: report at bugs.python.org (Julien Castiaux) Date: Tue, 06 Dec 2016 20:27:33 +0000 Subject: [New-bugs-announce] [issue28890] logging.handlers: Document that QueueListener is a daemon thread Message-ID: <1481056053.22.0.0948056967724.issue28890@psf.upfronthosting.co.za> Changes by Julien Castiaux : ---------- assignee: docs at python components: Documentation nosy: Julien Castiaux, docs at python priority: normal severity: normal status: open title: logging.handlers: Document that QueueListener is a daemon thread type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 20:24:28 2016 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 07 Dec 2016 01:24:28 +0000 Subject: [New-bugs-announce] [issue28891] Standardise more behaviours for zero-argument super() __class__ and __classcell__ Message-ID: <1481073868.22.0.737500382194.issue28891@psf.upfronthosting.co.za> New submission from Nick Coghlan: In http://bugs.python.org/issue28884#msg282535 Armin Rigo points out that the zero-argument super() cell injection currently interacts a little strangely with explicit "nonlocal __class__" statements in nested namespaces. Specifically, it acts like a closure variable that isn't visible in its own scope, but can be accessed via nonlocal in nested class scopes: >>> class C_with_nested_nonlocal: ... class Inner: ... nonlocal __class__ ... __class__ = 42 ... print(locals()) ... {'__module__': '__main__', '__qualname__': 'C_with_nested_nonlocal', 'Inner': , '__class__': 42} This weird behaviour is due to the way the CPython code generator injects __class__ into the namespaces we track during symbol table generation (specifically, it's made available as a free variable for nested namespaces to reference without actually adding it to the local symbol namespace for the class body). There's no requirement for other implementations to replicate the full details of that idiosyncratic behaviour, but there is a requirement that __class__ and (in 3.6+) __classcell__ not show up in locals() by default when evaluating the class body. And methods can similarly overwrite the interpreter provided reference to the defining class: >>> class C_with_method_assignment_to_class_cell: ... def bad_method(self): ... nonlocal __class__ ... __class__ = 42 ... def other_method(self): ... return __class__ ... bad_method(None) ... print(locals()["__class__"]) ... 42 >>> C_with_method_assignment_to_class_cell().other_method() >>> C_with_method_assignment_to_class_cell().bad_method() >>> C_with_method_assignment_to_class_cell().other_method() 42 One possible approach here would be to implement an outright language level ban on the use of "__class__" in explicit "nonlocal" declarations, and then add a test to Lib/test_super.py that ensures "__class__" and "__classcell__" don't show up in the class locals() while the statement body is executing. ---------- messages: 282585 nosy: arigo, ncoghlan priority: normal severity: normal stage: test needed status: open title: Standardise more behaviours for zero-argument super() __class__ and __classcell__ type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 21:52:27 2016 From: report at bugs.python.org (Dale) Date: Wed, 07 Dec 2016 02:52:27 +0000 Subject: [New-bugs-announce] [issue28892] pandas.to_datetime crashes in 3.6b4 Message-ID: <1481079147.57.0.642166298292.issue28892@psf.upfronthosting.co.za> New submission from Dale: I'm trying 3.6b4 on my mac (OS X 10.10.5) and when I run the following code (after doing pip install numpy and pandas) I see a 'SystemError': >>> import pandas as pd >>> pd.to_datetime('10/31/2016') ValueError: Error parsing datetime string "10/31/2016" at position 2 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "", line 1, in File "/Users/schouten/virtualenvs/tmp/lib/python3.6/site-packages/pandas/util/decorators.py", line 91, in wrapper return func(*args, **kwargs) File "/Users/schouten/virtualenvs/tmp/lib/python3.6/site-packages/pandas/tseries/tools.py", line 430, in to_datetime return _convert_listlike(np.array([arg]), box, format)[0] File "/Users/schouten/virtualenvs/tmp/lib/python3.6/site-packages/pandas/tseries/tools.py", line 401, in _convert_listlike require_iso8601=require_iso8601 File "pandas/tslib.pyx", line 2302, in pandas.tslib.array_to_datetime (pandas/tslib.c:43278) File "pandas/tslib.pyx", line 2458, in pandas.tslib.array_to_datetime (pandas/tslib.c:41773) File "pandas/tslib.pyx", line 2416, in pandas.tslib.array_to_datetime (pandas/tslib.c:41009) File "pandas/src/datetime.pxd", line 141, in datetime._string_to_dts (pandas/tslib.c:90460) SystemError: returned a result with an error set >>> sys.version says: >>> import sys >>> sys.version '3.6.0b4 (v3.6.0b4:18496abdb3d5, Nov 21 2016, 20:44:47) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]' >>> With 3.5 it works as expected: >>> import sys >>> sys.version '3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]' >>> import pandas as pd >>> pd.to_datetime('10/31/2016') Timestamp('2016-10-31 00:00:00') >>> I know it looks like pandas might be at fault, but given that the only thing I've changed is the Python version, I'm thinking it might be exposing a 3.6 bug (or vice versa, I suppose). My apologies if I'm doing this all wrong, I'm new around here. ---------- components: Extension Modules, Interpreter Core, macOS messages: 282588 nosy: Schouten, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: pandas.to_datetime crashes in 3.6b4 type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 6 23:41:33 2016 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 07 Dec 2016 04:41:33 +0000 Subject: [New-bugs-announce] [issue28893] Make sure exceptions raised in __aiter__ are properly chained in ceval Message-ID: <1481085693.53.0.293766364883.issue28893@psf.upfronthosting.co.za> New submission from Yury Selivanov: Originally reported in http://bugs.python.org/issue28885#msg282538 Ned, please take a look at the attached patch. While I think that the change is quite small & safe to merge, I think it's OK if we push this only in 3.6.1. It's a nice usability improvement, but only for people that implement objects with custom __await__, which is quite a rare case. ---------- assignee: yselivanov components: Interpreter Core files: chain.patch keywords: patch messages: 282595 nosy: brett.cannon, haypo, ned.deily, serhiy.storchaka, yselivanov priority: normal severity: normal stage: patch review status: open title: Make sure exceptions raised in __aiter__ are properly chained in ceval type: behavior versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45782/chain.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 7 09:47:11 2016 From: report at bugs.python.org (Marius Gedminas) Date: Wed, 07 Dec 2016 14:47:11 +0000 Subject: [New-bugs-announce] [issue28894] Memory leak in dict.pop() Message-ID: <1481122031.58.0.509371094394.issue28894@psf.upfronthosting.co.za> New submission from Marius Gedminas: Run the following script with Python 3.6.0rc1: class O: pass o = O() for n in range(20): print(n) o.x = 42 o.__dict__.pop('x', None) You can observe the memory usage of the Python process growing exponentially. E.g. in bash: ulimit -v 1000000 # don't push other processes into swap please python3.6 break.py 0 1 2 3 4 5 6 7 8 9 10 11 Traceback (most recent call last): File "break.py", line 7, in o.x = 42 MemoryError ---------- components: Interpreter Core messages: 282623 nosy: mgedmin priority: normal severity: normal status: open title: Memory leak in dict.pop() versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 7 09:49:13 2016 From: report at bugs.python.org (Mark Summerfield) Date: Wed, 07 Dec 2016 14:49:13 +0000 Subject: [New-bugs-announce] [issue28895] Two suggestions for windows.html Message-ID: <1481122153.16.0.608374359054.issue28895@psf.upfronthosting.co.za> New submission from Mark Summerfield: This document is v. useful for Windows Python users: https://docs.python.org/dev/using/windows.html However, I think it could be improved as follows: (1) Explain which Python installer to get (since there are so many)! Even a "get the Windows x86 executable installer if you just want it now!". Alternatively, the https://www.python.org/downloads/windows/ page could begine with a brief explanation of the differences. (2) Explain the trade-offs between Admin & User install & the effect this has on using pip (e.g., an Admin install may require pip to be used in an Admin console or to be used with the --user option). ---------- assignee: docs at python components: Documentation messages: 282625 nosy: docs at python, mark priority: normal severity: normal status: open title: Two suggestions for windows.html type: enhancement versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 7 11:38:28 2016 From: report at bugs.python.org (Alexey Izbyshev) Date: Wed, 07 Dec 2016 16:38:28 +0000 Subject: [New-bugs-announce] [issue28896] Embeddable zip allows Windows registry to override module location Message-ID: <1481128708.35.0.521458556277.issue28896@psf.upfronthosting.co.za> New submission from Alexey Izbyshev: The docs claim: "... the embedded distribution is (almost) fully isolated from the user?s system, including environment variables, system registry settings, and installed packages." Via ProcessMonitor tool I've discovered that python.exe still accesses keys like "HKLM\Software\Python\PythonCore\3.5\Modules\collections" on every module import, allowing registry settings to override the location of any non-builtin module. Digging into the 3.5.2 code revealed that WindowsRegistryFinder is unconditionally added to sys.meta_path (Lib/importlib/_bootstrap_external.py, line 1422): if _os.__name__ == 'nt': sys.meta_path.append(WindowsRegistryFinder) It can also be confirmed in runtime: Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> print(sys.meta_path) [, , , ] Is this behavior intended? It seems to be against doc claims and the goal of embeddability. ---------- components: Windows messages: 282632 nosy: izbyshev, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Embeddable zip allows Windows registry to override module location type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 7 11:54:01 2016 From: report at bugs.python.org (Charles Harris) Date: Wed, 07 Dec 2016 16:54:01 +0000 Subject: [New-bugs-announce] [issue28897] Python 3.6.0rc1 breaks NumPy tests. Message-ID: <1481129641.34.0.0925136712294.issue28897@psf.upfronthosting.co.za> New submission from Charles Harris: The lastest Python 3.6 pre-release broke a number of NumPy tests. The failing tests are of the sort with warnings.catch_warnings(record=True) as w: warnings.simplefilter('always') ... And the failure seems to be that nothing is recorded in w. None of the beta releases caused problems. It is possible that the testing environment (Travis CI) messed up, but reporting this here just in case. ---------- components: Library (Lib) messages: 282633 nosy: charris44 priority: normal severity: normal status: open title: Python 3.6.0rc1 breaks NumPy tests. type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 7 13:14:39 2016 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 07 Dec 2016 18:14:39 +0000 Subject: [New-bugs-announce] [issue28898] Can't compile gdb with Python 3.6 Message-ID: <1481134479.52.0.174259382887.issue28898@psf.upfronthosting.co.za> New submission from Charalampos Stratakis: Trying to compile gdb, with python support and by having it depend on Python 3.6 produces an error that the HAVE_LONG_LONG has been redefined [0]. This seems to have been introduced by this commit [1]. I'm in no way expert on gdb, but from what I could deduct from the build logs, the #define HAVE_LONG_LONG line in pyport.h [2] is the issue, as gdb also sets the same constant to 1 [3][4] I build python and gdb as rpm's, but I can't verify if it happens as well outside this environment. Could someone more experienced with gdb take a look at it? The issue seems to be fixed by wrapping the #define HAVE_LONG_LONG with an #ifndef HAVE_LONG_LONG Attaching a patch for consideration [0] https://copr-be.cloud.fedoraproject.org/results/cstratak/python3.6/fedora-26-x86_64/00485858-gdb/build.log.gz [1] https://hg.python.org/cpython/rev/cf6e9968ebb7/ [2] https://hg.python.org/cpython/file/tip/Include/pyport.h#l42 [3] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/config.in;h=3f8a72326b5d32db6ad8966c05045e248f955498;hb=HEAD#l282 [4] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/configure;h=6df88d9049b546a9e906b943f67374dc90d90d6d;hb=HEAD#l11662 ---------- components: Interpreter Core files: fix-gdb-compilation.patch keywords: patch messages: 282649 nosy: cstratak priority: normal severity: normal status: open title: Can't compile gdb with Python 3.6 versions: Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45791/fix-gdb-compilation.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 7 15:03:50 2016 From: report at bugs.python.org (=?utf-8?q?Arkady_=E2=80=9CKindDragon=E2=80=9D_Shapkin?=) Date: Wed, 07 Dec 2016 20:03:50 +0000 Subject: [New-bugs-announce] [issue28899] Symbols doesn't match in VS for python.exe and python35.dll Message-ID: <1481141030.49.0.258736096374.issue28899@psf.upfronthosting.co.za> New submission from Arkady ?KindDragon? Shapkin: I installed Python 3.5.2 with PDB, but they can't be loaded. If I try to load them manually Visual Studio displays message "A matching symbol file was not found in this folder." ---------- components: Windows messages: 282658 nosy: Arkady ?KindDragon? Shapkin, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Symbols doesn't match in VS for python.exe and python35.dll versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 7 22:28:03 2016 From: report at bugs.python.org (Matthias v/d Meent) Date: Thu, 08 Dec 2016 03:28:03 +0000 Subject: [New-bugs-announce] [issue28900] update 'docs for other versions' Message-ID: <1481167683.31.0.460396131564.issue28900@psf.upfronthosting.co.za> New submission from Matthias v/d Meent: The 'docs for other versions' links in the sidebar of docs.python.org do not link to 3.5 in both the 3.6 and 3.7 docs. As I didn't find any docs guidelines, I presume this is an error and should be fixed. A link to the Python 3.6 docs should get added under all active documentations before or the moment python 3.6 is released (though I suspect this is automated). ---------- assignee: docs at python components: Documentation messages: 282684 nosy: Matthias v/d Meent, docs at python priority: normal severity: normal status: open title: update 'docs for other versions' type: enhancement versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 00:36:04 2016 From: report at bugs.python.org (Matthias v/d Meent) Date: Thu, 08 Dec 2016 05:36:04 +0000 Subject: [New-bugs-announce] [issue28901] Embedded Release interactive mode documentation Message-ID: <1481175364.84.0.951011976369.issue28901@psf.upfronthosting.co.za> New submission from Matthias v/d Meent: The Windows Embedded release (at least the x86_64 version) does not include the usual helper functions (exit, help, ...) when run interactively (~ python.exe). This is not documented at the docs of Windows Embedded release, which might mean that this is a bug. Documentation on Embedded release here (https://docs.python.org/3/using/windows.html#embedded-distribution) missing in interactive mode of embedded release: (output of diff): ['copyright', 'credits', 'exit', 'help', 'license', 'quit'] Notice that 'help', a builtin function according to the docs [0], is missing in the Embedded release. Even when embedded, a builtin should be available IMO. [0] https://docs.python.org/3.6/library/functions.html This comparison was only between running the python executable in the [zip] and python installed from this [installer]. It is very well possible this is a long-standing issue since 3.5 (the first Embedded release), and this may occur on other architectures as well. [zip] https://www.python.org/ftp/python/3.6.0/python-3.6.0rc1-embed-amd64.zip [installer] https://www.python.org/ftp/python/3.6.0/python-3.6.0rc1-amd64.exe ---------- assignee: docs at python components: Documentation, Windows messages: 282693 nosy: Matthias v/d Meent, docs at python, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Embedded Release interactive mode documentation type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 01:24:41 2016 From: report at bugs.python.org (Decorater) Date: Thu, 08 Dec 2016 06:24:41 +0000 Subject: [New-bugs-announce] [issue28902] 3.6.0rc1 installer fails to install / uninstall. Message-ID: <1481178281.99.0.0821886789548.issue28902@psf.upfronthosting.co.za> New submission from Decorater: When installing python 3.6.0rc1 it errors saying that it cannot find python.dll in cab1.cab (or some sort of file name similar to that) which it would obviously not exist. and then when I try to uninstall it it will fail saying 3.6 is not installed but not check the registry to remove the entries for the windows Installed programs list. I would like if the (web and non web) installers would actually get better and check right before closing if 3.6 is in the registry when it cant find one installed and remove those entries. As well as looking for previous python versions that lo longer are on disk but are on the registry as if they are installed (basically allows for proper cleanup). ---------- components: Installation, Windows messages: 282694 nosy: Decorater, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: 3.6.0rc1 installer fails to install / uninstall. versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 03:34:03 2016 From: report at bugs.python.org (Ethan Smith) Date: Thu, 08 Dec 2016 08:34:03 +0000 Subject: [New-bugs-announce] [issue28903] Windows Embeddable Python exit not defined Message-ID: <1481186043.87.0.802350781562.issue28903@psf.upfronthosting.co.za> New submission from Ethan Smith: Hearing about the RC1 today, I downloaded the x64 Windows embeddable zip. I opened a Command Prompt window and ran python.exe to try it out. I was quite surprised when I ran: >>>exit() Traceback (most recent call last): File "", line 1, in NameError: name 'exit' is not defined I read through the notes on the embedded Python releases, but I did not see anything that would lead me to believe that exit should not defined. I also downloaded the distribution for 3.5.2, and did not have the same issue, which leads me to believe this is unintended behavior. If this behavior is intended, I do apologize for raising this issue. OS: Windows 10 x64. ---------- components: Windows messages: 282697 nosy: Ethan Smith, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows Embeddable Python exit not defined type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 09:37:06 2016 From: report at bugs.python.org (Samuel Colvin) Date: Thu, 08 Dec 2016 14:37:06 +0000 Subject: [New-bugs-announce] [issue28904] add more format conversion flags eg. "len" and "id" Message-ID: <1481207826.64.0.85637037523.issue28904@psf.upfronthosting.co.za> New submission from Samuel Colvin: (The "Components" selection might be wrong, I wasn't sure what to use) As https://docs.python.org/3.6/library/string.html > Three conversion flags are currently supported: '!s' which calls str() on the value, '!r' which calls repr() and '!a' which calls ascii(). It would be great if further conversation flags were added for more built-in methods. In particular: * '!l' for len() * '!i' for id() (There might be others but these are the two I would find most useful.) format() is now very powerful, but it's very common for strings, lists, dicts, sets etc. to want to include their length in strings. This is currently ugly. This enhancement will be even more sought after with string literals in python 3.6. Example of when this would be very useful: v = {'type': 'whatever, 'items': ['foo', 'bar', 'spam']} '{type}{items!l}'.format(**v) Would also be very useful with getattr, and getitem usage. ---------- components: Library (Lib) messages: 282707 nosy: Samuel Colvin priority: normal severity: normal status: open title: add more format conversion flags eg. "len" and "id" type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 12:02:58 2016 From: report at bugs.python.org (Danny Yoo) Date: Thu, 08 Dec 2016 17:02:58 +0000 Subject: [New-bugs-announce] [issue28905] re.sub appears not to check count optional argument for integerness Message-ID: <1481216578.4.0.700543113224.issue28905@psf.upfronthosting.co.za> New submission from Danny Yoo: This comes from diagnosing a beginner's question on Python-tutor. https://mail.python.org/pipermail/tutor/2016-December/110066.html It appears that re.sub is not checking whether the count argument is integer or not, and silently accepts a nonsensical argument. For example: >>> import re >>> s = "AAAcBBB\nAAAdBBB" >>> print(re.sub(r'^AAA', "aaa", s, re.MULTILINE)) aaacBBB AAAdBBB Of course, the user intended to pass re.MULTILINE to flags, not to count, but the fact that this isn't raising a TypeError is error-prone. ---------- components: Library (Lib) messages: 282719 nosy: Danny Yoo priority: normal severity: normal status: open title: re.sub appears not to check count optional argument for integerness type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 12:42:58 2016 From: report at bugs.python.org (Preston Landers) Date: Thu, 08 Dec 2016 17:42:58 +0000 Subject: [New-bugs-announce] [issue28906] Can't inherit sockets with multiprocessing on Windows Message-ID: <1481218978.59.0.0663276612908.issue28906@psf.upfronthosting.co.za> New submission from Preston Landers: I'm porting a Python 2.6 based application to Python 3.6. This app uses a customized version of the "flup" package to do FastCGI services on Windows using the multiprocessing package. This requires a few sockets to be inherited across processes - the main FastCGI protocol socket plus a control socket. In Python 2.6, the `socket.from_fd` function was not available on Windows. However I patched Python's socketmodule.c to provide that function using DuplicateHandle. In Python 2.6's version of multiprocessing it spawned a process with CreateProcess and bInheritHandles=True. This worked well for me. Now I'm trying to get this working after moving from Python 2.6 to 3.6 (currently using 3.6.0b4). Fortunately, the socket module now has a working `socket.from_fd` on Windows so I no longer have to patch that. Unfortunately for me, though, the multiprocessing module now calls CreateProcess with bInheritHandles=False. This causes my scenario to fail. Here's a short test script which illustrates this problem: https://gist.github.com/Preston-Landers/712fee10fb557cf0b5592b57561a7c08 If you run with an unpatched multiprocessing, it will fail with an error like: OSError: [WinError 10038] An operation was attempted on something that is not a socket If you patch multiprocessing to set bInheritHandles=True this now works. (Change is in popen_spawn_win32.py where it does _winapi.CreateProcess.) I'm sure there's a good reason for that change in multiprocessing, whether for security or for unrelated/undesired file handles being passed. https://www.python.org/dev/peps/pep-0446/#inheritance-of-file-descriptors-on-windows However it does break my scenario and I don't see a way to tell multiprocessing to allow certain handles to be inherited. The docs for multiprocessing say "In particular, unnecessary file descriptors and handles from the parent process will not be inherited." It would be nice to have a way to tell it that my sockets are "necessary." You would think that calling socket.set_inheritable(True) would do it. In fact you must do that, but you must also pass bInheritHandles=True to CreateProcess for it to actually work. There doesn't seem to be a way to pass through an argument to multiprocessing to tell it to set this flag. I do realize I could be going about this completely wrong, though. But right now it looks like my immediate options are: a) Go ahead and patch my copy of popen_spawn_win32.py to allow inherited handles despite other possible risks. b) Try to rewrite things to not use multiprocessing at all and directly spawn my processes instead. That's not attractive because multiprocessing otherwise does what I need to do. Are there any other options I'm missing? Maybe some way to duplicate the socket on the other end without relying on CreateProcess with bInheritHandles=True? Otherwise, I guess I'm asking for an option to be made available in multiprocessing to allow handles to be inherited on Windows. ---------- components: Library (Lib) messages: 282723 nosy: planders priority: normal severity: normal status: open title: Can't inherit sockets with multiprocessing on Windows type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 14:10:18 2016 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 08 Dec 2016 19:10:18 +0000 Subject: [New-bugs-announce] [issue28907] test_pydoc fails if build is in sub-directory Message-ID: <1481224218.05.0.36648491601.issue28907@psf.upfronthosting.co.za> New submission from Neil Schemenauer: test_pydoc is failing for me for 3.6rc1. I build in a sub-directory, e.g. Python-3.6.0rc1/build-opt. The root of the issue is that pydoc getdocloc() is broken. It cannot build 'basedir' as it does and assume that is the location of standard modules. Fixing that is tricky though, I will open a separate issue for that. For this issue, I think the test_mixed_case_module_names_are_lower_cased() function needs to be fixed to handle that case that get_pydoc_link() returns None. I.e. it thinks that the module is not a standard module and so returns no link. Attached is a patch. It is trivial and I think should go into 3.6. ---------- assignee: r.david.murray components: Tests files: test_pydoc_fix.txt messages: 282728 nosy: nascheme, r.david.murray priority: high severity: normal stage: patch review status: open title: test_pydoc fails if build is in sub-directory type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file45799/test_pydoc_fix.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 14:24:29 2016 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 08 Dec 2016 19:24:29 +0000 Subject: [New-bugs-announce] [issue28908] pydoc getdocloc() is broken Message-ID: <1481225069.67.0.983808754033.issue28908@psf.upfronthosting.co.za> New submission from Neil Schemenauer: The getdocloc() method in pydoc.py is supposed to return the doc location for modules. It uses a 'basedir' parameter that is supposed to point to the location of the standard library modules. That logic is broken for a number of different scenarios, I think. One is if you build Python in a sub-directory, not in the root of the source tree. Another I think is if you are using a Zip file for the std lib. Fixing this properly is not so easy. One solution would be to explictly mark modules that have docs available. E.g. create a __pydoc global variable or similar that the 'pydoc' module to inspect. That would have to be done on every module that has documentation. Another idea is at build time, crawl through Doc/library and generate a list of modules that have docs. That's a bit tricky because that generation needs to work on all platforms that Python is built on. A third idea is to manually add the list to the pydoc.py module. When new documentation is created under Doc/library, that list would have to be updated. ---------- components: Library (Lib) messages: 282729 nosy: nascheme priority: normal severity: normal stage: needs patch status: open title: pydoc getdocloc() is broken type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 15:04:34 2016 From: report at bugs.python.org (Francis Deslauriers) Date: Thu, 08 Dec 2016 20:04:34 +0000 Subject: [New-bugs-announce] [issue28909] Adding LTTng-UST tracing support Message-ID: <1481227474.94.0.337411886613.issue28909@psf.upfronthosting.co.za> New submission from Francis Deslauriers: This patch extends the tracing infrastructure to support LTTng UserSpace Tracer. Using LTTng-UST, users would have access to a low overhead tracing done entirely from userspace. Depending on the tracing configure option used (none, --with-dtrace or --with-lttngust) macros will be expanded to probes and tracepoints of the desired tracer if any. Only the needed instrumentation will be added to the binary. This technique is used to different degrees by other projects like Qemu[1] and Node.js[2]. I attached a patch adding this feature. I tested the changes and the instrumentation on LTTng-UST and SystemTap on Ubuntu 16.04. I would appreciate if someone could test those changes on macOS and other platforms supporting USDT probes. [1]https://github.com/qemu/qemu/blob/master/configure#L4303 [2]https://github.com/nodejs/node/blob/master/configure#L811 ---------- files: 0001-Add-LTTng-UST-probe-and-tracepoints.patch keywords: patch messages: 282733 nosy: Francis Deslauriers priority: normal severity: normal status: open title: Adding LTTng-UST tracing support type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45802/0001-Add-LTTng-UST-probe-and-tracepoints.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 16:18:19 2016 From: report at bugs.python.org (Eric Appelt) Date: Thu, 08 Dec 2016 21:18:19 +0000 Subject: [New-bugs-announce] [issue28910] Async generator does not raise RuntimeError if finalizer not set Message-ID: <1481231899.72.0.681247930354.issue28910@psf.upfronthosting.co.za> New submission from Eric Appelt: While testing my understanding in order to document PEP525 asynchronous generators in the Language Reference (issue 28091) I noticed that the implemented behavior deviates from PEP525, specifically the PEP states that: "When an asynchronous generator is iterated for the first time, it stores a reference to the current finalizer. If there is none, a RuntimeError is raised. This provides a strong guarantee that every asynchronous generator object will always have a finalizer installed by the correct event loop." I created an asynchronous generator to try to run calling __anext__ interactively without an event loop to check the behavior, and was surprised when I didn't get a RuntimeError even though I had not called sys.set_asyncgen_hooks() to set a finalizer function. I looked at the function async_gen_init_hooks defined in Objects/genobject.c and it appears that if the thread state async_gen_finalizer is NULL, then it just returns zero and allows the calling function to continue. I'm not sure if this is a bug, or this is intentional and the finalizer mechanism should be optional. If it is the latter should PEP525 get updated? ---------- components: Interpreter Core messages: 282737 nosy: Eric Appelt, yselivanov priority: normal severity: normal status: open title: Async generator does not raise RuntimeError if finalizer not set type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 16:48:20 2016 From: report at bugs.python.org (Arne de Laat) Date: Thu, 08 Dec 2016 21:48:20 +0000 Subject: [New-bugs-announce] [issue28911] Clarify the behaviour of assert_called_once_with Message-ID: <1481233700.68.0.637550951007.issue28911@psf.upfronthosting.co.za> New submission from Arne de Laat: The name assert_called_once_with and the current method documentation can be interpreted to mean that it asserts that there is precisely one call matching the given signature, regardless of the total number of calls. However, the method first checks that there is precisely one call, and then checks if that call has a signature matching the provided signature. Additionally, the assert_any_call method documentation references assert_called_once_with in a way that enforces the possible misinterpretation: "? assert_called_with and assert_called_once_with that only pass if the call is the most recent one". This may lead to the interpretation that there must be only one call with the given signature and that it must be the most recent one, it must in fact be the only one. In the mock examples documentation there is an important sentence that clarifies the actual functionality: "you can use the assert_called_once_with method that also asserts that the call_count is one". The example provided in the method documentation also does not satisfactorily address the ambiguity, because it only calls the mock with one call signature. By changing the call signature of the second call (and in the assert) in the example the purpose of the method becomes clearer. ---------- assignee: docs at python components: Documentation, Tests files: assert_once_with_doc.patch keywords: patch messages: 282740 nosy: 153957, docs at python priority: normal severity: normal status: open title: Clarify the behaviour of assert_called_once_with type: enhancement versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45803/assert_once_with_doc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 18:00:34 2016 From: report at bugs.python.org (Joshua Bronson) Date: Thu, 08 Dec 2016 23:00:34 +0000 Subject: [New-bugs-announce] [issue28912] collections.abc.OrderedMapping Message-ID: <1481238034.34.0.119082165821.issue28912@psf.upfronthosting.co.za> New submission from Joshua Bronson: Since code can be clearer than prose, I just sketched this idea out in the attached patch. Please take a look at it as a minimum demonstration of the concept. Rationale: The Python standard library provides collections.OrderedDict, along with several ABCs which OrderedDict extends, such as collections.abc.Mapping and (as of 3.6) collections.abc.Reversible, to enable better composability and interoperability. Currently there is no collections.abc.OrderedMapping ABC, but I wonder if there should be. OrderedMapping could provide a concrete, generic implementation of __eq__, that performed an order-sensitive comparison when passed another OrderedMapping, while performing an order-insensitive comparison when passed an unordered Mapping. Then OrderedDict could derive from OrderedMapping, inheriting its generic __eq__ implementation, rather than implementing its own __eq__ method. Currently, OrderedDict's own __eq__ implementation does ``isinstance(other, OrderedDict)`` to decide whether to perform an order-sensitive comparison, which thwarts interoperability. OrderedMapping could also derive from Reversible, signaling that classes that extend it implement __reversed__. The interoperability gain here is not just theoretical. Several packages are published on PyPI which would be able to interoperate better if they could all extend a common OrderedMapping interface. Grant Jenks' sortedcontainers.SortedDict[1] and my own bidict.OrderedBidict[2] are two particularly popular examples. Thanks for your consideration, and look forward to your feedback. [1] http://www.grantjenks.com/docs/sortedcontainers/sorteddict.html [2] https://bidict.readthedocs.io/en/dev/other-bidict-types.html#orderedbidict ---------- components: Library (Lib) files: jab-orderedmapping-1.patch keywords: patch messages: 282742 nosy: gvanrossum, jab, rhettinger priority: normal severity: normal status: open title: collections.abc.OrderedMapping type: enhancement Added file: http://bugs.python.org/file45804/jab-orderedmapping-1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 18:47:17 2016 From: report at bugs.python.org (Richard Eames) Date: Thu, 08 Dec 2016 23:47:17 +0000 Subject: [New-bugs-announce] [issue28913] "Fatal Python error: Cannot recover from stack overflow." from RecursionError Message-ID: <1481240837.05.0.510119516433.issue28913@psf.upfronthosting.co.za> New submission from Richard Eames: I've been porting a project to the latest version of Django, and due to one of the changes in the Django, caused a recursion error in my code. However, the error (under certain conditions) then causes the python interpreter to core dump. I'm not 100% sure what causes this to happen, but it does seem to be similar to https://bugs.python.org/issue6028 I've created a minimal django project: https://github.com/Naddiseo/python-core-dump However, it does rely on some interaction between mysql, pymysql, and django to be reproduced, the latter two being 100% python code. I'm sorry that I could not reduce the test case further. One of the interesting/weird things about this bug is that (on my machine at least) it requires exactly 15 entries in the `MIDDLEWARE` variable in "coredump/settings.py" in my test project, any more, or any less will cause the interpreter to issue a `RecursionError` as expected, but not to core dump. This appears to happen in 3.5, and not in 3.6 so perhaps whatever fix was applied to 3.6 can be backported to 3.5 so that it doesn't core dump? ---------- components: Interpreter Core messages: 282745 nosy: Richard Eames priority: normal severity: normal status: open title: "Fatal Python error: Cannot recover from stack overflow." from RecursionError type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 19:35:21 2016 From: report at bugs.python.org (Wataru Matsumoto) Date: Fri, 09 Dec 2016 00:35:21 +0000 Subject: [New-bugs-announce] [issue28914] selectmodule build fails Message-ID: <1481243721.04.0.91028253928.issue28914@psf.upfronthosting.co.za> New submission from Wataru Matsumoto: selectmodule build fails with the linux without epoll_create1(before kernel 2.6.27). building 'select' extension gcc -pthread -fPIC -fno-strict-aliasing -Wsign-compare -g -O0 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I./Include -I. -I/usr/local/include -I/home/wmatsumo/download/cpython/Include -I/home/wmatsumo/download/cpython -c /home/wmatsumo/download/cpython/Modules/selectmodule.c -o build/temp.linux-x86_64-3.7-pydebug/home/wmatsumo/download/cpython/Modules/selectmodule.o /home/wmatsumo/download/cpython/Modules/selectmodule.c: In function 'pyepoll_new': /home/wmatsumo/download/cpython/Modules/selectmodule.c:1306: error: 'EPOLL_CLOEXEC' undeclared (first use in this function) /home/wmatsumo/download/cpython/Modules/selectmodule.c:1306: error: (Each undeclared identifier is reported only once /home/wmatsumo/download/cpython/Modules/selectmodule.c:1306: error: for each function it appears in.) It seems due to the below change. http://bugs.python.org/issue20100 It have to check HAVE_EPOLL_CREATE1 is defined before using EPOLL_CLOEXEC. ---------- files: selectmodule.patch keywords: patch messages: 282746 nosy: sxsns243 priority: normal severity: normal status: open title: selectmodule build fails type: compile error versions: Python 3.7 Added file: http://bugs.python.org/file45806/selectmodule.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 8 20:07:34 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Dec 2016 01:07:34 +0000 Subject: [New-bugs-announce] [issue28915] Modify PyObject_CallFunction() to use fast call internally Message-ID: <1481245654.11.0.143889949597.issue28915@psf.upfronthosting.co.za> New submission from STINNER Victor: This issue tracks changes to support the "fast call" calling convention in functions: * PyObject_CallFunctionObjArgs() * PyObject_CallMethodObjArgs() * _PyObject_CallMethodIdObjArgs() A "stack" of Python objects is created to pass arguments to _PyObject_FastCall(). The goal is to avoid the creation of a temporary tuple to call functions. The patch serie changes slots (typeobject.c), so calling Python slots from Python should avoid completely the creation of temporary tuples to pass parameters. Microbenchmark on a simple class with an __int__() method, call int(o): int(o): Median +- std dev: [ref] 239 ns +- 13 ns -> [patch] 219 ns +- 14 ns: 1.10x faster (-9%) Microbenchmark on a simple class with an __getitem__() method, call o[100]: o[100]: Median +- std dev: [ref] 211 ns +- 11 ns -> [patch] 172 ns +- 11 ns: 1.23x faster (-19%) Comparison between Python 2.7, 3.5, 3.7 and 3.7+patch, 3.5 is used as the reference: int(o) ====== Median +- std dev: [3.5] 271 ns +- 15 ns -> [3.7] 239 ns +- 13 ns: 1.13x faster (-12%) Median +- std dev: [3.5] 271 ns +- 15 ns -> [patch] 219 ns +- 14 ns: 1.24x faster (-19%) Median +- std dev: [3.5] 271 ns +- 15 ns -> [2.7] 401 ns +- 21 ns: 1.48x slower (+48%) o[100] ====== Median +- std dev: [3.5] 206 ns +- 5 ns -> [3.7] 211 ns +- 11 ns: 1.02x slower (+2%) Not significant! Median +- std dev: [3.5] 206 ns +- 5 ns -> [patch] 172 ns +- 11 ns: 1.20x faster (-17%) Median +- std dev: [3.5] 206 ns +- 5 ns -> [2.7] 254 ns +- 15 ns: 1.23x slower (+23%) ---------- messages: 282748 nosy: haypo priority: normal severity: normal status: open title: Modify PyObject_CallFunction() to use fast call internally type: performance versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 00:20:41 2016 From: report at bugs.python.org (woo yoo) Date: Fri, 09 Dec 2016 05:20:41 +0000 Subject: [New-bugs-announce] [issue28916] Not matched behavior of modulo operator % with the description of the documentation Message-ID: <1481260841.6.0.53772469659.issue28916@psf.upfronthosting.co.za> New submission from woo yoo: Mismatch occurs within the "Notes" section,row 1.Here is the link:https://docs.python.org/3/library/stdtypes.html#old-string-formatting The course of coding shows below: >>>'%#07o' % 1223 Result value is '0o02307',which is not in line with the description. Description is "The alternate form causes a leading zero ('0') to be inserted between left-hand padding and the formatting of the number if the leading character of the result is not already a zero." ---------- assignee: docs at python components: Documentation messages: 282762 nosy: docs at python, woo yoo priority: normal severity: normal status: open title: Not matched behavior of modulo operator % with the description of the documentation type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 00:34:59 2016 From: report at bugs.python.org (Anand Reddy Pandikunta) Date: Fri, 09 Dec 2016 05:34:59 +0000 Subject: [New-bugs-announce] [issue28917] Docs: Add missing protocol to pickle Message-ID: <1481261699.94.0.5034553243.issue28917@psf.upfronthosting.co.za> New submission from Anand Reddy Pandikunta: In Python 2.7, it is documented. It is missing in Python 3 documentation. ---------- assignee: docs at python components: Documentation files: docs_pickle_add_missing_protocol.patch keywords: patch messages: 282764 nosy: ChillarAnand, abz64, docs at python, r.david.murray priority: normal severity: normal status: open title: Docs: Add missing protocol to pickle type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45810/docs_pickle_add_missing_protocol.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 03:51:23 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 09 Dec 2016 08:51:23 +0000 Subject: [New-bugs-announce] [issue28918] cross compiling xxlimited fails with "Py_LIMITED_API is incompatible with Py_DEBUG" Message-ID: <1481273483.19.0.548102187262.issue28918@psf.upfronthosting.co.za> New submission from Xavier de Gaye: This happens when the cross compilation is done with '--with-pydebug' while the native interpeter used to run setup.py has been built without it. The error message is: Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, and Py_REF_DEBUG ---------- assignee: xdegaye components: Cross-Build messages: 282771 nosy: Alex.Willmer, doko, xdegaye priority: normal severity: normal stage: needs patch status: open title: cross compiling xxlimited fails with "Py_LIMITED_API is incompatible with Py_DEBUG" type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 05:12:46 2016 From: report at bugs.python.org (Jiajun Huang) Date: Fri, 09 Dec 2016 10:12:46 +0000 Subject: [New-bugs-announce] [issue28919] Simplify `_copy_func_details` in unittest.mock Message-ID: <1481278366.66.0.0560230618441.issue28919@psf.upfronthosting.co.za> Changes by Jiajun Huang : ---------- components: Library (Lib) files: mock.patch keywords: patch nosy: Jiajun Huang priority: normal pull_requests: 2 severity: normal status: open title: Simplify `_copy_func_details` in unittest.mock type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45811/mock.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 08:38:13 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Dec 2016 13:38:13 +0000 Subject: [New-bugs-announce] [issue28920] Dangerous usage of "O" format string in _asynciomodule.c Message-ID: <1481290693.49.0.157975678284.issue28920@psf.upfronthosting.co.za> New submission from STINNER Victor: The new _asyncio module of Python 3.6 uses the _PyObject_CallMethodId() function to call functions. This function has a weird behaviour when using the format string "O": if the object is a tuple, the tuple is unpacked. _PyObject_CallMethodId(obj, &PyId_meth, "O", tuple, NULL) calls obj.meth(*tuple) instead of obj.meth(tuple). I only found one function which may have the bug: task_call_step(). But it seems like this function cannot be called with a tuple as "arg", only with an exception object. But just in case, I would suggest to replace: _PyObject_CallMethodId(obj, nameid, "O", arg); with _PyObject_CallMethodIdObjArgs(obj, nameid, arg, NULL); Note: _PyObject_CallMethodId() is called with a NULL terminal in the argument list, but the NULL is useless. A terminator is only required by _PyObject_CallMethodIdObjArgs(). Yeah, Python has a wide choice of functions to call a callable object, with funny APIs... And I'm adding new ones to Python 3.7 ;-) ---------- components: asyncio messages: 282778 nosy: gvanrossum, haypo, yselivanov priority: normal severity: normal status: open title: Dangerous usage of "O" format string in _asynciomodule.c versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 09:38:24 2016 From: report at bugs.python.org (Xiang Zhang) Date: Fri, 09 Dec 2016 14:38:24 +0000 Subject: [New-bugs-announce] [issue28921] Make str.count one character for latin1 string faster Message-ID: <1481294304.37.0.437308839314.issue28921@psf.upfronthosting.co.za> New submission from Xiang Zhang: I make a try to improve str.count one character for latin1 string. From benchmark, it could enhance the speed depending on the length of the string. # short one, a little regression ./python3 -m perf timeit --compare-to ~/cpython/python -s 's="abcdefg"' 's.count("a")' python: ..................... 190 ns +- 1 ns python3: ..................... 197 ns +- 2 ns Median +- std dev: [python] 190 ns +- 1 ns -> [python3] 197 ns +- 2 ns: 1.04x slower # a little longer ./python3 -m perf timeit --compare-to ~/cpython/python -s 's="abcdefghi"' 's.count("a")' python: ..................... 192 ns +- 15 ns python3: ..................... 184 ns +- 2 ns Median +- std dev: [python] 192 ns +- 15 ns -> [python3] 184 ns +- 2 ns: 1.05x faster # longer ./python3 -m perf timeit --compare-to ~/cpython/python -s 's="abcdefghihijklmnopqrstuvwxyz~!@##$%^&*()-=_+{}|"' 's.count("a")' python: ..................... 236 ns +- 12 ns python3: ..................... 209 ns +- 9 ns Median +- std dev: [python] 236 ns +- 12 ns -> [python3] 209 ns +- 9 ns: 1.13x faster # very long ./python3 -m perf timeit --compare-to ~/cpython/python -s 's="abcdefgHijk"*100' 's.count("z")' python: ..................... 1.02 us +- 0.00 us python3: ..................... 610 ns +- 1 ns Median +- std dev: [python] 1.02 us +- 0.00 us -> [python3] 610 ns +- 1 ns: 1.67x faster And since str.replace may also go through the code path involving count, it's somewhat affected: ./python3 -m perf timeit --compare-to ~/cpython/python -s 's="abcdefghihijklmnopqrstuvwxyz~!@##$%^&*()-=_+{}|"' 's.replace("a", "ccc")' python: ..................... 318 ns +- 31 ns python3: ..................... 298 ns +- 19 ns Median +- std dev: [python] 318 ns +- 31 ns -> [python3] 298 ns +- 19 ns: 1.07x faster For ucs2 and ucs4, the benchmarks are not appealing so leave them untouched. ---------- components: Interpreter Core files: latin1-str-count-one-character.patch keywords: patch messages: 282784 nosy: haypo, serhiy.storchaka, xiang.zhang priority: normal severity: normal stage: patch review status: open title: Make str.count one character for latin1 string faster type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45816/latin1-str-count-one-character.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 11:11:44 2016 From: report at bugs.python.org (ProgVal) Date: Fri, 09 Dec 2016 16:11:44 +0000 Subject: [New-bugs-announce] [issue28922] Add fixer for "import exceptions" Message-ID: <1481299904.08.0.332005358401.issue28922@psf.upfronthosting.co.za> New submission from ProgVal: Hi, Here is a fixer to remove "import exceptions" from Python 2 code and replace "exceptions.X" with "X". Valentin ---------- components: 2to3 (2.x to 3.x conversion tool) files: fix_import_exceptions.py messages: 282787 nosy: Valentin.Lorentz priority: normal severity: normal status: open title: Add fixer for "import exceptions" type: enhancement versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45817/fix_import_exceptions.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 12:21:10 2016 From: report at bugs.python.org (Ivan Pozdeev) Date: Fri, 09 Dec 2016 17:21:10 +0000 Subject: [New-bugs-announce] [issue28923] Nonexisting encoding specified in Tix.py Message-ID: <1481304070.27.0.11719456506.issue28923@psf.upfronthosting.co.za> New submission from Ivan Pozdeev: $ head 'c:\Py\Lib\lib-tk\Tix.py' -n 1 # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- There's no "iso-latin-1-unix" encoding in Python, so this declaration produces an error in some code analysis tools (I have it in PyScripter), as it should according to PEP263 . In 3.x, this was fixed in changeset d63344ba187888b6792ba8362a0dd09e06ed2f9a . ---------- components: Library (Lib) files: 105052.patch keywords: patch messages: 282791 nosy: Ivan.Pozdeev priority: normal severity: normal status: open title: Nonexisting encoding specified in Tix.py type: compile error versions: Python 2.7 Added file: http://bugs.python.org/file45819/105052.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 13:00:50 2016 From: report at bugs.python.org (STINNER Victor) Date: Fri, 09 Dec 2016 18:00:50 +0000 Subject: [New-bugs-announce] [issue28924] Inline PyEval_EvalFrameEx() in callers Message-ID: <1481306450.73.0.124326033178.issue28924@psf.upfronthosting.co.za> New submission from STINNER Victor: Inline PyEval_EvalFrameEx() in callers. The PEP 523 modified PyEval_EvalFrameEx(): it's now an indirection to interp->eval_frame(). Inline the call in performance critical code. Leave PyEval_EvalFrame() unchanged, this function is only kept for backward compatibility (and so not important for performance). I pushed directly my change as the revision 99c34e47348b, but it broke test_gdb. So now I doubt that it's 100% "safe" to inline the code. Outside test_gdb, does something else rely on PyEval_EvalFrameEx()? So I chose to open an issue to discuss the change. By "something", I'm thinking to Pyjion :-) Attached patch updates also python-gdb.py to fix test_gdb. ---------- files: inline_evalframeex.patch keywords: patch messages: 282794 nosy: brett.cannon, haypo, serhiy.storchaka priority: normal severity: normal status: open title: Inline PyEval_EvalFrameEx() in callers type: performance versions: Python 3.7 Added file: http://bugs.python.org/file45821/inline_evalframeex.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 13:11:16 2016 From: report at bugs.python.org (Raoul Gough) Date: Fri, 09 Dec 2016 18:11:16 +0000 Subject: [New-bugs-announce] [issue28925] Confusing exception from cPickle on reduce failure Message-ID: <1481307076.91.0.720116511602.issue28925@psf.upfronthosting.co.za> New submission from Raoul Gough: Description =========== Running the attached example program with Python 2.7.12 produces the output below. The demo deliberately raises a user-defined exception during the unpickling process, but the problem is that this exception does not propagate out of the unpickle call. Instead, it gets converted into a TypeError which is confusing and does not help identify the original problem. INFO:root:Creating BadReduce object INFO:root:Pickling INFO:root:Unpickling INFO:root:Raising exception "BadReduce init failed" Traceback (most recent call last): File "cpickle_reduce_failure.py", line 48, in main() File "cpickle_reduce_failure.py", line 41, in main pickler.loads(s1) File "cpickle_reduce_failure.py", line 27, in __init__ raise exception TypeError: __init__() takes exactly 2 arguments (4 given) If you change the demo to use the Python pickle module, i.e. "import pickle as pickler", it produces the expected output below: INFO:root:Creating BadReduce object INFO:root:Pickling INFO:root:Unpickling INFO:root:Raising exception "BadReduce init failed" INFO:root:Got MyException "BadReduce init failed" INFO:root:Done Analysis ======== The following code in Modules/cPickle.c in the function Instance_New (around https://github.com/python/cpython/blob/2.7/Modules/cPickle.c#L3917) does a PyErr_Restore with the exception type MyException, as raised from BadReduce.__init__, but it replaces the exception value with a tuple (original_exception, cls, args): PyObject *tp, *v, *tb, *tmp_value; PyErr_Fetch(&tp, &v, &tb); tmp_value = v; /* NULL occurs when there was a KeyboardInterrupt */ if (tmp_value == NULL) tmp_value = Py_None; if ((r = PyTuple_Pack(3, tmp_value, cls, args))) { Py_XDECREF(v); v=r; } PyErr_Restore(tp,v,tb); Later, PyErr_NormalizeException attempts to convert the exception value (the tuple) to the original exception type. This fails because MyException.__init__() can't handle the multiple arguments. This is what produces the TypeError "__init__() takes exactly 2 arguments (4 given)" Proposed Fix ============ I think it would be better if Instance_New did the PyErr_NormalizeException itself instead of allowing it to be done lazily. If the normalize works, i.e. the exception type accepts the extra arguments, the behaviour would be almost unchanged - the only difference being the PyErr_NormalizeException happens earlier. However, if the normalize fails, Instance_New can restore the original exception unchanged. That means that we lose the cls, args information in this case, but not the original exception. ---------- components: Library (Lib) files: cpickle_reduce_failure.py messages: 282795 nosy: raoul_gough_baml priority: normal severity: normal status: open title: Confusing exception from cPickle on reduce failure type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file45822/cpickle_reduce_failure.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 15:55:37 2016 From: report at bugs.python.org (Steven) Date: Fri, 09 Dec 2016 20:55:37 +0000 Subject: [New-bugs-announce] [issue28926] subprocess.Popen + Sqlalchemy doesn't wait for process Message-ID: <1481316937.81.0.393153740651.issue28926@psf.upfronthosting.co.za> New submission from Steven: Called subprocess.Popen("python_file.py", shell=True).wait(), which triggered a call to `Base.metadata.create_all(engine)` inside `python_file.py` This caused nothing after the `create_all(engine)` call to execute in `python_file.py` But, if I changed `subprocess.Popen` to `subprocess.check_call("python_file", shell=True).wait()`, the desired behavior was achieved. I was able to continue past `create_all(engine)` if there was an error in the parent script after the subprocess call. In this case, then `python_file.py` was able to execute fully as expected. ---------- components: Library (Lib) messages: 282804 nosy: s1113950 priority: normal severity: normal status: open title: subprocess.Popen + Sqlalchemy doesn't wait for process type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 19:07:26 2016 From: report at bugs.python.org (Robert Xiao) Date: Sat, 10 Dec 2016 00:07:26 +0000 Subject: [New-bugs-announce] [issue28927] bytes.fromhex should ignore all whitespace Message-ID: <1481328446.9.0.450435696311.issue28927@psf.upfronthosting.co.za> New submission from Robert Xiao: bytes.fromhex ignores space characters now (yay!) but still barfs if fed newlines or tabs: >>> bytes.fromhex('ab\ncd') Traceback (most recent call last): File "", line 1, in ValueError: non-hexadecimal number found in fromhex() arg at position 2 >>> bytes.fromhex('ab\tcd') Traceback (most recent call last): File "", line 1, in ValueError: non-hexadecimal number found in fromhex() arg at position 2 It's often quite useful to paste blobs of hex into source code (or the REPL) and call ".fromhex" on them. These might include spaces, tabs and/or newlines, and barfing on these other whitespace characters is inconvenient. I propose that bytes.fromhex should ignore all whitespace. A patch + test is attached. ---------- files: fromhex.patch keywords: patch messages: 282811 nosy: nneonneo priority: normal severity: normal status: open title: bytes.fromhex should ignore all whitespace type: enhancement versions: Python 3.6 Added file: http://bugs.python.org/file45823/fromhex.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 19:39:26 2016 From: report at bugs.python.org (wkdewey) Date: Sat, 10 Dec 2016 00:39:26 +0000 Subject: [New-bugs-announce] [issue28928] IDLE crashes when opening .py file from Finder Message-ID: <1481330366.3.0.996309855229.issue28928@psf.upfronthosting.co.za> New submission from wkdewey: Every time I try to open a .py file from the Finder (macOS Sierra), IDLE opens up and then immediately "unexpectedly quits." I can open them from within IDLE without the same problem I've attached Apple's crash report. Additionally, in the Console I get an error message like "IDLE[14872]: objc[14872]: Invalid or prematurely-freed autorelease pool 0x7f81bf959048." every time the crash happens I am using Python 2.7.12; I installed the correct version of tcltk (something that is frequently mentioned when I search online for this problem) so that isn't the issue. ---------- assignee: terry.reedy components: IDLE files: error.txt messages: 282815 nosy: terry.reedy, wkdewey priority: normal severity: normal status: open title: IDLE crashes when opening .py file from Finder type: crash versions: Python 2.7 Added file: http://bugs.python.org/file45824/error.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 9 19:58:56 2016 From: report at bugs.python.org (Brett Cannon) Date: Sat, 10 Dec 2016 00:58:56 +0000 Subject: [New-bugs-announce] [issue28929] Provide a link from documentation back to its source file Message-ID: <1481331536.86.0.539237207001.issue28929@psf.upfronthosting.co.za> New submission from Brett Cannon: It would be great if we provided a link from a documentation page back to the source file that the page is produced from, e.g. have https://docs.python.org/3.6/library/abc.html provide a link to https://github.com/python/cpython/blob/3.6/Doc/library/abc.rst. ---------- assignee: docs at python components: Documentation messages: 282818 nosy: brett.cannon, docs at python priority: normal severity: normal stage: needs patch status: open title: Provide a link from documentation back to its source file type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 10 01:20:32 2016 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 10 Dec 2016 06:20:32 +0000 Subject: [New-bugs-announce] [issue28930] bytes_methods.c won't recompile if related stringlib/* changed Message-ID: <1481350832.04.0.902172752525.issue28930@psf.upfronthosting.co.za> New submission from Xiang Zhang: bytes_methods.c includes files in stringlib, for example, stringlib/count.h. But if count.h changes, simply running make won't recompile bytes_methods.c and the methods of bytes remain unchanged. You have to make distclean and compile from scratch. ---------- components: Build messages: 282832 nosy: xiang.zhang priority: normal severity: normal status: open title: bytes_methods.c won't recompile if related stringlib/* changed type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 10 09:54:33 2016 From: report at bugs.python.org (Ivan Pozdeev) Date: Sat, 10 Dec 2016 14:54:33 +0000 Subject: [New-bugs-announce] [issue28931] urllib ignores FTP 226 response, breaking further FTP requests Message-ID: <1481381673.54.0.845583442328.issue28931@psf.upfronthosting.co.za> New submission from Ivan Pozdeev: >>> urllib.urlretrieve("ftp://ftp.zlatkovic.com/pub/libxml/md5sum.txt","t.bin") ('t.bin', ) >>> urllib.urlretrieve("ftp://ftp.zlatkovic.com/pub/libxml/md5sum.txt","t.bin") Traceback (most recent call last): File "", line 1, in File "C:\Py\lib\urllib.py", line 98, in urlretrieve return opener.retrieve(url, filename, reporthook, data) File "C:\Py\lib\urllib.py", line 245, in retrieve fp = self.open(url, data) File "C:\Py\lib\urllib.py", line 213, in open return getattr(self, name)(url) File "C:\Py\lib\urllib.py", line 558, in open_ftp (fp, retrlen) = self.ftpcache[key].retrfile(file, type) File "C:\Py\lib\urllib.py", line 906, in retrfile conn, retrlen = self.ftp.ntransfercmd(cmd) File "C:\Py\lib\ftplib.py", line 334, in ntransfercmd host, port = self.makepasv() File "C:\Py\lib\ftplib.py", line 312, in makepasv host, port = parse227(self.sendcmd('PASV')) File "C:\Py\lib\ftplib.py", line 830, in parse227 raise error_reply, resp IOError: [Errno ftp error] 200 Type set to I The cause is the 226 Transfer Complete response being ignored, causing further response lines to be incorrectly matched to request lines. The bug is a result of issue16270 for 3.x and issue26960 for 2.7. ---------- components: Library (Lib) files: ftp_error_illustration.txt messages: 282853 nosy: Ivan.Pozdeev priority: normal severity: normal status: open title: urllib ignores FTP 226 response, breaking further FTP requests type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45835/ftp_error_illustration.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 10 11:49:07 2016 From: report at bugs.python.org (Alexandr Shadchin) Date: Sat, 10 Dec 2016 16:49:07 +0000 Subject: [New-bugs-announce] [issue28932] Fail compile Python 3.6.0rc1 on OpenBSD 6.0 Message-ID: <1481388547.33.0.916805591486.issue28932@psf.upfronthosting.co.za> New submission from Alexandr Shadchin: In OpenBSD not exist sys/random.h. ---------- components: Build, Installation files: patch-Python_random_c messages: 282860 nosy: Alexandr Shadchin priority: normal severity: normal status: open title: Fail compile Python 3.6.0rc1 on OpenBSD 6.0 type: compile error versions: Python 3.6 Added file: http://bugs.python.org/file45837/patch-Python_random_c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 10 12:12:56 2016 From: report at bugs.python.org (Julien Palard) Date: Sat, 10 Dec 2016 17:12:56 +0000 Subject: [New-bugs-announce] [issue28933] AC: Accept None as a default value for any type Message-ID: <1481389976.88.0.777049011956.issue28933@psf.upfronthosting.co.za> New submission from Julien Palard: Today, writing an AC declaration like: something: Py_ssize_t(c_default="-1") = None Leads to the almost obvious "Py_ssize_t_converter: default value None for field something is not of type int". But it actually make sense: - Accept None as a default python value - Document "something=None" in the docstring - Write `Py_ssize_t something = -1` in the C code - Don't try to parse the argument if it's the default value, keeping the value from the C initialization In other words, it's a "Give -1 to the C implementation when argument is not given or None, and it may be usefull, typically I'll use it in issue28754. ---------- components: Argument Clinic messages: 282861 nosy: larry, mdk priority: normal severity: normal status: open title: AC: Accept None as a default value for any type versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 10 12:35:36 2016 From: report at bugs.python.org (bpoaugust) Date: Sat, 10 Dec 2016 17:35:36 +0000 Subject: [New-bugs-announce] [issue28934] _mboxMMDF#get_message should delegate to get_bytes Message-ID: <1481391336.7.0.180309653101.issue28934@psf.upfronthosting.co.za> New submission from bpoaugust: At present both _mboxMMDF#get_message and get_bytes read the file directly. However the code in get_bytes duplicates some of the code in get_message. get_message should be recoded to use get_bytes. It would then be possible to override get_bytes (which is also used by get_string) in order to transform the input stream e.g. to unmangle '>From ' lines. But in any case it makes sense to reuse the code - DRY ---------- components: email messages: 282863 nosy: barry, bpoaugust, r.david.murray priority: normal severity: normal status: open title: _mboxMMDF#get_message should delegate to get_bytes type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 10 14:12:20 2016 From: report at bugs.python.org (Axel Haustant) Date: Sat, 10 Dec 2016 19:12:20 +0000 Subject: [New-bugs-announce] [issue28935] distutils use ConfigParser in Python 3.x and fails to parse setup.cfg with percent sign Message-ID: <1481397140.66.0.236784364676.issue28935@psf.upfronthosting.co.za> New submission from Axel Haustant: Because of the Python 3.2 configparser renaming/refactoring, string interpolation has been enabled into distutils config parsing and so fails to read any setup.cfg with percent signs (try to perform string interpolation and fails). To reproduce: create a project with a percent sign anywhere in the setup.cfg file and execute python setup.py egg_info. It will pass on Python 2.x and fails on Python 3.x. The attached patch suimply disable string interpolation in distutils config parsing. That would be awesome to have this applied on any 3.x version (because project using tox to test against different Python versions also fails with the same issue Python 3.x and PyPI 3.x) ---------- components: Distutils files: disable-distutils-string-interpolation.patch keywords: patch messages: 282865 nosy: Axel Haustant, dstufft, eric.araujo priority: normal severity: normal status: open title: distutils use ConfigParser in Python 3.x and fails to parse setup.cfg with percent sign type: crash versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45839/disable-distutils-string-interpolation.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 11 07:33:10 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 11 Dec 2016 12:33:10 +0000 Subject: [New-bugs-announce] [issue28936] test_global_err_then_warn in test_syntax is no longer valid Message-ID: <1481459590.71.0.768888502862.issue28936@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Issue27999 invalidated test_global_err_then_warn in Lib/test/test_syntax.py:567. That test was added in issue763201 for testing that SyntaxWarning emitted in symtable_global() doesn't clobber a SyntaxError. In issue27999 a SyntaxWarning was converted to SyntaxError, and the test no longer serves its purpose. Issue28512 makes tests more strong (it tests the position of SyntaxError), but it can't be applied in 3.6, because _check_error() catches different SyntaxError. ---------- components: Tests keywords: 3.6regression messages: 282916 nosy: Jeremy.Hylton, gvanrossum, levkivskyi, serhiy.storchaka priority: normal severity: normal status: open title: test_global_err_then_warn in test_syntax is no longer valid versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 11 10:11:42 2016 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 11 Dec 2016 15:11:42 +0000 Subject: [New-bugs-announce] [issue28937] str.split(): remove empty strings when sep is not None Message-ID: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> New submission from Barry A. Warsaw: This has finally bugged me enough to file an issue, although I wouldn't be able to use it until Python 3.7. There's a subtle but documented difference in str.split() when sep=None: >>> help(''.split) Help on built-in function split: split(...) method of builtins.str instance S.split(sep=None, maxsplit=-1) -> list of strings Return a list of the words in S, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done. If sep is not specified or is None, any whitespace string is a separator and empty strings are removed from the result. I.e., that empty strings are removed from the result. This does not happen when sep is given, leading to this type of unfortunate code: >>> 'foo,bar,baz'.split(',') ['foo', 'bar', 'baz'] >>> 'foo,bar,baz'.replace(',', ' ').split() ['foo', 'bar', 'baz'] >>> ''.split(',') [''] >>> ''.replace(',', ' ').split() [] Specifically, code that wants to split on say commas, but has to handle the case where the source string is empty, shouldn't have to also filter out the single empty string item. Obviously we can't change existing behavior, so I propose to add a keyword argument `prune` that would make these two bits of code identical: >>> ''.split() [] >>> ''.split(' ', prune=True) [] and would handle the case of ''.split(',') without having to resort to creating an ephemeral intermediate string. `prune` should be a keyword-only argument, defaulting to False. ---------- components: Library (Lib) messages: 282923 nosy: barry priority: normal severity: normal status: open title: str.split(): remove empty strings when sep is not None versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 11 15:14:26 2016 From: report at bugs.python.org (Steffen Ullrich) Date: Sun, 11 Dec 2016 20:14:26 +0000 Subject: [New-bugs-announce] [issue28938] match_hostname treats SAN IP address as DNS name and fails to check CN then Message-ID: <1481487266.54.0.545771157838.issue28938@psf.upfronthosting.co.za> New submission from Steffen Ullrich: from Lib/ssl.py 303 elif key == 'IP Address': 304 if host_ip is not None and _ipaddress_match(value, host_ip): 305 return 306 dnsnames.append(value) 307 if not dnsnames: 308 # The subject is only checked when there is no dNSName entry 309 # in subjectAltName RFC 2818 and RFC 6125 say that CN should not be used if subjectAltNames contains DNS names. This means CN should still be checked if SAN contains only IP addresses. By appending IP address to dnsnames in line 306 it will not check the CN if there are no DNS names in SAN but only IP address. See also http://stackoverflow.com/questions/41089539/authentication-issue-with-ssl-certificate-using-python-requests-lib/41090559#41090559 ---------- messages: 282940 nosy: noxxi priority: normal severity: normal status: open title: match_hostname treats SAN IP address as DNS name and fails to check CN then versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 11 15:16:23 2016 From: report at bugs.python.org (Greg Solomon) Date: Sun, 11 Dec 2016 20:16:23 +0000 Subject: [New-bugs-announce] [issue28939] Groupby Is Roughly Equivalent To ... Message-ID: <1481487383.57.0.242190046836.issue28939@psf.upfronthosting.co.za> New submission from Greg Solomon: https://docs.python.org/3/library/itertools.html#itertools.groupby I found the "equivalent" code a bit hard to read. Is there any merit in changing it to something a bit like the following ? Kind Rgds, Greg class groupby: def __init__( self , iterable , key_function = ( lambda x: x ) ): self.iterable = iter( iterable ) self.key_function = key_function self.FINISHED = object() try: self.next_value = next( self.iterable ) except StopIteration: self.next_value = self.FINISHED def __iter__( self ): return self def __next__( self ): if self.next_value == self.FINISHED: raise StopIteration self.group_key_value = self.key_function( self.next_value ) return ( self.group_key_value , self._group() ) def _group( self ): while self.next_value != self.FINISHED \ and self.group_key_value == self.key_function( self.next_value ): yield self.next_value try: self.next_value = next( self.iterable ) except StopIteration: self.next_value = self.FINISHED return ---------- assignee: docs at python components: Documentation messages: 282943 nosy: docs at python, greg.solomon priority: normal severity: normal status: open title: Groupby Is Roughly Equivalent To ... versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 11 15:53:16 2016 From: report at bugs.python.org (Ronald Oussoren) Date: Sun, 11 Dec 2016 20:53:16 +0000 Subject: [New-bugs-announce] [issue28940] __length_hint__ isn't a hint for list() Message-ID: <1481489596.88.0.223371500433.issue28940@psf.upfronthosting.co.za> New submission from Ronald Oussoren: The following code raises MemoryError instead of creating an empty list: # START import sys class CustomIter: def __iter__(self): return self def __next__(self): raise StopIteration def __length_hint__(self): return sys.maxsize l = list(CustomIter()) #END That's because this empty iterator has a __length_hint__ that claims it returns a very large number of methods. The function listextend in Objects/listobject.c already ignores __length_hint__() when using it would overflow the size of the list, it would IMHO also be better to ignore the length hint when the attempt to resize fails as __length_hint__() is documented as a hint that may be incorrect. ---------- components: Interpreter Core messages: 282946 nosy: ronaldoussoren priority: normal severity: normal status: open title: __length_hint__ isn't a hint for list() versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 11 22:36:59 2016 From: report at bugs.python.org (Mariatta Wijaya) Date: Mon, 12 Dec 2016 03:36:59 +0000 Subject: [New-bugs-announce] [issue28941] Update the link to Source Code in Python Docs from hg to github Message-ID: <1481513819.65.0.156579360966.issue28941@psf.upfronthosting.co.za> New submission from Mariatta Wijaya: Some Python docs include a link to the Source Code, for example: https://docs.python.org/3.6/library/abc.html Once the repo is moved to github, the link should probably be updated to point to github: https://github.com/python/cpython/blob/master/Lib/abc.py ---------- assignee: docs at python components: Documentation messages: 282960 nosy: Mariatta, docs at python priority: normal severity: normal status: open title: Update the link to Source Code in Python Docs from hg to github versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 06:12:02 2016 From: report at bugs.python.org (Adam Gregory) Date: Mon, 12 Dec 2016 11:12:02 +0000 Subject: [New-bugs-announce] [issue28942] await expressions in f-strings Message-ID: <1481541122.12.0.429355486169.issue28942@psf.upfronthosting.co.za> New submission from Adam Gregory: Hi, I've been playing with f-strings, which seem like a great addition to the language. I noticed in the definition of f_expression that it can include any or_expr. As far as I understand, this includes "await" expressions, so I tried using await inside an f-string in a coroutine with CPython 3.6.0b4. This produces a SyntaxError. Should await be allowed in f-strings? I don't know if this is a bug or a documentation issue. Personally, I think it would be an occasionally useful feature - more so than yield, at least, which does work. Ref: https://docs.python.org/3.6/reference/lexical_analysis.html#formatted-string-literals ---------- assignee: docs at python components: Documentation, asyncio messages: 282980 nosy: Adam Gregory, docs at python, gvanrossum, yselivanov priority: normal severity: normal status: open title: await expressions in f-strings versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 06:22:10 2016 From: report at bugs.python.org (Xiang Zhang) Date: Mon, 12 Dec 2016 11:22:10 +0000 Subject: [New-bugs-announce] [issue28943] Use PyUnicode_MAX_CHAR_VALUE instead of PyUnicode_KIND in some API's short path Message-ID: <1481541730.48.0.478924248348.issue28943@psf.upfronthosting.co.za> New submission from Xiang Zhang: Some unicode APIs like PyUnicode_Contains get a short path comparing kinds. But this get a problem cannot apply to ascii and latin1. PyUnicode_MAX_CHAR_VALUE could be used instead to make the short path also apply to ascii and latin1. This skill is already used in PyUnicode_Replace. ---------- components: Interpreter Core files: short-path.patch keywords: patch messages: 282982 nosy: serhiy.storchaka, xiang.zhang priority: normal severity: normal stage: patch review status: open title: Use PyUnicode_MAX_CHAR_VALUE instead of PyUnicode_KIND in some API's short path type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45856/short-path.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 07:10:28 2016 From: report at bugs.python.org (woo yoo) Date: Mon, 12 Dec 2016 12:10:28 +0000 Subject: [New-bugs-announce] [issue28944] A lack of comma within EBNF rule of keywords_arguments Message-ID: <1481544628.07.0.0933253462311.issue28944@psf.upfronthosting.co.za> New submission from woo yoo: This is the documented rule, which lacks a comma within the last line. keywords_arguments ::= (keyword_item | "**" expression) ("," keyword_item | "**" expression)* The correct form should be: keywords_arguments ::= (keyword_item | "**" expression) ("," keyword_item |",""**" expression)* The original documentation is https://docs.python.org/3/reference/expressions.html#calls ---------- assignee: docs at python components: Documentation messages: 282987 nosy: docs at python, woo yoo priority: normal severity: normal status: open title: A lack of comma within EBNF rule of keywords_arguments versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 07:54:57 2016 From: report at bugs.python.org (bpoaugust) Date: Mon, 12 Dec 2016 12:54:57 +0000 Subject: [New-bugs-announce] [issue28945] get_boundary invokes unquote twice Message-ID: <1481547297.88.0.91240101349.issue28945@psf.upfronthosting.co.za> New submission from bpoaugust: get_boundary calls get_param('boundary') which unquotes the value. It then calls utils.collapse_rfc2231_value which also calls unquote. This causes problems for boundaries that have two sets of quotes. For example, I have seen the following in the wild: Content-Type: multipart/mixed; boundary="<<001-3e1dcd5a-119e>>" Both "" and <> are treated as quotes by unquote. The result is that both "< and >" are stripped off. This means that the boundaries no longer match. ---------- components: email messages: 282991 nosy: barry, bpoaugust, r.david.murray priority: normal severity: normal status: open title: get_boundary invokes unquote twice type: behavior versions: Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 08:27:27 2016 From: report at bugs.python.org (dd) Date: Mon, 12 Dec 2016 13:27:27 +0000 Subject: [New-bugs-announce] [issue28946] AttributeError: module 'signal' has no attribute 'SIGALRM' Message-ID: <1481549247.36.0.982629771207.issue28946@psf.upfronthosting.co.za> New submission from dd: When I try to run the example at the very end of the signal documentation page [https://docs.python.org/3/library/signal.html#example] I get the error from the title: AttributeError: module 'signal' has no attribute 'SIGALRM' The same thing happens for SIGINT, which is what I was trying to use in the first place. I found the comment that many things in signal have been turned to enums [https://docs.python.org/3/library/signal.html#module-contents] but they don't seem to be documented anywhere. I'm not sure if this is an actual bug or if these enums are just not documented, but It would be great if someone could look into this. I run an up-to-date Manjaro Linux (an Arch-based distro) and Python 3.5.2 (default, Nov 7 2016, 11:31:36) [GCC 6.2.1 20160830] Let me know if anything is unclear. ---------- messages: 282993 nosy: dd priority: normal severity: normal status: open title: AttributeError: module 'signal' has no attribute 'SIGALRM' versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 08:34:47 2016 From: report at bugs.python.org (arpit arora) Date: Mon, 12 Dec 2016 13:34:47 +0000 Subject: [New-bugs-announce] [issue28947] Facing issue while running Python 3.6.0rc1 windows x86-64 web based installer Message-ID: <1481549687.21.0.953592088628.issue28947@psf.upfronthosting.co.za> New submission from arpit arora: Hi, Post installing 'Python 3.6.0rc1 windows x86-64 web based installer' on my Windows 7 64 bit system, i am not able to start python. Each time i start it, i get a pop up saying that "the program can't start because 'api-ms-win-crt-runtime-|1-1-0.dll' is missing from your computer. Try reinstalling this program to fix this problem." I have reinstalled Python but still i get the same error message while starting it. I am stuck here. Please help me with this. Thanks in advance. Regards Arpit Arora ---------- components: Windows messages: 282994 nosy: arpit arora, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Facing issue while running Python 3.6.0rc1 windows x86-64 web based installer versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 08:35:06 2016 From: report at bugs.python.org (arpit arora) Date: Mon, 12 Dec 2016 13:35:06 +0000 Subject: [New-bugs-announce] [issue28948] Facing issue while running Python 3.6.0rc1 windows x86-64 web based installer Message-ID: <1481549706.57.0.80853202455.issue28948@psf.upfronthosting.co.za> New submission from arpit arora: Hi, Post installing 'Python 3.6.0rc1 windows x86-64 web based installer' on my Windows 7 64 bit system, i am not able to start python. Each time i start it, i get a pop up saying that "the program can't start because 'api-ms-win-crt-runtime-|1-1-0.dll' is missing from your computer. Try reinstalling this program to fix this problem." I have reinstalled Python but still i get the same error message while starting it. I am stuck here. Please help me with this. Thanks in advance. Regards Arpit Arora ---------- components: Windows messages: 282995 nosy: arpit arora, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Facing issue while running Python 3.6.0rc1 windows x86-64 web based installer versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 09:40:19 2016 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 12 Dec 2016 14:40:19 +0000 Subject: [New-bugs-announce] [issue28949] Unable to launch Python interpreter Message-ID: <1481553619.84.0.343525103437.issue28949@psf.upfronthosting.co.za> New submission from Jason R. Coombs: I recently upgraded Python 3.6.0rc1 over 3.6.0b4. Python would invoke just fine after the update, but following a system restart, I'm experiencing crashes on any invocation of Python. I suspect it's just a bad/corrupted install. I will do more investigation, but here's the report from MacOS. Process: Python [3211] Path: /Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: 3.6.0rc1 (3.6.0rc1) Code Type: X86-64 (Native) Parent Process: zsh [990] Responsible: Python [3211] User ID: 501 Date/Time: 2016-12-12 09:36:50.115 -0500 OS Version: Mac OS X 10.12.1 (16B2657) Report Version: 12 Anonymous UUID: 31F72BE9-33AC-23C5-6CC1-DA2C20DDA3B2 Time Awake Since Boot: 1400 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Application Specific Information: abort() called Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fffc65e0dda __pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fffc66cc787 pthread_kill + 90 2 libsystem_c.dylib 0x00007fffc6546420 abort + 129 3 org.python.python 0x00000001001280d1 Py_FatalError + 65 4 org.python.python 0x0000000100129e21 _Py_InitializeEx_Private + 1377 5 org.python.python 0x0000000100146c60 Py_Main + 1376 6 org.python.python 0x0000000100000dfe 0x100000000 + 3582 7 org.python.python 0x0000000100000c34 0x100000000 + 3124 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x0000000000000006 rcx: 0x00007fff5bfff448 rdx: 0x0000000000000000 rdi: 0x0000000000000307 rsi: 0x0000000000000006 rbp: 0x00007fff5bfff470 rsp: 0x00007fff5bfff448 r8: 0x0000000000000000 r9: 0x0000000000000006 r10: 0x0000000008000000 r11: 0x0000000000000206 r12: 0x00007fffcf286a20 r13: 0x0000000000000002 r14: 0x00007fffcf2a23c0 r15: 0x00007fff5bfff4d0 rip: 0x00007fffc65e0dda rfl: 0x0000000000000206 cr2: 0x00007fffcf284128 Logical CPU: 0 Error Code: 0x02000148 Trap Number: 133 Binary Images: 0x100000000 - 0x100000ff7 +org.python.python (3.6.0rc1 - 3.6.0rc1) <581ACC12-D39B-9ED6-E4C0-DC4709F9A849> /Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python 0x100003000 - 0x100225ff7 +org.python.python (3.6.0rc1, [c] 2001-2016 Python Software Foundation. - 3.6.0rc1) <57D55331-6C7E-012A-47A2-5CA85BB2ECAC> /Library/Frameworks/Python.framework/Versions/3.6/Python 0x7fff60b9d000 - 0x7fff60bda287 dyld (421.2) /usr/lib/dyld 0x7fffb11c3000 - 0x7fffb165cff7 com.apple.CoreFoundation (6.9 - 1348.15) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x7fffc4cdc000 - 0x7fffc4cddff3 libDiagnosticMessagesClient.dylib (102) <422911A4-E273-3E88-BFC4-DF6470E48242> /usr/lib/libDiagnosticMessagesClient.dylib 0x7fffc4f1b000 - 0x7fffc4f1cff3 libSystem.B.dylib (1238) /usr/lib/libSystem.B.dylib 0x7fffc502c000 - 0x7fffc502cff3 libauto.dylib (187) <5BBF6A00-CC76-389D-84E7-CA88EDADE683> /usr/lib/libauto.dylib 0x7fffc504d000 - 0x7fffc50a3ff7 libc++.1.dylib (307.4) /usr/lib/libc++.1.dylib 0x7fffc50a4000 - 0x7fffc50cefff libc++abi.dylib (307.2) <1CEF8ABB-7E6D-3C2F-8E0A-E7884478DD23> /usr/lib/libc++abi.dylib 0x7fffc560a000 - 0x7fffc582ffff libicucore.A.dylib (57132.0.1) <063DBF01-CEF8-3C2E-9917-A08358BB006D> /usr/lib/libicucore.A.dylib 0x7fffc5bbf000 - 0x7fffc5f8fd97 libobjc.A.dylib (706) /usr/lib/libobjc.A.dylib 0x7fffc63b6000 - 0x7fffc63c7ff3 libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib 0x7fffc63d6000 - 0x7fffc63daff7 libcache.dylib (79) <84E55656-FDA9-3B29-9E4F-BE31B2C0AA3C> /usr/lib/system/libcache.dylib 0x7fffc63db000 - 0x7fffc63e5fff libcommonCrypto.dylib (60092.20.1) /usr/lib/system/libcommonCrypto.dylib 0x7fffc63e6000 - 0x7fffc63edfff libcompiler_rt.dylib (62) <486BDE52-81B4-3446-BD72-23977CAE556F> /usr/lib/system/libcompiler_rt.dylib 0x7fffc63ee000 - 0x7fffc63f6fff libcopyfile.dylib (138) <0DA49B77-56EC-362D-98FF-FA78CFD986D6> /usr/lib/system/libcopyfile.dylib 0x7fffc63f7000 - 0x7fffc6479fdb libcorecrypto.dylib (442.20.2) <9846F683-6CED-3CE5-AE8A-B0A681F7FEEF> /usr/lib/system/libcorecrypto.dylib 0x7fffc647a000 - 0x7fffc64acfff libdispatch.dylib (703.20.1) /usr/lib/system/libdispatch.dylib 0x7fffc64ad000 - 0x7fffc64b2ff3 libdyld.dylib (421.2) <7BFA3476-6210-3BCB-8CE8-9B952F87BD84> /usr/lib/system/libdyld.dylib 0x7fffc64b3000 - 0x7fffc64b3ffb libkeymgr.dylib (28) <09CD7CA6-46D2-3A9F-B9F1-7C4CA5CA0D68> /usr/lib/system/libkeymgr.dylib 0x7fffc64c1000 - 0x7fffc64c1fff liblaunch.dylib (972.20.3) <7AB2E2EA-8B47-3420-87CE-5EE18A4EEE49> /usr/lib/system/liblaunch.dylib 0x7fffc64c2000 - 0x7fffc64c7fff libmacho.dylib (894) <1EAE5ADD-490C-3B1F-9F97-447BA8E0E90F> /usr/lib/system/libmacho.dylib 0x7fffc64c8000 - 0x7fffc64caff3 libquarantine.dylib (85) <78EF62D8-C890-3FC0-937A-C2FD8CEF8992> /usr/lib/system/libquarantine.dylib 0x7fffc64cb000 - 0x7fffc64ccffb libremovefile.dylib (45) /usr/lib/system/libremovefile.dylib 0x7fffc64cd000 - 0x7fffc64e5ff7 libsystem_asl.dylib (349.1.1) <2217DE86-0635-393E-93DD-A1344EC0EF4B> /usr/lib/system/libsystem_asl.dylib 0x7fffc64e6000 - 0x7fffc64e6ff7 libsystem_blocks.dylib (67) /usr/lib/system/libsystem_blocks.dylib 0x7fffc64e7000 - 0x7fffc6574fef libsystem_c.dylib (1158.20.4) /usr/lib/system/libsystem_c.dylib 0x7fffc6575000 - 0x7fffc6578ffb libsystem_configuration.dylib (888.20.5) /usr/lib/system/libsystem_configuration.dylib 0x7fffc6579000 - 0x7fffc657cfff libsystem_coreservices.dylib (41.2) /usr/lib/system/libsystem_coreservices.dylib 0x7fffc657d000 - 0x7fffc6595ffb libsystem_coretls.dylib (121.1.1) <8F7E9B12-400D-3276-A9C5-4546B0258554> /usr/lib/system/libsystem_coretls.dylib 0x7fffc6596000 - 0x7fffc659cfff libsystem_dnssd.dylib (765.20.4) <49E37AB9-776C-3F84-8AC2-9BDD0438ED9D> /usr/lib/system/libsystem_dnssd.dylib 0x7fffc659d000 - 0x7fffc65c6fff libsystem_info.dylib (503) /usr/lib/system/libsystem_info.dylib 0x7fffc65c7000 - 0x7fffc65e9ff7 libsystem_kernel.dylib (3789.21.4) <651F249F-D797-3FBD-A66F-66DFB48FCF38> /usr/lib/system/libsystem_kernel.dylib 0x7fffc65ea000 - 0x7fffc6631fe7 libsystem_m.dylib (3121.4) /usr/lib/system/libsystem_m.dylib 0x7fffc6632000 - 0x7fffc6650ff7 libsystem_malloc.dylib (116) <3DD17B88-B7A4-38B9-9E95-AB88E1C3B647> /usr/lib/system/libsystem_malloc.dylib 0x7fffc6651000 - 0x7fffc66a8ff3 libsystem_network.dylib (856.20.4) <0F16BBE0-3092-390E-96D9-0B5DCC97B317> /usr/lib/system/libsystem_network.dylib 0x7fffc66a9000 - 0x7fffc66b2ff3 libsystem_networkextension.dylib (563.20.3) /usr/lib/system/libsystem_networkextension.dylib 0x7fffc66b3000 - 0x7fffc66bcff3 libsystem_notify.dylib (165.20.1) /usr/lib/system/libsystem_notify.dylib 0x7fffc66bd000 - 0x7fffc66c5fe7 libsystem_platform.dylib (126.1.2) <884DDF42-3CAE-334A-82CE-965617130FB1> /usr/lib/system/libsystem_platform.dylib 0x7fffc66c6000 - 0x7fffc66d0ff7 libsystem_pthread.dylib (218.20.1) /usr/lib/system/libsystem_pthread.dylib 0x7fffc66d1000 - 0x7fffc66d4ff7 libsystem_sandbox.dylib (592.21.2) /usr/lib/system/libsystem_sandbox.dylib 0x7fffc66d5000 - 0x7fffc66d6fff libsystem_secinit.dylib (24) /usr/lib/system/libsystem_secinit.dylib 0x7fffc66d7000 - 0x7fffc66defff libsystem_symptoms.dylib (532.1.1) /usr/lib/system/libsystem_symptoms.dylib 0x7fffc66df000 - 0x7fffc66ffff7 libsystem_trace.dylib (518.20.8) <046443DA-0474-3A73-A69F-1DC21C49B8AD> /usr/lib/system/libsystem_trace.dylib 0x7fffc6700000 - 0x7fffc6705ffb libunwind.dylib (35.3) <9F7C2AD8-A9A7-3DE4-828D-B0F0F166AAA0> /usr/lib/system/libunwind.dylib 0x7fffc6706000 - 0x7fffc672fff7 libxpc.dylib (972.20.3) /usr/lib/system/libxpc.dylib External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 1016 thread_create: 0 thread_set_state: 0 VM Region Summary: ReadOnly portion of Libraries: Total=130.3M resident=0K(0%) swapped_out_or_unallocated=130.3M(100%) Writable regions: Total=35.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=35.7M(100%) VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Kernel Alloc Once 8K 2 MALLOC 19.3M 11 MALLOC guard page 16K 4 VM_ALLOCATE 4K 2 __DATA 3452K 49 __LINKEDIT 113.4M 5 __TEXT 16.8M 47 __UNICODE 556K 2 __UNIXSTACK 16.0M 2 shared memory 8K 3 =========== ======= ======= TOTAL 169.5M 117 Model: MacBookPro13,2, BootROM MBP132.0226.B00, 2 processors, Intel Core i7, 3.3 GHz, 16 GB, SMC 2.37f18 Graphics: kHW_IntelIrisGraphics550Item, Intel Iris Graphics 550, Built-In Memory Module: BANK 0/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320 Memory Module: BANK 1/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x802C, 0x4D5435324C31473332443450472D30393320 AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x157), Broadcom BCM43xx 1.0 (7.21.171.47.1a8) Bluetooth: Version 5.0.1f7, 3 services, 27 devices, 1 incoming serial ports Network Service: Wi-Fi, AirPort, en0 PCI Card: pci1b21,1142, USB eXtensible Host Controller, Thunderbolt at 195,0,0 USB Device: USB 3.0 Bus USB Device: iBridge USB Device: USB 3.0 Bus USB Device: ASM107x USB Device: TUSB3410 Boot Device USB Device: Microsoft? LifeCam Cinema(TM) USB Device: ASM107x Thunderbolt Bus: MacBook Pro, Apple Inc., 11.9 Thunderbolt Bus: MacBook Pro, Apple Inc., 11.9 Thunderbolt Device: 34UM95, LG Electronics, 3, 24.1 ---------- messages: 283007 nosy: jason.coombs priority: normal severity: normal status: open title: Unable to launch Python interpreter versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 13:15:13 2016 From: report at bugs.python.org (Xiang Zhang) Date: Mon, 12 Dec 2016 18:15:13 +0000 Subject: [New-bugs-announce] [issue28950] -j0 fails the check -j are not allowed together with -T/-l Message-ID: <1481566513.26.0.47817718709.issue28950@psf.upfronthosting.co.za> New submission from Xiang Zhang: For python test command line arguments, -j is not allowed together with -T/-l (don't know why): [cpython]$ ./python -m test -j4 -T usage: python -m test [options] [test_name1 [test_name2 ...]] python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]] regrtest.py: error: -T and -j don't go together! Pass -h or --help for complete help. [cpython]$ ./python -m test -j4 -l usage: python -m test [options] [test_name1 [test_name2 ...]] python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]] regrtest.py: error: -l and -j don't go together! Pass -h or --help for complete help. But -j0 which also spawns multiple progresses fails the check. ---------- components: Tests files: test-command-line-j0.patch keywords: patch messages: 283032 nosy: xiang.zhang priority: normal severity: normal stage: patch review status: open title: -j0 fails the check -j are not allowed together with -T/-l type: behavior versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45864/test-command-line-j0.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 13:57:28 2016 From: report at bugs.python.org (kevin) Date: Mon, 12 Dec 2016 18:57:28 +0000 Subject: [New-bugs-announce] [issue28951] re.flags not documented in Module Contents as promised. Message-ID: <1481569048.46.0.00215126822864.issue28951@psf.upfronthosting.co.za> New submission from kevin: In the online documentation of module re (https://docs.python.org/3.5/library/re.html) under 6.2.1. Regular Expression Syntax for item (?aiLmsux) we are promised "The flags are described in Module Contents" but no description is found there. In fact a number of other references are found to flags, but no description of the individual flags. AFAICT the closest thing to a description is found at the original reference -- at least it gives a code and name for each one. ---------- assignee: docs at python components: Documentation messages: 283034 nosy: 4Dummies, docs at python priority: normal severity: normal status: open title: re.flags not documented in Module Contents as promised. type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 14:38:54 2016 From: report at bugs.python.org (kevin) Date: Mon, 12 Dec 2016 19:38:54 +0000 Subject: [New-bugs-announce] [issue28952] csv.Sniffer().sniff(0 returns a value without the "strict" attribute Message-ID: <1481571534.8.0.412951784743.issue28952@psf.upfronthosting.co.za> New submission from kevin: In https://docs.python.org/3.5/library/csv.html#dialects-and-formatting-parameters the Dialect objects are described as supporting, among others, the Dialect.strict attribute, with a default value of False. However, the sniff() returns an object lacking this attribute entirely, not even with the value None. At least on my inputs, which I'd include but they have personnel information. I can redact it if required. ---------- components: Library (Lib) messages: 283041 nosy: 4Dummies priority: normal severity: normal status: open title: csv.Sniffer().sniff(0 returns a value without the "strict" attribute type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 16:43:13 2016 From: report at bugs.python.org (Ram Rachum) Date: Mon, 12 Dec 2016 21:43:13 +0000 Subject: [New-bugs-announce] [issue28953] Use `raise from` when raising new IncompleteRead Message-ID: <1481578993.98.0.52471260982.issue28953@psf.upfronthosting.co.za> New submission from Ram Rachum: I had this error come up in my code, and because it doesn't use `raise ... from` I thought that the second error was unexpected, while in fact it wasn't. This patch should fix that. ---------- components: Library (Lib) files: 1.patch keywords: patch messages: 283052 nosy: cool-RR priority: normal severity: normal status: open title: Use `raise from` when raising new IncompleteRead versions: Python 3.7 Added file: http://bugs.python.org/file45865/1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 21:22:46 2016 From: report at bugs.python.org (woo yoo) Date: Tue, 13 Dec 2016 02:22:46 +0000 Subject: [New-bugs-announce] [issue28954] Incorrect EBNF rule of keywords_arguments Message-ID: <1481595766.74.0.577639992265.issue28954@psf.upfronthosting.co.za> New submission from woo yoo: This is the documented rule, which lacks a comma within the last line. keywords_arguments ::= (keyword_item | "**" expression) ("," keyword_item | "**" expression)* The correct form should be: keywords_arguments ::= (keyword_item | "**" expression) ("," keyword_item |",""**" expression)* The original documentation is https://docs.python.org/3/reference/expressions.html#calls ---------- assignee: docs at python components: Documentation messages: 283067 nosy: docs at python, woo yoo priority: normal severity: normal status: open title: Incorrect EBNF rule of keywords_arguments versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 23:09:31 2016 From: report at bugs.python.org (woo yoo) Date: Tue, 13 Dec 2016 04:09:31 +0000 Subject: [New-bugs-announce] [issue28955] Not matched behavior of numeric comparison with the documentation Message-ID: <1481602171.57.0.675005739221.issue28955@psf.upfronthosting.co.za> New submission from woo yoo: According to the documentation, which said "Additionally, comparing any number to a not-a-number value will return False. ",the comparison of `float('nan')!= 1`should yield False, while the result is True. Small errors like this in documentation should be corrected? The related link https://docs.python.org/3/reference/expressions.html#value-comparisons ---------- assignee: docs at python components: Documentation messages: 283069 nosy: docs at python, woo yoo priority: normal severity: normal status: open title: Not matched behavior of numeric comparison with the documentation type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 12 23:21:41 2016 From: report at bugs.python.org (Srikanth Anantharam) Date: Tue, 13 Dec 2016 04:21:41 +0000 Subject: [New-bugs-announce] [issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError Message-ID: <1481602901.85.0.570887953824.issue28956@psf.upfronthosting.co.za> New submission from Srikanth Anantharam: return minimum of modes for a multimodal distribution instead of raising a StatisticsError ---------- components: Library (Lib) messages: 283071 nosy: Srikanth Anantharam priority: normal pull_requests: 3 severity: normal status: open title: return minimum of modes for a multimodal distribution instead of raising a StatisticsError type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 13 01:07:33 2016 From: report at bugs.python.org (Ramakrishna Kommineni) Date: Tue, 13 Dec 2016 06:07:33 +0000 Subject: [New-bugs-announce] [issue28957] undefined symbol: PyUnicodeUCS2_FromUnicode when executing any command with pip2.7 Message-ID: <1481609253.38.0.127310652457.issue28957@psf.upfronthosting.co.za> New submission from Ramakrishna Kommineni: Hi, I have installed python from source in the directory /home/rkommine/software/python2.7. During installation there are no errors seen. I have added the below environment variables to my bashrc export PATH=/home/rkommine/software/python2.7.12/bin:/home/rkommine/software/tcltk8.6.6/bin:$PATH export LD_LIBBRARY_PATH=/home/rkommine/software/python2.7.12/lib:$LD_LIBBRARY_PATH rkommine at rubuntu:~/Downloads$ which python2.7 /home/rkommine/software/python2.7.12/bin/python2.7 rkommine at rubuntu:~/Downloads$ python2.7 --version Python 2.7.12 rkommine at rubuntu:~/Downloads$ which pip2.7 /home/rkommine/software/python2.7.12/bin/pip2.7 But when I execute any command with pip2.7 I am getting the below errors rkommine at rubuntu:~/Downloads$ pip2.7 --version Traceback (most recent call last): File "/home/rkommine/software/python2.7.12/bin/pip2.7", line 7, in from pip import main File "/home/rkommine/software/python2.7.12/lib/python2.7/site-packages/pip/__init__.py", line 16, in from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/home/rkommine/software/python2.7.12/lib/python2.7/site-packages/pip/vcs/subversion.py", line 9, in from pip.index import Link File "/home/rkommine/software/python2.7.12/lib/python2.7/site-packages/pip/index.py", line 30, in from pip.wheel import Wheel, wheel_ext File "/home/rkommine/software/python2.7.12/lib/python2.7/site-packages/pip/wheel.py", line 32, in from pip import pep425tags File "/home/rkommine/software/python2.7.12/lib/python2.7/site-packages/pip/pep425tags.py", line 9, in import ctypes File "/home/rkommine/software/python2.7.12/lib/python2.7/ctypes/__init__.py", line 7, in from _ctypes import Union, Structure, Array ImportError: /home/rkommine/software/python2.7.12/lib/python2.7/lib-dynload/_ctypes.so: undefined symbol: PyUnicodeUCS2_FromUnicode rkommine at rubuntu:~/Downloads$ pip2.7 install robotframework Traceback (most recent call last): File "/home/rkommine/software/python2.7.12/bin/pip2.7", line 7, in from pip import main File "/home/rkommine/software/python2.7.12/lib/python2.7/site-packages/pip/__init__.py", line 16, in from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/home/rkommine/software/python2.7.12/lib/python2.7/site-packages/pip/vcs/subversion.py", line 9, in from pip.index import Link File "/home/rkommine/software/python2.7.12/lib/python2.7/site-packages/pip/index.py", line 30, in from pip.wheel import Wheel, wheel_ext File "/home/rkommine/software/python2.7.12/lib/python2.7/site-packages/pip/wheel.py", line 32, in from pip import pep425tags File "/home/rkommine/software/python2.7.12/lib/python2.7/site-packages/pip/pep425tags.py", line 9, in import ctypes File "/home/rkommine/software/python2.7.12/lib/python2.7/ctypes/__init__.py", line 7, in from _ctypes import Union, Structure, Array ImportError: /home/rkommine/software/python2.7.12/lib/python2.7/lib-dynload/_ctypes.so: undefined symbol: PyUnicodeUCS2_FromUnicode rkommine at rubuntu:~/Downloads$ Could you please help to fix this error? Thanks in advance. ---------- components: ctypes files: Installation.Log.txt messages: 283074 nosy: Ramakrishna Kommineni priority: normal severity: normal status: open title: undefined symbol: PyUnicodeUCS2_FromUnicode when executing any command with pip2.7 type: crash versions: Python 2.7 Added file: http://bugs.python.org/file45869/Installation.Log.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 13 01:55:01 2016 From: report at bugs.python.org (Ilya Kulakov) Date: Tue, 13 Dec 2016 06:55:01 +0000 Subject: [New-bugs-announce] [issue28958] Python should return comperhansive error when SSLContext cannot be created Message-ID: <1481612101.72.0.228099199654.issue28958@psf.upfronthosting.co.za> New submission from Ilya Kulakov: When SSLContext cannot be created, python raises an SSLError exception with "failed to allocate SSL context". https://hg.python.org/cpython/file/4def2a2901a5/Modules/_ssl.c#l2260 This is completely useless to debug the error. In fact many errors raised from _ssl.c are non-helpful. Python's SSLError should be extended to include comprehensive information about OpenSSL's error stack which can be extracted with `ERR_get_error_line`. ---------- assignee: christian.heimes components: SSL messages: 283078 nosy: Ilya.Kulakov, christian.heimes priority: normal severity: normal status: open title: Python should return comperhansive error when SSLContext cannot be created type: enhancement versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 13 08:07:01 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Dec 2016 13:07:01 +0000 Subject: [New-bugs-announce] [issue28959] Add a macro for dict size Message-ID: <1481634421.56.0.985862767516.issue28959@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: In additional to C API functions PyTuple_Size() and PyList_Size() there are fast macros PyTuple_GET_SIZE() and PyList_GET_SIZE() for getting the size of a tuple or a list. But for dicts there is just PyDict_Size(). It is not just slower than a macro, but can return an error (actually this never happens in CPython core and extensions). Proposed patch adds new private macro _PyDict_GET_SIZE() and makes the code using it instead of PyDict_Size(). I don't expect significant performance gain except perhaps few checks that a dict is empty. The main advantage to me is that not checking the result for error no longer looks as potential bug. ---------- components: Interpreter Core files: _PyDict_GET_SIZE.patch keywords: patch messages: 283099 nosy: haypo, inada.naoki, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Add a macro for dict size type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45874/_PyDict_GET_SIZE.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 13 08:38:04 2016 From: report at bugs.python.org (Ryan) Date: Tue, 13 Dec 2016 13:38:04 +0000 Subject: [New-bugs-announce] [issue28960] Small typo in Thread.join docs Message-ID: <1481636284.79.0.913462681395.issue28960@psf.upfronthosting.co.za> New submission from Ryan: There is a '--' before a ',' that doesn't make sense here: https://docs.python.org/3/library/threading.html#threading.Thread.join ---------- assignee: docs at python components: Documentation files: fixdoc.patch keywords: patch messages: 283101 nosy: docs at python, rcorre priority: normal severity: normal status: open title: Small typo in Thread.join docs type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45875/fixdoc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 13 08:47:48 2016 From: report at bugs.python.org (Jiajun Huang) Date: Tue, 13 Dec 2016 13:47:48 +0000 Subject: [New-bugs-announce] [issue28961] Is it a bug(method `_Call.__new__` in unittest.mock)? Message-ID: <1481636868.17.0.0411235027553.issue28961@psf.upfronthosting.co.za> New submission from Jiajun Huang: code in `_Call.__new__`: def __new__(cls, value=(), name=None, parent=None, two=False, ? ? ? from_kall=True): ? name = '' ? args = () ? kwargs = {} ? _len = len(value) ? if _len == 3: ... the parameter `name` had been override since the function starts. so whatever name is, it's been ignored. Is it a bug? or something else? ---------- components: Library (Lib) messages: 283104 nosy: Jiajun Huang priority: normal severity: normal status: open title: Is it a bug(method `_Call.__new__` in unittest.mock)? type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 13 11:28:07 2016 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 13 Dec 2016 16:28:07 +0000 Subject: [New-bugs-announce] [issue28962] Crash when throwing an exception with a malicious __hash__ override Message-ID: <1481646487.87.0.692050241508.issue28962@psf.upfronthosting.co.za> New submission from Jelle Zijlstra: $ cat baderror.py class BadError(Exception): def __init__(self): self.i = 0 def __hash__(self): self.i += 1 return self.i e = BadError() raise e from e $ ./python.exe -V Python 3.5.2+ $ ./python.exe baderror.py Segmentation fault: 11 I have reproduced this with Python 3.3, 3.4, 3.5, and 3.6; I assume it's been present throughout the 3 series. This is because print_exception_recursive in pythonrun.c keeps following the __cause__ chain, and here the exception is its own __cause__. It uses a set to ensure that it breaks cycles, but that doesn't help here because of the exception's incorrect __hash__ method. ---------- components: Interpreter Core files: baderror.py messages: 283118 nosy: Jelle Zijlstra priority: normal severity: normal status: open title: Crash when throwing an exception with a malicious __hash__ override versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45876/baderror.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 13 14:26:41 2016 From: report at bugs.python.org (Ned Williamson) Date: Tue, 13 Dec 2016 19:26:41 +0000 Subject: [New-bugs-announce] [issue28963] Use-after-free in _asynciomodule.c Message-ID: <1481657201.46.0.37032067172.issue28963@psf.upfronthosting.co.za> New submission from Ned Williamson: There are two cases of use-after-free in the new Modules/_asynciomodule.c in the release candidate for Python 3.6, but I'm filing these together because it's the same underlying issue. In both cases in this file where the unsafe `PyList_GET_ITEM` is called, `_asyncio_Future_remove_done_callback` and `future_schedule_callbacks`, there is a function called on the fetched item that allows the user to mutate the callbacks list (`PyObject_RichCompareBool` and `_PyObject_CallMethodId`), which then leads to OOB access on subsequent iterations. For example, this script can trigger the vulnerability for `remove_done_callback`: ``` import asyncio fut = asyncio.Future() fut.add_done_callback(str) for _ in range(63): fut.add_done_callback(id) class evil: def __eq__(self, other): fut.remove_done_callback(id) return False fut.remove_done_callback(evil()) ``` On an ASAN build we can see that there is indeed a UAF occurring: ``` ================================================================= ==19239==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60300000e7f0 at pc 0x000106fe6704 bp 0x7fff5cda09c0 sp 0x7fff5cda09b8 READ of size 8 at 0x60300000e7f0 thread T0 #0 0x106fe6703 in _asyncio_Future_remove_done_callback _asynciomodule.c:526 #1 0x102f5af35 in _PyCFunction_FastCallDict methodobject.c:192 #2 0x1030e9044 in call_function ceval.c:4788 #3 0x1030da2f0 in _PyEval_EvalFrameDefault ceval.c:3275 #4 0x1030eb09b in _PyEval_EvalCodeWithName ceval.c:718 #5 0x1030ced53 in PyEval_EvalCode ceval.c:4140 #6 0x10317da47 in PyRun_FileExFlags pythonrun.c:980 #7 0x10317c110 in PyRun_SimpleFileExFlags pythonrun.c:396 #8 0x1031c76b8 in Py_Main main.c:320 #9 0x102e5ed40 in main python.c:69 #10 0x7fffc9bd8254 in start (libdyld.dylib+0x5254) 0x60300000e7f0 is located 0 bytes to the right of 32-byte region [0x60300000e7d0,0x60300000e7f0) allocated by thread T0 here: #0 0x1039d5f87 in wrap_realloc (libclang_rt.asan_osx_dynamic.dylib+0x4af87) #1 0x102efb089 in list_ass_slice listobject.c:63 #2 0x106fe6605 in _asyncio_Future_remove_done_callback _asynciomodule.c:541 #3 0x102f5af35 in _PyCFunction_FastCallDict methodobject.c:192 #4 0x1030e9044 in call_function ceval.c:4788 #5 0x1030da2f0 in _PyEval_EvalFrameDefault ceval.c:3275 #6 0x1030ed94a in _PyFunction_FastCallDict ceval.c:718 #7 0x102e81308 in _PyObject_FastCallDict abstract.c:2295 #8 0x102e816b1 in _PyObject_Call_Prepend abstract.c:2358 #9 0x102e81286 in _PyObject_FastCallDict abstract.c:2316 #10 0x102fa125a in slot_tp_richcompare typeobject.c:6287 #11 0x102f61f66 in PyObject_RichCompare object.c:671 #12 0x102f62421 in PyObject_RichCompareBool object.c:741 #13 0x106fe6544 in _asyncio_Future_remove_done_callback _asynciomodule.c:528 #14 0x102f5af35 in _PyCFunction_FastCallDict methodobject.c:192 #15 0x1030e9044 in call_function ceval.c:4788 #16 0x1030da2f0 in _PyEval_EvalFrameDefault ceval.c:3275 #17 0x1030eb09b in _PyEval_EvalCodeWithName ceval.c:718 #18 0x1030ced53 in PyEval_EvalCode ceval.c:4140 #19 0x10317da47 in PyRun_FileExFlags pythonrun.c:980 #20 0x10317c110 in PyRun_SimpleFileExFlags pythonrun.c:396 #21 0x1031c76b8 in Py_Main main.c:320 #22 0x102e5ed40 in main python.c:69 #23 0x7fffc9bd8254 in start (libdyld.dylib+0x5254) SUMMARY: AddressSanitizer: heap-buffer-overflow _asynciomodule.c:526 in _asyncio_Future_remove_done_callback Shadow bytes around the buggy address: 0x1c0600001ca0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600001cb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600001cc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600001cd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600001ce0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x1c0600001cf0: fa fa fa fa fa fa fa fa fa fa 00 00 00 00[fa]fa 0x1c0600001d00: 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 00 02 0x1c0600001d10: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd 0x1c0600001d20: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa 0x1c0600001d30: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fd 0x1c0600001d40: fa fa fd fd fd fd fa fa 00 00 00 00 fa fa 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==19239==ABORTING [1] 19239 abort ASAN_OPTIONS=halt_on_error=0 ./python.exe test.py ``` ---------- messages: 283134 nosy: Ned Williamson priority: normal severity: normal status: open title: Use-after-free in _asynciomodule.c type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 13 16:47:44 2016 From: report at bugs.python.org (Steve Merritt) Date: Tue, 13 Dec 2016 21:47:44 +0000 Subject: [New-bugs-announce] [issue28964] AST literal_eval exceptions provide no information about line number Message-ID: <1481665664.26.0.256194535172.issue28964@psf.upfronthosting.co.za> New submission from Steve Merritt: Without line numbers, debugging syntax errors in large documents is a tedious and painful process. ---------- components: Library (Lib) files: mywork.patch keywords: patch messages: 283142 nosy: stevemerritt priority: normal severity: normal status: open title: AST literal_eval exceptions provide no information about line number type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file45879/mywork.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 13 19:51:48 2016 From: report at bugs.python.org (Sean Murphy) Date: Wed, 14 Dec 2016 00:51:48 +0000 Subject: [New-bugs-announce] [issue28965] Multiprocessing spawn/forkserver fails to pass Queues Message-ID: <1481676708.34.0.90034781132.issue28965@psf.upfronthosting.co.za> New submission from Sean Murphy: Python fails to pass a Queue when calling Process with multiprocessing.set_start_method set to "spawn" or "forkserver". Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/multiprocessing/spawn.py", line 106, in spawn_main exitcode = _main(fd) File "/usr/lib/python3.5/multiprocessing/spawn.py", line 116, in _main self = pickle.load(from_parent) File "/usr/lib/python3.5/multiprocessing/synchronize.py", line 111, in __setstate__ self._semlock = _multiprocessing.SemLock._rebuild(*state) FileNotFoundError: [Errno 2] No such file or directory Here is a minimized example: ``` #!/usr/bin/env python3 import multiprocessing def check_child(q): print("Queue", q) if __name__ == '__main__': multiprocessing.set_start_method('spawn') # multiprocessing.set_start_method('fork') # multiprocessing.set_start_method('forkserver') q = multiprocessing.Queue(-1) print("q", q) proc = multiprocessing.Process(target=check_child, args=(q,)) proc.start() ``` Also, this fails when the Queue is implicitly passed to the child. ``` class Blerg(): def __init__(self): self.q = multiprocessing.Queue(-1) def print_queue(self): print("Queue", self.q) if __name__ == '__main__': multiprocessing.set_start_method('spawn') blerg = Blerg() blerg.print_queue() proc = multiprocessing.Process(target=blerg.print_queue) proc.start() ``` $ python3 --version Python 3.5.2 Windows (which defaults to "spawn" style multiprocessing) does not seem to have this issue (at least in 2.7.12). ---------- components: Library (Lib) messages: 283150 nosy: Sean Murphy priority: normal severity: normal status: open title: Multiprocessing spawn/forkserver fails to pass Queues type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 13 20:45:53 2016 From: report at bugs.python.org (Victor Sergienko) Date: Wed, 14 Dec 2016 01:45:53 +0000 Subject: [New-bugs-announce] [issue28966] Menu.add_checkbutton has no checkmark on OS X Message-ID: <1481679953.88.0.548860195336.issue28966@psf.upfronthosting.co.za> New submission from Victor Sergienko: On Linux, this code toggles the checkmark on a checkbutton in right-click menu. On OS X 10.12 it doesn't. OS X 10.12, python 3.6.0b4. #!/usr/bin/env python3 import tkinter as tk class NodePopup(tk.Menu): def __init__(self, master): super().__init__(master, tearoff=0) self.send_disabled = tk.BooleanVar() self.add_checkbutton(label="Disable sending", variable=self.send_disabled, command=self.toggle_send) def popup(self, event): print('send_disabled before:', self.send_disabled.get()) self.post(event.x_root, event.y_root) def toggle_send(self): print('send_disabled after:', self.send_disabled.get()) def change(): state = not menu.send_disabled.get() menu.send_disabled.set(state) root = tk.Tk() root.pack_propagate(0) menu = NodePopup(root) root.bind('', menu.popup) root.mainloop() ---------- components: Tkinter messages: 283153 nosy: Victor Sergienko priority: normal severity: normal status: open title: Menu.add_checkbutton has no checkmark on OS X type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 14 01:09:48 2016 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 14 Dec 2016 06:09:48 +0000 Subject: [New-bugs-announce] [issue28967] copy.copy fails on threading.local subclass Message-ID: <1481695788.41.0.793591769474.issue28967@psf.upfronthosting.co.za> New submission from Jelle Zijlstra: Calling copy.copy on a threading.local subclass copies attributes over correctly in Python 2.7, but creates an empty object in Python 3.3-3.5 and fails with a pickle-related error in 3.6. Marking this as a release blocker and assigning to Ned because this appears to be a regression in 3.6. However, given that the behavior in previous Python 3 versions isn't very useful either, I'd personally not want to block 3.6 on it. I haven't yet looked at code to figure out what is causing the differences in behavior. I couldn't find any tracker issues related to copying or pickling threading.local objects, but may have missed something. $ cat thread_local_copy.py import copy import threading class Obj(threading.local): def __init__(self): self.x = 3 o = Obj() o2 = copy.copy(o) assert hasattr(o2, 'x') $ python2.7 thread_local_copy.py $ python3.3 thread_local_copy.py Traceback (most recent call last): File "thread_local_copy.py", line 10, in assert hasattr(o2, 'x') AssertionError $ python3.4 thread_local_copy.py Traceback (most recent call last): File "thread_local_copy.py", line 10, in assert hasattr(o2, 'x') AssertionError $ python3.5 thread_local_copy.py Traceback (most recent call last): File "thread_local_copy.py", line 10, in assert hasattr(o2, 'x') AssertionError $ ./python.exe -V Python 3.6.0+ $ ./python.exe thread_local_copy.py Traceback (most recent call last): File "thread_local_copy.py", line 9, in o2 = copy.copy(o) File "/Users/Jelle/code/cpython/Lib/copy.py", line 96, in copy rv = reductor(4) TypeError: can't pickle Obj objects ---------- assignee: ned.deily files: thread_local_copy.py keywords: 3.6regression messages: 283165 nosy: Jelle Zijlstra, ned.deily priority: release blocker severity: normal status: open title: copy.copy fails on threading.local subclass type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file45886/thread_local_copy.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 14 04:53:43 2016 From: report at bugs.python.org (Manish Singh) Date: Wed, 14 Dec 2016 09:53:43 +0000 Subject: [New-bugs-announce] [issue28968] xml rpc server fails with connection reset by peer error no 104 Message-ID: <1481709223.17.0.559234955094.issue28968@psf.upfronthosting.co.za> New submission from Manish Singh: I have used xml rpc library with transport http. My client and server are running on same host. In normal load scenario(20% cpu usage, 80% memory usage, 18 GB memory free), some request of xml rpc client fails with connection reset by peer error. I have used xmlrpclib.ServerProxy() to call remote method on xml rpc server running on an empherial port. This issue has happen many times. log snippet, File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request verbose=self.__verbose File "/usr/lib64/python2.6/xmlrpclib.py", line 1237, in request errcode, errmsg, headers = h.getreply() File "/usr/lib64/python2.6/httplib.py", line 1064, in getreply response = self._conn.getresponse() File "/usr/lib64/python2.6/httplib.py", line 990, in getresponse response.begin() File "/usr/lib64/python2.6/httplib.py", line 391, in begin version, status, reason = self._read_status() File "/usr/lib64/python2.6/httplib.py", line 349, in _read_status line = self.fp.readline() File "/usr/lib64/python2.6/socket.py", line 433, in readline data = recv(1) error: [Errno 104] Connection reset by peer ---------- components: Library (Lib) messages: 283180 nosy: manu priority: normal severity: normal status: open title: xml rpc server fails with connection reset by peer error no 104 type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 14 05:49:24 2016 From: report at bugs.python.org (Nicolas Savoire) Date: Wed, 14 Dec 2016 10:49:24 +0000 Subject: [New-bugs-announce] [issue28969] fnmatch is not threadsafe Message-ID: <1481712564.52.0.530922236321.issue28969@psf.upfronthosting.co.za> New submission from Nicolas Savoire: With python3.5, fnmatch appears not to be thrad safe. It fails with the following exception: Traceback (most recent call last): File "test.py", line 18, in f.result() File "/opt/anaconda3/lib/python3.5/concurrent/futures/_base.py", line 405, in result return self.__get_result() File "/opt/anaconda3/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result raise self._exception File "/opt/anaconda3/lib/python3.5/concurrent/futures/thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "test.py", line 12, in foo fnmatch(ref, s) File "/opt/anaconda3/lib/python3.5/fnmatch.py", line 36, in fnmatch return fnmatchcase(name, pat) File "/opt/anaconda3/lib/python3.5/fnmatch.py", line 70, in fnmatchcase match = _compile_pattern(pat) KeyError: ('SXJ8WZ9F7Z', ) Here is a minimal example reproducing the issue: import concurrent.futures from fnmatch import fnmatch import random import string def str_generator(size=10, chars=string.ascii_uppercase + string.digits): return ''.join(random.choice(chars) for _ in range(size)) def foo(strs, ref): for s in strs: fnmatch(ref, s) some_strings = [str_generator() for _ in range(500)] with concurrent.futures.ThreadPoolExecutor() as executor: futures = [executor.submit(foo, some_strings, some_strings[0]) for _ in range(8)] for f in futures: f.result() $ python3 --version Python 3.5.2 :: Anaconda 4.2.0 (64-bit) ---------- components: Library (Lib) files: test.py messages: 283185 nosy: Nicolas Savoire priority: normal severity: normal status: open title: fnmatch is not threadsafe type: crash versions: Python 3.5 Added file: http://bugs.python.org/file45895/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 14 06:36:48 2016 From: report at bugs.python.org (Hans-Peter Jansen) Date: Wed, 14 Dec 2016 11:36:48 +0000 Subject: [New-bugs-announce] [issue28970] ctypes.from_buffer counterpart to actively remove the mapping Message-ID: <1481715408.44.0.569114702165.issue28970@psf.upfronthosting.co.za> New submission from Hans-Peter Jansen: In an attempt of using ctypes.from_buffer() to map a structure to a memory mapped file, it is important to destroy the mapping after use, because the mmap won't be resizable or freeable correctly until then. The best approach, I was able to came up with is using a context manager, but calling the dtor of the mapping in __exit__ is not enough, which results to code like this: with StructMap(ctypes_struct, mm, offest) as smap: smap.xxx = 'blabla' del smap # necessary, but ugly Without the del, the "with" variable still exist in the local context, hence the mapping still exist, until it is explicitly destroyed. I hope, that ctypes is able to (or can be made to) actively remove the mapping in the __exit__ part of the context manager. I've put some code on stackoverflow to play with this: http://stackoverflow.com/questions/41077696/python-ctypes-from-buffer-mapping-with-context-manager-into-memory-mapped-file The problem seems to exist with the linux mmap implementation only. ---------- components: ctypes messages: 283188 nosy: frispete priority: normal severity: normal status: open title: ctypes.from_buffer counterpart to actively remove the mapping type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 14 06:54:14 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 14 Dec 2016 11:54:14 +0000 Subject: [New-bugs-announce] [issue28971] nntplib fails on all buildbots Message-ID: <1481716454.12.0.730668429479.issue28971@psf.upfronthosting.co.za> New submission from Xavier de Gaye: All the buildbots are currently failing at test_nntplib. See the errors in attached test_nntplib.log. The same error messages can be reproduced with a 3.5.2 interpreter: $ python Python 3.5.2 (default, Nov 7 2016, 11:31:36) [GCC 6.2.1 20160830] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from nntplib import NNTP_SSL >>> s = NNTP_SSL('nntp.aioe.org') >>> resp, count, first, last, name = s.group('comp.lang.python') >>> resp, overviews = s.over((last - 1, last)) # does not fail >>> resp, overviews = s.over((last - 9, last)) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/nntplib.py", line 831, in over resp, lines = self._longcmdstring(cmd, file) File "/usr/lib/python3.5/nntplib.py", line 525, in _longcmdstring resp, list = self._getlongresp(file) File "/usr/lib/python3.5/nntplib.py", line 494, in _getlongresp line = self._getline() File "/usr/lib/python3.5/nntplib.py", line 434, in _getline raise NNTPDataError('line too long') nntplib.NNTPDataError: line too long >>> resp, overviews = s.over((last - 1, last)) # fails now Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/nntplib.py", line 831, in over resp, lines = self._longcmdstring(cmd, file) File "/usr/lib/python3.5/nntplib.py", line 525, in _longcmdstring resp, list = self._getlongresp(file) File "/usr/lib/python3.5/nntplib.py", line 476, in _getlongresp resp = self._getresp() File "/usr/lib/python3.5/nntplib.py", line 458, in _getresp raise NNTPProtocolError(resp) nntplib.NNTPProtocolError: a657tKkPSmKkOzCP9RkpDChwanytHhX4XFYLLMWqmA at mail.gmail.com> 10039 25 Xref: aioe.org comp.lang.python:183369 ---------- components: Library (Lib) files: test_nntplib.log messages: 283189 nosy: xdegaye, zach.ware priority: normal severity: normal status: open title: nntplib fails on all buildbots type: behavior versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45897/test_nntplib.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 14 08:00:03 2016 From: report at bugs.python.org (Miki Tebeka) Date: Wed, 14 Dec 2016 13:00:03 +0000 Subject: [New-bugs-announce] [issue28972] Document all "python -m" utilities Message-ID: <1481720403.32.0.43245427479.issue28972@psf.upfronthosting.co.za> New submission from Miki Tebeka: Several modules can be invoked with -m and are pretty handy (json.tool, zipfile, tarfile ...). There should be a section in the documentation that groups all of these "python -m" tools together. Something like http://pythonwise.blogspot.nl/2015/01/python-m.html ---------- assignee: docs at python components: Documentation messages: 283190 nosy: docs at python, tebeka priority: normal severity: normal status: open title: Document all "python -m" utilities type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 14 09:38:29 2016 From: report at bugs.python.org (Bernhard10) Date: Wed, 14 Dec 2016 14:38:29 +0000 Subject: [New-bugs-announce] [issue28973] multiprocess.Queue changes objects identity Message-ID: <1481726309.53.0.886951264774.issue28973@psf.upfronthosting.co.za> New submission from Bernhard10: When I did some tests involving unittest.mock.sentinel and multiprocessing.Queue, I noticed that multiprocessing.Queue changes the id of the sentinel. This behaviour is definitely surprising and not documented. ---------- files: mwe.py messages: 283192 nosy: Bernhard10 priority: normal severity: normal status: open title: multiprocess.Queue changes objects identity type: behavior versions: Python 2.7, Python 3.5 Added file: http://bugs.python.org/file45899/mwe.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 14 16:52:10 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Dec 2016 21:52:10 +0000 Subject: [New-bugs-announce] [issue28974] Make default __format__ be equivalent to __str__ Message-ID: <1481752330.56.0.847513688639.issue28974@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Originally PEP 3101 defined the default __format__ implementation, object.__format__ as def __format__(self, format_spec): return format(str(self), format_spec) After few changes (issue7994, issue28385) it now looks as def __format__(self, format_spec): assert format_spec == '' return format(str(self), '') Proposed patch makes it yet simpler: def __format__(self, format_spec): assert format_spec == '' return str(self) This is equivalent to the previous form except obscure case when str() returns not exact str, but strict subclass with overridden __format__. The benefit of this change is simpler semantical model of the default implementation. See the start of the discussion in issue28385 and the discussion on Python-Dev: https://mail.python.org/pipermail/python-dev/2016-October/146765.html. ---------- components: Interpreter Core files: simpler-object-__format__.patch keywords: patch messages: 283220 nosy: eric.smith, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Make default __format__ be equivalent to __str__ type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45902/simpler-object-__format__.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 14 17:08:39 2016 From: report at bugs.python.org (Colin David Chen) Date: Wed, 14 Dec 2016 22:08:39 +0000 Subject: [New-bugs-announce] [issue28975] os.walk generator vs Message-ID: <1481753319.18.0.913748060881.issue28975@psf.upfronthosting.co.za> New submission from Colin David Chen: os.walk in 3.6rc1 (Windows) appears to generate different output depending on its invocation. In the first invocation, I use the generator to yield one result at a time: source = "C:\\cdchen_data\\downloads\\python-xlib-0.18\\" texasranger = os.walk(Path(source)) roottree = [next(texasranger)] roottree[0][0] Output: 'C:\\cdchen_data\\downloads\\python-xlib-0.18' The same result occurs when using the generator in a for loop. In the second invocation, I generate the complete list first: sourcetree = [x for x in os.walk(source)] sourcetree[0][0] Output: 'C:\\cdchen_data\\downloads\\python-xlib-0.18\\' The particular behavior causing me trouble is the omission in the first result of the final '\\'. I checked in 2.7.6 and os.walk is consistent and I believe more correct in that it will yield equivalent results and includes the '\\'. Not sure if earlier Python 3 implementations have this problem, I couldn't get 3.5 to run this function without failing. ---------- components: Library (Lib) messages: 283221 nosy: Colin David Chen priority: normal severity: normal status: open title: os.walk generator vs type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 14 22:24:55 2016 From: report at bugs.python.org (woo yoo) Date: Thu, 15 Dec 2016 03:24:55 +0000 Subject: [New-bugs-announce] [issue28976] incorrect description that dose not conform to the actual behavior Message-ID: <1481772295.45.0.836170310477.issue28976@psf.upfronthosting.co.za> New submission from woo yoo: The paragraph that describes the precedence of semicolon encounters a minor error, which said : "Also note that the semicolon binds tighter than the colon in this context, so that in the following example, either all or none of the print() calls are executed: if x < y < z: print(x); print(y); print(z)" However,the series of print function calls could execute partly if the previous ones are legal. ---------- assignee: docs at python components: Documentation messages: 283232 nosy: docs at python, woo yoo priority: normal severity: normal status: open title: incorrect description that dose not conform to the actual behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 15 03:36:01 2016 From: report at bugs.python.org (STINNER Victor) Date: Thu, 15 Dec 2016 08:36:01 +0000 Subject: [New-bugs-announce] [issue28977] Document PyObject_CallFunction() special case more explicitly Message-ID: <1481790961.1.0.0700086912401.issue28977@psf.upfronthosting.co.za> New submission from STINNER Victor: The PyObject_CallFunction() function has a special case if the format string is "O". See my email thread on python-dev: https://mail.python.org/pipermail/python-dev/2016-December/146919.html Serhiy wrote: "It is documented for Py_BuildValue(), and the documentation of PyObject_CallFunction() refers to Py_BuildValue()." which is true, but I would prefer to be more explicit to avoid bad surprises (see issues #21209 and #28920). Attached patch modifies PyObject_CallFunction() doc to mention the "O" format special case in the .rst doc and the .h comment. The documentation of PyObject_CallMethod() and _PyObject_CallMethodId() should also be modified, but I would prefer to wait for a first review on the added text before modifying all functions. I proposed to only modify Python 3.7 because Include/abstract.h was a in a bad shape: I rewrote this file to make it easier to maintain, but only in Python 3.7, see issue #28838. ---------- assignee: docs at python components: Documentation, Interpreter Core files: call_doc.patch keywords: patch messages: 283256 nosy: docs at python, haypo, serhiy.storchaka priority: normal severity: normal status: open title: Document PyObject_CallFunction() special case more explicitly versions: Python 3.7 Added file: http://bugs.python.org/file45908/call_doc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 15 06:59:34 2016 From: report at bugs.python.org (woo yoo) Date: Thu, 15 Dec 2016 11:59:34 +0000 Subject: [New-bugs-announce] [issue28978] a redundant right parentheses in the EBNF rules of parameter_list Message-ID: <1481803174.61.0.122563860327.issue28978@psf.upfronthosting.co.za> New submission from woo yoo: Quote the documentation as below: > parameter_list ::= (defparameter ",")* | "*" [parameter] ("," defparameter)* ["," "**" parameter] | "**" parameter | defparameter [","] ) The last right parenthesis is redundant.And the second alternative form is not complete, it does not incorporate a case that only include starred parameter. ---------- assignee: docs at python components: Documentation messages: 283288 nosy: docs at python, woo yoo priority: normal severity: normal status: open title: a redundant right parentheses in the EBNF rules of parameter_list versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 15 08:52:12 2016 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Thu, 15 Dec 2016 13:52:12 +0000 Subject: [New-bugs-announce] [issue28979] What's New entry on compact dict mentions "faster" implementation Message-ID: <1481809932.35.0.280442382983.issue28979@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: Specifically, the entry reads: "The dict type has been reimplemented to use a faster, more compact representation similar to the PyPy dict implementation." Through, the text describing the new implementation doesn't mention anything on speed, it only mentions memory usage. issue27350 and, specifically, msg275587 even report a slight regression ok key look-ups. Am I interpreting this differently? If not, is it a good idea to be stating it is faster? ---------- assignee: docs at python components: Documentation messages: 283304 nosy: Jim Fasarakis-Hilliard, docs at python priority: normal severity: normal status: open title: What's New entry on compact dict mentions "faster" implementation versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 15 10:03:36 2016 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 15 Dec 2016 15:03:36 +0000 Subject: [New-bugs-announce] [issue28980] ResourceWarning when imorting antigravity in 3.6 Message-ID: <1481814216.83.0.890338512389.issue28980@psf.upfronthosting.co.za> New submission from Ivan Levkivskyi: In 3.6 importing antigravity prints a warning (although it does what it should do): >>> import antigravity /home/ivan/.../Lib/subprocess.py:761: ResourceWarning: subprocess 15501 is still running ResourceWarning, source=self) This is probably related to http://bugs.python.org/issue27069 ---------- components: Library (Lib) messages: 283317 nosy: levkivskyi priority: normal severity: normal status: open title: ResourceWarning when imorting antigravity in 3.6 type: resource usage versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 15 13:08:08 2016 From: report at bugs.python.org (Matt Bogosian) Date: Thu, 15 Dec 2016 18:08:08 +0000 Subject: [New-bugs-announce] [issue28981] distutils/check.py overzealous catch block hides errors Message-ID: <1481825288.28.0.614509725219.issue28981@psf.upfronthosting.co.za> New submission from Matt Bogosian: >From (e.g) https://github.com/python/cpython/blob/2.7/Lib/distutils/command/check.py#L145: {{{ try: parser.parse(data, document) except AttributeError as e: # <- this could happen anywhere inside parser.parse reporter.messages.append( (-1, 'Could not finish the parsing: %s.' % e, '', {})) }}} Without a stack trace, diagnosing problems like #23063 becomes unnecessarily difficult. See also: * https://sourceforge.net/p/docutils/bugs/270/ * https://sourceforge.net/p/docutils/bugs/302/ I'd offer a patch, but I'm not sure what is meant to be signaled by the `AttributeError`. (Could `parser.parse` not exist? Is it something else?) ---------- components: Distutils messages: 283338 nosy: dstufft, eric.araujo, posita priority: normal severity: normal status: open title: distutils/check.py overzealous catch block hides errors type: behavior versions: Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 15 15:44:25 2016 From: report at bugs.python.org (Ryan Brindley) Date: Thu, 15 Dec 2016 20:44:25 +0000 Subject: [New-bugs-announce] [issue28982] multiprocessing.Queue.get(block=True, timeout=0) always raises queue.Empty Message-ID: <1481834665.78.0.584713250682.issue28982@psf.upfronthosting.co.za> New submission from Ryan Brindley: Hey dev team, According to the following test, `q.get(True, 0)` always raises queue.Empty. from multiprocessing import Queue q = Queue() q.put('foo') q.get(True, 0) # raises Empty This result throws me off as I was expecting a similar result to the underlying poll/select timeout where 0 actually just means non-blocking. After reviewing Lib/multiprocessing/queues.py, I found the condition where the timeout, after the adjustment for the time required to acquire the lock, would not even call poll() if it was less than 0. So, linked is a simple PR that I'm offering as a suggested fix/behavior-change of Queue.get's handling of timeout=0 to match the underlying poll/select handling (aka non-blocking). Cheers, Ryan Brindley ---------- components: Library (Lib) messages: 283344 nosy: Ryan Brindley priority: normal pull_requests: 5 severity: normal status: open title: multiprocessing.Queue.get(block=True, timeout=0) always raises queue.Empty type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 15 17:25:42 2016 From: report at bugs.python.org (Rhesa Browning) Date: Thu, 15 Dec 2016 22:25:42 +0000 Subject: [New-bugs-announce] [issue28983] Python 3.5.2 won't install on my computer Message-ID: <1481840742.78.0.554470867064.issue28983@psf.upfronthosting.co.za> New submission from Rhesa Browning: When I install Python, I get an error message saying that the python35.dll file doesn't exist on my computer. That is at far as it goes. I have attached a RAR folder with the logs from the times I tried to install. ---------- files: Python installation archive.rar messages: 283346 nosy: Rhesa Browning priority: normal severity: normal status: open title: Python 3.5.2 won't install on my computer type: performance versions: Python 3.5 Added file: http://bugs.python.org/file45920/Python installation archive.rar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 15 18:11:18 2016 From: report at bugs.python.org (Knut) Date: Thu, 15 Dec 2016 23:11:18 +0000 Subject: [New-bugs-announce] [issue28984] json.dump + indent creates trailing extra spaces Message-ID: <1481843478.24.0.510180134171.issue28984@psf.upfronthosting.co.za> New submission from Knut: module json python 2.7.12 json.dump(..., indent=4, sort_keys=True) gives me: { "size": { "total": 19106,X "code": 18614,X "data": 492 },X "next_item": 10 } The "X" mark extra trailing space characters which are needless. ---------- components: Library (Lib) messages: 283354 nosy: voxspox priority: normal severity: normal status: open title: json.dump + indent creates trailing extra spaces type: resource usage versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 15 22:24:53 2016 From: report at bugs.python.org (Dingyuan Wang) Date: Fri, 16 Dec 2016 03:24:53 +0000 Subject: [New-bugs-announce] [issue28985] sqlite3 authorizer codes constants not up to date Message-ID: <1481858693.19.0.888054078986.issue28985@psf.upfronthosting.co.za> New submission from Dingyuan Wang: We have the sqlite3.set_authorizer function, where the first argument to its callback is one of the Authorizer Action Codes that the SQLite documentations defines[1]. However, the constants in the sqlite3 module is not up to date. The code in _sqlite/module.c haven't been updated since June, 2006. According to the SQLite Changelog[2] and digging through the history, * 2006-08-12 (3.3.7) added SQLITE_CREATE_VTABLE, SQLITE_DROP_VTABLE * 2006-10-09 (3.3.8) added SQLITE_FUNCTION * 2009-01-12 (3.6.8) added SQLITE_SAVEPOINT * 2014-02-03 (3.8.3) added SQLITE_RECURSIVE The constants above should be present in the module. The documentation[3] says, "All necessary constants are available in the sqlite3 module." [1] https://sqlite.org/c3ref/c_alter_table.html [2] https://sqlite.org/changes.html [3] https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.set_authorizer ---------- components: Library (Lib) files: sqlite3.patch keywords: patch messages: 283363 nosy: gumblex priority: normal severity: normal status: open title: sqlite3 authorizer codes constants not up to date type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45921/sqlite3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 16 04:13:52 2016 From: report at bugs.python.org (Nick Evans) Date: Fri, 16 Dec 2016 09:13:52 +0000 Subject: [New-bugs-announce] [issue28986] Docs should say set.update takes iterable Message-ID: <1481879632.81.0.577859496056.issue28986@psf.upfronthosting.co.za> New submission from Nick Evans: The docs say that set.update takes *args: update(*others) But actually set.update takes an optional iterable: update([iterable]) ---------- assignee: docs at python components: Documentation messages: 283394 nosy: docs at python, nre3976 priority: normal severity: normal status: open title: Docs should say set.update takes iterable versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 16 09:49:37 2016 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Fri, 16 Dec 2016 14:49:37 +0000 Subject: [New-bugs-announce] [issue28987] Remove typo in whats new entry on Descriptor Protocol Enhancements Message-ID: <1481899777.6.0.168027118987.issue28987@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: Attached patch removes small typo ('has') from text: extends the descriptor protocol has to include the new optional ---------- assignee: docs at python components: Documentation files: whatsnew_typo.patch keywords: patch messages: 283401 nosy: Jim Fasarakis-Hilliard, docs at python priority: normal severity: normal status: open title: Remove typo in whats new entry on Descriptor Protocol Enhancements versions: Python 3.6 Added file: http://bugs.python.org/file45924/whatsnew_typo.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 16 10:01:05 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Dec 2016 15:01:05 +0000 Subject: [New-bugs-announce] [issue28988] Switch dict and set structures to PyVarObject Message-ID: <1481900465.81.0.491407063999.issue28988@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: In issue28959 Raymond said that a dict structure can be switched to PyVarObject. Victor guessed that it makes sense to switch a set structure too. Proposed patch implements this. The layout of a dict structure is not changed. The number of used and filled entries in a set structure are swapped, therefore extensions that use PySet_GET_SIZE or access fields of PySetObject directly (both are not in a stable API) should be recompiled. I don't see a benefit from this patch except some unification. ---------- assignee: rhettinger components: Extension Modules files: dict-set-var-object.patch keywords: patch messages: 283404 nosy: haypo, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Switch dict and set structures to PyVarObject type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45925/dict-set-var-object.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 16 10:38:15 2016 From: report at bugs.python.org (Gabriel Lopez) Date: Fri, 16 Dec 2016 15:38:15 +0000 Subject: [New-bugs-announce] [issue28989] .dll files missing Message-ID: <1481902695.92.0.0511959734428.issue28989@psf.upfronthosting.co.za> New submission from Gabriel Lopez: Every time I try loading Python 3.5, it says "The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer." How can I fix this? ---------- messages: 283411 nosy: Gabriel Lopez priority: normal severity: normal status: open title: .dll files missing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 16 11:41:05 2016 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 16 Dec 2016 16:41:05 +0000 Subject: [New-bugs-announce] [issue28990] asyncio SSL hangs if connection is closed before handshake completed Message-ID: <1481906465.87.0.352329351706.issue28990@psf.upfronthosting.co.za> New submission from Yury Selivanov: Resolved: https://github.com/python/asyncio/issues/472 ---------- assignee: yselivanov components: asyncio messages: 283413 nosy: gvanrossum, larry, ned.deily, yselivanov priority: release blocker severity: normal status: open title: asyncio SSL hangs if connection is closed before handshake completed versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 16 13:59:17 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 16 Dec 2016 18:59:17 +0000 Subject: [New-bugs-announce] [issue28991] Fix obscure lru_cache reentrancy bug Message-ID: <1481914757.29.0.923999616367.issue28991@psf.upfronthosting.co.za> New submission from Raymond Hettinger: Call __len__ directly inside the LRU cache code rather than using len(). This helps further encapsulate the cache internals making it less dependent on parts of the environment that are subject to change. ---------- assignee: serhiy.storchaka components: Library (Lib) files: fix_lru_len_reentrancy.diff keywords: patch messages: 283426 nosy: rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Fix obscure lru_cache reentrancy bug type: behavior versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45927/fix_lru_len_reentrancy.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 16 15:28:42 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Dec 2016 20:28:42 +0000 Subject: [New-bugs-announce] [issue28992] Use bytes.fromhex() Message-ID: <1481920122.63.0.616252652526.issue28992@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch makes the code and tests using bytes.fromhex(). The benefit of bytes.fromhex() over manual converting hexadecimals to bytes: 1. This is the one obvious way to do it. 2. This is the fastest way to do it. ---------- components: Library (Lib) files: use_bytes_fromhex.patch keywords: patch messages: 283433 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Use bytes.fromhex() type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45930/use_bytes_fromhex.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 16 15:29:42 2016 From: report at bugs.python.org (femi) Date: Fri, 16 Dec 2016 20:29:42 +0000 Subject: [New-bugs-announce] [issue28993] math.ceil() python 2.7 Message-ID: <1481920182.19.0.244143078463.issue28993@psf.upfronthosting.co.za> New submission from femi: math.ceil(10/3) python 2.7.12 returns 3 ---------- messages: 283434 nosy: akinfemi09 priority: normal severity: normal status: open title: math.ceil() python 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 16 18:38:16 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Dec 2016 23:38:16 +0000 Subject: [New-bugs-announce] [issue28994] Misc fixes and cleanups in error handling C code Message-ID: <1481931496.89.0.341758339319.issue28994@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch makes few minor changes related to handling errors in C. * Fixed possible NULL dereference in PyErr_NormalizeException(). * Fixed error checking in atexit._run_exitfuncs(). * Fixed possible memory leaks in _Py_FatalError_PrintExc(). * PyErr_NormalizeException() no longer recursive. * If an error is occurred during handling other error, the original exception is chained as the __contex__ attribute to the new exception instead of just be dropped. * PyTraceBack_Print() no longer fails OverflowError if tracebacklimit is very large negative or positive value. * ctype error message now include the name of the initial exception instead of the repr of its class. * Py_XDECREFs is replaced with Py_DECREFs if this is safe. * Added few asserts. * Other minor cleanups. ---------- components: Interpreter Core files: errors.diff keywords: patch messages: 283451 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Misc fixes and cleanups in error handling C code type: behavior versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45932/errors.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 16 19:09:00 2016 From: report at bugs.python.org (Steve Dower) Date: Sat, 17 Dec 2016 00:09:00 +0000 Subject: [New-bugs-announce] [issue28995] pathlib.WindowsPath.resolve() test expects short path Message-ID: <1481933340.85.0.729517888649.issue28995@psf.upfronthosting.co.za> New submission from Steve Dower: With issue19717, WindowsPath.resolve() now properly resolves the filename using the Windows APIs. However, this may cause parts of the path to be replaced with their full name when provided as the 8.3 short name. The test was not updated for this: Traceback (most recent call last): File "C:\build\cpython36\lib\test\test_pathlib.py", line 1547, in test_resolve_common self._check_resolve_relative(p, P(d, 'foo'), False) File "C:\build\cpython36\lib\test\test_pathlib.py", line 1491, in _check_resolve self.assertEqual(q, expected) AssertionError: WindowsPath('C:/Users/steve.dower/AppData/Local/Temp/2/tmptnm6y2cm-dirD/foo') != WindowsPath('C:/Users/STEVE~1.DOW/AppData/Local/Temp/2/tmptnm6y2cm-dirD/foo') We should make sure the test is referring to the same file rather than doing a direct path comparison. Maybe write a UUID into a file and read it out? ---------- components: Tests, Windows keywords: 3.6regression messages: 283452 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: pathlib.WindowsPath.resolve() test expects short path type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 17 03:35:18 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 17 Dec 2016 08:35:18 +0000 Subject: [New-bugs-announce] [issue28996] wcscoll is broken on Android and test_locale fails Message-ID: <1481963718.08.0.920050367938.issue28996@psf.upfronthosting.co.za> New submission from Xavier de Gaye: These failures happen now that issue 28596 has been fixed and that locale.getpreferredencoding(False) returns 'UTF-8'. ====================================================================== FAIL: test_strcoll_with_diacritic (test.test_locale.TestEnUSCollation) ---------------------------------------------------------------------- Traceback (most recent call last): File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_locale.py", line 362, in test_strcoll_with_diacritic self.assertLess(locale.strcoll('?', 'b'), 0) AssertionError: 1 not less than 0 ====================================================================== FAIL: test_strxfrm_with_diacritic (test.test_locale.TestEnUSCollation) ---------------------------------------------------------------------- Traceback (most recent call last): File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_locale.py", line 365, in test_strxfrm_with_diacritic self.assertLess(locale.strxfrm('?'), locale.strxfrm('b')) AssertionError: '?' not less than 'b' ---------------------------------------------------------------------- ---------- assignee: xdegaye components: Tests messages: 283474 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: wcscoll is broken on Android and test_locale fails type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 17 04:02:49 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 17 Dec 2016 09:02:49 +0000 Subject: [New-bugs-announce] [issue28997] test_readline.test_nonascii fails on Android Message-ID: <1481965369.72.0.409169776064.issue28997@psf.upfronthosting.co.za> New submission from Xavier de Gaye: test_nonascii has been implemented in issue 16182. The error message: ====================================================================== FAIL: test_nonascii (test.test_readline.TestReadline) ---------------------------------------------------------------------- Traceback (most recent call last): File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_readline.py", line 203, in test_nonascii self.assertIn(b"text 't\\xeb'\r\n", output) AssertionError: b"text 't\\xeb'\r\n" not found in bytearray(b"^A^B^B^B^B^B^B^B\t\tx\t\r\n[\\303\\257nserted]|t\x07\x08\x08\x08\x08\x08\x08\x08\x07\x07xrted]|t\x08\x08\x08\x08\x08\x08\x08\x07\r\nresult \'[\\xefnsexrted]|t\'\r\nhistory \'[\\xefnsexrted]|t\'\r\n") ---------------------------------------------------------------------- ---------- assignee: xdegaye components: Tests messages: 283476 nosy: xdegaye priority: normal severity: normal stage: needs patch status: open title: test_readline.test_nonascii fails on Android type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 17 04:37:38 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Dec 2016 09:37:38 +0000 Subject: [New-bugs-announce] [issue28998] Unifying Long Integers and Integers in 2.7 Message-ID: <1481967458.92.0.739722865425.issue28998@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Since implementing PEP 237 (Unifying Long Integers and Integers) in Python 2.4 int and long instances became interchangeable. Virtually any function that needs an integer, accepts both int and long. But there are few places where only int is accepted. Since it is easy unintentionally convert int to long (add and subtract large int, or add 0L), this can lead to subtle errors in rare circumstances. Proposed patch makes few places that accepted only int accepting long too. This mainly is changing isinstance(x, int) to isinstance(x, (int, long)). ---------- components: Extension Modules, Library (Lib) messages: 283479 nosy: benjamin.peterson, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Unifying Long Integers and Integers in 2.7 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 17 05:09:47 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Dec 2016 10:09:47 +0000 Subject: [New-bugs-announce] [issue28999] Use Py_RETURN_NONE and like Message-ID: <1481969387.72.0.775552115596.issue28999@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: In the comment to issue28765 patch Victor suggested to replace "Py_INCREF(Py_None); return Py_None;" with "Py_RETURN_NONE;". Here is a Coccinelle [1] semantic patch that replaces all returns of new references to None, True or False with macros Py_RETURN_NONE, Py_RETURN_TRUE or Py_RETURN_FALSE correspondingly. [1] http://coccinelle.lip6.fr/ ---------- components: Extension Modules, Interpreter Core files: py_return.cocci messages: 283480 nosy: haypo, serhiy.storchaka priority: normal severity: normal status: open title: Use Py_RETURN_NONE and like type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45936/py_return.cocci _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 17 08:41:04 2016 From: report at bugs.python.org (woo yoo) Date: Sat, 17 Dec 2016 13:41:04 +0000 Subject: [New-bugs-announce] [issue29000] Not matched behavior within printf style bytes formatting Message-ID: <1481982064.72.0.399504561165.issue29000@psf.upfronthosting.co.za> New submission from woo yoo: Per the documentation,"The alternate form causes a leading octal specifier ('0o') to be inserted before the first digit", However the actual behavior didn't conform to the principle. Code: >>>b'%#07o' % 34 Output: b'0000o42' ---------- assignee: docs at python components: Documentation messages: 283485 nosy: docs at python, woo yoo priority: normal severity: normal status: open title: Not matched behavior within printf style bytes formatting versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 17 15:00:59 2016 From: report at bugs.python.org (Bruce Edge) Date: Sat, 17 Dec 2016 20:00:59 +0000 Subject: [New-bugs-announce] [issue29001] logging.handlers.RotatingFileHandler rotation broken under gunicorn Message-ID: <1482004859.28.0.622019934032.issue29001@psf.upfronthosting.co.za> New submission from Bruce Edge: I've been seeing some funny behavior in log files form a logging.handlers.RotatingFileHandler. Here's my handler config snippet, in a "log.cfg": [handlers] keys=log_file [formatters] keys=access [formatter_access] format=%(asctime)s - %(name)s(%(funcName)s:%(lineno)s)[%(process)d] - %(levelname)s: %(message)s datefmt=%Y-%m-%d %H:%M:%S class=logging.Formatter [handler_log_file] class=logging.handlers.RotatingFileHandler formatter=access args=('/var/log/ml-api/access.log', 'a', 10000000, 16, 'utf8') Specified using: /usr/local/bin/gunicorn --worker-class=gevent --bind unix:ml-api.sock -m 007 --workers=8 --log-config=log.cfg --log-level=DEBUG app I ran this script to show the progression of log file creation: while true ; do ls -lrt && sleep 10; done Initially there's one incrementing log file, fine: -rw-r--r-- 1 ubuntu www-data 9765042 Dec 16 17:50 access.log total 9572 -rw-r--r-- 1 ubuntu www-data 9796828 Dec 16 17:50 access.log total 9656 -rw-r--r-- 1 ubuntu www-data 9881053 Dec 16 17:50 access.log total 9708 -rw-r--r-- 1 ubuntu www-data 9936776 Dec 16 17:50 access.log total 9756 -rw-r--r-- 1 ubuntu www-data 9984782 Dec 16 17:50 access.log total 9816 But as soon as it gets rotated, I immediately get 8 log files: -rw-r--r-- 1 ubuntu www-data 9999911 Dec 16 17:50 access.log.7 -rw-r--r-- 1 ubuntu www-data 2578 Dec 16 17:50 access.log.5 -rw-r--r-- 1 ubuntu www-data 2578 Dec 16 17:50 access.log.3 -rw-r--r-- 1 ubuntu www-data 6871 Dec 16 17:50 access.log.2 -rw-r--r-- 1 ubuntu www-data 5122 Dec 16 17:50 access.log.1 -rw-r--r-- 1 ubuntu www-data 11165 Dec 16 17:50 access.log.4 -rw-r--r-- 1 ubuntu www-data 1718 Dec 16 17:50 access.log -rw-r--r-- 1 ubuntu www-data 2905 Dec 16 17:50 access.log.6 total 9864 -rw-r--r-- 1 ubuntu www-data 9999911 Dec 16 17:50 access.log.7 -rw-r--r-- 1 ubuntu www-data 8921 Dec 16 17:50 access.log.6 -rw-r--r-- 1 ubuntu www-data 15460 Dec 16 17:50 access.log -rw-r--r-- 1 ubuntu www-data 10313 Dec 16 17:51 access.log.2 -rw-r--r-- 1 ubuntu www-data 7699 Dec 16 17:51 access.log.3 -rw-r--r-- 1 ubuntu www-data 21471 Dec 16 17:51 access.log.4 -rw-r--r-- 1 ubuntu www-data 6874 Dec 16 17:51 access.log.5 -rw-r--r-- 1 ubuntu www-data 11989 Dec 16 17:51 access.log.1 total 9892 -rw-r--r-- 1 ubuntu www-data 9999911 Dec 16 17:50 access.log.7 -rw-r--r-- 1 ubuntu www-data 7699 Dec 16 17:51 access.log.3 -rw-r--r-- 1 ubuntu www-data 12849 Dec 16 17:51 access.log.1 -rw-r--r-- 1 ubuntu www-data 14936 Dec 16 17:51 access.log.6 -rw-r--r-- 1 ubuntu www-data 30068 Dec 16 17:51 access.log.4 -rw-r--r-- 1 ubuntu www-data 19755 Dec 16 17:51 access.log -rw-r--r-- 1 ubuntu www-data 11170 Dec 16 17:51 access.log.5 -rw-r--r-- 1 ubuntu www-data 15466 Dec 16 17:51 access.log.2 total 9932 Is this a consequence of the gunicorn --workers=8? Does logging.handlers.RotatingFileHandler not work with gunicorn workers? I tried --worker-class=gevent as well with the same result. ---------- components: Extension Modules messages: 283511 nosy: Bruce Edge priority: normal severity: normal status: open title: logging.handlers.RotatingFileHandler rotation broken under gunicorn type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 17 18:53:44 2016 From: report at bugs.python.org (Alex Jurkiewicz) Date: Sat, 17 Dec 2016 23:53:44 +0000 Subject: [New-bugs-announce] [issue29002] typing.AnyStr doc is unclear about python2 unicode support Message-ID: <1482018824.86.0.562219638154.issue29002@psf.upfronthosting.co.za> New submission from Alex Jurkiewicz: The typing.AnyStr documentation: https://docs.python.org/3/library/typing.html#typing.AnyStr It gives some examples using u-strings (u'foo') but doesn't make explicit some subtleties about behaviour with Python 2. Specifically, with Python 2 all the given examples work, and even this works: concat("foo", u"bar") Which seems contrary to the goal of AnyStr being "used for functions that may accept any kind of string without allowing different kinds of strings to mix". I think the documentation should call out that for Python 2, AnyStr doesn't distinguish between str & unicode, and mention that in python 2, b'str' is equivalent to 'str' (I know this is mentioned elsewhere, but it seems useful to repeat it here). ---------- assignee: docs at python components: Documentation messages: 283524 nosy: aj, docs at python priority: normal severity: normal status: open title: typing.AnyStr doc is unclear about python2 unicode support type: enhancement versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 17 22:19:32 2016 From: report at bugs.python.org (Ma Lin) Date: Sun, 18 Dec 2016 03:19:32 +0000 Subject: [New-bugs-announce] [issue29003] sqlite3: can't run VACUUM on Python 3.6 Message-ID: <1482031172.61.0.238447305866.issue29003@psf.upfronthosting.co.za> New submission from Ma Lin: I'm using Python 3.6.0 RC2. When I try to run VACUUM command, an exception raised: conn.execute('begin') # <- remove this line get the same result conn.execute('VACUUM') sqlite3.OperationalError: cannot VACUUM from within a transaction On Python 3.5, everything is fine. Attached file cant_vacuum.py is the full example code. ---------- related issue: #10740 sqlite3 module breaks transactions and potentially corrupts data R. David Murray said in #10740 about this issue: It is an unexpected change in behavior and is therefore probably a bug. It will work if you set isolation_level=None. Because of that I don't think it is a release critical bug, though one could wish we'd discovered it earlier. ---------- components: Library (Lib) files: cannot_vacuum.py messages: 283532 nosy: Ma Lin priority: normal severity: normal status: open title: sqlite3: can't run VACUUM on Python 3.6 type: behavior versions: Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45950/cannot_vacuum.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 18 05:52:31 2016 From: report at bugs.python.org (Martin Panter) Date: Sun, 18 Dec 2016 10:52:31 +0000 Subject: [New-bugs-announce] [issue29004] binascii.crc_hqx() implements CRC-CCITT Message-ID: <1482058351.49.0.0302572495626.issue29004@psf.upfronthosting.co.za> New submission from Martin Panter: If I had known this it would have saved me getting a separate implementation working. >>> hex(binascii.crc_hqx(b"\x01", 0)) '0x1021' https://files.stairways.com/other/binhex-40-specs-info.txt Documenting this might helped many other people. Top Google hits seem oblivious to crc_hqx(), using other CRC implementations, and even other helper functions from the binascii module: https://pypi.python.org/pypi/crc16 http://stackoverflow.com/questions/26204060/calculate-crc-ccitt-0xffff-for-hex-string ---------- assignee: docs at python components: Documentation files: crc-ccitt.patch keywords: patch messages: 283548 nosy: docs at python, martin.panter priority: normal severity: normal stage: patch review status: open title: binascii.crc_hqx() implements CRC-CCITT versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45952/crc-ccitt.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 18 10:50:12 2016 From: report at bugs.python.org (woo yoo) Date: Sun, 18 Dec 2016 15:50:12 +0000 Subject: [New-bugs-announce] [issue29005] Possibly incorrect description about method objects Message-ID: <1482076212.99.0.372888946767.issue29005@psf.upfronthosting.co.za> New submission from woo yoo: "In general, calling a method with a list of n arguments is equivalent to calling the corresponding function with an argument list that is created by inserting the method?s object before the first argument." Is above description right? The link is https://docs.python.org/3.5/tutorial/classes.html#method-objects ---------- assignee: docs at python components: Documentation messages: 283556 nosy: docs at python, woo yoo priority: normal severity: normal status: open title: Possibly incorrect description about method objects versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 18 16:18:59 2016 From: report at bugs.python.org (Armin Rigo) Date: Sun, 18 Dec 2016 21:18:59 +0000 Subject: [New-bugs-announce] [issue29006] 2.7.13 _sqlite more prone to "database table is locked" Message-ID: <1482095939.25.0.891516594682.issue29006@psf.upfronthosting.co.za> New submission from Armin Rigo: 2.7.13 did a small change to the sqlite commit() method, http://bugs.python.org/issue10513, which I think is causing troubles. I noticed the problem in PyPy, which (with the same change) fails another test in Lib/sqlite3/test/regression.py, CheckTypeMapUsage(), containing this code: ... con.execute(SELECT) con.execute("drop table foo") ... The first execute() method creates a cursor; assuming it is not promptly deleted, its mere existence causes the second execute() method to fail inside Sqlite with "OperationalError: database table is locked". As a second step, I could reproduce the problem in CPython by changing the test like this: ... keepalive = con.execute(SELECT) # the cursor stays alive con.execute("drop table foo") ... The reason is that in the commit() done by the second execute(), we no longer reset all this connection's cursors before proceeding. But depending on the operation, Sqlite may then complain that the "table is locked" by these old cursors. In other words, this new situation introduced in 2.7.13 potentially makes a few complicated cases crash by "table is locked" on CPython, where they would work fine previously---which is bad IMHO. About PyPy, many more cases would crash, to the point that we may have no choice but not implement this 2.7.13 change at all. ---------- messages: 283569 nosy: arigo priority: normal severity: normal status: open title: 2.7.13 _sqlite more prone to "database table is locked" versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 18 21:50:41 2016 From: report at bugs.python.org (Brian Davis) Date: Mon, 19 Dec 2016 02:50:41 +0000 Subject: [New-bugs-announce] [issue29007] Virus detected when attempting to download numpy-1.11.3-cp35-none-win32.whl Message-ID: <1482115841.03.0.80807750574.issue29007@psf.upfronthosting.co.za> New submission from Brian Davis: When attempting to download the latest numpy windows binary, it is quarantined due to the presence of Trojan:Win32/Spursint.A!cl. This should be removed, and root caused as to how this could have made it into the package. ---------- messages: 283573 nosy: Brian Davis priority: normal severity: normal status: open title: Virus detected when attempting to download numpy-1.11.3-cp35-none-win32.whl type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 18 22:17:19 2016 From: report at bugs.python.org (Dan Snider) Date: Mon, 19 Dec 2016 03:17:19 +0000 Subject: [New-bugs-announce] [issue29008] Can't do dict comp from previously defined dict in the outermost scope of class defintion Message-ID: <1482117439.83.0.807887809751.issue29008@psf.upfronthosting.co.za> New submission from Dan Snider: class MyClass: a_dict = {'key':'value'} r_dict = {a_dict[k]:k for k in a_dict} throws the error: Traceback (most recent call last): File "C:/Users/D/AppData/Local/Programs/Python/Python35-32/deleteme.py", line 1, in class MyClass: File "C:/Users/D/AppData/Local/Programs/Python/Python35-32/deleteme.py", line 3, in MyClass r_dict = {a_dict[k]:k for k in a_dict} File "C:/Users/D/AppData/Local/Programs/Python/Python35-32/deleteme.py", line 3, in r_dict = {a_dict[k]:k for k in a_dict} NameError: name 'a_dict' is not defined ---------- assignee: terry.reedy components: IDLE, Interpreter Core, Windows messages: 283575 nosy: Assume_Away, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal status: open title: Can't do dict comp from previously defined dict in the outermost scope of class defintion type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 18 23:30:59 2016 From: report at bugs.python.org (Xiang Zhang) Date: Mon, 19 Dec 2016 04:30:59 +0000 Subject: [New-bugs-announce] [issue29009] Outdated part in the doc of PyUnicode_RichCompare Message-ID: <1482121859.8.0.633122991353.issue29009@psf.upfronthosting.co.za> New submission from Xiang Zhang: The sentence: "Note that Py_EQ and Py_NE comparisons can cause a UnicodeWarning in case the conversion of the arguments to Unicode fails with a UnicodeDecodeError." in the doc of PyUnicode_RichCompare is not true in 3.x. Proposed patch simply deletes it. ---------- assignee: docs at python components: Documentation files: doc-of-PyUnicode_RichCompare.patch keywords: patch messages: 283578 nosy: docs at python, haypo, xiang.zhang priority: normal severity: normal stage: patch review status: open title: Outdated part in the doc of PyUnicode_RichCompare versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45960/doc-of-PyUnicode_RichCompare.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 18 23:45:33 2016 From: report at bugs.python.org (woo yoo) Date: Mon, 19 Dec 2016 04:45:33 +0000 Subject: [New-bugs-announce] [issue29010] Incorrect description about scope related with inheritance Message-ID: <1482122733.15.0.137275171819.issue29010@psf.upfronthosting.co.za> New submission from woo yoo: The current description is "The name BaseClassName must be defined in a scope containing the derived class definition", which did not conform to the actual situation ,e.g. the base class object is not in the same scope as the derived class. ---------- messages: 283580 nosy: woo yoo priority: normal severity: normal status: open title: Incorrect description about scope related with inheritance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 19 01:19:33 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 19 Dec 2016 06:19:33 +0000 Subject: [New-bugs-announce] [issue29011] No entry for deques in typing Message-ID: <1482128373.3.0.983889719325.issue29011@psf.upfronthosting.co.za> New submission from Raymond Hettinger: We have: # Concrete collection types. 'Dict', 'DefaultDict', 'List', 'Set', 'FrozenSet', 'NamedTuple', # Not really a type. 'Generator', But no mention of Deque. What this an intended omission? I would like to be able to write something like this: user_posts = defaultdict(deque) # type: DefaultDict[User, Deque[Post]] ---------- messages: 283590 nosy: gvanrossum, rhettinger priority: normal severity: normal status: open title: No entry for deques in typing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 19 03:00:07 2016 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Mon, 19 Dec 2016 08:00:07 +0000 Subject: [New-bugs-announce] [issue29012] __bases__ is a tuple (possibly empty or a singleton) Message-ID: <1482134407.67.0.814127407079.issue29012@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: The following statement is in the Language Reference for Custom classes: > __bases__ is a tuple (possibly empty or a singleton) containing the base classes AFAIK, ``object.__bases__`` is the only object for which ``__bases__`` is empty and it isn't a *custom* class. Attempts to create a class and assign __bases__ to an empty tuple is checked to enforce inheritance from ``object``. This *seems* to be something that slipped through when the docs were created for Python 3.0? I'm curious to see if this can actually be empty, if not, attached patch removes ''empty'' from the sentence. ---------- assignee: docs at python components: Documentation files: fixbasesdoc.patch keywords: patch messages: 283595 nosy: Jim Fasarakis-Hilliard, docs at python priority: normal severity: normal status: open title: __bases__ is a tuple (possibly empty or a singleton) versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45962/fixbasesdoc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 19 04:04:33 2016 From: report at bugs.python.org (Monte Davidoff) Date: Mon, 19 Dec 2016 09:04:33 +0000 Subject: [New-bugs-announce] [issue29013] zipfile: inconsistent doc for ZIP64 file size Message-ID: <1482138273.34.0.375914911911.issue29013@psf.upfronthosting.co.za> New submission from Monte Davidoff: The documentation for the zipfile module, https://docs.python.org/3.5/library/zipfile.html, contains inconsistent descriptions of the maximum size of a ZIP file when allowZip64 is False. The second paragraph in the zipfile module documentation states: "It can handle ZIP files that use the ZIP64 extensions (that is ZIP files that are more than 4 GiB in size)." Later on, in the description of the zipfile.ZipFile class, it says: "If allowZip64 is True (the default) zipfile will create ZIP files that use the ZIP64 extensions when the zipfile is larger than 2 GiB." The two sizes (4 GiB and 2 GiB) should be the same. According to https://en.wikipedia.org/wiki/Zip_(file_format)#ZIP64, 4 GiB is the correct value. There is a similar problem in the 2.7.13 documentation, https://docs.python.org/2.7/library/zipfile.html. ---------- assignee: docs at python components: Documentation messages: 283597 nosy: docs at python, mndavidoff priority: normal severity: normal status: open title: zipfile: inconsistent doc for ZIP64 file size versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 19 06:31:38 2016 From: report at bugs.python.org (David Karimi) Date: Mon, 19 Dec 2016 11:31:38 +0000 Subject: [New-bugs-announce] [issue29014] Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10 Message-ID: <1482147098.02.0.695368643489.issue29014@psf.upfronthosting.co.za> New submission from David Karimi: "Edit with IDLE" option is also not present in my installation when I right-click on a .py file. And when I try to choose the IDLE application, it just defaults to the command line version every time. I don't know why this happens. I was able to run it fine on my Windows 7 and it recognized all my .py student files as IDLE-based which is exactly what I want: to see them in a script editing environment. Any help would be appreciated. All the proposed solutions online haven't helped. ---------- assignee: terry.reedy components: IDLE messages: 283606 nosy: frostyelsa, terry.reedy priority: normal severity: normal status: open title: Python 3.5.2 installer doesn't register IDLE .py extensions on Windows 10 type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 19 10:38:56 2016 From: report at bugs.python.org (=?utf-8?b?0KHQtdGA0LPQtdC5INCh0L3QtdCz0LjRgNGR0LI=?=) Date: Mon, 19 Dec 2016 15:38:56 +0000 Subject: [New-bugs-announce] [issue29015] re slashes Message-ID: <1482161936.1.0.52333974721.issue29015@psf.upfronthosting.co.za> New submission from ?????? ????????: >>> path 'd:/\\temp\\\\' >>> pat = '[{}]+'.format(re.escape('\\/')) >>> re.sub(pat, '\\', path) Traceback (most recent call last): File "", line 1, in re.sub(pat, '\\', path) File "C:\Users\??????\AppData\Local\Programs\Python\Python35\lib\re.py", line 182, in sub return _compile(pattern, flags).sub(repl, string, count) File "C:\Users\??????\AppData\Local\Programs\Python\Python35\lib\re.py", line 325, in _subx template = _compile_repl(template, pattern) File "C:\Users\??????\AppData\Local\Programs\Python\Python35\lib\re.py", line 312, in _compile_repl p = sre_parse.parse_template(repl, pattern) File "C:\Users\??????\AppData\Local\Programs\Python\Python35\lib\sre_parse.py", line 849, in parse_template s = Tokenizer(source) File "C:\Users\??????\AppData\Local\Programs\Python\Python35\lib\sre_parse.py", line 225, in __init__ self.__next() File "C:\Users\??????\AppData\Local\Programs\Python\Python35\lib\sre_parse.py", line 239, in __next self.string, len(self.string) - 1) from None sre_constants.error: bad escape (end of pattern) at position 0 >>> pat '[\\\\\\/]+' >>> In JS it works: > 'd:/\\temp\\\\'.replace(new RegExp('[\\\\\\/]+', 'g'), '\\') "d:\temp\" ---------- components: Regular Expressions messages: 283626 nosy: ezio.melotti, mrabarnett, ?????? ???????? priority: normal severity: normal status: open title: re slashes versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 19 12:35:02 2016 From: report at bugs.python.org (Robin W Gambill) Date: Mon, 19 Dec 2016 17:35:02 +0000 Subject: [New-bugs-announce] [issue29016] negative numbers raised to power zero should be 1, not -1 Message-ID: <1482168902.44.0.695125384594.issue29016@psf.upfronthosting.co.za> Changes by Robin W Gambill : ---------- components: Interpreter Core nosy: rwgambill priority: normal severity: normal status: open title: negative numbers raised to power zero should be 1, not -1 type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 19 14:03:48 2016 From: report at bugs.python.org (Ettore Atalan) Date: Mon, 19 Dec 2016 19:03:48 +0000 Subject: [New-bugs-announce] [issue29017] Docs: PySide is provided by 'The Qt Company' and not by 'Nokia' Message-ID: <1482174228.93.0.510062905066.issue29017@psf.upfronthosting.co.za> New submission from Ettore Atalan: Regarding URL: http://docs.python.org/3/library/othergui.html Section: PySide PySide is provided by 'The Qt Company' and no longer by 'Nokia' like mentioned in the documentation. ---------- assignee: docs at python components: Documentation messages: 283646 nosy: Ettore Atalan, docs at python priority: normal severity: normal status: open title: Docs: PySide is provided by 'The Qt Company' and not by 'Nokia' versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 19 16:19:44 2016 From: report at bugs.python.org (issuefinder) Date: Mon, 19 Dec 2016 21:19:44 +0000 Subject: [New-bugs-announce] [issue29018] Misinformation when showing how slices work in The Tutorial Message-ID: <1482182384.19.0.82503979706.issue29018@psf.upfronthosting.co.za> New submission from issuefinder: In this page: https://docs.python.org/3/tutorial/introduction.html#strings When showing how slices work: +---+---+---+---+---+---+ | P | y | t | h | o | n | +---+---+---+---+---+---+ 0 1 2 3 4 5 6 -6 -5 -4 -3 -2 -1 The accurate matrix is: +---+---+---+---+---+---+ | P | y | t | h | o | n | +---+---+---+---+---+---+ 0 1 2 3 4 5 6 0 -6 -5 -4 -3 -2 -1 ---------- assignee: docs at python components: Documentation messages: 283649 nosy: docs at python, issuefinder priority: normal severity: normal status: open title: Misinformation when showing how slices work in The Tutorial versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 19 18:29:42 2016 From: report at bugs.python.org (Rasmus Villemoes) Date: Mon, 19 Dec 2016 23:29:42 +0000 Subject: [New-bugs-announce] [issue29019] dict.fromkeys overallocates when given a sparse dict Message-ID: <1482190182.71.0.221629635951.issue29019@psf.upfronthosting.co.za> New submission from Rasmus Villemoes: Somewhat related to #23971, but with the opposite sign: Using Py_SIZE on a PyDictObject gives the ma_fill member in 2.7 (and until 3.2 AFAICT), not the ma_used member. So calling dict.fromkeys(d) overallocates significantly if a lot of elements have been deleted from d. The fix is trivial, though one could of course avoid the function call and do a cast. Not sure this qualifies for 2.7, though. ---------- components: Interpreter Core files: fromkeys.patch keywords: patch messages: 283654 nosy: villemoes priority: normal severity: normal status: open title: dict.fromkeys overallocates when given a sparse dict type: resource usage versions: Python 2.7 Added file: http://bugs.python.org/file45973/fromkeys.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 19 19:30:12 2016 From: report at bugs.python.org (bpoaugust) Date: Tue, 20 Dec 2016 00:30:12 +0000 Subject: [New-bugs-announce] [issue29020] collapse_rfc2231_value has inconsistent unquoting Message-ID: <1482193812.46.0.729778317823.issue29020@psf.upfronthosting.co.za> New submission from bpoaugust: collapse_rfc2231_value unquotes the value before returning it except here: rawbytes = bytes(text, 'raw-unicode-escape') return str(rawbytes, charset, errors) Why is the text not unquoted in this case? Actually I wonder whether the function should do any unquoting at all. There is at least one case where it is called with an already unquoted value (get_boundary, see issue28945). But if it is intended to do unquoting, it should be consistent. ---------- components: email messages: 283658 nosy: barry, bpoaugust, r.david.murray priority: normal severity: normal status: open title: collapse_rfc2231_value has inconsistent unquoting versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 20 04:24:51 2016 From: report at bugs.python.org (Ingo Ruhnke) Date: Tue, 20 Dec 2016 09:24:51 +0000 Subject: [New-bugs-announce] [issue29021] Custom functions in sqlite receive None on invalid UTF-8 Message-ID: <1482225891.27.0.11020777474.issue29021@psf.upfronthosting.co.za> New submission from Ingo Ruhnke: When a sqlite database contains invalid UTF-8 code in a TEXT column, Python can query that data normally when .text_factory is set appropriately. However when a custom function is created with .create_function() and applied to that column the custom function will receive 'None' as argument instead of the value of the column. The following example demonstrate the issue: Example: -------- import sqlite3 import sys import os con = sqlite3.connect(":memory:") con.text_factory = os.fsdecode con.create_function("py_identity", 1, lambda x: x) cur = con.cursor() cur.execute("CREATE TABLE foo(bar TEXT)") # insert some invalid UTF-8 into the database cur.execute("INSERT INTO foo(bar) VALUES(cast(? AS TEXT))", [b"\xff"]) # try to call a custom function on the invalid UTF-8 cur.execute("SELECT " " typeof(bar), " " bar, " # this works " py_identity(bar), " # this returns None instead of the content of 'bar' " cast(py_identity(cast(bar as BLOB)) AS TEXT) " # this works around the issue "FROM foo") for row in cur: print(row) Output: ------- ('text', '\udcff', None, '\udcff') Expected: --------- ('text', '\udcff', '\udcff', '\udcff') ---------- components: Library (Lib) messages: 283674 nosy: Ingo Ruhnke priority: normal severity: normal status: open title: Custom functions in sqlite receive None on invalid UTF-8 type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 20 07:00:51 2016 From: report at bugs.python.org (Jacopo) Date: Tue, 20 Dec 2016 12:00:51 +0000 Subject: [New-bugs-announce] [issue29022] Aritmetic error Message-ID: <1482235251.59.0.167697278337.issue29022@psf.upfronthosting.co.za> New submission from Jacopo: $ python Python 2.7.3 (default, Jun 21 2016, 18:38:19) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 69.90 + 2.90 72.80000000000001 ---------- components: Interpreter Core messages: 283684 nosy: r00ta priority: normal severity: normal status: open title: Aritmetic error type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 20 07:46:14 2016 From: report at bugs.python.org (Jakub Mateusz Kowalski) Date: Tue, 20 Dec 2016 12:46:14 +0000 Subject: [New-bugs-announce] [issue29023] Results of random.seed() call with integer argument should be claimed deterministic. Message-ID: <1482237974.75.0.612413216492.issue29023@psf.upfronthosting.co.za> New submission from Jakub Mateusz Kowalski: In https://docs.python.org/2/library/random.html#random.seed I can find that "If a hashable object is given, deterministic results are only assured when PYTHONHASHSEED is disabled." Both int and long are hashable. However, tests on the random module as well as C source code of random_seed (as indicated in http://stackoverflow.com/a/41228062/4879688) suggest that behaviour of the module is deterministic when seeded with an integer. ---------- assignee: docs at python components: Documentation messages: 283686 nosy: Jakub.Mateusz.Kowalski, docs at python priority: normal severity: normal status: open title: Results of random.seed() call with integer argument should be claimed deterministic. versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 20 07:46:36 2016 From: report at bugs.python.org (Alexander Taylor) Date: Tue, 20 Dec 2016 12:46:36 +0000 Subject: [New-bugs-announce] [issue29024] Add Kivy entry to Graphic User Interface FAQ Message-ID: <1482237996.76.0.238481497642.issue29024@psf.upfronthosting.co.za> Changes by Alexander Taylor : ---------- assignee: docs at python components: Documentation files: gui_faq_kivy.patch keywords: patch nosy: docs at python, inclement priority: normal severity: normal status: open title: Add Kivy entry to Graphic User Interface FAQ type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file45975/gui_faq_kivy.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 20 08:07:17 2016 From: report at bugs.python.org (Jakub Mateusz Kowalski) Date: Tue, 20 Dec 2016 13:07:17 +0000 Subject: [New-bugs-announce] [issue29025] random.seed() relation to hash() function and its determinism is vague Message-ID: <1482239237.17.0.976890507022.issue29025@psf.upfronthosting.co.za> New submission from Jakub Mateusz Kowalski: 2.7 (https://docs.python.org/2/library/random.html#random.seed) - warning about PYTHONHASHSEED (environmental variable) voiding determinism - no warning on -R interpreter switch - relation to hash() function omitted 2.6 (https://docs.python.org/2.6/library/random.html#random.seed) 3.0 (https://docs.python.org/3.0/library/random.html#random.seed) 3.1 (https://docs.python.org/3.1/library/random.html#random.seed) 3.2 (https://docs.python.org/3.2/library/random.html#random.seed) 3.3 (https://docs.python.org/3.3/library/random.html#random.seed) 3.4 (https://docs.python.org/3.4/library/random.html#random.seed) - no warning about PYTHONHASHSEED nor -R switch - relation to hash() function acknowledged 3.5 (https://docs.python.org/3.5/library/random.html#random.seed) 3.6 (https://docs.python.org/3.6/library/random.html#random.seed) 3.7 (https://docs.python.org/3.7/library/random.html#random.seed) - no warning about PYTHONHASHSEED nor -R switch - relation to hash() function omitted ---------- assignee: docs at python components: Documentation messages: 283688 nosy: Jakub.Mateusz.Kowalski, docs at python priority: normal severity: normal status: open title: random.seed() relation to hash() function and its determinism is vague versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 20 09:24:49 2016 From: report at bugs.python.org (STINNER Victor) Date: Tue, 20 Dec 2016 14:24:49 +0000 Subject: [New-bugs-announce] [issue29026] time.time() documentation should mention UTC timezone Message-ID: <1482243889.09.0.538886851254.issue29026@psf.upfronthosting.co.za> New submission from STINNER Victor: The documentation of the time.time() mentions "epoch" which it doesn't define epoch. If I recall correctly, it's January 1st, 1970 on most OS and most implementations of Python, except of IronPython which uses a different epoch. https://docs.python.org/dev/library/time.html#time.time Moreover, the timezone is not defined. In practice, it's UTC, so it would be nice to document it. I opened this issue because I wasn't sure if time.time() is impacted by DST or not. The answer is no. Maybe the behaviour of time.time() on DST should also be documentation. Hint: it is not impacted by DST since it uses UTC timezone. Related question on StackOverflow: http://stackoverflow.com/questions/32469318/python-time-time-and-daylight-saving-time ---------- assignee: docs at python components: Documentation messages: 283690 nosy: belopolsky, docs at python, haypo priority: normal severity: normal status: open title: time.time() documentation should mention UTC timezone versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 20 10:15:44 2016 From: report at bugs.python.org (kevin) Date: Tue, 20 Dec 2016 15:15:44 +0000 Subject: [New-bugs-announce] [issue29027] 3.5.2 compile error from ssl related. Message-ID: <1482246944.19.0.555352966537.issue29027@psf.upfronthosting.co.za> New submission from kevin: Download the python version 3.5.2 source code from official web site. Compile the python code by the following steps: sudo ./configure sudo make sudo make install but from make, I get the following errors: /home/boot/tools/Python-3.5.2/Modules/_ssl.c:2582:46: error: dereferencing pointer to incomplete type ?X509_STORE {aka struct x509_store_st}? flags = X509_VERIFY_PARAM_get_flags(store->param); ^ /home/boot/tools/Python-3.5.2/Modules/_ssl.c: In function ?_ssl__SSLContext_load_cert_chain_impl?: /home/boot/tools/Python-3.5.2/Modules/_ssl.c:2782:48: error: dereferencing pointer to incomplete type ?SSL_CTX {aka struct ssl_ctx_st}? pem_password_cb *orig_passwd_cb = self->ctx->default_passwd_callback; ^ /home/boot/tools/Python-3.5.2/Modules/_ssl.c: In function ?_ssl__SSLContext_cert_store_stats_impl?: /home/boot/tools/Python-3.5.2/Modules/_ssl.c:3443:20: error: dereferencing pointer to incomplete type ?X509_OBJECT {aka struct x509_object_st}? switch (obj->type) { ^ /home/boot/tools/Python-3.5.2/Modules/_ssl.c:3453:18: error: ?X509_LU_PKEY? undeclared (first use in this function) case X509_LU_PKEY: then I install the openssl by compiling download code,and the ssl can work, and compile python code,the error still exists. please help me check where I take a mistake. Thanks a lot. ---------- assignee: christian.heimes components: SSL messages: 283699 nosy: christian.heimes, kevin.zhai80 priority: normal severity: normal status: open title: 3.5.2 compile error from ssl related. type: compile error versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 20 10:25:31 2016 From: report at bugs.python.org (dyjakan) Date: Tue, 20 Dec 2016 15:25:31 +0000 Subject: [New-bugs-announce] [issue29028] Use-After-Free in PyString_FromStringAndSize() of stringobject.c Message-ID: <1482247531.75.0.221402980867.issue29028@psf.upfronthosting.co.za> New submission from dyjakan: Recently I started doing some research related to language interpreters and I've stumbled upon a bug in current Python 2.7. I already contacted PSRT and we concluded that this doesn't have security implications. Repro file looks like this: ``` class Index(object): def __index__(self): for c in "foobar"*n: a.append(c) return n * 4 for n in range(1, 100000, 100): a = bytearray("test"*n) buf = buffer(a) s = buf[:Index():1] ``` If you have ASAN build then you'll see this: ``` ==29054== ERROR: AddressSanitizer: heap-use-after-free on address 0x60040000a233 at pc 0x4fab7f bp 0x7ffdbfec0b50 sp 0x7ffdbfec0b48 READ of size 1 at 0x60040000a233 thread T0 #0 0x4fab7e (/home/ad/builds/python-2.7-asan/bin/python2.7+0x4fab7e) #1 0x6bbed4 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x6bbed4) #2 0x59d998 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x59d998) #3 0x5b53fe (/home/ad/builds/python-2.7-asan/bin/python2.7+0x5b53fe) #4 0x5b5a65 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x5b5a65) #5 0x637eac (/home/ad/builds/python-2.7-asan/bin/python2.7+0x637eac) #6 0x63b3af (/home/ad/builds/python-2.7-asan/bin/python2.7+0x63b3af) #7 0x4192d0 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x4192d0) #8 0x7f6da3cf0f44 (/lib/x86_64-linux-gnu/libc-2.19.so+0x21f44) #9 0x417c11 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x417c11) 0x60040000a233 is located 3 bytes inside of 5-byte region [0x60040000a230,0x60040000a235) freed by thread T0 here: #0 0x7f6da49d455f (/usr/lib/x86_64-linux-gnu/libasan.so.0.0.0+0x1555f) #1 0x6c5388 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x6c5388) #2 0x5b15fb (/home/ad/builds/python-2.7-asan/bin/python2.7+0x5b15fb) #3 0x5b53fe (/home/ad/builds/python-2.7-asan/bin/python2.7+0x5b53fe) #4 0x6f59c2 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x6f59c2) #5 0x440bc8 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x440bc8) #6 0x44a712 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x44a712) #7 0x440bc8 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x440bc8) #8 0x52afeb (/home/ad/builds/python-2.7-asan/bin/python2.7+0x52afeb) #9 0x4391ab (/home/ad/builds/python-2.7-asan/bin/python2.7+0x4391ab) #10 0x5b5d35 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x5b5d35) #11 0x4ea936 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x4ea936) #12 0x6bbd20 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x6bbd20) #13 0x59d998 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x59d998) #14 0x5b53fe (/home/ad/builds/python-2.7-asan/bin/python2.7+0x5b53fe) #15 0x5b5a65 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x5b5a65) #16 0x637eac (/home/ad/builds/python-2.7-asan/bin/python2.7+0x637eac) #17 0x63b3af (/home/ad/builds/python-2.7-asan/bin/python2.7+0x63b3af) #18 0x4192d0 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x4192d0) #19 0x7f6da3cf0f44 (/lib/x86_64-linux-gnu/libc-2.19.so+0x21f44) previously allocated by thread T0 here: #0 0x7f6da49d455f (/usr/lib/x86_64-linux-gnu/libasan.so.0.0.0+0x1555f) #1 0x6c7b3d (/home/ad/builds/python-2.7-asan/bin/python2.7+0x6c7b3d) #2 0x6ca853 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x6ca853) #3 0x522ddd (/home/ad/builds/python-2.7-asan/bin/python2.7+0x522ddd) #4 0x440bc8 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x440bc8) #5 0x59f1ca (/home/ad/builds/python-2.7-asan/bin/python2.7+0x59f1ca) #6 0x5b53fe (/home/ad/builds/python-2.7-asan/bin/python2.7+0x5b53fe) #7 0x5b5a65 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x5b5a65) #8 0x637eac (/home/ad/builds/python-2.7-asan/bin/python2.7+0x637eac) #9 0x63b3af (/home/ad/builds/python-2.7-asan/bin/python2.7+0x63b3af) #10 0x4192d0 (/home/ad/builds/python-2.7-asan/bin/python2.7+0x4192d0) #11 0x7f6da3cf0f44 (/lib/x86_64-linux-gnu/libc-2.19.so+0x21f44) Shadow bytes around the buggy address: 0x0c00ffff93f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c00ffff9400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c00ffff9410: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c00ffff9420: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c00ffff9430: fa fa fa fa fa fa fa fa fa fa fa fa fa fa 00 04 =>0x0c00ffff9440: fa fa fd fa fa fa[fd]fa fa fa fd fa fa fa fd fa 0x0c00ffff9450: fa fa fd fd fa fa fd fa fa fa fd fa fa fa 00 fa 0x0c00ffff9460: fa fa 06 fa fa fa fd fa fa fa fd fa fa fa fd fd 0x0c00ffff9470: fa fa fd fa fa fa fd fa fa fa fd fd fa fa fd fa 0x0c00ffff9480: fa fa fd fd fa fa fd fa fa fa 00 fa fa fa fd fa 0x0c00ffff9490: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap righ redzone: fb Freed Heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 ASan internal: fe ==29054== ABORTING ``` ---------- components: Interpreter Core messages: 283700 nosy: dyjakan priority: normal severity: normal status: open title: Use-After-Free in PyString_FromStringAndSize() of stringobject.c type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 20 16:30:18 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 20 Dec 2016 21:30:18 +0000 Subject: [New-bugs-announce] [issue29029] Faster positional arguments parsing in PyArg_ParseTupleAndKeywords Message-ID: <1482269418.38.0.550958237488.issue29029@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Proposed patch speeds up parsing positional arguments in PyArg_ParseTupleAndKeywords(). $ ./python -m perf timeit "1 .to_bytes(1, 'little', signed=False)" Unpatched: Median +- std dev: 2.01 us +- 0.09 us Patched: Median +- std dev: 1.23 us +- 0.03 us Currently names of all passed positional argument are looked up in the kwargs dictionary for checking if the argument is passed as positional and keyword argument. With the patch this is checked only if there are unhandled keyword arguments after parsing keyword arguments that don't passed as positional arguments. The same optimization also is applied to _PyArg_ParseTupleAndKeywordsFast() and like, but the effect is much smaller. The patch also includes tiny refactoring. ---------- components: Interpreter Core files: PyArg_ParseTupleAndKeywords-faster-positional-args-parse.patch keywords: patch messages: 283711 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Faster positional arguments parsing in PyArg_ParseTupleAndKeywords type: performance versions: Python 3.7 Added file: http://bugs.python.org/file45977/PyArg_ParseTupleAndKeywords-faster-positional-args-parse.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 20 19:52:26 2016 From: report at bugs.python.org (Cyker Way) Date: Wed, 21 Dec 2016 00:52:26 +0000 Subject: [New-bugs-announce] [issue29030] argparse: choices override metavar Message-ID: <1482281546.0.0.613026945443.issue29030@psf.upfronthosting.co.za> New submission from Cyker Way: Using `choices` option in `argparse` module caused unwanted behavior. # Without `choices` parser = argparse.ArgumentParser() parser.add_argument('length') parser.print_help() ## Output usage: demo.py [-h] length positional arguments: length optional arguments: -h, --help show this help message and exit # With choices parser = argparse.ArgumentParser() parser.add_argument('length', choices=[1,2,3]) parser.print_help() ## Output usage: demo.py [-h] {1,2,3} positional arguments: {1,2,3} optional arguments: -h, --help show this help message and exit I think the doc says ArgumentParser objects use the `dest` value as the ?name? of each object. And the doc doesn't mention anything about `dest` be changed by `choices`. The help text looks ugly when there is a long list of choices. Currently the problem can be remedied by adding a `metavar` option. But I hope it will be fixed in the library itself. ---------- components: Library (Lib) messages: 283713 nosy: cyker priority: normal severity: normal status: open title: argparse: choices override metavar type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 03:13:10 2016 From: report at bugs.python.org (Thomas Heller) Date: Wed, 21 Dec 2016 08:13:10 +0000 Subject: [New-bugs-announce] [issue29031] 'from module import *' and __all__ Message-ID: <1482307990.24.0.476248226278.issue29031@psf.upfronthosting.co.za> New submission from Thomas Heller: The documentation states that 'from module import *' imports all symbols that are listed in the module's __all__ list. In Python 3, unlike Python 2, only symbols that do NOT start with an underscore are actually imported. The following code works in Python 2.7, but raises a NameError in Python 3.5: python -c "from ctypes.wintypes import *; print(_ULARGE_INTEGER)" ---------- components: Interpreter Core messages: 283721 nosy: theller priority: normal severity: normal status: open title: 'from module import *' and __all__ type: behavior versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 04:08:52 2016 From: report at bugs.python.org (woo yoo) Date: Wed, 21 Dec 2016 09:08:52 +0000 Subject: [New-bugs-announce] [issue29032] How does the __self__ attribute of method become a class rather a instance? Message-ID: <1482311332.86.0.69129698975.issue29032@psf.upfronthosting.co.za> New submission from woo yoo: The documentation of instance methods confused me, it classifies methods into two types:the one is retrieved by an instance of a class, the other is created by retrieving a method from a class or instance. According to the description, >When an instance method object is created by retrieving a class method >object from a class or instance, its __self__ attribute is the class >itself, and its __func__ attribute is the function object underlying the >class method. the __self__ attribute of the more complex methods is a class. How does this happen? Is this description incorrect? ---------- assignee: docs at python components: Documentation messages: 283724 nosy: docs at python, woo yoo priority: normal severity: normal status: open title: How does the __self__ attribute of method become a class rather a instance? type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 04:16:25 2016 From: report at bugs.python.org (Mr B Jones) Date: Wed, 21 Dec 2016 09:16:25 +0000 Subject: [New-bugs-announce] [issue29033] Windows Python installer rolls back when run under SYSTEM account (SCCM) Message-ID: <1482311785.5.0.564825395885.issue29033@psf.upfronthosting.co.za> New submission from Mr B Jones: Hi, When I try to use the Python 3.5 and later installer for windows to make an automated unattended install via SCCM, it seems to work, but some time later it rolls back leaving only a few files installed (seems to be pip.exe and friends). I have attached all the Python installer logs from a test machine from the temp folder used by the SYSTEM account (%SystemRoot%\Temp). Manually installing from an account which is a member of the Administrators group works fine (not for 800+ machines though). Thanks, Bryn ---------- components: Installation, Windows files: python352logs.zip messages: 283726 nosy: Mr B Jones, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows Python installer rolls back when run under SYSTEM account (SCCM) type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file45980/python352logs.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 05:34:58 2016 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 21 Dec 2016 10:34:58 +0000 Subject: [New-bugs-announce] [issue29034] refleak in path_converter on error case Message-ID: <1482316498.7.0.932585385435.issue29034@psf.upfronthosting.co.za> New submission from Xiang Zhang: It looks like the bytes variable should be Py_DECREFed on error cases as the patch shows. ---------- components: Library (Lib) files: path_converter.patch keywords: patch messages: 283736 nosy: haypo, steve.dower, xiang.zhang priority: normal severity: normal stage: patch review status: open title: refleak in path_converter on error case versions: Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45982/path_converter.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 09:28:14 2016 From: report at bugs.python.org (STINNER Victor) Date: Wed, 21 Dec 2016 14:28:14 +0000 Subject: [New-bugs-announce] [issue29035] regrtest: simplify regex to match test names for the --fromfile option Message-ID: <1482330494.19.0.986324681201.issue29035@psf.upfronthosting.co.za> New submission from STINNER Victor: Lib/test/libregrtest/main.py uses a complex regex to find "test_builtin" in lines like '0:00:00 [ 4/400] test_builtin -- test_dict took 1 sec'. Recently, I changed (change d8222c197831) the regex to support a filename containing a list of filenames. Example: haypo at selma$ ls Lib/test/test_*xml*py >| list haypo at selma$ cat list Lib/test/test_docxmlrpc.py Lib/test/test_xml_dom_minicompat.py Lib/test/test_xml_etree_c.py Lib/test/test_xml_etree.py Lib/test/test_xmlrpc_net.py Lib/test/test_xmlrpc.py haypo at selma$ ./python -m test --fromfile=list --list test_docxmlrpc test_xml_dom_minicompat test_xml_etree_c test_xml_etree test_xmlrpc_net test_xmlrpc Serhiy sent me a private message to suggest to simply the regex. So here is a patch. ---------- components: Tests files: regrtest_regex.patch keywords: patch messages: 283755 nosy: haypo, inada.naoki, serhiy.storchaka, xiang.zhang priority: normal severity: normal status: open title: regrtest: simplify regex to match test names for the --fromfile option versions: Python 3.7 Added file: http://bugs.python.org/file45984/regrtest_regex.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 11:15:12 2016 From: report at bugs.python.org (Ram Rachum) Date: Wed, 21 Dec 2016 16:15:12 +0000 Subject: [New-bugs-announce] [issue29036] logging module: Add `full_module_name` to LogRecord details Message-ID: <1482336912.68.0.293105867979.issue29036@psf.upfronthosting.co.za> New submission from Ram Rachum: LogRecord currently supplies `module` that you can show in your messages, but it's just the name of the module without the path. It'll be nice to have `full_module_name` that has the qualified name (e.g. foo.bar.baz instead of baz.) Usually it's the logger's name, but not always. ---------- components: Library (Lib) messages: 283764 nosy: cool-RR priority: normal severity: normal status: open title: logging module: Add `full_module_name` to LogRecord details type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 14:00:35 2016 From: report at bugs.python.org (A.B., Khalid) Date: Wed, 21 Dec 2016 19:00:35 +0000 Subject: [New-bugs-announce] [issue29037] Python 2.7.13 prints version header and exits immediately on Windows 10 x64 Message-ID: <1482346835.39.0.82709495756.issue29037@psf.upfronthosting.co.za> New submission from A.B., Khalid: I updated my Python 2.7.12 to 2.7.13 on Windows 10 x64. When I run it in Windows command prompt shell, Python prints the version header and then exits immediately. Like so: """ E:\Users\thisuser>python Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. E:\Users\thisuser> """ This did not happen before. The same happens when Python is run from a powershell. I have no problems running ipython or jupyter notebook, however. And Python does the right thing when run under MSYS2, like so: """ $ python -i Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> """ Could this be an encoding problem? Because MSYS2 is fairly new and I think it might be more friendly to the encoding issues related to Windows shell programming. ---------- components: Windows messages: 283773 nosy: abkhd, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python 2.7.13 prints version header and exits immediately on Windows 10 x64 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 14:35:42 2016 From: report at bugs.python.org (Daniel Bolgheroni) Date: Wed, 21 Dec 2016 19:35:42 +0000 Subject: [New-bugs-announce] [issue29038] Duplicate entry for SSLContext.get_ca_certs() in ssl Message-ID: <1482348942.9.0.649967135375.issue29038@psf.upfronthosting.co.za> New submission from Daniel Bolgheroni: There is a duplicate entry for SSLContext.get_ca_certs() in ssl section 17.3.3. They are not equal, and the one that appears first has a more detailed description. ---------- assignee: docs at python components: Documentation messages: 283775 nosy: dbolgheroni, docs at python priority: normal severity: normal status: open title: Duplicate entry for SSLContext.get_ca_certs() in ssl versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 14:52:12 2016 From: report at bugs.python.org (Matteo Cafasso) Date: Wed, 21 Dec 2016 19:52:12 +0000 Subject: [New-bugs-announce] [issue29039] Segmentation fault when using PyUnicode_FromString Message-ID: <1482349932.8.0.094002567537.issue29039@psf.upfronthosting.co.za> New submission from Matteo Cafasso: The following code snippet: ---------------------------------------------- #include #include int main() { char *broken_string[8]; char broken_char = 4294967252; sprintf(broken_string, "%c", broken_char); PyUnicode_FromString(broken_string); } ---------------------------------------------- Produces a Segmentation Fault. Is this behaviour the expected one? The real life example comes when reading a malformed path on a Ext4 filesystem. The read string causes PyUnicode_FromString to segfault. ---------- components: Extension Modules messages: 283777 nosy: noxdafox priority: normal severity: normal status: open title: Segmentation fault when using PyUnicode_FromString type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 15:24:25 2016 From: report at bugs.python.org (Xavier de Gaye) Date: Wed, 21 Dec 2016 20:24:25 +0000 Subject: [New-bugs-announce] [issue29040] building Android with android-ndk-r14 Message-ID: <1482351865.89.0.655034997181.issue29040@psf.upfronthosting.co.za> New submission from Xavier de Gaye: android-ndk-r14 introduces "Unified Headers" [1] and is planned to be released late january/early february 2017 [2]. __ANDROID_API__ is not anymore defined in 'android/api-level.h' that is currently included by Include/pyport.h, and is passed instead with -D__ANDROID_API__=$API when compiling. And 'android/api-level.h' is now used to set the API level to 10000 as a Magic version number for a current development build when __ANDROID_API__ is not defined (see attached file). Adoption of android-ndk-r14 should be made with the following changes: * Remove the include of in Include/pyport.h. * Update configure.ac to abort when __ANDROID__ is defined and __ANDROID_API__ is not defined. * Revert the changes made in issues #28538 and #28762, android-ndk-r14 fixes the problems raised in these two issues. [1] https://android.googlesource.com/platform/ndk.git/+/master/docs/UnifiedHeaders.md [2] https://github.com/android-ndk/ndk/wiki ---------- components: Cross-Build files: api-level.h messages: 283778 nosy: Alex.Willmer, xdegaye priority: normal severity: normal stage: needs patch status: open title: building Android with android-ndk-r14 type: compile error versions: Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45987/api-level.h _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 17:28:41 2016 From: report at bugs.python.org (Zachary Ware) Date: Wed, 21 Dec 2016 22:28:41 +0000 Subject: [New-bugs-announce] [issue29041] Reference leaks on Windows Message-ID: <1482359321.76.0.526806281889.issue29041@psf.upfronthosting.co.za> New submission from Zachary Ware: Discussion in #29034 inspired me to run a refleak check on Windows, with the following results from a 32-bit build of the current 3.6 branch: C:\cpython\3.6>PCbuild\build.bat -e -d C:\cpython\3.6>python -m test -uall -R 3:3:refleak_log.txt --timeout=7200 ... 24 tests failed: test_atexit test_capi test_concurrent_futures test_fileio test_functools test_glob test_idle test_io test_math test_multiprocessing_spawn test_ntpath test_os test_platform test_posixpath test_shutil test_ssl test_sys test_tarfile test_tempfile test_threading test_unicode_file_functions test_unittest test_warnings test_winconsoleio 1 test altered the execution environment: test_distutils 28 tests skipped: test_crypt test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_epoll test_fcntl test_fork1 test_gdb test_grp test_ioctl test_kqueue test_nis test_openpty test_ossaudiodev test_pipes test_poll test_posix test_pty test_pwd test_readline test_resource test_spwd test_syslog test_threadsignals test_wait3 test_wait4 test_zipfile64 Total duration: 190 min 60 sec Tests result: FAILURE test_atexit leaked [12, 12, 12] references, sum=36 test_atexit leaked [4, 6, 6] memory blocks, sum=16 test_capi leaked [6, 6, 6] references, sum=18 test_capi leaked [2, 4, 4] memory blocks, sum=10 test_concurrent_futures leaked [792, 783, 765] references, sum=2340 test_concurrent_futures leaked [264, 263, 257] memory blocks, sum=784 test_fileio leaked [1, 2, 2] memory blocks, sum=5 test_functools leaked [0, 3, 2] memory blocks, sum=5 test_glob leaked [265, 266, 266] memory blocks, sum=797 test_idle leaked [471, 471, 471] references, sum=1413 test_idle leaked [209, 211, 211] memory blocks, sum=631 test_io leaked [2, 3, 3] memory blocks, sum=8 test_multiprocessing_spawn leaked [168, 117, 144] references, sum=429 test_multiprocessing_spawn leaked [55, 43, 50] memory blocks, sum=148 test_ntpath leaked [103, 104, 104] memory blocks, sum=311 test_os leaked [33, 33, 33] references, sum=99 test_os leaked [58, 60, 60] memory blocks, sum=178 test_platform leaked [12, 12, 12] references, sum=36 test_platform leaked [4, 6, 6] memory blocks, sum=16 test_posixpath leaked [3, 4, 4] memory blocks, sum=11 test_shutil leaked [5, 6, 6] memory blocks, sum=17 test_ssl leaked [3, 4, 4] memory blocks, sum=11 test_sys leaked [9, 9, 9] references, sum=27 test_sys leaked [3, 5, 5] memory blocks, sum=13 test_tarfile leaked [4, 5, 5] memory blocks, sum=14 test_tempfile leaked [82, 83, 83] memory blocks, sum=248 test_threading leaked [12, 12, 12] references, sum=36 test_threading leaked [4, 6, 6] memory blocks, sum=16 test_unicode_file_functions leaked [5, 6, 6] memory blocks, sum=17 test_winconsoleio leaked [38, 38, 38] references, sum=114 test_winconsoleio leaked [0, 1, 2] memory blocks, sum=3 ---------- components: Windows messages: 283792 nosy: haypo, paul.moore, serhiy.storchaka, steve.dower, tim.golden, xiang.zhang, zach.ware priority: high severity: normal stage: needs patch status: open title: Reference leaks on Windows type: resource usage versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 23:36:28 2016 From: report at bugs.python.org (Dolda2000) Date: Thu, 22 Dec 2016 04:36:28 +0000 Subject: [New-bugs-announce] [issue29042] os.path.exists should not throw "Embedded NUL character" exception Message-ID: <1482381388.92.0.462077532018.issue29042@psf.upfronthosting.co.za> New submission from Dolda2000: Currently, calling os.path.exists on a path which contains NUL characters behaves consistently with most file-system calls by throwing an exception: >>> os.path.exists('\0') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/genericpath.py", line 19, in exists os.stat(path) ValueError: embedded null byte However, os.path.exists is supposed to be a predicate returning whether there exists a file named by the path; it does not specify any particular method or system call for doing the test, and so reflecting the behavior of the underlying syscall used is not obviously desirable. A path containing an embedded NUL character simply cannot name an existing file, and therefore os.path.exists should return False for such a path. ---------- components: Library (Lib) messages: 283807 nosy: Dolda2000 priority: normal severity: normal status: open title: os.path.exists should not throw "Embedded NUL character" exception type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 21 23:38:44 2016 From: report at bugs.python.org (Tadhg McDonald-Jensen) Date: Thu, 22 Dec 2016 04:38:44 +0000 Subject: [New-bugs-announce] [issue29043] dict view string representations are misleading Message-ID: <1482381524.94.0.618583923227.issue29043@psf.upfronthosting.co.za> New submission from Tadhg McDonald-Jensen: Currently the string representation for dictionary views are a bit misleading as they look like valid expression but isn't: >>> {'a':1, 'b':2}.keys() dict_keys(['b', 'a']) >>> dict_keys = type({}.keys()) #get a reference to the type >>> dict_keys(['b', 'a']) Traceback (most recent call last): File "", line 1, in dict_keys(['b', 'a']) TypeError: cannot create 'dict_keys' instances This seems inconsistent with the documentation for 'repr' https://docs.python.org/3/reference/datamodel.html#object.__repr__ "If at all possible, this should look like a valid Python expression that could be used to recreate an object with the same value (given an appropriate environment). If this is not possible, a string of the form <...some useful description...> should be returned." So I'd think the representation for dictionary views should look something like this instead: to indicate that it cannot be reproduced by a simple expression but still shows it's contents. ---------- messages: 283808 nosy: Tadhg McDonald-Jensen priority: normal severity: normal status: open title: dict view string representations are misleading type: behavior versions: Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 22 00:00:08 2016 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 22 Dec 2016 05:00:08 +0000 Subject: [New-bugs-announce] [issue29044] Use after free in string '%c' formater Message-ID: <1482382808.01.0.0790799966286.issue29044@psf.upfronthosting.co.za> New submission from Xiang Zhang: In string %c formater(formatchar), when receiving an integer-like objects, the return value is decrefed immediately before use. ---------- components: Interpreter Core files: use-after-free.patch keywords: patch messages: 283811 nosy: haypo, xiang.zhang priority: normal severity: normal stage: patch review status: open title: Use after free in string '%c' formater type: behavior versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file45996/use-after-free.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 22 01:06:20 2016 From: report at bugs.python.org (Xiang Zhang) Date: Thu, 22 Dec 2016 06:06:20 +0000 Subject: [New-bugs-announce] [issue29045] Outdated C api doc about Windows error Message-ID: <1482386780.7.0.302567843382.issue29045@psf.upfronthosting.co.za> New submission from Xiang Zhang: https://docs.python.org/3.7/c-api/exceptions.html#c.PyErr_SetFromWindowsErrWithFilename it stills refers to PyErr_SetFromWindowsErrWithFilenameObject but this function doesn't exist since Py3.4. I didn't find when and why it's deleted. And https://docs.python.org/3.4/c-api/exceptions.html#c.PyErr_SetFromWindowsErr raises OSError instead of WindowsError. ---------- assignee: docs at python components: Documentation messages: 283814 nosy: docs at python, xiang.zhang priority: normal severity: normal status: open title: Outdated C api doc about Windows error versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 22 05:44:26 2016 From: report at bugs.python.org (Patrik Iselind) Date: Thu, 22 Dec 2016 10:44:26 +0000 Subject: [New-bugs-announce] [issue29046] Coverage related documentation missing Message-ID: <1482403466.51.0.435148590485.issue29046@psf.upfronthosting.co.za> New submission from Patrik Iselind: Is it possible to do coverage -j8 or similar? Cannot find any documentation on this. Coverage takes so long on the tests... I checked https://docs.python.org/devguide/coverage.html ---------- assignee: docs at python components: Documentation messages: 283824 nosy: docs at python, patriki priority: normal severity: normal status: open title: Coverage related documentation missing versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 22 05:44:33 2016 From: report at bugs.python.org (Patrik Iselind) Date: Thu, 22 Dec 2016 10:44:33 +0000 Subject: [New-bugs-announce] [issue29047] Where are the test results stored? Message-ID: <1482403473.61.0.626919341446.issue29047@psf.upfronthosting.co.za> New submission from Patrik Iselind: I cannot find any documentation on where the test results are stored. Looked at https://docs.python.org/devguide/runtests.html ---------- assignee: docs at python components: Documentation messages: 283825 nosy: docs at python, patriki priority: normal severity: normal status: open title: Where are the test results stored? versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 22 06:56:16 2016 From: report at bugs.python.org (Patrik Iselind) Date: Thu, 22 Dec 2016 11:56:16 +0000 Subject: [New-bugs-announce] [issue29048] Coverage influence tests, make some of them fail Message-ID: <1482407776.18.0.223230024277.issue29048@psf.upfronthosting.co.za> New submission from Patrik Iselind: I checkout the latest tip from scratch. When i run the tests i get the following results: % ./python -m test -j [...] 376 tests OK. 1 test altered the execution environment: test_site 27 tests skipped: test_bz2 test_ctypes test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_gdb test_kqueue test_lzma test_msilib test_ossaudiodev test_readline test_smtpnet test_socketserver test_sqlite test_startfile test_timeout test_tix test_tk test_ttk_guionly test_urllib2net test_urllibnet test_winconsoleio test_winreg test_winsound test_xmlrpc_net test_zipfile64 Total duration: 2 min 57 sec Tests result: SUCCESS Without any changes i run the tests again but this time under coverage. I get a completely different result: % ./python ../coveragepy run --pylib Lib/test/regrtest.py [...] 328 tests OK. 8 tests failed: test_exceptions test_frame test_ssl test_subprocess test_super test_traceback test_unittest test_xml_etree_c 41 tests altered the execution environment: test_asynchat test_asyncio test_asyncore test_capi test_concurrent_futures test_decimal test_distutils test_docxmlrpc test_email test_fork1 test_ftplib test_functools test_gc test_hashlib test_httplib test_httpservers test_imaplib test_import test_io test_json test_logging test_mailbox test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_spawn test_nntplib test_os test_poll test_poplib test_pydoc test_queue test_robotparser test_sched test_smtplib test_socket test_sys test_telnetlib test_threaded_import test_threadedtempfile test_threading test_xml_etree 27 tests skipped: test_bz2 test_ctypes test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_gdb test_kqueue test_lzma test_msilib test_ossaudiodev test_readline test_smtpnet test_socketserver test_sqlite test_startfile test_timeout test_tix test_tk test_ttk_guionly test_urllib2net test_urllibnet test_winconsoleio test_winreg test_winsound test_xmlrpc_net test_zipfile64 Total duration: 92 min 34 sec Tests result: FAILURE Is the reason for this difference known? Coverage shouldn't affect the outcome of the tests right? ---------- components: Tests messages: 283828 nosy: patriki priority: normal severity: normal status: open title: Coverage influence tests, make some of them fail type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 22 07:00:44 2016 From: report at bugs.python.org (INADA Naoki) Date: Thu, 22 Dec 2016 12:00:44 +0000 Subject: [New-bugs-announce] [issue29049] Lazy GC tracking frame Message-ID: <1482408044.82.0.398076651662.issue29049@psf.upfronthosting.co.za> New submission from INADA Naoki: Don't _PyObject_GC_TRACK(frame) before using it. After evaluation is finished, do tracking only if refcnt is not one. result without --enable-optimization: $ ~/local/cpython/bin/pyperf compare_to default.json.gz patched.json.gz -G Slower (15): - scimark_sparse_mat_mult: 5.83 ms +- 0.03 ms -> 6.12 ms +- 0.35 ms: 1.05x slower (+5%) - sympy_expand: 734 ms +- 21 ms -> 765 ms +- 40 ms: 1.04x slower (+4%) - sympy_str: 327 ms +- 10 ms -> 339 ms +- 13 ms: 1.04x slower (+4%) - scimark_fft: 498 ms +- 2 ms -> 512 ms +- 2 ms: 1.03x slower (+3%) - scimark_monte_carlo: 172 ms +- 3 ms -> 175 ms +- 4 ms: 1.02x slower (+2%) - chameleon: 17.6 ms +- 0.3 ms -> 17.9 ms +- 0.2 ms: 1.02x slower (+2%) - telco: 11.3 ms +- 0.4 ms -> 11.5 ms +- 0.6 ms: 1.02x slower (+2%) - logging_simple: 19.0 us +- 0.3 us -> 19.2 us +- 0.3 us: 1.01x slower (+1%) - pickle_dict: 52.2 us +- 0.3 us -> 52.9 us +- 0.2 us: 1.01x slower (+1%) - pickle_list: 6.86 us +- 0.04 us -> 6.94 us +- 0.05 us: 1.01x slower (+1%) - pickle: 17.4 us +- 0.2 us -> 17.6 us +- 0.2 us: 1.01x slower (+1%) - logging_silent: 556 ns +- 13 ns -> 561 ns +- 11 ns: 1.01x slower (+1%) - sqlite_synth: 5.25 us +- 0.44 us -> 5.28 us +- 0.15 us: 1.01x slower (+1%) - pidigits: 248 ms +- 2 ms -> 249 ms +- 2 ms: 1.00x slower (+0%) - unpack_sequence: 73.5 ns +- 0.6 ns -> 73.8 ns +- 2.4 ns: 1.00x slower (+0%) Faster (27): - call_method_slots: 11.4 ms +- 0.1 ms -> 10.7 ms +- 0.1 ms: 1.07x faster (-6%) - call_method: 11.5 ms +- 0.1 ms -> 10.8 ms +- 0.2 ms: 1.06x faster (-6%) - call_simple: 10.7 ms +- 0.3 ms -> 10.1 ms +- 0.3 ms: 1.06x faster (-5%) - regex_effbot: 4.08 ms +- 0.05 ms -> 3.97 ms +- 0.04 ms: 1.03x faster (-3%) - regex_compile: 318 ms +- 11 ms -> 310 ms +- 10 ms: 1.03x faster (-3%) - html5lib: 154 ms +- 4 ms -> 150 ms +- 4 ms: 1.03x faster (-3%) - deltablue: 13.5 ms +- 0.5 ms -> 13.1 ms +- 0.4 ms: 1.03x faster (-3%) - call_method_unknown: 13.1 ms +- 0.1 ms -> 12.8 ms +- 0.1 ms: 1.02x faster (-2%) - richards: 131 ms +- 2 ms -> 128 ms +- 2 ms: 1.02x faster (-2%) - meteor_contest: 170 ms +- 3 ms -> 167 ms +- 4 ms: 1.02x faster (-2%) - sympy_integrate: 34.7 ms +- 0.7 ms -> 34.0 ms +- 0.2 ms: 1.02x faster (-2%) - spectral_norm: 210 ms +- 2 ms -> 206 ms +- 2 ms: 1.02x faster (-2%) - dulwich_log: 115 ms +- 1 ms -> 113 ms +- 2 ms: 1.01x faster (-1%) - genshi_text: 54.1 ms +- 0.8 ms -> 53.4 ms +- 0.5 ms: 1.01x faster (-1%) - 2to3: 511 ms +- 3 ms -> 505 ms +- 2 ms: 1.01x faster (-1%) - pathlib: 28.8 ms +- 0.6 ms -> 28.5 ms +- 0.8 ms: 1.01x faster (-1%) - xml_etree_parse: 199 ms +- 3 ms -> 198 ms +- 2 ms: 1.01x faster (-1%) - hexiom: 17.9 ms +- 0.1 ms -> 17.7 ms +- 0.1 ms: 1.01x faster (-1%) - mako: 35.1 ms +- 1.0 ms -> 34.9 ms +- 0.3 ms: 1.01x faster (-1%) - nbody: 194 ms +- 1 ms -> 193 ms +- 1 ms: 1.01x faster (-1%) - unpickle_pure_python: 634 us +- 15 us -> 630 us +- 10 us: 1.01x faster (-1%) - unpickle_list: 6.16 us +- 0.06 us -> 6.13 us +- 0.05 us: 1.01x faster (-1%) - genshi_xml: 113 ms +- 3 ms -> 112 ms +- 1 ms: 1.01x faster (-1%) - json_dumps: 19.1 ms +- 0.3 ms -> 19.1 ms +- 0.2 ms: 1.00x faster (-0%) - python_startup: 13.3 ms +- 0.1 ms -> 13.3 ms +- 0.1 ms: 1.00x faster (-0%) - python_startup_no_site: 8.24 ms +- 0.06 ms -> 8.22 ms +- 0.04 ms: 1.00x faster (-0%) - go: 421 ms +- 3 ms -> 421 ms +- 3 ms: 1.00x faster (-0%) Benchmark hidden because not significant (22): chaos, crypto_pyaes, django_template, fannkuch, float, json_loads, logging_format, nqueens, pickle_pure_python, raytrace, regex_dna, regex_v8, scimark_lu, scimark_sor, sqlalchemy_declarative, sqlalchemy_imperative, sympy_sum, tornado_http, unpickle, xml_etree_generate, xml_etree_iterparse, xml_etree_process ---------- files: frame-lazy-track.patch keywords: patch messages: 283830 nosy: haypo, inada.naoki priority: normal severity: normal stage: patch review status: open title: Lazy GC tracking frame type: performance Added file: http://bugs.python.org/file45997/frame-lazy-track.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 22 12:48:46 2016 From: report at bugs.python.org (Adam Williamson) Date: Thu, 22 Dec 2016 17:48:46 +0000 Subject: [New-bugs-announce] [issue29050] xml.etree.ElementTree in Python 3.6 is incompatible with defusedxml Message-ID: <1482428926.43.0.656400422228.issue29050@psf.upfronthosting.co.za> New submission from Adam Williamson: The changes made to xml.etree.ElementTree in this commit: https://github.com/python/cpython/commit/12a626fae80a57752ccd91ad25b5a283e18154ec break defusedxml , Christian Heimes' library of modified parsers that's intended to be safe for parsing untrusted input. As of now, it's not possible to have defusedxml working properly with Python 3.6; its ElementTree parsers cannot work properly. Of course, defusedxml is an external library that does 'inappropriate' things (like fiddling around with internals of the xml library). So usually this should be considered just a problem for defusedxml to deal with somehow, and indeed I've reported it there: https://github.com/tiran/defusedxml/issues/3 . That report has more details on the precise problem. I thought it was worthwhile reporting to Python itself as well, however, for a specific reason. The Python docs for the xml library explicitly cover and endorse the use of defusedxml: "defusedxml is a pure Python package with modified subclasses of all stdlib XML parsers that prevent any potentially malicious operation. Use of this package is recommended for any server code that parses untrusted XML data." - https://docs.python.org/3.6/library/xml.html#the-defusedxml-and-defusedexpat-packages so as things stand, the Python 3.6 docs will explicitly recommend people use a module which does not work with Python 3.6. Is this considered a serious problem? It also looks to me (though I'm hardly an expert) as if it might be quite difficult and ugly to fix this on the defusedxml side, and the 'nicest' fix might actually be to tweak Python's xml module back a bit more to how it was in < 3.6 (but without losing the optimization from the commit in question) so it's easier for defusedxml to get at the internals it needs...but I could well be wrong about that. Thanks! ---------- components: XML messages: 283854 nosy: adamwill priority: normal severity: normal status: open title: xml.etree.ElementTree in Python 3.6 is incompatible with defusedxml type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 23 07:01:01 2016 From: report at bugs.python.org (Chi Hsuan Yen) Date: Fri, 23 Dec 2016 12:01:01 +0000 Subject: [New-bugs-announce] [issue29051] Improve error reporting involving f-strings (PEP 498) Message-ID: <1482494461.91.0.191852219403.issue29051@psf.upfronthosting.co.za> New submission from Chi Hsuan Yen: Here are the two examples I found confusing when playing with f-strings. The first one involves with a NameError: $ cat test2 f''' { FOO } ''' $ python3.7m test2 Traceback (most recent call last): File "test2", line 5, in ''' NameError: name 'FOO' is not defined It would be better if the error reporter points to the actual line of the error: $ python3.7m test2 Traceback (most recent call last): File "test2", line 3, in FOO NameError: name 'FOO' is not defined The second one involves a SyntaxError: $ cat test2 f''' { a b c } ''' $ python3.7m test2 File "", line 2 a b c ^ SyntaxError: invalid syntax It would be better if the line number is relative to the file instead of the expression in f-strings: $ python3.7m test2 File "test2", line 3 a b c ^ SyntaxError: invalid syntax By the way, external checkers like pyflakes also suffers. They rely on ASTs. Nodes in f-strings have their lineno relative to the {...} expression instead of the whole code string. For example: import ast code = ''' f'{LOL}' ''' for node in ast.walk(ast.parse(code, "", "exec")): if isinstance(node, ast.Name): print(node.lineno) Prints 1 instead of 2. Another by the way, ruby reports correct line numbers: $ cat test3 " #{ FOO } " $ ruby test3 test3:3:in `
': uninitialized constant FOO (NameError) $ cat test3 " #{ @@ } " $ ruby test3 test3:3: `@@' without identifiers is not allowed as a class variable name test3:3: syntax error, unexpected end-of-input Added the author and the primary reviewer of issue24965. ---------- components: Interpreter Core messages: 283874 nosy: Chi Hsuan Yen, eric.smith, martin.panter priority: normal severity: normal status: open title: Improve error reporting involving f-strings (PEP 498) type: enhancement versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 23 07:11:24 2016 From: report at bugs.python.org (Karsten Tinnefeld) Date: Fri, 23 Dec 2016 12:11:24 +0000 Subject: [New-bugs-announce] [issue29052] Detect Windows platform 32bit/64bit automatically Message-ID: <1482495084.23.0.916471956703.issue29052@psf.upfronthosting.co.za> New submission from Karsten Tinnefeld: When navigating https://www.python.org/ with a browser, in the main menu fly-out Downloads/Download for Windows it suggests to download the 32 bit version of the current 2.x and 3.x releases (leaving out the information that the buttons provide 32 bit binaries). Further, https://www.python.org/downloads/ repeats this pattern in its header area "Download the latest version for Windows". May I suggest that, depending on the User-Agent header, the menu offers 64 bit versions of the interpreter and tools package by default in case the browser suggests it is running on a 64 bit platform? According to own tests and http://www.useragentstring.com/pages/useragentstring.php, this should be possible with a regexp like '(WOW|x)64' on at least IE, FF, Chrome and Edge. ---------- assignee: docs at python components: Documentation messages: 283875 nosy: Karsten Tinnefeld, docs at python priority: normal severity: normal status: open title: Detect Windows platform 32bit/64bit automatically type: enhancement versions: Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 23 09:16:48 2016 From: report at bugs.python.org (bpoaugust) Date: Fri, 23 Dec 2016 14:16:48 +0000 Subject: [New-bugs-announce] [issue29053] Implement >From_ decoding on input from mbox Message-ID: <1482502608.45.0.127449678115.issue29053@psf.upfronthosting.co.za> New submission from bpoaugust: The email package implements mboxo From_ mangling on output by default. However there is no provision to unmangle >From_ on input. This means that it's not possible to import mboxo files correctly. ---------- components: email messages: 283879 nosy: barry, bpoaugust, r.david.murray priority: normal severity: normal status: open title: Implement >From_ decoding on input from mbox type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 23 09:17:17 2016 From: report at bugs.python.org (Cornelius Diekmann) Date: Fri, 23 Dec 2016 14:17:17 +0000 Subject: [New-bugs-announce] [issue29054] pty.py: pty.spawn hangs after client disconnect over nc (netcat) Message-ID: <1482502637.76.0.304881442895.issue29054@psf.upfronthosting.co.za> New submission from Cornelius Diekmann: My OS: Debian GNU/Linux 8.6 (jessie) Python 3.4.2 pty.py from Python-3.5.2/Lib (pty.py is just a tiny, portable python file which did not see many changes) Bug Report Steps to Reproduce: I wrote a very simple python remote shell: #!/usr/bin/env python3 import pty pty.spawn('/bin/sh') It can be run in a terminal (call it TermA) with `nc -e ./myfancypythonremoteshell.py -l -p 6699` In a different terminal (call it TermB), I connect to my fancy remote shell with `nc 127.0.0.1 6699`. The shell works fine. In TermB, I quit by pressing ctrl+c. Observed Behavior: In TermA, the nc process, the python process, and the spawned /bin/sh still exist. They still occupy TermA. Expected Behavior: The client in TermB has disconnected, /bin/sh in TermA can no longer read anything from stdin and it should close down. Ultimately, in TermA, nc should have exited successfully. Fix: End the _copy loop in pty.py once EOF in STDIN is reached. Everything shuts itself down automatically. I included a small patch to demonstrate this behavior. This patch is not meant to go straight into production. I have not verified if this behavior somehow breaks other use cases. This bug report is meant to document exactly one specific use case and supply exactly one line of code change for it. This issue is related to issue26228. Actually, it is complementary. issue26228 wants to return if master_fd is EOF, this issue wants to return if stdin is EOF. Both behaviors together looks good to me. By the way, I hacked a hacky `assert False` into my patch as a placeholder for issue26228's proper handling of exec failures at that part of the code. I suggest to combine the patches of this issue and issue26228. ---------- components: Library (Lib) files: pty.patch keywords: patch messages: 283880 nosy: Cornelius Diekmann, martin.panter priority: normal severity: normal status: open title: pty.py: pty.spawn hangs after client disconnect over nc (netcat) type: enhancement versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file46006/pty.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 23 10:56:58 2016 From: report at bugs.python.org (then0rTh) Date: Fri, 23 Dec 2016 15:56:58 +0000 Subject: [New-bugs-announce] [issue29055] random.choice on empty sequence should hide previous exception [patch] Message-ID: <1482508618.0.0.189699213254.issue29055@psf.upfronthosting.co.za> New submission from then0rTh: Passing empty sequence to random.choice function leads to: Traceback (most recent call last): ... ValueError: number of bits must be greater than zero During handling of the above exception, another exception occurred: Traceback (most recent call last): ... IndexError: Cannot choose from an empty sequence * the ValueError doesn't add any useful information, only bloats stderr * the "During handling" line indicates that something went wrong inside random.py This patch uses `raise x from None` to hide the ValueError, resulting in much cleaner output. -Tested on Python 3.7.0a0 ---------- components: Library (Lib) files: random_choice_errmsg.patch keywords: patch messages: 283884 nosy: mark.dickinson, rhettinger, then0rTh priority: normal severity: normal status: open title: random.choice on empty sequence should hide previous exception [patch] type: behavior versions: Python 3.7 Added file: http://bugs.python.org/file46007/random_choice_errmsg.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 23 12:26:56 2016 From: report at bugs.python.org (Dan Passaro) Date: Fri, 23 Dec 2016 17:26:56 +0000 Subject: [New-bugs-announce] [issue29056] logging.Formatter doesn't respect more than one formatException() Message-ID: <1482514016.63.0.534341960628.issue29056@psf.upfronthosting.co.za> New submission from Dan Passaro: If two formatters maintain the default implementation of Formatter.format(), but provide custom behavior for Formatter.formatException(), whichever formatException() is called first and returns something truthy is the only formatException() that is used. This is due to a misplaced check for a cached value. logging.Formatter.format() sets (maybe monkey-patches?) an exc_text attribute onto the record it receives, with a comment indicating it's to prevent needlessly re-formatting the exception. If this value is set, it avoids the call to formatException() and just returns the exc_text attribute. If this check for exc_text is moved to Formatter.formatException() instead, I am sure this behavior will be fixed. I.e. Formatter.formatException()'s first few lines turn into something like: if record.exc_text: return record.exc_text sio = cString.StringIO() # ... and so on (rest of current impl) This way the default implementation still caches, and subclass implementation changes still have an effect. The only problem here is this method has no access to the record object. It's not clear to me what is the best way to solve this. I don't have experience making changes to Python or projects of this size but these are my thoughts: * Since the formatException() API is public it shouldn't be changed (e.g. to add record) * Removing the caching might have a significant performance penalty for certain users, although I haven't really tested it * Users who care can copy format() source code into their subclasses and remove the caching code. Alternatively, a class-level flag can be added to determine whether the cache should be used. Documentation in formatException() is added to indicate this issue. This seems like a very poor solution to me. * Adding @functools.lru_cache() in front of the base implementation (after e.g. making it a staticmethod() or something like that) seems clean from a code POV but could negatively impact memory usage, and might also negatively impact CPU usage if the cache isn't effective. * Adding `self._record = record` to format(), before the call to formatException(), probably has the lowest performance impact and is the change I'd lean towards personally, but seems like bad coding practice. I've attached a script that demonstrates the buggy behavior. If someone can weigh in on what a good strategy is to resolve this issue I'd be glad to supply a patch. ---------- files: logging_formatter_exc_bug.py messages: 283888 nosy: daniel.passaro priority: normal severity: normal status: open title: logging.Formatter doesn't respect more than one formatException() type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file46008/logging_formatter_exc_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 23 12:37:29 2016 From: report at bugs.python.org (Pam McA'Nulty) Date: Fri, 23 Dec 2016 17:37:29 +0000 Subject: [New-bugs-announce] [issue29057] Compiler failure on Mac OS X - sys/random.h Message-ID: <1482514649.72.0.460227366509.issue29057@psf.upfronthosting.co.za> New submission from Pam McA'Nulty: make failed on Mac OS X including sys/random.h It looks to be caused by this commit: https://github.com/python/cpython/commit/1958527a2c5dda766b1917ab563622434b3dad0d Restoring the removed ifdefs solves the problem (see github PR) Official patch to follow Failure message. ``` In file included from Python/random.c:16: /usr/include/sys/random.h:37:32: error: unknown type name 'u_int' void read_random(void* buffer, u_int numBytes); ^ /usr/include/sys/random.h:38:33: error: unknown type name 'u_int' void read_frandom(void* buffer, u_int numBytes); ^ /usr/include/sys/random.h:39:33: error: unknown type name 'u_int' int write_random(void* buffer, u_int numBytes); ^ 3 errors generated. make: *** [Python/random.o] Error 1 ``` ---------- components: Build messages: 283889 nosy: Pam.McANulty priority: normal pull_requests: 6 severity: normal status: open title: Compiler failure on Mac OS X - sys/random.h type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 23 19:11:50 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Dec 2016 00:11:50 +0000 Subject: [New-bugs-announce] [issue29058] Mark new limited C API Message-ID: <1482538310.89.0.583492092721.issue29058@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Functions added to a limited API after 3.2 should be available only when Py_LIMITED_API is not defined or is set to corresponding hexadecimal Python version (e.g. 0x03050000). Proposed patch makes following names available only for corresponding versions of a limited API. Removed declaration: PyErr_SetExcWithArgsKwargs(). Excluded from stable ABI: _PyBytes_DecodeEscape(), PyInit_imp(). 3.3: Py_hexdigits, PyImport_ExecCodeModuleObject(), PyImport_AddModuleObject(), PyImport_ImportFrozenModuleObject(), PyMemoryView_FromMemory(), PyModule_NewObject(), PyModule_GetNameObject(), PyObject_GenericSetDict(), PyErr_GetExcInfo(), PyErr_SetExcInfo(), PyErr_SetImportError(), PyParser_SimpleParseStringFlagsFilename(), PyThread_GetInfo(), PyUnicode_Substring(), PyUnicode_AsUCS4(), PyUnicode_AsUCS4Copy(), PyUnicode_GetLength(), PyUnicode_ReadChar(), PyUnicode_WriteChar(), PyUnicode_DecodeCodePageStateful(), PyUnicode_EncodeCodePage(), PyUnicode_DecodeLocaleAndSize(), PyUnicode_DecodeLocale(), PyUnicode_EncodeLocale(), PyUnicode_FindChar(), and a number of OSError subclasses. 3.4: PyErr_SetFromErrnoWithFilenameObjects(), PyErr_SetExcFromWindowsErrWithFilenameObjects(). 3.5: PyNumber_MatrixMultiply(), PyNumber_InPlaceMatrixMultiply(), PyCodec_NameReplaceErrors(), Py_DecodeLocale(), Py_EncodeLocale(), PyImport_ImportModuleLevelObject(), PyObject_Calloc(), PyExc_StopAsyncIteration, PyExc_RecursionError, PyMem_Calloc(), a number of PyODict_* macros. 3.6: Py_FileSystemDefaultEncodeErrors, PyOS_FSPath(), PyExc_ModuleNotFoundError, PyErr_SetImportErrorSubclass(), PyErr_ResourceWarning(). However it may be better that some was added to stable ABI by mistake. Py_hexdigits looks as a stuff for internal use, PyThread_GetInfo() and PyODict_* macros are not documented. ---------- components: Interpreter Core files: limited-api.patch keywords: patch messages: 283910 nosy: haypo, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Mark new limited C API versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46016/limited-api.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 23 20:33:11 2016 From: report at bugs.python.org (Joseph Hackman) Date: Sat, 24 Dec 2016 01:33:11 +0000 Subject: [New-bugs-announce] [issue29059] Windows: Python not using ANSI compatible console Message-ID: <1482543191.02.0.407458515739.issue29059@psf.upfronthosting.co.za> New submission from Joseph Hackman: On windows, Python does not request that Windows enable VT100 for console output for Python. That is to say that ANSI codes such as \033[91m will function on Mac and Linux Pythons, but not Windows. As there is no good interface in core Python to the kernel32 console operations (and there probably shouldn't be, it would be better to be consistent), I suggest just flipping the bit at startup on Windows. I would be happy to submit a patch, but seek guidance on the best location for addition of code to 'at startup iff a tty is attached'. The following code solves the issue: import platform if platform.system().lower() == 'windows': from ctypes import windll, c_int, byref stdout_handle = windll.kernel32.GetStdHandle(c_int(-11)) mode = c_int(0) windll.kernel32.GetConsoleMode(c_int(stdout_handle), byref(mode)) mode = c_int(mode.value | 4) windll.kernel32.SetConsoleMode(c_int(stdout_handle), mode) Please see: https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx (Search for ENABLE_VIRTUAL_TERMINAL_PROCESSING) https://msdn.microsoft.com/en-us/library/windows/desktop/ms683231(v=vs.85).aspx (As for why stdout is -11 on Windows) ---------- components: Windows messages: 283913 nosy: joseph.hackman, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows: Python not using ANSI compatible console type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 23 22:13:53 2016 From: report at bugs.python.org (Daz) Date: Sat, 24 Dec 2016 03:13:53 +0000 Subject: [New-bugs-announce] [issue29060] Changing the installation location still adds AppData filepaths that do not exist to the path variable on Windows 10 Message-ID: <1482549233.73.0.705523991357.issue29060@psf.upfronthosting.co.za> New submission from Daz: New to python issue tracking; prone to ignorance. I'm on Windows 10. I noticed after checking to add Python to my path variable and then changing the location from AppData's directory that after the installation, the filepaths associated with AppData were added to the path variable. The new path and any would-be associated filepaths were not added to the path variable. Thanks in advance if you can at least let me know if this is typical or a problem. ---------- components: Installation messages: 283916 nosy: Dazc priority: normal severity: normal status: open title: Changing the installation location still adds AppData filepaths that do not exist to the path variable on Windows 10 type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 24 01:24:43 2016 From: report at bugs.python.org (Brian Nenninger) Date: Sat, 24 Dec 2016 06:24:43 +0000 Subject: [New-bugs-announce] [issue29061] secrets.randbelow(-1) hangs Message-ID: <1482560683.53.0.415654381831.issue29061@psf.upfronthosting.co.za> New submission from Brian Nenninger: secrets.randbelow(-1) causes the interpreter to hang. It should presumably raise an exception like secrets.randbelow(0) does. This is on Mac OS X 10.11.6, shell transcript below. ========================================================= $ python3 Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import secrets >>> secrets.randbelow(1) 0 >>> secrets.randbelow(0) Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/secrets.py", line 29, in randbelow return _sysrand._randbelow(exclusive_upper_bound) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/random.py", line 232, in _randbelow r = getrandbits(k) # 0 <= r < 2**k File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/random.py", line 678, in getrandbits raise ValueError('number of bits must be greater than zero') ValueError: number of bits must be greater than zero >>> secrets.randbelow(-1) (hangs using 100% CPU until aborted) ---------- components: Library (Lib) messages: 283923 nosy: Brian Nenninger priority: normal severity: normal status: open title: secrets.randbelow(-1) hangs type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 24 04:21:43 2016 From: report at bugs.python.org (Frank Millman) Date: Sat, 24 Dec 2016 09:21:43 +0000 Subject: [New-bugs-announce] [issue29062] Documentation link error Message-ID: <1482571303.3.0.781602557285.issue29062@psf.upfronthosting.co.za> New submission from Frank Millman: If you call up online documentation for Python3.6, and select modules>h>hashlib, it takes you to 15.2. hashlib ? BLAKE2 hash functions It should take you to 15.1. hashlib ? Secure hashes and message digests ---------- assignee: docs at python components: Documentation messages: 283930 nosy: docs at python, frankmillman priority: normal severity: normal status: open title: Documentation link error type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 24 05:41:49 2016 From: report at bugs.python.org (Decorater) Date: Sat, 24 Dec 2016 10:41:49 +0000 Subject: [New-bugs-announce] [issue29063] Fix timemodule compile warnings. Message-ID: <1482576109.57.0.29725831282.issue29063@psf.upfronthosting.co.za> New submission from Decorater: I fixed some Possible Loss of Data warnings. but only the ones for timemodule. There are still some others when building the 64 bit version however. I added some comments that can be removed in another patch if desired otherwise it should look good for now for this module. ---------- components: Build, Interpreter Core, Windows files: timemodule.patch-1.patch keywords: patch messages: 283937 nosy: Decorater, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Fix timemodule compile warnings. versions: Python 3.7 Added file: http://bugs.python.org/file46022/timemodule.patch-1.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 24 07:55:02 2016 From: report at bugs.python.org (kevin) Date: Sat, 24 Dec 2016 12:55:02 +0000 Subject: [New-bugs-announce] [issue29064] Package numpy can't be used normally Message-ID: <1482584102.8.0.443531506198.issue29064@psf.upfronthosting.co.za> New submission from kevin: I used package numpy,but encounter the following error: Traceback (most recent call last): File "rgbtoyuv.py", line 2, in import numpy as np File "/usr/local/lib/python3.5/site-packages/numpy-1.11.2-py3.5-linux-x86_64.egg/numpy/__init__.py", line 163, in from . import random File "/usr/local/lib/python3.5/site-packages/numpy-1.11.2-py3.5-linux-x86_64.egg/numpy/random/__init__.py", line 99, in from .mtrand import * ImportError: /usr/local/lib/python3.5/site-packages/numpy-1.11.2-py3.5-linux-x86_64.egg/numpy/random/mtrand.cpython-35m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf I have download the numpy install package,and installed. Platform ubuntu16.04 x86_64 python version: 3.5.2 numpy version:1.11.2 and try to version:1.9.0 also,but installed failed. Please help me find the reason,thanks a lot. ---------- components: Library (Lib) messages: 283949 nosy: kevin.zhai80 priority: normal severity: normal status: open title: Package numpy can't be used normally type: resource usage versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 24 17:28:08 2016 From: report at bugs.python.org (Utku Gultopu) Date: Sat, 24 Dec 2016 22:28:08 +0000 Subject: [New-bugs-announce] [issue29065] SSL module problem on Python 3.6.0 and macOS Sierra Message-ID: <1482618488.69.0.324323347363.issue29065@psf.upfronthosting.co.za> New submission from Utku Gultopu: It seems like ssl module is not working for me: (virtualenv) user at host:~$ python Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>> import socket >>> context = ssl.create_default_context() >>> conn = context.wrap_socket(socket.socket(socket.AF_INET), server_hostname="www.python.org") >>> conn.connect(("www.python.org", 443)) Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1093, in connect self._real_connect(addr, False) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1084, in _real_connect self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1061, in do_handshake self._sslobj.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 683, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) >>> It seems like a problem with OpenSSL in Sierra itself. Because the following command does not work either: (virtualenv) user at host:~$ openssl s_client -connect www.python.org:443 CONNECTED(00000003) depth=1 /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA verify error:num=20:unable to get local issuer certificate verify return:0 --- Certificate chain 0 s:/businessCategory=Private Organization/1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/serialNumber=3359300/street=16 Allen Rd/postalCode=03894-4801/C=US/ST=NH/L=Wolfeboro/O=Python Software Foundation/CN=www.python.org i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA 1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA --- Server certificate -----BEGIN CERTIFICATE----- MIIIWjCCB0KgAwIBAgIQCXCW7BLw16II/CMOsOFe/jANBgkqhkiG9w0BAQsFADB1 MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMTQwMgYDVQQDEytEaWdpQ2VydCBTSEEyIEV4dGVuZGVk IFZhbGlkYXRpb24gU2VydmVyIENBMB4XDTE2MDYyOTAwMDAwMFoXDTE4MDkyNzEy MDAwMFowgfgxHTAbBgNVBA8TFFByaXZhdGUgT3JnYW5pemF0aW9uMRMwEQYLKwYB BAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQITCERlbGF3YXJlMRAwDgYDVQQF EwczMzU5MzAwMRQwEgYDVQQJEwsxNiBBbGxlbiBSZDETMBEGA1UEERMKMDM4OTQt NDgwMTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk5IMRIwEAYDVQQHEwlXb2xmZWJv cm8xIzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRcwFQYDVQQD Ew53d3cucHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB AMpgUlIza25mor2AW20yRs8uHtRJs0kXpMF2zATQjhYAgfpqjoKugoWBlMrLCFQj G/Aq8W7pT4WWHCb9Nv2QGdnIEapxi5HSfxc3b1HIRmJDdfxsc2Y4dATfgzIS4wNw jDM9tmYcMZMKZVdW4WxurQIka8r3tBFP944yAllRn8uuFVXSDYALkZOiiWxuMYKA q40hYrDhWO53uKk23HNBo5Kgfvcj3t0ZcMSkzekClxyxgyS1nnkNWIdEEMCP/FFU UXrQt0MEtkmfc++6Ps2SEiHL2T4MEqY8eE0ss6Mvmt+yzy8QsZOArrpxv7l8OwBO 5yB0LU3ByoQan1O/upeNclkCAwEAAaOCBGAwggRcMB8GA1UdIwQYMBaAFD3TUKXW oK3u80pgCmXTIdT4+NYPMB0GA1UdDgQWBBTL2ztKcGS38IxHEASJaOzwHuUqljCC AQsGA1UdEQSCAQIwgf+CDnd3dy5weXRob24ub3Jngg9kb2NzLnB5dGhvbi5vcmeC D2J1Z3MucHl0aG9uLm9yZ4IPd2lraS5weXRob24ub3Jngg1oZy5weXRob24ub3Jn gg9tYWlsLnB5dGhvbi5vcmeCD3B5cGkucHl0aG9uLm9yZ4IUcGFja2FnaW5nLnB5 dGhvbi5vcmeCEGxvZ2luLnB5dGhvbi5vcmeCEmRpc2N1c3MucHl0aG9uLm9yZ4IM dXMucHljb24ub3JnggdweXBpLmlvggxkb2NzLnB5cGkuaW+CCHB5cGkub3Jngg1k b2NzLnB5cGkub3Jngg9kb25hdGUucHlwaS5vcmcwDgYDVR0PAQH/BAQDAgWgMB0G A1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjB1BgNVHR8EbjBsMDSgMqAwhi5o dHRwOi8vY3JsMy5kaWdpY2VydC5jb20vc2hhMi1ldi1zZXJ2ZXItZzEuY3JsMDSg MqAwhi5odHRwOi8vY3JsNC5kaWdpY2VydC5jb20vc2hhMi1ldi1zZXJ2ZXItZzEu Y3JsMEsGA1UdIAREMEIwNwYJYIZIAYb9bAIBMCowKAYIKwYBBQUHAgEWHGh0dHBz Oi8vd3d3LmRpZ2ljZXJ0LmNvbS9DUFMwBwYFZ4EMAQEwgYgGCCsGAQUFBwEBBHww ejAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMFIGCCsGAQUF BzAChkZodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNlcnRTSEEyRXh0 ZW5kZWRWYWxpZGF0aW9uU2VydmVyQ0EuY3J0MAwGA1UdEwEB/wQCMAAwggF9Bgor BgEEAdZ5AgQCBIIBbQSCAWkBZwB2AKS5CZC0GFgUh7sTosxncAo8NZgE+RvfuON3 zQ7IDdwQAAABVkgj4a8AAAQDAEcwRQIhAMhsxamO6hrRjfNmH4Yj/cnJo72cmTHm rSlEi0FHilNtAiB/tDiULYh6rf9H5eKmrV8PRsvFNSflBsQIIF1VejnWrwB2AGj2 mPgfZIK+OozuuSgdTPxxUV1nk9RE0QpnrLtPT/vEAAABVkgj4XYAAAQDAEcwRQIg Ygh+rvtk2KQd2CRaM+whfGgc6waZACSMgwzYVmOZr9sCIQDGs78IDIoPZhNBGfIK xXQdq8DwAjahQboXeJWx/AfAxQB1AFYUBpov18Ls0/XhvUSyPsdGdrm8mRFcwO+U mFXWidDdAAABVkgj4dkAAAQDAEYwRAIgMOOdrhZ0280XsmWuLt7fcFnwtRIu42j7 WmRrQ2NlJLUCIG5Z6vzlhvFNIhN67A0G/hrRH7hzJ13/elILZcjZYJQqMA0GCSqG SIb3DQEBCwUAA4IBAQCuDt1T9tBxAVYp2u10uONL6FTHQlgguQCiN5ANmjp6dUAq 2I1nCgZB9nxhGUFOsdiQ5DFDgJ0xTAgwF4nWAyXEHKjyacoaUOh3Zq7A62r5+0eE P3XDNKIN2TWF3+djFneND/uqqpDGo2bMdcm9l0dvktUP9xQXIZBBkOMJZfXSxh0/ 7H+bDizx+bq/5Dwv97fs770UCz5LqGRuIUaZQvBQblsP5QoBaKEYW5Hsmfu9FWbW 0qreV7KHFp7ONBSKFUefbG0Q37O8oTPr7JnMxTvdUcthJOLcN9IHo2StTzv3Wru0 5njv0zLw7zwePKc9YJ1YBLmLj7vPxyy/XoW8+8hI -----END CERTIFICATE----- subject=/businessCategory=Private Organization/1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/serialNumber=3359300/street=16 Allen Rd/postalCode=03894-4801/C=US/ST=NH/L=Wolfeboro/O=Python Software Foundation/CN=www.python.org issuer=/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA --- No client certificate CA names sent --- SSL handshake has read 3524 bytes and written 456 bytes --- New, TLSv1/SSLv3, Cipher is AES128-SHA Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1 Cipher : AES128-SHA Session-ID: 239A88888D772216EDDD8C204996A901BAD27D50B929E6A626955472456077B6 Session-ID-ctx: Master-Key: FB1EAC13FFD2F42DA5BF0364E3A08A869DD129389374416B6574F6D852692888F991B79027143A81963FA7594FFB85BD Key-Arg : None Start Time: 1482618121 Timeout : 300 (sec) Verify return code: 0 (ok) --- Connecting to `www.python.org` (or any other secure site) works on web browsers. Also, `DigiCert High Assurance EV Root CA` exists in the System Roots section of Keychain. I guess the problem might be that ssl module does not use the Keychain, like `openssl` command. Regards ---------- assignee: christian.heimes components: SSL, macOS messages: 283976 nosy: christian.heimes, ned.deily, ronaldoussoren, ugultopu priority: normal severity: normal status: open title: SSL module problem on Python 3.6.0 and macOS Sierra type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 25 02:38:55 2016 From: report at bugs.python.org (Utku Gultopu) Date: Sun, 25 Dec 2016 07:38:55 +0000 Subject: [New-bugs-announce] [issue29066] PIP doesn't honor --trusted-host or --cert options Message-ID: <1482651535.67.0.15058500735.issue29066@psf.upfronthosting.co.za> New submission from Utku Gultopu: Steps to Reproduce ================== 1. Install Python 3.6.0 on macOS Sierra, using the macOS binary installer from python.org. 2. Don't install any SSL certificates. 3. Run `pip install -U channels`. It will fail. 4. Run `pip install -U --trusted-host pypi.python.org channels`. It will fail too. 5. Run `pip --cert ~/cacert.pem install -U channels` (where `cacert.pem` is [this](https://curl.haxx.se/ca/cacert.pem).) It will fail too. Expected Results ================ Command at number 3 to fail, commands at number 4 and 5 to succeed. Actual Results ============== Commands at number 3, 4 and 5 fail. Version Info ============ Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin macOS Sierra 10.12 pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (python 3.6) Related Issues ============= 29065 Explanation =========== I installed Python 3.6.0 on macOS Sierra, using the macOS binary installer from python.org. Initially, I didn't install the necessary certificates by running the script /Applications/Python 3.6/Install Certificates.command. When I wanted to install a module where PIP establishes an SSL connection during installation, I got an SSL: CERTIFICATE_VERIFY_FAILED error, as expected. Command at step 3: (virtualenv) user at host:~/Documents/virtualenv$ pip install -U channels Collecting channels Downloading channels-0.17.3-py2.py3-none-any.whl (53kB) 100% |????????????????????????????????| 61kB 299kB/s Requirement already up-to-date: Django>=1.8 in ./lib/python3.6/site-packages (from channels) Collecting asgiref>=0.13 (from channels) Downloading asgiref-1.0.0-py2.py3-none-any.whl Collecting daphne>=0.14.1 (from channels) Downloading daphne-0.15.0-py2.py3-none-any.whl Collecting six (from asgiref>=0.13->channels) Using cached six-1.10.0-py2.py3-none-any.whl Collecting twisted>=16.0 (from daphne>=0.14.1->channels) Downloading Twisted-16.6.0.tar.bz2 (3.0MB) 100% |????????????????????????????????| 3.0MB 265kB/s Complete output from command python setup.py egg_info: Download error on https://pypi.python.org/simple/incremental/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found! Couldn't find index page for 'incremental' (maybe misspelled?) Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found! No local packages or working download links found for incremental>=16.10.1 Traceback (most recent call last): File "", line 1, in File "/private/var/folders/45/r4yr9bbj29dfbtxqv75_785m0000gn/T/pip-build-o5qosaie/twisted/setup.py", line 21, in setuptools.setup(**_setup["getSetupArgs"]()) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/dist.py", line 316, in __init__ self.fetch_build_eggs(attrs['setup_requires']) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/dist.py", line 371, in fetch_build_eggs replace_conflicting=True, File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 846, in resolve dist = best[req.key] = env.best_match(req, ws, installer) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1118, in best_match return self.obtain(req, installer) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1130, in obtain return installer(requirement) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/dist.py", line 439, in fetch_build_egg return cmd.easy_install(req) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 668, in easy_install raise DistutilsError(msg) distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('incremental>=16.10.1') ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/45/r4yr9bbj29dfbtxqv75_785m0000gn/T/pip-build-o5qosaie/twisted/ Command at step 4: (virtualenv) user at host:~/Documents/virtualenv$ pip install -U --trusted-host pypi.python.org channels Collecting channels Downloading channels-0.17.3-py2.py3-none-any.whl (53kB) 100% |????????????????????????????????| 61kB 291kB/s Requirement already up-to-date: Django>=1.8 in ./lib/python3.6/site-packages (from channels) Collecting asgiref>=0.13 (from channels) Downloading asgiref-1.0.0-py2.py3-none-any.whl Collecting daphne>=0.14.1 (from channels) Downloading daphne-0.15.0-py2.py3-none-any.whl Collecting six (from asgiref>=0.13->channels) Downloading six-1.10.0-py2.py3-none-any.whl Collecting twisted>=16.0 (from daphne>=0.14.1->channels) Downloading Twisted-16.6.0.tar.bz2 (3.0MB) 100% |????????????????????????????????| 3.0MB 359kB/s Complete output from command python setup.py egg_info: Download error on https://pypi.python.org/simple/incremental/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found! Couldn't find index page for 'incremental' (maybe misspelled?) Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found! No local packages or working download links found for incremental>=16.10.1 Traceback (most recent call last): File "", line 1, in File "/private/var/folders/45/r4yr9bbj29dfbtxqv75_785m0000gn/T/pip-build-6fteuyi9/twisted/setup.py", line 21, in setuptools.setup(**_setup["getSetupArgs"]()) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/dist.py", line 316, in __init__ self.fetch_build_eggs(attrs['setup_requires']) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/dist.py", line 371, in fetch_build_eggs replace_conflicting=True, File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 846, in resolve dist = best[req.key] = env.best_match(req, ws, installer) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1118, in best_match return self.obtain(req, installer) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1130, in obtain return installer(requirement) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/dist.py", line 439, in fetch_build_egg return cmd.easy_install(req) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 668, in easy_install raise DistutilsError(msg) distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('incremental>=16.10.1') ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/45/r4yr9bbj29dfbtxqv75_785m0000gn/T/pip-build-6fteuyi9/twisted/ Command at step 5: (virtualenv) user at host:~/Documents/virtualenv$ pip --cert ~/cacert.pem install -U channels Collecting channels Using cached channels-0.17.3-py2.py3-none-any.whl Collecting asgiref>=0.13 (from channels) Using cached asgiref-1.0.0-py2.py3-none-any.whl Collecting daphne>=0.14.1 (from channels) Using cached daphne-0.15.0-py2.py3-none-any.whl Requirement already up-to-date: Django>=1.8 in ./lib/python3.6/site-packages (from channels) Collecting six (from asgiref>=0.13->channels) Using cached six-1.10.0-py2.py3-none-any.whl Collecting twisted>=16.0 (from daphne>=0.14.1->channels) Using cached Twisted-16.6.0.tar.bz2 Complete output from command python setup.py egg_info: Download error on https://pypi.python.org/simple/incremental/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found! Couldn't find index page for 'incremental' (maybe misspelled?) Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found! No local packages or working download links found for incremental>=16.10.1 Traceback (most recent call last): File "", line 1, in File "/private/var/folders/45/r4yr9bbj29dfbtxqv75_785m0000gn/T/pip-build-_c6zb9_v/twisted/setup.py", line 21, in setuptools.setup(**_setup["getSetupArgs"]()) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/dist.py", line 316, in __init__ self.fetch_build_eggs(attrs['setup_requires']) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/dist.py", line 371, in fetch_build_eggs replace_conflicting=True, File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 846, in resolve dist = best[req.key] = env.best_match(req, ws, installer) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1118, in best_match return self.obtain(req, installer) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1130, in obtain return installer(requirement) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/dist.py", line 439, in fetch_build_egg return cmd.easy_install(req) File "/Users/user/Documents/virtualenv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 668, in easy_install raise DistutilsError(msg) distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('incremental>=16.10.1') ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/45/r4yr9bbj29dfbtxqv75_785m0000gn/T/pip-build-_c6zb9_v/twisted/ ---------- assignee: christian.heimes components: SSL, macOS messages: 283987 nosy: christian.heimes, ned.deily, ronaldoussoren, ugultopu priority: normal severity: normal status: open title: PIP doesn't honor --trusted-host or --cert options type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 25 03:25:57 2016 From: report at bugs.python.org (amig) Date: Sun, 25 Dec 2016 08:25:57 +0000 Subject: [New-bugs-announce] [issue29067] Source archive: wrong directory attributes Message-ID: <1482654357.71.0.854296911958.issue29067@psf.upfronthosting.co.za> New submission from amig: In Python-3.6.0.tgz and Python-3.6.0.tar.xz the folders inside have attributes drwxr--r-- instaed of drwxrwxr-x. This leads to setting the user #501 as an owner while unpacking the archives in a folder owned by root with sudo and therefore access denial. ---------- components: Build messages: 283989 nosy: amig priority: normal severity: normal status: open title: Source archive: wrong directory attributes type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 25 08:52:32 2016 From: report at bugs.python.org (Chi Hsuan Yen) Date: Sun, 25 Dec 2016 13:52:32 +0000 Subject: [New-bugs-announce] [issue29068] Fix example code for PyErr_Fetch Message-ID: <1482673952.94.0.428755110908.issue29068@psf.upfronthosting.co.za> New submission from Chi Hsuan Yen: Remove an extra * The typo is there in 3.5~3.7 branches. 2.7 branch does not have this example. Nosy the two major commiters to Python/errors.c ---------- assignee: docs at python components: Documentation files: PyErr_Fetch-fix.patch keywords: patch messages: 283993 nosy: Chi Hsuan Yen, docs at python, martin.panter, serhiy.storchaka priority: normal severity: normal status: open title: Fix example code for PyErr_Fetch versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46029/PyErr_Fetch-fix.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 25 10:38:32 2016 From: report at bugs.python.org (paka) Date: Sun, 25 Dec 2016 15:38:32 +0000 Subject: [New-bugs-announce] [issue29069] Default PyPI URL in docs is not what is really in code Message-ID: <1482680312.49.0.384857389372.issue29069@psf.upfronthosting.co.za> New submission from paka: Currently https://docs.python.org/3.7/distutils/packageindex.html#the-pypirc-file says that URL of the PyPI server defaults to https://www.python.org/pypi. That URL does not work. Lib/distutils/config.py defines DEFAULT_REPOSITORY as https://upload.pypi.org/legacy/, so I'm attaching a patch for docs to update to current default. I might be wrong about value that must be in docs, so guidance is appreciated :) ---------- assignee: docs at python components: Distutils, Documentation files: fix-pypi-url.patch keywords: patch messages: 283997 nosy: docs at python, dstufft, eric.araujo, paka priority: normal severity: normal status: open title: Default PyPI URL in docs is not what is really in code versions: Python 3.7 Added file: http://bugs.python.org/file46034/fix-pypi-url.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 25 11:43:45 2016 From: report at bugs.python.org (Cornelius Diekmann) Date: Sun, 25 Dec 2016 16:43:45 +0000 Subject: [New-bugs-announce] [issue29070] Integration tests for pty.spawn on Linux and all other platforms Message-ID: <1482684225.17.0.467768789806.issue29070@psf.upfronthosting.co.za> New submission from Cornelius Diekmann: As Martin Panter noted, "it doesn?t look like pty.spawn() is tested at all" [issue26228]. So I wrote some very basic integration tests for pty.spawn. They work perfectly on my Linux machine. Line 4 of the library module under test (pty.py) states: "Only tested on Linux." I don't like this comment ;-) There are two possibilities how to proceed from here: 1) The tests work perfectly on all other platforms: then we can remove this comment from pty.py. 2) The tests fail on other platforms: then we can finally document where this module is expected to work and where not. In either case, I need some help by non-Linux users to run theses tests and document their success/failure and whether we have a bug on the specific platform (i.e. pty.spawn should work but does not) or whether the tests should be skipped (i.e. platform does not support ptys at all). It would be really awesome if some *BSD and Windows users would join the nosy list :-) Happy Holidays! ---------- components: Cross-Build, Tests files: PtyLinuxIntegrtionTest.patch keywords: patch messages: 284003 nosy: Alex.Willmer, Cornelius Diekmann, chris.torek, martin.panter priority: normal severity: normal status: open title: Integration tests for pty.spawn on Linux and all other platforms type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file46035/PtyLinuxIntegrtionTest.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Dec 25 20:16:18 2016 From: report at bugs.python.org (Kenzie Togami) Date: Mon, 26 Dec 2016 01:16:18 +0000 Subject: [New-bugs-announce] [issue29071] IDLE doesn't highlight f-strings properly Message-ID: <1482714978.44.0.603392455768.issue29071@psf.upfronthosting.co.za> New submission from Kenzie Togami: IDLE doesn't highlight f-strings like r-strings or u-strings. See the attached screenshot. ---------- assignee: terry.reedy components: IDLE files: python_idle_3.6_bug.png messages: 284010 nosy: Kenzie Togami, terry.reedy priority: normal severity: normal status: open title: IDLE doesn't highlight f-strings properly type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file46037/python_idle_3.6_bug.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 26 03:53:33 2016 From: report at bugs.python.org (=?utf-8?b?5YqJ5YqN5bOw?=) Date: Mon, 26 Dec 2016 08:53:33 +0000 Subject: [New-bugs-announce] [issue29072] the message of help(os.environ.setdefault) have some error Message-ID: <1482742413.83.0.382615378598.issue29072@psf.upfronthosting.co.za> New submission from ???: the message `D.setdefault(k[,d])', compiler inform SyntaxError: invalid syntax. I think that it woulld be D.setdefault([k, d]). ---------- assignee: docs at python components: Documentation messages: 284015 nosy: docs at python, ??? priority: normal severity: normal status: open title: the message of help(os.environ.setdefault) have some error versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 26 04:52:44 2016 From: report at bugs.python.org (Fabio Sangiovanni) Date: Mon, 26 Dec 2016 09:52:44 +0000 Subject: [New-bugs-announce] [issue29073] bytearray.__mod__() truncates on first \x00 Message-ID: <1482745964.51.0.352448624616.issue29073@psf.upfronthosting.co.za> New submission from Fabio Sangiovanni: Originally posted by Russell Keith-Magee on Twitter: https://twitter.com/freakboy3742/status/812609675283681280 Reproduced successfully on Python 3.5.2 >>> x = bytearray(1) >>> y = {} >>> x % y Python3.5: bytearray(b'') Python3.6: bytearray(b'\x00') also: >>> bytearray([0,1]) % {} # same with [], (), range(42) bytearray(b'') >>> bytearray([1,0]) % {} bytearray(b'\x01') ---------- components: Interpreter Core messages: 284018 nosy: sanjioh priority: normal severity: normal status: open title: bytearray.__mod__() truncates on first \x00 type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 26 07:41:55 2016 From: report at bugs.python.org (iMath) Date: Mon, 26 Dec 2016 12:41:55 +0000 Subject: [New-bugs-announce] [issue29074] repr doesn't give full result for this re math result Message-ID: <1482756115.08.0.598245159081.issue29074@psf.upfronthosting.co.za> New submission from iMath: I tested with Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32 re.search(r'http://v.pptv.com/show/.*?\.html.+', 'http://v.pptv.com/show/2bwkox9SS4nsatI.html?rcc_src=P5') does give a match, but it show the result <_sre.SRE_Match object; span=(0, 54), match='http://v.pptv.com/show/2bwkox9SS4nsatI.html?rcc_s> missing rc=P5' in IDLE BTW, py2.7 works fine ---------- components: Regular Expressions messages: 284024 nosy: ezio.melotti, mrabarnett, redstone-cold priority: normal severity: normal status: open title: repr doesn't give full result for this re math result type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 26 13:00:41 2016 From: report at bugs.python.org (Steve Dower) Date: Mon, 26 Dec 2016 18:00:41 +0000 Subject: [New-bugs-announce] [issue29075] Update WINVER to Windows 7 Message-ID: <1482775241.44.0.333291277311.issue29075@psf.upfronthosting.co.za> New submission from Steve Dower: Windows Vista SP2 is out of support by the time that Python 3.7 releases (see PEP 0537 and [1]), so we should do the following tasks: * update the definition of Py_WINVER in PC/pyconfig.h to 0x0601 _WIN32_WINNT_WIN7 * remove any dynamic API imports that are not required on Win7 (I don't think?there are many, if any) * remove pre-Win7 supportedOS elements from PC/python.manifest * block Windows Vista in the installer We may also be able to take advantage of new flags, particularly related to security (I think LoadLibrary[Ex] got new flags). If there's anything else we need to do, post it here so we don't forget. References: [1]: https://support.microsoft.com/en-us/lifecycle/search?alpha=Windows%20Vista%20Service%20Pack%202 ---------- components: Windows messages: 284034 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Update WINVER to Windows 7 type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 26 13:46:40 2016 From: report at bugs.python.org (Elias Zamaria) Date: Mon, 26 Dec 2016 18:46:40 +0000 Subject: [New-bugs-announce] [issue29076] Python 3.6 installer doesn't update "python3" shell command Message-ID: <1482778000.76.0.584407589583.issue29076@psf.upfronthosting.co.za> New submission from Elias Zamaria: I have a Mac running OS X 10.11.6, Python 3.5.2, and fish 2.3.1. I installed Python 3.6.0, and everything seemed to work fine. However, I typed "python3" in my shell and it started Python 3.5.2. I restarted my shell and typed "python3", and it still started Python 3.5.2. I ran "which python3" and it told me "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3". I ran "echo $PATH" and it told me "/Library/Frameworks/Python.framework/Versions/3.5/bin", among other directories that seem unrelated to Python. I thought that maybe the installer updated my ~/.bash_profile, assuming that I am using bash like most people, but I looked in that file, and the only things affecting my path that look Python-related are adding the directories "/Library/Frameworks/Python.framework/Versions/2.7/bin" and "/Library/Frameworks/Python.framework/Versions/3.5/bin". I re-ran the installer, clicked the "Customize" button, made sure that the "Shell profile updater" checkbox was checked, and ran "python3", and it started Python 3.5.2. I can probably fix this by adding the right directory to my $PATH, but I think it is a bug if the installer doesn't make that change for me, or even try to make the change. ---------- components: Installation, macOS messages: 284036 nosy: elias, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Python 3.6 installer doesn't update "python3" shell command versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 26 14:19:02 2016 From: report at bugs.python.org (Steve Wills) Date: Mon, 26 Dec 2016 19:19:02 +0000 Subject: [New-bugs-announce] [issue29077] build failure when enabling dtrace on FreeBSD Message-ID: <1482779942.39.0.346100216113.issue29077@psf.upfronthosting.co.za> New submission from Steve Wills: When enabling dtrace support via the --with-dtrace configure flag, build fails on FreeBSD with this message: /usr/sbin/dtrace -o Include/pydtrace_probes.h -h -s dtrace: option requires an argument -- s Looks like line 882 of Makefile.pre.in: 882 $(DTRACE) $(DFLAGS) -o $@ -h -s $< changing this to: 882 $(DTRACE) $(DFLAGS) -o $@ -h -s $(srcdir)/Include/pydtrace.d avoids that issue. Note that bmake is being used here. After this however, another issue is encountered during linking: Python/ceval.o: In function `_PyEval_EvalFrameDefault': Python/ceval.c:(.text+0xc94): undefined reference to `__dtraceenabled_python___function__entry' Python/ceval.c:(.text+0xcdd): undefined reference to `__dtrace_python___function__entry' Python/ceval.c:(.text+0xff0): undefined reference to `__dtraceenabled_python___line' Python/ceval.c:(.text+0x109f): undefined reference to `__dtrace_python___line' Python/ceval.c:(.text+0x125e): undefined reference to `__dtraceenabled_python___line' Python/ceval.c:(.text+0x12e5): undefined reference to `__dtraceenabled_python___line' Python/ceval.c:(.text+0x1358): undefined reference to `__dtraceenabled_python___line' Python/ceval.c:(.text+0x13f2): undefined reference to `__dtraceenabled_python___line' Python/ceval.c:(.text+0x146c): undefined reference to `__dtraceenabled_python___line' Python/ceval.o:Python/ceval.c:(.text+0x14de): more undefined references to `__dtraceenabled_python___line' follow Python/ceval.o: In function `_PyEval_EvalFrameDefault': Python/ceval.c:(.text+0x87f2): undefined reference to `__dtraceenabled_python___function__return' Python/ceval.c:(.text+0x8833): undefined reference to `__dtrace_python___function__return' Modules/gcmodule.o: In function `collect': Modules/gcmodule.c:(.text+0x380): undefined reference to `__dtraceenabled_python___gc__start' Modules/gcmodule.c:(.text+0x38c): undefined reference to `__dtrace_python___gc__start' Modules/gcmodule.c:(.text+0xe1b): undefined reference to `__dtraceenabled_python___gc__done' Modules/gcmodule.c:(.text+0xe2a): undefined reference to `__dtrace_python___gc__done' which I believe is due to dtrace -G modifying Python/ceval.o and Modules/gcmodule.o. Finally, note that all calls to dtrace -G or dtrace -h on FreeBSD 11.0 should have -xnolibs added to enable use without the DTrace kernel modules loaded. Otherwise dtrace processes the /usr/lib/dtrace scripts unnecessarily, and errors out when it tries to talk to the DTrace kernel code, causing build failure in a jail. (I can provide patches, but suspect you have preferences about how the build system work that I'm not aware of, so wanted to explain before patching in ways that aren't satisfactory.) ---------- messages: 284038 nosy: swills priority: normal severity: normal status: open title: build failure when enabling dtrace on FreeBSD versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 26 15:15:52 2016 From: report at bugs.python.org (Dhushyanth Ramasamy) Date: Mon, 26 Dec 2016 20:15:52 +0000 Subject: [New-bugs-announce] [issue29078] Example in Section 8.1.5 time Objects is broken Message-ID: <1482783352.26.0.821424852315.issue29078@psf.upfronthosting.co.za> New submission from Dhushyanth Ramasamy: The example doesn't import timedelta. This causes an error when attempting to run the example in the interactive window. ---------- assignee: docs at python components: Documentation files: datetime.patch keywords: patch messages: 284042 nosy: docs at python, rdhushyanth priority: normal severity: normal status: open title: Example in Section 8.1.5 time Objects is broken versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46045/datetime.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Dec 26 15:46:14 2016 From: report at bugs.python.org (Georg Mischler) Date: Mon, 26 Dec 2016 20:46:14 +0000 Subject: [New-bugs-announce] [issue29079] pathlib.resolve() causes infinite loop on Windows Message-ID: <1482785174.29.0.0980303906914.issue29079@psf.upfronthosting.co.za> New submission from Georg Mischler: When pathlib.resolve() is invoked on Windows(10) with an absolute path including a non-existing drive, it gets caught in an infinite loop. To reproduce: Select a drive letter that doesn't exist on the system (in my case H:). Run the following line of code: pathlib.Path('h:\\').resolve() Expected result: returns the input string unchanged. Actual result: pathlib.resolve() ends up in an infinite loop, repeatedly calling _getfinalpathname() on the same string. ---------- components: Library (Lib), Windows messages: 284045 nosy: Georg Mischler, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: pathlib.resolve() causes infinite loop on Windows type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 04:53:02 2016 From: report at bugs.python.org (Joseph Shen) Date: Tue, 27 Dec 2016 09:53:02 +0000 Subject: [New-bugs-announce] [issue29080] unnecessary hg required for build version 3.6 on Windows Message-ID: <1482832382.86.0.80948215742.issue29080@psf.upfronthosting.co.za> New submission from Joseph Shen: the released 3.6.0 PCbuild/build.bat required hg for building. but this requirement is not necessary for build python from source. maybe it will be better for us to remove this requirement as the old versions. ---------- components: Build messages: 284078 nosy: Joseph.Shen priority: normal severity: normal status: open title: unnecessary hg required for build version 3.6 on Windows type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 05:05:12 2016 From: report at bugs.python.org (hywl51) Date: Tue, 27 Dec 2016 10:05:12 +0000 Subject: [New-bugs-announce] [issue29081] time.strptime() return wrong result Message-ID: <1482833112.13.0.0168836521105.issue29081@psf.upfronthosting.co.za> New submission from hywl51: In [1]:import time In [2]: time.strptime('2016 52 0', '%Y %W %w') Out[2]: time.struct_time(tm_year=2017, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=367, tm_isdst=-1) When given the parameters above, the function return the struct_time object with tm_yday=367, that is wrong. I test the codes on Python 2.7.11 and 3.5.1, the error is same. ---------- components: Library (Lib) messages: 284080 nosy: hywl51 priority: normal severity: normal status: open title: time.strptime() return wrong result type: behavior versions: Python 2.7, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 05:09:01 2016 From: report at bugs.python.org (Chi Hsuan Yen) Date: Tue, 27 Dec 2016 10:09:01 +0000 Subject: [New-bugs-announce] [issue29082] In 2.7.13, _ctypes.LoadLibrary no longer accepts Unicode objects Message-ID: <1482833341.48.0.70408057792.issue29082@psf.upfronthosting.co.za> New submission from Chi Hsuan Yen: In issue27330, there's one more change besides fixing possible memory leaks. In LoadLibrary function of _ctypes: [1] - if (!PyArg_ParseTuple(args, "O|O:LoadLibrary", &nameobj, &ignored)) + if (!PyArg_ParseTuple(args, "S|O:LoadLibrary", &nameobj, &ignored)) Before this change, both bytes and unicode objects are accepted in _ctypes.LoadLibrary() (Unicode objects are implicitly converted to bytes), and after this change only bytes objects are valid. There are two options: * Revert the relevant PyArg_ParseTuple. It's better to have fewer surprises on 2.7 branch :) * Document the change. I prefer the first option as in our project ```from __future__ import unicode_literals``` is used everywhere, and in Python 3 only Unicode objects are acceptable in _ctypes.LoadLibrary(). Downstream report: https://github.com/rg3/youtube-dl/issues/11540 Added the author and the reviewer in issue27330. [1] e04c054beb53 ---------- components: ctypes messages: 284081 nosy: Chi Hsuan Yen, martin.panter, serhiy.storchaka priority: normal severity: normal status: open title: In 2.7.13, _ctypes.LoadLibrary no longer accepts Unicode objects type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 08:41:52 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Dec 2016 13:41:52 +0000 Subject: [New-bugs-announce] [issue29083] Readd PyArg_VaParse to the stable API Message-ID: <1482846112.52.0.144835029316.issue29083@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: Seems PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were excluded from the stable API by the mistake in fixing issue11626. These functions was in the stable API before 3.3, and the documentation doesn't mention that they are not in the stable API. I think they should be readded to the stable API. ---------- components: Interpreter Core messages: 284097 nosy: loewis, serhiy.storchaka priority: normal severity: normal status: open title: Readd PyArg_VaParse to the stable API type: compile error versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 08:59:17 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Dec 2016 13:59:17 +0000 Subject: [New-bugs-announce] [issue29084] C API of OrderedDict Message-ID: <1482847157.79.0.799208161515.issue29084@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: C API of the C implementation of OrderedDict was added in 3.5 together with the C implementation of OrderedDict. But it was never announced nor documented. Some macros contain bugs. PyODict_Check() and PyODict_CheckExact() are declared in the limited API, but don't work since use PyODict_Type not available in the limited API. PyODict_SIZE() is expanded to syntactically incorrect code and it's name is not consistent with similar macros: PyTuple_GET_SIZE, PyList_GET_SIZE and just added PyDict_GET_SIZE. Many names are just transparent wrappers around PyDict API (and they can't be different). Since PyODict C API is not documented, partially not working and partially redundant, and the C implementation of OrderedDict is optional (other Python implementations can provide just Python implementation of OrderedDict), I think this C API should be made private if not removed. ---------- components: Interpreter Core messages: 284098 nosy: eric.snow, rhettinger, serhiy.storchaka priority: normal severity: normal status: open title: C API of OrderedDict _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 12:39:24 2016 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 27 Dec 2016 17:39:24 +0000 Subject: [New-bugs-announce] [issue29085] Python 3.6 on Windows doesn't seed Random() well enough Message-ID: <1482860364.41.0.203895591313.issue29085@psf.upfronthosting.co.za> New submission from Ned Batchelder: Creating two Random() instances in quick succession produces the same sequence, but only on Windows on Python 3.6. On 3.5 or earlier, or on Mac/Linux, the randomization is good. Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import random; print(random.Random().randint(1, 999999), random.Random().randint(1, 999999)) 903885 903885 >>> import random; print(*[random.Random().randint(1, 999999) for _ in range(2)]) 996947 56476 >>> import random; print(*[random.Random().randint(1, 999999) for _ in range(2)]) 793282 793282 >>> import random; print(*[random.Random().randint(1, 999999) for _ in range(2)]) 519702 519702 >>> import random; print(*[random.Random().randint(1, 999999) for _ in range(2)]) 230678 230678 >>> import random; print(*[random.Random().randint(1, 999999) for _ in range(3)]) 474701 474701 474701 >>> import random; print(*[random.Random().randint(1, 999999) for _ in range(3)]) 890942 890942 890942 >>> import random; print(*[random.Random().randint(1, 999999) for _ in range(3)]) 997495 997495 997495 >>> import random; print(*[random.Random().randint(1, 999999) for _ in range(5)]) 27803 27803 27803 27803 919401 >>> I would expect each of these runs to produce unique numbers, with no duplicates. ---------- keywords: 3.6regression messages: 284118 nosy: nedbat priority: normal severity: normal status: open title: Python 3.6 on Windows doesn't seed Random() well enough _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 14:01:59 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Dec 2016 19:01:59 +0000 Subject: [New-bugs-announce] [issue29086] Document C API that is not part of the limited API Message-ID: <1482865319.03.0.627052322458.issue29086@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: >From the documentation: https://docs.python.org/3/c-api/stable.html In the C API documentation, API elements that are not part of the limited API are marked as "Not part of the limited API." But they don't. Following sample patch adds the notes to Unicode Objects and Codecs C API. I'm going to add them to all C API. What are your though about formatting the note? Should it be before the description, after the description, but before the "deprecated" directive (as in the patch), or after the first paragraph of the description? Should it be on the separate line or be appended at the end of the previous paragraph, or starts the first paragraph (if before the description)? May be introduce a special directive for it? ---------- assignee: docs at python components: Documentation files: unicode-not-part-of-the-limited-api.patch keywords: patch messages: 284125 nosy: docs at python, georg.brandl, serhiy.storchaka priority: normal severity: normal status: open title: Document C API that is not part of the limited API type: enhancement versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46057/unicode-not-part-of-the-limited-api.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 14:13:23 2016 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Dec 2016 19:13:23 +0000 Subject: [New-bugs-announce] [issue29087] UCS4 support functions are not implemented Message-ID: <1482866003.6.0.322450240953.issue29087@psf.upfronthosting.co.za> New submission from Serhiy Storchaka: There is a special section in the documentation of Unicode Objects C API: UCS4 Support. https://docs.python.org/3/c-api/unicode.html#ucs4-support It documents utility functions that work on strings of Py_UCS4 characters like Py_UCS4_strlen(), Py_UCS4_strcpy(), etc. But none of these functions is implemented. May be the documentation should be just removed? ---------- assignee: docs at python components: Documentation, Unicode messages: 284126 nosy: benjamin.peterson, docs at python, ezio.melotti, haypo, lemburg, serhiy.storchaka priority: normal severity: normal status: open title: UCS4 support functions are not implemented type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 15:22:35 2016 From: report at bugs.python.org (Kodiologist) Date: Tue, 27 Dec 2016 20:22:35 +0000 Subject: [New-bugs-announce] [issue29088] Inconsistent use of underscore in names that start with "is" Message-ID: <1482870155.37.0.889856609574.issue29088@psf.upfronthosting.co.za> New submission from Kodiologist: Compare ``isinstance``, ``issubclass``, and ``islower`` to ``is_integer``, ``is_fifo``, and ``is_enabled``. In Python 3.6, of all the names in the standard library starting with ``is``, I count 69 names with the underscore and 91 without. It seems better to pick one way or the other and stick with it. I would recommend using the underscore, for legibility. ---------- messages: 284133 nosy: Kodiologist priority: normal severity: normal status: open title: Inconsistent use of underscore in names that start with "is" versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 16:27:05 2016 From: report at bugs.python.org (Xezlec) Date: Tue, 27 Dec 2016 21:27:05 +0000 Subject: [New-bugs-announce] [issue29089] Python 2 dictionary keys described incorrectly Message-ID: <1482874025.47.0.911588306573.issue29089@psf.upfronthosting.co.za> New submission from Xezlec: In section 5.5 on the page https://docs.python.org/2/tutorial/datastructures.html#dictionaries the requirements given for dictionary keys are not correct. Specifically, it is claimed that only immutable objects (and tuples containing only immutable objects) may be used as keys. This is false, as user-defined mutable objects may be used as keys. I suggest rewording along these lines: "Only user-defined objects and immutable built-in types may be used as keys. Although allowed, it is bad practice to use a mutable user-defined object as a key when equality is determined in any way other than identity (the default)." ---------- assignee: docs at python components: Documentation messages: 284135 nosy: Xezlec, docs at python priority: normal severity: normal status: open title: Python 2 dictionary keys described incorrectly versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Dec 27 21:40:00 2016 From: report at bugs.python.org (Mike Hobbs) Date: Wed, 28 Dec 2016 02:40:00 +0000 Subject: [New-bugs-announce] [issue29090] python34.dll crash Message-ID: <1482892800.26.0.562397151262.issue29090@psf.upfronthosting.co.za> New submission from Mike Hobbs: Only info (Windows event viewer): Faulting application python_cc.exe, version 0.0.0.0, faulting module python34.dll, version 3.4.3150.1013, fault address 0x001059b7 Note: python_cc.exe is renamed python.exe to identify it in task manager. OS is Windows XP SP3 The following script crashes the python executable every few hours (not regular, seemingly random). The exact same script also crashes python 2.7.13. Each version has the latest pyserial module installed for the appropriate python version. When python 2.7 crashes, the reported error is always in _ctypes.dll which is used extensively in the serialwin32.py for reading the serial port, but python 3.4 fails in the main DLL. This same script has been running without a problem for several years on the same hardware (Quad core Shuttle with CurrentCost 128 electricity monitor on COM3, using PL2303 serial/USB chipset (probably clone)). The crashes have only occured since harddisc replacement involving new XP installation and reinstallation of application software. Occasionally, the crash results in a blue screen but usually its just the task crash notification (which I automatically dismiss using AutoIt3 watchdog script). Everything else on the machine id running normally so the serial port handling is the prime suspect. import serial, sys, time, traceback, os import xml.etree.ElementTree as ET correction = 1.074 # 247V when CC128 is designed for 230V path = "E:\\Apache\\htdocs\\energy\\elec_data\\" log = "E:\\Apache\\htdocs\\energy\\log.txt" ser = None amps = [0,0,0,0] def localtime(): y,m,d,h,mn,s,wd,b,c = time.localtime() return '%4d%02d%02d %02d%02d%02d' % (y,m,d,h,mn,s) def dbg(msg): msg = msg.strip() print(msg) if len(msg) <= 2: return global log # avoid huge files if os.path.getsize(log) > 2000000: y,m,d,h,mn,s,wd,b,c = time.localtime() old = 'log_%4d%02d%02d_%02d%02d%02d.txt' % (y,m,d,h,mn,s) os.rename(log, old) f = open(log, 'a') t = localtime() f.write('%s %s\n' % (t, msg)) f.close() try: ser = serial.Serial(port="COM3", baudrate=57600, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=3) dbg("Connected to CurrentCost meter") except serial.SerialException: dbg("Failed to connect to CurrentCost meter") sys.exit(1) err_count = 0 while True: try: line = ser.readline().strip() # should be something every 6 seconds if line: watts = '' try: msg = ET.fromstring(line) watts = msg.findtext('ch1/watts') watts = float(watts) err_count = 0 except: watts = '' err_count += 1 finally: try: del exc_info except: pass if watts: # _ _ _ _ # _ or __ regarded as bogus amps[0] = amps[1]; amps[1] = amps[2]; amps[2] = amps[3] amps[3] = float(watts)*.00405 # 247 volts bogus = False if amps[1]>0 and amps[1] < amps[0]/2: if amps[1] < amps[2]/2: bogus = True if amps[1] < amps[3]/2 and amps[2] < amps[3]/2: bogus = True #dbg('%s %s %s %s %s' % (amps[0],amps[1],amps[2],amps[3],bogus)) if not bogus and amps[2]>0 and amps[3]>0: y,m,d,h,mn,s,a,b,c = time.localtime() try: line = '%f,%f' % (float(h)+float(mn)/60+float(s)/3600, amps[1]) f = open('%s\\%4d%02d%02d.csv' % (path,y,m,d), 'a') f.write('%s\n' % line) f.close() except: exc_info = sys.exc_info() dbg('CC EXCEPTION %s ' % traceback.format_exception(*exc_info)) finally: try: del exc_info # force garbage collection except: pass else: if err_count > 100: dbg("100 consecutive errors detected") break except serial.SerialException: exc_info = sys.exc_info() dbg('CC EXCEPTION %s ' % traceback.format_exception(*exc_info)) ser.close() sys.exit(1) except KeyboardInterrupt: ser.close() sys.exit(0) except: exc_info = sys.exc_info() dbg('CC EXCEPTION %s ' % traceback.format_exception(*exc_info)) finally: try: del exc_info # force garbage collection except: pass ser.close() sys.exit(1) ---------- components: Windows messages: 284148 nosy: MikeH, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: python34.dll crash type: crash versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 02:23:21 2016 From: report at bugs.python.org (Seth Michael Larson) Date: Wed, 28 Dec 2016 07:23:21 +0000 Subject: [New-bugs-announce] [issue29091] Python 3.5+ socket.socketpair fallback incorrectly implemented Message-ID: <1482909801.54.0.391034460781.issue29091@psf.upfronthosting.co.za> New submission from Seth Michael Larson: The socket.socketpair() fallback for Python 3.5+ is incorrectly implemented from the original source. The fallback doesn't provide a backlog argument to the lsock.listen() function call. When running the function it gives the following error: `TypeError: listen() takes exactly one argument (0 given)` Issue can be seen here on line 514: https://hg.python.org/cpython/file/3.6/Lib/socket.py Should add 1 as the argument to listen() to bring the implementation in line with the source implementation at: https://gist.github.com/geertj/4325783 ---------- components: Library (Lib) messages: 284158 nosy: SethMichaelLarson priority: normal severity: normal status: open title: Python 3.5+ socket.socketpair fallback incorrectly implemented type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 03:42:25 2016 From: report at bugs.python.org (Xiang Zhang) Date: Wed, 28 Dec 2016 08:42:25 +0000 Subject: [New-bugs-announce] [issue29092] Sync os.stat's doc and doc string Message-ID: <1482914545.99.0.849195642081.issue29092@psf.upfronthosting.co.za> New submission from Xiang Zhang: The accepted types of parameter *path* are different between os.stat's doc and doc string. In doc, it mentions Pathlike, string and file descriptor. In doc string, it mentions string, bytes and file descriptor. (3.5 only lack bytes in doc). ---------- assignee: docs at python components: Documentation files: doc-os-stat.patch keywords: patch messages: 284167 nosy: docs at python, xiang.zhang priority: normal severity: normal stage: patch review status: open title: Sync os.stat's doc and doc string versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46061/doc-os-stat.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 07:48:17 2016 From: report at bugs.python.org (Evan) Date: Wed, 28 Dec 2016 12:48:17 +0000 Subject: [New-bugs-announce] [issue29093] Windows launcher breaks history in Git Bash Message-ID: <1482929297.98.0.0622229530904.issue29093@psf.upfronthosting.co.za> New submission from Evan: When I launch *any* version of Python using py.exe from Git Bash, the up and down arrows clear the line buffer instead of navigating history. The following things all work as intended: * py.exe in cmd.exe * py.exe in Git Bash using winpty * Python 2.7, 3.5, 3.6 when run directly The only thing that appears to trigger this bug is using the launcher in Git Bash without winpty. Tested with the following versions of Git Bash: * GNU bash, version 4.3.42(2)-release (x86_64-pc-msys) * GNU bash, version 4.3.46(2)-release (x86_64-pc-msys) Unfortunately I can't point to exactly which version of the launcher introduced this bug. Initially I was certain this only happened when I upgraded from 3.5.2 to 3.6.0, but now I've checked another machine with 3.5.2 and 3.4.4, and the bug appears there too. ---------- components: Windows messages: 284171 nosy: evan_, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows launcher breaks history in Git Bash versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 08:26:31 2016 From: report at bugs.python.org (Peter Ebden) Date: Wed, 28 Dec 2016 13:26:31 +0000 Subject: [New-bugs-announce] [issue29094] Regression in zipfile writing in 2.7.13 Message-ID: <1482931591.96.0.8795611166.issue29094@psf.upfronthosting.co.za> New submission from Peter Ebden: In Python 2.7.13, using zipfile.ZipFile to write into a file with some initial preamble produces a zip file that cannot be read again by some zip implementations. Our use case is using pex (https://github.com/pantsbuild/pex) which writes a zip that begins with a shebang, and later attempting to manipulate that using Go's standard archive/zip package. In 2.7.12 that works OK, but in 2.7.13 the .pex file is rejected on reading. Linux's command-line unzip tool will read the archive, but issues a warning ("4 extra bytes at beginning or within zipfile") which wasn't present previously. zipfile.ZipFile does read the files OK. I assume this is related to https://bugs.python.org/issue26293 since that's the most obvious zipfile change in 2.7.13. It's pretty easy to reproduce using the example in that issue: from zipfile import ZipFile with open('a.zip', 'wb') as base: base.write(b'old\n') with ZipFile(base, 'a') as myzip: myzip.write('eggs.txt') unzip -t a.zip Archive: a.zip warning [a.zip]: 4 extra bytes at beginning or within zipfile (attempting to process anyway) ... ---------- components: Library (Lib) messages: 284172 nosy: Peter Ebden priority: normal severity: normal status: open title: Regression in zipfile writing in 2.7.13 versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 15:02:42 2016 From: report at bugs.python.org (=?utf-8?q?Walter_D=C3=B6rwald?=) Date: Wed, 28 Dec 2016 20:02:42 +0000 Subject: [New-bugs-announce] [issue29095] Compiling Python 3.6 from source on MacOS X Sierra Message-ID: <1482955362.45.0.530145158959.issue29095@psf.upfronthosting.co.za> New submission from Walter D?rwald: I'm trying to compile Python 3.6 from source on MacOS X Sierra. However it seems that the _ssl module doesn't get built. Attached is the complete output. Note that I have openssl installed via homebrew: ~/ ? brew list openssl /usr/local/Cellar/openssl/1.0.2j/bin/c_rehash /usr/local/Cellar/openssl/1.0.2j/bin/openssl /usr/local/Cellar/openssl/1.0.2j/include/openssl/ (75 files) /usr/local/Cellar/openssl/1.0.2j/lib/libcrypto.1.0.0.dylib /usr/local/Cellar/openssl/1.0.2j/lib/libssl.1.0.0.dylib /usr/local/Cellar/openssl/1.0.2j/lib/engines/ (12 files) /usr/local/Cellar/openssl/1.0.2j/lib/pkgconfig/ (3 files) /usr/local/Cellar/openssl/1.0.2j/lib/ (4 other files) /usr/local/Cellar/openssl/1.0.2j/share/man/ (1592 files) but if I understood Mac/BuildScript/resources/ReadMe.rtf correctly, this should be irrelevant. Anyway the resulting pip seems to be unusable: ~/ ? python -mpip install cx_Oracle pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting cx_Oracle Could not fetch URL https://pypi.python.org/simple/cx-oracle/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping ---------- components: Build files: Python3.6-build.log messages: 284193 nosy: doerwalter priority: normal severity: normal status: open title: Compiling Python 3.6 from source on MacOS X Sierra versions: Python 3.6 Added file: http://bugs.python.org/file46065/Python3.6-build.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 15:38:35 2016 From: report at bugs.python.org (Ted Meyer) Date: Wed, 28 Dec 2016 20:38:35 +0000 Subject: [New-bugs-announce] [issue29096] Signal Handlers reliably cause UnboundLocalErrors Message-ID: <1482957515.7.0.441178310139.issue29096@psf.upfronthosting.co.za> New submission from Ted Meyer: Using this simple snippit of code: import signal import signal def sig_hdlr(signum, frame): raise ValueError() def faulty(): local_var = "" signal.signal(signal.SIGALRM, sig_hdlr) signal.alarm(1) try: while True: local_var += "!" except ValueError: print (local_val) faulty() I can reliably get a crash: tmathmeyer at tmathmeyer-linuxstation:~$ python --version Python 2.7.6 tmathmeyer at tmathmeyer-linuxstation:~$ python pybug.py Traceback (most recent call last): File "pybug.py", line 16, in faulty() File "pybug.py", line 14, in faulty print local_val NameError: global name 'local_val' is not defined tmathmeyer at tmathmeyer-linuxstation:~$ python3.4 pybug.py Traceback (most recent call last): File "pybug.py", line 12, in faulty local_var += "!" File "pybug.py", line 4, in sig_hdlr raise ValueError() ValueError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "pybug.py", line 16, in faulty() File "pybug.py", line 14, in faulty print (local_val) NameError: name 'local_val' is not defined I can repro this on 2.7.6 and 3.4, but do not have other versions to test on. ---------- messages: 284196 nosy: Ted Meyer priority: normal severity: normal status: open title: Signal Handlers reliably cause UnboundLocalErrors versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 15:49:20 2016 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Wed, 28 Dec 2016 20:49:20 +0000 Subject: [New-bugs-announce] [issue29097] datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6 Message-ID: <1482958160.11.0.32337159902.issue29097@psf.upfronthosting.co.za> New submission from Pekka Kl?rck: For example: E:\>py -3.6 -c "import datetime; datetime.datetime.fromtimestamp(42)" Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument Works fine at least with Python 2.6-2.7 and 3.3-3.5. Only tested on Windows (missing deadsnakes for easy Linux testing). I was also surprised to get OSError in general, but apparently fromtimestamp uses that instead of ValueError nowadays in some error situations. ---------- messages: 284199 nosy: pekka.klarck priority: normal severity: normal status: open title: datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 17:08:50 2016 From: report at bugs.python.org (Carl George) Date: Wed, 28 Dec 2016 22:08:50 +0000 Subject: [New-bugs-announce] [issue29098] document minimum sqlite version Message-ID: <1482962930.74.0.760741820297.issue29098@psf.upfronthosting.co.za> New submission from Carl George: While attempting to build a Python 3.6 RPM for RHEL/CentOS 6, I noticed the following warning. *** WARNING: renaming "_sqlite3" since importing it failed: build/lib.linux-i686-3.6-pydebug/_sqlite3.cpython-36dm-i386-linux-gnu.so: undefined symbol: sqlite3_stmt_readonly I was able to locate changeset 284676cf2ac8 (#10740) which introduced the usage of the sqlite3_stmt_readonly interface. That interface wasn't added to sqlite until 3.7.4 (http://www.sqlite.org/releaselog/3_7_4.html). My RPM build failed because RHEL/CentOS 6 only has sqlite 3.6.20. I understand that Python can't support old libraries forever, but can this minimum sqlite version be noted somewhere in the documentation? ---------- assignee: docs at python components: Documentation messages: 284202 nosy: carlwgeorge, docs at python priority: normal severity: normal status: open title: document minimum sqlite version versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 18:04:29 2016 From: report at bugs.python.org (Bozo Kopic) Date: Wed, 28 Dec 2016 23:04:29 +0000 Subject: [New-bugs-announce] [issue29099] sqlite3 timestamp converter ValueError Message-ID: <1482966269.67.0.620298847284.issue29099@psf.upfronthosting.co.za> New submission from Bozo Kopic: Current convert_timestamp function raises exception when parsing timestamps that contain timezone information and have microsecond set to zero. Patch for this behavior is included. Example script that demonstrates this problem: import sys import datetime import sqlite3 import traceback import contextlib def main(): db = sqlite3.connect('test.db', detect_types=sqlite3.PARSE_DECLTYPES) db.executescript(""" CREATE TABLE IF NOT EXISTS test ( timestamp TIMESTAMP) """) t = datetime.datetime.now(tz=datetime.timezone.utc) t = t.replace(microsecond=0) db.executemany("INSERT INTO test VALUES (:timestamp)", [{'timestamp': t}]) db.commit() with contextlib.closing(db.cursor()) as c: try: c.execute('SELECT * FROM test') c.fetchall() print('original implementation success') except Exception as e: print('original implementation failed') traceback.print_exc() c.close() sqlite3.register_converter("timestamp", _sqlite_convert_timestamp) with contextlib.closing(db.cursor()) as c: try: c.execute('SELECT * FROM test') c.fetchall() print('patched implementation success') except Exception as e: print('patched implementation failed') traceback.print_exc() c.close() def _sqlite_convert_timestamp(val): datepart, timepart = val.split(b" ") # this is the patch timepart = timepart.split(b'+', 1)[0].split(b'-', 1)[0] year, month, day = map(int, datepart.split(b"-")) timepart_full = timepart.split(b".") hours, minutes, seconds = map(int, timepart_full[0].split(b":")) if len(timepart_full) == 2: microseconds = int('{:0<6.6}'.format(timepart_full[1].decode())) else: microseconds = 0 val = datetime.datetime(year, month, day, hours, minutes, seconds, microseconds) return val if __name__ == '__main__': sys.exit(main()) ---------- components: Library (Lib) files: sqlite3.patch keywords: patch messages: 284205 nosy: bozo.kopic priority: normal severity: normal status: open title: sqlite3 timestamp converter ValueError type: crash versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46067/sqlite3.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 19:50:47 2016 From: report at bugs.python.org (Jordon Phillips) Date: Thu, 29 Dec 2016 00:50:47 +0000 Subject: [New-bugs-announce] [issue29100] Core dump / OverflowError for datetime.fromtimestamp with overly large timestamp in Ubuntu 12.04 Message-ID: <1482972647.78.0.524140289263.issue29100@psf.upfronthosting.co.za> New submission from Jordon Phillips: In Python 3.6.0 if you give datetime.fromtimestamp a very bad value you either get a core dump or an OverflowError. The core dump occurs when no tzinfo is provided, the OverflowError occurs when a tzinfo is provided (such as tzlocal from dateutil). Attached is a minimal script to reproduce the error. Note that this behavior only occurs on certain systems. It does not happen on OSX 10.11.6, but it does happen on Ubuntu 12.04. I imagine it happens on other systems as well, but I haven't tested beyond those two. Here are the specific errors I get on Ubuntu 12.04. When no tzinfo is provided: python: /tmp/python-build.20161228223921.28011/Python-3.6.0/Modules/_datetimemodule.c:251: days_before_year: Assertion `year >= 1' failed. Aborted (core dumped) When a tzinfo is provided: Traceback (most recent call last): File "test1.py", line 11, in datetime.fromtimestamp(bad_st_mtime, local_time_zone) File "~/.pyenv/versions/venv36d/lib/python3.6/site-packages/dateutil/tz/_common.py", line 210, in fromutc dt_wall = self._fromutc(dt) File "~/.pyenv/versions/venv36d/lib/python3.6/site-packages/dateutil/tz/_common.py", line 195, in _fromutc return dt + dtdst OverflowError: date value out of range I imagine this is related to the fold changes. ---------- components: Library (Lib) files: test.py messages: 284218 nosy: Jordon Phillips priority: normal severity: normal status: open title: Core dump / OverflowError for datetime.fromtimestamp with overly large timestamp in Ubuntu 12.04 type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file46068/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Dec 28 22:58:24 2016 From: report at bugs.python.org (Victor Liu) Date: Thu, 29 Dec 2016 03:58:24 +0000 Subject: [New-bugs-announce] [issue29101] Nested lambdas in setattr() lose context in Python 2.7 Message-ID: <1482983904.15.0.0148999643172.issue29101@psf.upfronthosting.co.za> New submission from Victor Liu: I would expect bug.py to output: foo bar baz but instead we observe: baz baz baz Replicated on Windows 10 Home Edition, Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] ---------- files: bug.py messages: 284224 nosy: Victor Liu priority: normal severity: normal status: open title: Nested lambdas in setattr() lose context in Python 2.7 type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file46069/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 01:53:42 2016 From: report at bugs.python.org (Eric Snow) Date: Thu, 29 Dec 2016 06:53:42 +0000 Subject: [New-bugs-announce] [issue29102] Add an id field to PyInterpreterState. Message-ID: <1482994422.5.0.64533163171.issue29102@psf.upfronthosting.co.za> New submission from Eric Snow: Currently there isn't any way to uniquely identify an interpreter. This patch adds a new "id" field to the PyInterpreterState struct. The ID for every new interpreter is set to the value of an increasing global counter. That means that the ID is unique within the process. IIRC, the availability of unique ID would help tools that make use of subinterpreters, like mod_wsgi. It is also necessary for any effort to expose interpreters in Python-level code (which is the subject of other ongoing work). The patch also adds: unsigned long PyInterpreterState_GetID(PyInterpreterState *interp) Note that, without a Python-level interpreters module, testing this change is limited to extending the existing test code in test_capi. ---------- assignee: eric.snow components: Interpreter Core files: interpreter-id.diff keywords: patch messages: 284229 nosy: brett.cannon, eric.snow, grahamd, ncoghlan, steve.dower priority: normal severity: normal stage: patch review status: open title: Add an id field to PyInterpreterState. type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file46070/interpreter-id.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 02:37:30 2016 From: report at bugs.python.org (Jean-Sebastien Bevilacqua) Date: Thu, 29 Dec 2016 07:37:30 +0000 Subject: [New-bugs-announce] [issue29103] Make enum.py pep8 compliant Message-ID: <1482997050.71.0.505456771635.issue29103@psf.upfronthosting.co.za> New submission from Jean-Sebastien Bevilacqua: Hello, This is my first patch on CPython, so please tell me if I do something wrong. When executing flake8 on Lib/enum.py, there are lot of warning. This patch remove all these warnings. ---------- components: Library (Lib) files: enum_format.patch keywords: patch messages: 284234 nosy: barry, eli.bendersky, ethan.furman, realitix priority: normal severity: normal status: open title: Make enum.py pep8 compliant type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file46071/enum_format.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 06:56:25 2016 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Thu, 29 Dec 2016 11:56:25 +0000 Subject: [New-bugs-announce] [issue29104] Left bracket remains in format string result when '\' preceeds it Message-ID: <1483012585.51.0.342717701316.issue29104@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: In short: >>> f"\{10}" yields: "\\{10" This is reproducible only when `\` precedes the opening bracket, that is: >>> f"\ {10}" results in: "\\ 10" ---------- components: Interpreter Core messages: 284249 nosy: Jim Fasarakis-Hilliard priority: normal severity: normal status: open title: Left bracket remains in format string result when '\' preceeds it versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 11:29:54 2016 From: report at bugs.python.org (iMath) Date: Thu, 29 Dec 2016 16:29:54 +0000 Subject: [New-bugs-announce] [issue29105] code or doc improvement for logging.handlers.RotatingFileHandler Message-ID: <1483028994.58.0.687650973528.issue29105@psf.upfronthosting.co.za> New submission from iMath: For class logging.handlers.RotatingFileHandler(filename, mode='a', maxBytes=0, backupCount=0, encoding=None, delay=0) if backupCount is zero and maxBytes is non-zero, the log file size could exceed maxBytes, i.e. we are not able to restrict the log file size using RotatingFileHandler at this case . I suggest add the above description to the doc https://docs.python.org/3.6/library/logging.handlers.html#logging.handlers.RotatingFileHandler If possible , set backupCount=1 by default to avoid this pitfall as much as possible. The doc right now just says "if either of maxBytes or backupCount is zero, rollover never occurs.", it is too difficult to understand the meaning of 'Rollover' to aviod the pitfall . ---------- assignee: docs at python components: Documentation messages: 284277 nosy: docs at python, redstone-cold priority: normal severity: normal status: open title: code or doc improvement for logging.handlers.RotatingFileHandler type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 11:52:42 2016 From: report at bugs.python.org (Szabolcs Dombi) Date: Thu, 29 Dec 2016 16:52:42 +0000 Subject: [New-bugs-announce] [issue29106] get-pip.py fails with Python 3.6 embed Windows Message-ID: <1483030362.55.0.53701112975.issue29106@psf.upfronthosting.co.za> New submission from Szabolcs Dombi: Downloaded python 3.6 embedable zip file (windows 32 bit) Downloaded get-pip.py from the following URL: https://pip.pypa.io/en/stable/installing/ This is the traceback: Traceback (most recent call last): File "get-pip.py", line 20061, in main() File "get-pip.py", line 194, in main bootstrap(tmpdir=tmpdir) File "get-pip.py", line 82, in bootstrap import pip File "", line 961, in _find_and_load File "", line 950, in _find_and_load_unlocked File "", line 646, in _load_unlocked File "", line 616, in _load_backward_compatible File "C:\Users\User\AppData\Local\Temp\tmpinoq60hn\pip.zip\pip\__init__.py", line 26, in File "", line 961, in _find_and_load File "", line 950, in _find_and_load_unlocked File "", line 646, in _load_unlocked File "", line 616, in _load_backward_compatible File "C:\Users\User\AppData\Local\Temp\tmpinoq60hn\pip.zip\pip\utils\__init__.py", line 23, in File "", line 961, in _find_and_load File "", line 950, in _find_and_load_unlocked File "", line 646, in _load_unlocked File "", line 616, in _load_backward_compatible File "C:\Users\User\AppData\Local\Temp\tmpinoq60hn\pip.zip\pip\locations.py", line 88, in File "ntpath.py", line 75, in join TypeError: expected str, bytes or os.PathLike object, not NoneType ---------- messages: 284279 nosy: Szabolcs Dombi priority: normal severity: normal status: open title: get-pip.py fails with Python 3.6 embed Windows type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 13:23:48 2016 From: report at bugs.python.org (Naftali Harris) Date: Thu, 29 Dec 2016 18:23:48 +0000 Subject: [New-bugs-announce] [issue29107] traceback module incorrectly formats args-less syntax errors Message-ID: <1483035828.75.0.241561980745.issue29107@psf.upfronthosting.co.za> New submission from Naftali Harris: The traceback documentation states that it "exactly mimics the behavior of the Python interpreter when it prints a stack trace." Here's a small case where it doesn't, on 2.7.13: ~/repos/Python-2.7.13$ cat example.py def f(x): global x ~/repos/Python-2.7.13$ ./python.exe Python 2.7.13 (default, Dec 29 2016, 09:54:42) [GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import traceback >>> import example Traceback (most recent call last): File "", line 1, in File "example.py", line 1 def f(x): SyntaxError: name 'x' is local and global >>> try: ... import example ... except: ... traceback.print_exc() ... Traceback (most recent call last): File "", line 2, in SyntaxError: name 'x' is local and global (example.py, line 1) >>> I believe Kurt fixed this for Python 3000 with https://mail.python.org/pipermail/python-3000-checkins/2007-July/001259.html ---------- components: Library (Lib) messages: 284287 nosy: Naftali.Harris, benjamin.peterson, kbk priority: normal severity: normal status: open title: traceback module incorrectly formats args-less syntax errors type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 16:57:31 2016 From: report at bugs.python.org (Jose Miguel Colella) Date: Thu, 29 Dec 2016 21:57:31 +0000 Subject: [New-bugs-announce] [issue29108] Python 3.6.0 multiprocessing map_async callback Message-ID: <1483048651.39.0.165070292977.issue29108@psf.upfronthosting.co.za> New submission from Jose Miguel Colella: Hello I am trying to use the callback for the map_async method for Pool, but have found a bug. In the below code, only the print statement is carried out, the return is completely ignored. Is this working as designed or is this a bug? from multiprocessing import Pool def f(x): return x * x def s(x): print(f'Here: {x}') return type(x) if __name__ == '__main__': with Pool(5) as p: result = p.map_async(f, [1, 2, 3], callback=s) q = result.get() print(q) ---------- components: Library (Lib) files: main2.py messages: 284295 nosy: Jose Miguel Colella priority: normal severity: normal status: open title: Python 3.6.0 multiprocessing map_async callback type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file46084/main2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 18:39:06 2016 From: report at bugs.python.org (Loic Pefferkorn) Date: Thu, 29 Dec 2016 23:39:06 +0000 Subject: [New-bugs-announce] [issue29109] Small doc improvements for tracemalloc Message-ID: <1483054746.95.0.549035293258.issue29109@psf.upfronthosting.co.za> New submission from Loic Pefferkorn: Hello, I believe that some improvements can be made to the Python 3.4 documentation of the tracemalloc module: * Wrong parameter name, 'group_by' instead of 'key_type' (checked in tracemalloc.py) * Don't round up numbers when explaining the examples. If they exactly match what can be read in the script output, it is to easier to understand (4.8 MiB vs 4855 KiB) * Fix incorrect method link that was pointing to another module I will wait for some feedback before checking the 3.5, 3.6 versions, hopefully I did not forget something :) Cheers, Loic ---------- assignee: docs at python components: Documentation files: doc_3.4_tracemalloc.diff keywords: patch messages: 284298 nosy: docs at python, haypo, loicp priority: normal severity: normal status: open title: Small doc improvements for tracemalloc type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file46086/doc_3.4_tracemalloc.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 19:55:17 2016 From: report at bugs.python.org (Anthony Zhang) Date: Fri, 30 Dec 2016 00:55:17 +0000 Subject: [New-bugs-announce] [issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file. Message-ID: <1483059317.41.0.849254662988.issue29110@psf.upfronthosting.co.za> New submission from Anthony Zhang: Summary ------- This shows up as two closely-related issues: * ``aifc.open`` leaks file object when invalid AIFF file encountered. This is probably a bug. * ``aifc.close`` closes file object even when it didn't open the file object to begin with. While this is technically documented behaviour [1], it's inconsistent with how similar modules like ``wave`` work [2]. I have confirmed the issue is present in all the selected Python versions. Steps to reproduce ------------------ For the first issue, run this code: #!/usr/bin/env python3 # to simplify this example, use this script itself as a random non-AIFF file (though any non-AIFF file will work fine) FILE = __file__ # print warnings on stderr import warnings warnings.resetwarnings() # try to open the non-AIFF file as an AIFF file, which should fail, but shouldn't give any ResourceWarnings import aifc try: aifc.open(FILE, "rb") except: pass For the second issue, run this code: #!/usr/bin/env python3 from os import path FILE = path.expanduser("~/cpython/Lib/test/audiodata/pluck-pcm8.aiff") # open the file as a file-like object, then open it again with ``aifc.open`` import aifc with open(FILE, "rb") as f: assert not f.closed, "Before opening with AIFC" with aifc.open(f, "rb"): pass assert not f.closed, "After opening with AIFC" Expected result --------------- For the first code sample, code should give no output - ``aifc.open`` should throw an exception due to the passed filename being an invalid AIFF file, but that exception should be caught and suppressed. by the ``try``/``except`` statements. For the second code sample, all assertions should pass - the file should be opened with ``open``, "opened" again with ``aifc.open``, and should not be closed when the inner context manager exits. Actual result ------------- For the first code sample: $ python3 test.py /home/anthony/Desktop/test.py:13: ResourceWarning: unclosed file <_io.BufferedReader name='/home/anthony/Desktop/test.py'> except: pass In other words, code executes as described in "Expected result", but also prints a warning to stderr about the file object not being closed. For the second code sample: $ python3 "/home/anthony/Desktop/test.py" Traceback (most recent call last): File "/home/anthony/Desktop/test.py", line 11, in assert not f.closed, "After opening with AIFC" AssertionError: After opening with AIFC In other words, code runs normally until the inner context manager exits, and the file object gets closed, even though the file object wasn't opened by ``aifc``. Solution -------- Attached are patches that fix each issue separately - the first patch fixes the first mentioned issue, while the second patch fixes both at once. Backwards compatibility: * The first patch, "fix_aifc_leak.patch", makes no functionality changes, so there shouldn't be any backwards compatibility concerns. * The second patch, "fix_aifc_leak_and_file_object_close.patch", slightly changes the behaviour of `aifc_instance.close()` so that it closes in only a subset of cases it would originally. While it is possible for this to lead to leaks in certain cases (example below), the impact shoul be low, as existing codebases seem to use context managers and similar constructs that clean everything up properly. #!/usr/bin/env python3 from os import path FILE = path.expanduser("~/cpython/Lib/test/audiodata/pluck-pcm8.aiff") import aifc f = open(FILE, "rb") with aifc.open(f, "rb"): pass # with the patch applied, `f` is not closed at this point anymore [1]: https://docs.python.org/3/library/aifc.html#aifc.aifc.close [2]: https://docs.python.org/3/library/wave.html#wave.Wave_read.close ---------- components: Library (Lib) files: fix_aifc_leak.patch keywords: patch messages: 284299 nosy: azhang priority: normal severity: normal status: open title: [patch] Fix file object leak in `aifc.open` when given invalid AIFF file. type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46087/fix_aifc_leak.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 20:59:53 2016 From: report at bugs.python.org (Antony Lee) Date: Fri, 30 Dec 2016 01:59:53 +0000 Subject: [New-bugs-announce] [issue29111] Strange signature for memoryview constructor Message-ID: <1483063193.08.0.841678787602.issue29111@psf.upfronthosting.co.za> New submission from Antony Lee: The return value of `inspect.signature(memoryview)` is rather strange: Python 3.5.2 (default, Nov 7 2016, 11:31:36) [GCC 6.2.1 20160830] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import inspect; inspect.signature(memoryview) ---------- components: Library (Lib) messages: 284302 nosy: Antony.Lee priority: normal severity: normal status: open title: Strange signature for memoryview constructor versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 21:04:27 2016 From: report at bugs.python.org (Jesse Hall) Date: Fri, 30 Dec 2016 02:04:27 +0000 Subject: [New-bugs-announce] [issue29112] questionable wording in sequences documentation Message-ID: <1483063467.95.0.432250545704.issue29112@psf.upfronthosting.co.za> New submission from Jesse Hall: In note 3 of 4.6.1, the word "string" should be replaced with "sequence", because the note is describing a general example where this concept is not specifically used with a string type sequence, it is discussing the general use of negative indexes which can be used on any type of sequence. ---------- assignee: docs at python components: Documentation messages: 284303 nosy: Jesse Hall, docs at python priority: normal severity: normal status: open title: questionable wording in sequences documentation versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Dec 29 21:16:05 2016 From: report at bugs.python.org (Adam Williamson) Date: Fri, 30 Dec 2016 02:16:05 +0000 Subject: [New-bugs-announce] [issue29113] modulefinder no longer finds all required modules for Python itself, due to use of __import__ in sysconfig Message-ID: <1483064165.82.0.932079190988.issue29113@psf.upfronthosting.co.za> New submission from Adam Williamson: I'm not sure if this is really considered a bug or just an unavoidable limitation, but as it involves part of the stdlib operating on Python itself, I figured it was at least worth reporting. In Fedora we have a fairly simple little script called python-deps: https://github.com/rhinstaller/anaconda/blob/master/dracut/python-deps which is used to figure out the dependencies of a couple of Python scripts used in the installer's initramfs environment, so the necessary bits of Python (but not the rest of it) can be included in the installer's initramfs. Unfortunately, with Python 3.6, this seems to be broken for the core of Python itself, because of this change: https://github.com/python/cpython/commit/a6431f2c8cf4783c2fd522b2f6ee04c3c204237f which changed sysconfig.py from doing "from _sysconfigdata import build_time_vars" to using __import__ . I *think* that modulefinder can't cope with this use of __import__ and so misses that sysconfig requires "_sysconfigdata_m_linux_x86_64-linux-gnu" (or whatever the actual name is on your particular platform and arch). This results in us not including the platform-specific module in the installer initramfs, so Python blows up on startup when the 'site' module tries to import the 'sysconfig' module. We could work around this one way or another in the python-deps script, but I figured the issue was at least worth an upstream report to see if it's considered a significant issue or not. You can reproduce the problem quite trivially by writing a test script which just does, e.g., "import site", and then running the example code from the ModuleFinder docs on it: from modulefinder import ModuleFinder finder = ModuleFinder() finder.run_script('test.py') print('Loaded modules:') for name, mod in finder.modules.items(): print('%s: ' % name, end='') print(','.join(list(mod.globalnames.keys())[:3])) if you examine the output, you'll see that the 'sysconfig' module is included, but the site-specific module is not. ---------- components: Library (Lib) messages: 284304 nosy: adamwill priority: normal severity: normal status: open title: modulefinder no longer finds all required modules for Python itself, due to use of __import__ in sysconfig versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 30 00:53:38 2016 From: report at bugs.python.org (lanf0n) Date: Fri, 30 Dec 2016 05:53:38 +0000 Subject: [New-bugs-announce] [issue29114] __class__ not exists in the method which bounded by types.MethodType. Message-ID: <1483077218.4.0.672977492114.issue29114@psf.upfronthosting.co.za> New submission from lanf0n: test code below: ```python >>> from types import MethodType >>> class A: ... def f(self): ... print(__class__) ... >>> a = A() >>> a.fn = MethodType(lambda s: print(__class__), a) >>> >>> a.f() >>> a.fn() Traceback (most recent call last): File "", line 1, in File "", line 1, in NameError: name '__class__' is not defined ``` this behavior affect `super()` not work in patched function scope, of course we can use old super as super(self.__class__, self) to make it work as expected, but I think it should work as original method if we already bounded the function to instance(class). ---------- components: Library (Lib) messages: 284313 nosy: lanfon72 priority: normal severity: normal status: open title: __class__ not exists in the method which bounded by types.MethodType. type: behavior versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 30 03:37:44 2016 From: report at bugs.python.org (Decorater) Date: Fri, 30 Dec 2016 08:37:44 +0000 Subject: [New-bugs-announce] [issue29115] distutils.core.setup does not let people set 'bugtrack_url'. Message-ID: <1483087064.15.0.921977916672.issue29115@psf.upfronthosting.co.za> New submission from Decorater: So, I could have an example setup.py which sets a bugtrack url however using sdist and bdist_wheel on them produces this warning: H:\Python\Python360\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url' warnings.warn(msg) The issue with this is wanting to set or change the bug track url's for the particular packages using setup.py to generate a PKG-INFO file which explicitly sets the value. Currently there is no way to modify the fields online anymore since probably like 3~4 months ago I before was able to do it for a little while without having to upload a PKG-INFO file. Example setup.py that does this: from setuptools import setup import re requirements = [] try: with open('requirements.txt') as f: requirements = f.read().splitlines() except Exception as ex: with open('sasync.egg-info\requires.txt') as f: requirements = f.read().splitlines() version = '0.0.1' if not version: raise RuntimeError('version is not set') with open('README') as f: readme = f.read() setup(name='examplepackage', author='Decorater', author_email='seandhunt_7 at yahoo.com', url='https://github.com/AraHaan/examplepackage', bugtrack_url='https://github.com/AraHaan/examplepackage/issues', version=version, packages=['sasync'], license='MIT', description=('example package package demonstrating that bugtrack_url is not recognized by distutils.'), long_description=readme, maintainer_email='seandhunt_7 at yahoo.com', download_url='https://github.com/AraHaan/examplepackage', include_package_data=True, install_requires=requirements, platforms='Any', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Other Audience', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Software Development :: Libraries :: Python Modules', ] ) ---------- components: Distutils, Library (Lib) messages: 284323 nosy: Decorater, dstufft, eric.araujo priority: normal severity: normal status: open title: distutils.core.setup does not let people set 'bugtrack_url'. versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 30 13:56:51 2016 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Fri, 30 Dec 2016 18:56:51 +0000 Subject: [New-bugs-announce] [issue29116] Make str and bytes error messages on concatenation conform with other sequences Message-ID: <1483124211.75.0.715869443236.issue29116@psf.upfronthosting.co.za> New submission from Jim Fasarakis-Hilliard: Specifically, bytes (always, from what I could find) had this error message: >>> b'' + '' TypeError: can't concat bytes to str while str, after a change in issue26057, was made to: >>> '' + b'' TypeError: must be str, not bytes from the previous form of "TypeError: Can't convert 'bytes' object to str implicitly". I think these could be changed to conform with what the other sequences generate and fall in line with the error messages produced for other operations. Specifically changing them to: >>> b'' + '' TypeError: can only concatenate bytes (not 'str') to bytes and similarly for str. If this idea makes sense, I can attach a patch that addresses it. ---------- components: Interpreter Core messages: 284340 nosy: Jim Fasarakis-Hilliard priority: normal severity: normal status: open title: Make str and bytes error messages on concatenation conform with other sequences type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 30 16:51:10 2016 From: report at bugs.python.org (Antony Lee) Date: Fri, 30 Dec 2016 21:51:10 +0000 Subject: [New-bugs-announce] [issue29117] dir() should include dunder attributes of the unbound method Message-ID: <1483134670.11.0.964598948516.issue29117@psf.upfronthosting.co.za> New submission from Antony Lee: ``` Python 3.5.2 (default, Nov 7 2016, 11:31:36) [GCC 6.2.1 20160830] on linux Type "help", "copyright", "credits" or "license" for more information. >>> class C: ... def f(self): pass ... >>> C.f.attr = 42 >>> print(dir(C.f)) ['__annotations__', '__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__globals__', '__gt__', '__hash__', '__init__', '__kwdefaults__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'attr'] >>> print(dir(C().f)) ['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__func__', '__ge__', '__get__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'attr'] >>> ``` Note that `dir(C().f)` does include the custom `attr` attribute, but is missing some of the dunder attributes (e.g. `__annotations__`), which are actually accessible directly from the boun method. ---------- components: Interpreter Core messages: 284347 nosy: Antony.Lee priority: normal severity: normal status: open title: dir() should include dunder attributes of the unbound method versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Dec 30 22:45:01 2016 From: report at bugs.python.org (Spacemage 33) Date: Sat, 31 Dec 2016 03:45:01 +0000 Subject: [New-bugs-announce] [issue29118] Randit Message-ID: <1483155901.64.0.660907130999.issue29118@psf.upfronthosting.co.za> New submission from Spacemage 33: I have a book with i can learn phyton but in the first Little game there is "from random import randit" and the book is for Phyton3 now it do not work im realy said about this please fix that ---------- assignee: terry.reedy components: IDLE files: Screenshot_4.png messages: 284358 nosy: Spacemage 33, terry.reedy priority: normal severity: normal status: open title: Randit versions: Python 3.6 Added file: http://bugs.python.org/file46096/Screenshot_4.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 31 01:11:43 2016 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 31 Dec 2016 06:11:43 +0000 Subject: [New-bugs-announce] [issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end Message-ID: <1483164703.14.0.0947290095452.issue29119@psf.upfronthosting.co.za> New submission from Raymond Hettinger: The root.prev and first.prev assignments should use weak references rather than hard references. Spotted by Andra Bogildea. ---------- components: Library (Lib) files: od_proxy.diff keywords: patch messages: 284367 nosy: rhettinger priority: normal severity: normal status: open title: Unintentional hard reference assignment in Python version of OrderedDict.move_to_end type: resource usage versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46097/od_proxy.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 31 06:36:34 2016 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 31 Dec 2016 11:36:34 +0000 Subject: [New-bugs-announce] [issue29120] Rename Python/random.c to Python/bootstrap_hash.c Message-ID: <1483184194.47.0.551318865872.issue29120@psf.upfronthosting.co.za> New submission from Nick Coghlan: This is the last major structural refactoring proposal to come out of the prep work on the PEP 432 modular bootstrapping feature development branch: * rename Python/random.c -> Python/hash_randomization.c * rename _PyRandom_Init -> __Py_HashRandomization_Init * rename _PyRandom_Fini -> __Py_HashRandomization_Fini The current naming is confusing when working on the interpreter startup sequence as the file and API naming looks like it relates to initialising the random module, when it has nothing to do with that. ---------- assignee: ncoghlan messages: 284383 nosy: brett.cannon, christian.heimes, eric.snow, ncoghlan, steve.dower priority: normal severity: normal stage: needs patch status: open title: Rename Python/random.c to Python/bootstrap_hash.c type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 31 11:04:55 2016 From: report at bugs.python.org (Aviv Palivoda) Date: Sat, 31 Dec 2016 16:04:55 +0000 Subject: [New-bugs-announce] [issue29121] sqlite3 Controlling Transactions documentation not updated Message-ID: <1483200295.1.0.801871810477.issue29121@psf.upfronthosting.co.za> New submission from Aviv Palivoda: commit 284676cf2ac8 changed the sqlite3 module so it will no longer implicitly commit an open transaction before DDL statements. The docs have been updated but there is still an incorrect paragraph that has not been removed. Attached is a patch that remove the old paragraph. ---------- files: sqlite-transaction-doc.patch keywords: patch messages: 284396 nosy: berker.peksag, ghaering, palaviv, serhiy.storchaka priority: normal severity: normal status: open title: sqlite3 Controlling Transactions documentation not updated versions: Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46101/sqlite-transaction-doc.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 31 12:33:48 2016 From: report at bugs.python.org (styg) Date: Sat, 31 Dec 2016 17:33:48 +0000 Subject: [New-bugs-announce] [issue29122] set() bug Message-ID: <1483205628.15.0.98024774147.issue29122@psf.upfronthosting.co.za> New submission from styg: set() method leads to this error: a=[1,2,3,3] b=set(a) print b >> set([1,2,3]) # should be [1,2,3] ---------- messages: 284402 nosy: styg priority: normal severity: normal status: open title: set() bug type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 31 12:41:47 2016 From: report at bugs.python.org (Berker Peksag) Date: Sat, 31 Dec 2016 17:41:47 +0000 Subject: [New-bugs-announce] [issue29123] CheckSqlTimestamp is fragile Message-ID: <1483206107.71.0.541035804461.issue29123@psf.upfronthosting.co.za> New submission from Berker Peksag: ====================================================================== FAIL: CheckSqlTimestamp (sqlite3.test.types.DateTimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/buildarea/3.6.angelico-debian-amd64/build/Lib/sqlite3/test/types.py", line 391, in CheckSqlTimestamp self.assertEqual(ts.year, now.year) AssertionError: 2016 != 2017 ---------------------------------------------------------------------- See http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.6/builds/93/steps/test/logs/stdio for details. In Lib/sqlite3/test/types.py, there is a comment saying # SQLite's current_timestamp uses UTC time, while datetime.datetime.now() uses local time. Unless I'm missing something, there is no reason not to use datetime.utcnow(). That would make the test more robust. ---------- components: Tests messages: 284404 nosy: berker.peksag priority: normal severity: normal stage: needs patch status: open title: CheckSqlTimestamp is fragile type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 31 12:51:05 2016 From: report at bugs.python.org (Liran Ringel) Date: Sat, 31 Dec 2016 17:51:05 +0000 Subject: [New-bugs-announce] [issue29124] Freeze fails to compile on windows Message-ID: <1483206665.88.0.0421614971405.issue29124@psf.upfronthosting.co.za> New submission from Liran Ringel: The patch fixes 3 bugs: 1. Include Python.h in frozen_dllmain.c - needed for Py_ARRAY_LENGTH symbol 2. DL_IMPORT is used in checkextensions_win32.py, but it's deprecated and not defined anymore. Replaced it with __declspec(dllimport) 3. Fix python lib path in winmakemakefile.py There is one more thing left to do to make it work, but it already has an open issue: http://bugs.python.org/issue28068 ---------- components: Demos and Tools, Windows files: fix-freeze-on-windows.patch keywords: patch messages: 284405 nosy: Liran Ringel, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Freeze fails to compile on windows type: compile error versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46104/fix-freeze-on-windows.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 31 14:00:30 2016 From: report at bugs.python.org (symphorien) Date: Sat, 31 Dec 2016 19:00:30 +0000 Subject: [New-bugs-announce] [issue29125] Shell injection via TIX_LIBRARY when using tkinter.tix Message-ID: <1483210830.52.0.920210756798.issue29125@psf.upfronthosting.co.za> New submission from symphorien: The tkinter.tix module looks for a Tix installation in the directory specified by the TIX_LIBRARY environment variable, but blindly trusts that it is a path in the filesystem. This enables a shell injection : TIX_LIBRARY='/dev/null}; exec gsimplecal;' python2 -c "from Tix import Tk; Tk()" or TIX_LIBRARY='/dev/null}; exec gsimplecal;' python3 -c "from tkinter.tix import Tk; Tk()" Python execs gsimplecal, waits on its completion and then raises a tkinter.TclError. The offending code is here : https://github.com/python/cpython/blob/master/Lib/tkinter/tix.py#L204-L208 ---------- components: Tkinter messages: 284408 nosy: symphorien priority: normal severity: normal status: open title: Shell injection via TIX_LIBRARY when using tkinter.tix type: security versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 31 18:25:17 2016 From: report at bugs.python.org (Jim Nasby) Date: Sat, 31 Dec 2016 23:25:17 +0000 Subject: [New-bugs-announce] [issue29126] Fix comments about _PyThreadState_Current Message-ID: <1483226717.62.0.229510209962.issue29126@psf.upfronthosting.co.za> New submission from Jim Nasby: Attached patch fixes two comments in dictobject.c referring to no longer exposed _PyThreadState_Current variable. I also tweaked the grammar for that issue in NEWS, since it came up in my search. Apologies if that's considered gratuitous noise. ---------- components: Interpreter Core files: _PyThreadState_Current_comments.diff keywords: patch messages: 284415 nosy: Jim Nasby priority: normal severity: normal status: open title: Fix comments about _PyThreadState_Current type: enhancement versions: Python 3.7 Added file: http://bugs.python.org/file46106/_PyThreadState_Current_comments.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Dec 31 21:44:14 2016 From: report at bugs.python.org (Eric Ahn) Date: Sun, 01 Jan 2017 02:44:14 +0000 Subject: [New-bugs-announce] [issue29127] Incorrect reference names in asyncio.subprocess documentation Message-ID: <1483238654.05.0.408550900872.issue29127@psf.upfronthosting.co.za> New submission from Eric Ahn: On this page of the documentation https://docs.python.org/3/library/asyncio-subprocess.html it seems that some of the reference names are incorrect. Namely, asyncio.subprocess.PIPE is referred to as asyncio.asyncio.subprocess.PIPE (along with STDOUT and DEVNULL), plus asyncio.subprocess.Process is referred to as asyncio.asyncio.subprocess.Process. This is reflected in the permalinks as well as when one tries to reference these via intersphinx (which is how I discovered it; I was trying to link to this page and was failing). ---------- assignee: docs at python components: Documentation messages: 284418 nosy: Eric Ahn, docs at python priority: normal severity: normal status: open title: Incorrect reference names in asyncio.subprocess documentation versions: Python 3.6 _______________________________________ Python tracker _______________________________________