From report at bugs.python.org Fri Jun 1 01:11:49 2018 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 01 Jun 2018 05:11:49 +0000 Subject: [New-bugs-announce] [issue33727] Server.wait_closed() doesn't always wait for its transports to fihish Message-ID: <1527829909.37.0.682650639539.issue33727@psf.upfronthosting.co.za> New submission from Yury Selivanov : Server.wait_closed() currently does two checks: 1. if _sockets is None -- means that Server.close() was called 2. if self._waiters is None -- means that Server._wakeup() was called if (1) *or* (2) is true, wait_closed() just returns without waiting on anything. However, when Server.close() is called there might be still active transports serving requests. Server.wait_closed() should wait until all of them are detached, even if Server._sockets is already reset. So the below implementation: async def wait_closed(self): if self._sockets is None or self._waiters is None: return waiter = self._loop.create_future() self._waiters.append(waiter) await waiter should be changed to: async def wait_closed(self): if self._waiters is None: assert self._active_count == 0 return waiter = self._loop.create_future() self._waiters.append(waiter) await waiter ---------- components: asyncio messages: 318360 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Server.wait_closed() doesn't always wait for its transports to fihish versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 02:48:48 2018 From: report at bugs.python.org (Feng) Date: Fri, 01 Jun 2018 06:48:48 +0000 Subject: [New-bugs-announce] [issue33728] pandas.to_records can not be saved by numpy.savez Message-ID: <1527835728.74.0.682650639539.issue33728@psf.upfronthosting.co.za> New submission from Feng : my first time to report a bug here. But it is so annoying, I have to report it. Here is the demonstration of the errors I encounter: >>> import numpy as np >>> import pandas as pd >>> np.__version__ '1.14.3' >>> pd.__version__ u'0.23.0' >>> df=pd.DataFrame({'a':range(10)}) >>> df['b']='abc' >>> df a b 0 0 abc 1 1 abc 2 2 abc 3 3 abc 4 4 abc 5 5 abc 6 6 abc 7 7 abc 8 8 abc 9 9 abc >>> np.savez_compressed('abc',data=df.to_records(index=False)) >>> a=np.load('abc.npz') >>> a.keys() ['data'] >>> a['data'] Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python2.7/site-packages/numpy/lib/npyio.py", line 235, in __getitem__ pickle_kwargs=self.pickle_kwargs) File "/usr/lib64/python2.7/site-packages/numpy/lib/format.py", line 635, in read_array shape, fortran_order, dtype = _read_array_header(fp, version) File "/usr/lib64/python2.7/site-packages/numpy/lib/format.py", line 523, in _read_array_header raise ValueError(msg % (d['descr'],)) ValueError: descr is not a valid dtype descriptor: [(u'a', ' _______________________________________ From report at bugs.python.org Fri Jun 1 04:36:11 2018 From: report at bugs.python.org (Juuso Lehtivarjo) Date: Fri, 01 Jun 2018 08:36:11 +0000 Subject: [New-bugs-announce] [issue33729] Hashlib/blake2* missing 'data' keyword argument Message-ID: <1527842171.52.0.682650639539.issue33729@psf.upfronthosting.co.za> New submission from Juuso Lehtivarjo : In python 3.6.5: hashlib blake2b/blake2s constructors do not recognize 'data' keyword. Try the following: from hashlib import blake2b print (blake2b(b"foobar").hexdigest()) # works print (blake2b(data=b"foobar").hexdigest()) # TypeError: 'data' is an invalid keyword argument for this function ---------- messages: 318370 nosy: Juuso Lehtivarjo priority: normal severity: normal status: open title: Hashlib/blake2* missing 'data' keyword argument type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 06:21:24 2018 From: report at bugs.python.org (Jakub Szewczyk) Date: Fri, 01 Jun 2018 10:21:24 +0000 Subject: [New-bugs-announce] [issue33730] string format 'n' produces numbers with incorrect precision Message-ID: <1527848484.0.0.682650639539.issue33730@psf.upfronthosting.co.za> New submission from Jakub Szewczyk : Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> print ("{:.2n}".format(1.89)) 1.9 >>> print ("{:.2f}".format(1.89)) 1.89 ---------- components: Extension Modules messages: 318388 nosy: Jakub Szewczyk, eric.smith priority: normal severity: normal status: open title: string format 'n' produces numbers with incorrect precision type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 08:42:33 2018 From: report at bugs.python.org (Jakub Szewczyk) Date: Fri, 01 Jun 2018 12:42:33 +0000 Subject: [New-bugs-announce] [issue33731] string formatting that produces floats with preset precision while respecting locale Message-ID: <1527856953.25.0.682650639539.issue33731@psf.upfronthosting.co.za> New submission from Jakub Szewczyk : .2f produces a string representation of a float rounded up to 2 significant digits. >>> print ("{:.2f}".format(1.891)) 1.89 However, it does not respect locale. There is no counterpart of 'f' that would respect locale. There is 'n', but because it follows the rules of 'g', in many cases it returns a different number of significant digits. >>> print ("{:.2n}".format(1.891)) 1.9 In all my uses of formatted float printing, I need to produce floats that are rounded to have the same number of significant digits. I _presume_ this generalizes to the majority people, and the use of 'f' option is much more widespread than the use of 'g'. If this is the case, then a locale-friendly counterpart of 'f' would be very useful. ---------- components: Extension Modules messages: 318407 nosy: Jakub Szewczyk, eric.smith priority: normal severity: normal status: open title: string formatting that produces floats with preset precision while respecting locale type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 08:59:58 2018 From: report at bugs.python.org (Gibson Fahnestock) Date: Fri, 01 Jun 2018 12:59:58 +0000 Subject: [New-bugs-announce] [issue33732] Python 2.7.15: xml.sax.parse() closes file objects passed to it Message-ID: <1527857998.29.0.682650639539.issue33732@psf.upfronthosting.co.za> New submission from Gibson Fahnestock : Sorry if this is a duplicate, I didn't find anything. We hit some issues with this change: - Python Bug: https://bugs.python.org/issue30264 - Github PRs: https://github.com/python/cpython/pull/1451 and https://github.com/python/cpython/pull/1476 It's possible I'm misunderstanding something, let me know if that's the case. It seems that in Python 2.7.15, xml.sax.parse() closes file descriptors that are passed to it. 1. Isn't this a breaking change? It certainly breaks code we're using in production. 2. Why is the sax parser closing file descriptors that it didn't open? I understand if the parser is given a path and opens its own fd it makes sense to close it, but not when the fd is given directly. 3. What do you do if you need access to the file descriptor after parsing it (because you parse it in place)? For file descriptors that point to files on disk we can work around it by reopening the file after each parse, but for something like a StringIO buffer (see simplified example below) I'm not aware of any way to get around the problem. -> StringIO Example: import xml.sax import StringIO # Some StringIO buffer. fd = StringIO.StringIO(b'<_/>') # Do some parsing. xml.sax.parse(fd, xml.sax.handler.ContentHandler()) # Try to do some other parsing (fails). xml.sax.parse(fd, xml.sax.handler.ContentHandler()) -> File Example: import xml.sax fd = open('/tmp/test-junit1.xml') # Do some parsing. xml.sax.parse(fd, xml.sax.handler.ContentHandler()) # Do some other parsing. xml.sax.parse(fd, xml.sax.handler.ContentHandler()) Originally posted on https://github.com/python/cpython/pull/1451#issuecomment-393837538, thanks serhiy.storchaka for redirecting me here. ---------- components: Library (Lib), XML messages: 318408 nosy: gibfahn, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Python 2.7.15: xml.sax.parse() closes file objects passed to it versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 09:18:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Jun 2018 13:18:19 +0000 Subject: [New-bugs-announce] [issue33733] Add utilities to get/set pipe and socket buffer sizes? Message-ID: <1527859099.35.0.682650639539.issue33733@psf.upfronthosting.co.za> New submission from STINNER Victor : Many Python unit tests require a blocking send into a pipe or a socket. support.PIPE_MAX_SIZE (4 MiB +1 B) has been added for pipes in bpo-17835: sending PIPE_MAX_SIZE into a pipe must block. On Linux, the maximum size of a pipe is /proc/sys/fs/pipe-max-size. Since Linux 2.6.35, it's now possible to get and set the size of a pipe using fcntl with F_GETPIPE_SZ and F_SETPIPE_SZ commands. For sockets, support.SOCK_MAX_SIZE (16 MiB) has been added in bpo-18643. It's possible to get/set the size of receive and send socket buffers using getsockopt() and setsockopt() with SO_RCVBUF and SO_SNDBUF commands. For pipes, I'm not sure that it's possible to get the size of a pipe buffer in a portable way. For example, F_GETPIPE_SZ was only introduced in Linux 2.6.35. Since the first user of these features are tests, maybe we can start with best-effort functions in test.support. Recently, I got issues with buffer sizes in test_multiprocessing_forkserver.test_ignore() (bpo-33532) and sendfile tests of test_asyncio (bpo-33353). ---------- components: Library (Lib) messages: 318411 nosy: pitrou, vstinner, yselivanov priority: normal severity: normal status: open title: Add utilities to get/set pipe and socket buffer sizes? type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 10:53:53 2018 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 01 Jun 2018 14:53:53 +0000 Subject: [New-bugs-announce] [issue33734] asyncio/ssl: Fix AttributeError, increase default handshake timeout Message-ID: <1527864833.64.0.81473610881.issue33734@psf.upfronthosting.co.za> New submission from Yury Selivanov : I've ported asyncio's sslproto.py to uvloop and released a new major version of it yesterday. Hynek discovered that the default SSL handshake timeout (10 seconds currently) is too low, and that there's a critical code path that is broken because it assumes all SSL exceptions have an 'errno' attribute. The PR changes the default SSL handshake timeout to 60 seconds (as in nginx [1]) and fixes the AttributeError. IMO this should go into 3.7.0rc1. [1] https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-tcp/#speeding-up-secure-tcp-connections ---------- assignee: yselivanov components: asyncio messages: 318422 nosy: asvetlov, hynek, ned.deily, yselivanov priority: release blocker severity: normal status: open title: asyncio/ssl: Fix AttributeError, increase default handshake timeout type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 10:58:07 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 01 Jun 2018 14:58:07 +0000 Subject: [New-bugs-announce] [issue33735] test_multiprocessing_spawn leaked [1, 2, 1] memory blocks on AMD64 Windows8.1 Refleaks 3.7 Message-ID: <1527865087.2.0.81473610881.issue33735@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/132/builds/154 test_multiprocessing_spawn leaked [1, 2, 1] memory blocks, sum=4 ---------- components: Tests, Windows messages: 318425 nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: test_multiprocessing_spawn leaked [1, 2, 1] memory blocks on AMD64 Windows8.1 Refleaks 3.7 type: resource usage versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 12:25:52 2018 From: report at bugs.python.org (Elvis Pranskevichus) Date: Fri, 01 Jun 2018 16:25:52 +0000 Subject: [New-bugs-announce] [issue33736] Improve the documentation of asyncio stream API Message-ID: <1527870352.33.0.81473610881.issue33736@psf.upfronthosting.co.za> Change by Elvis Pranskevichus : ---------- assignee: docs at python components: Documentation nosy: Elvis.Pranskevichus, docs at python priority: normal severity: normal status: open title: Improve the documentation of asyncio stream API type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 13:05:10 2018 From: report at bugs.python.org (Puneet Singh) Date: Fri, 01 Jun 2018 17:05:10 +0000 Subject: [New-bugs-announce] [issue33737] Multiprocessing not working Message-ID: <1527872710.36.0.81473610881.issue33737@psf.upfronthosting.co.za> New submission from Puneet Singh : I have attached a sampl program for my project.can anyone help e to solve this multiprocessing problem.I have applied all the tpes of multiprocessing ( map,map_async, starmap, starmap_async, aplly_async) but the result is same that CPU utilisation is one core instead it had to use all of them. The picture for cpu utilisation an be found in github account:- https://github.com/joddiy/multiprocess/issues/1 ---------- components: Library (Lib) messages: 318433 nosy: Puneet Singh, docs at python priority: normal severity: normal status: open title: Multiprocessing not working type: performance versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 13:14:59 2018 From: report at bugs.python.org (Christian Tismer) Date: Fri, 01 Jun 2018 17:14:59 +0000 Subject: [New-bugs-announce] [issue33738] PyIndex_Check conflicts with PEP 384 Message-ID: <1527873299.01.0.81473610881.issue33738@psf.upfronthosting.co.za> New submission from Christian Tismer : The file number.rst on python 3.6 says """ .. c:function:: int PyIndex_Check(PyObject *o) Returns ``1`` if *o* is an index integer (has the nb_index slot of the tp_as_number structure filled in), and ``0`` otherwise. """ But in reality, this is a macro: """ #define PyIndex_Check(obj) \ ((obj)->ob_type->tp_as_number != NULL && \ (obj)->ob_type->tp_as_number->nb_index != NULL) """ But such a macro does not work with the limited API, since non-heaptypes cannot use PyType_GetSlot. The patch is trivial: Define the function instead of the macro when Py_LIMITED_API is set. I also think the documentation makes more sense when it is correct. ---------- components: Extension Modules messages: 318436 nosy: Christian.Tismer, larry, ned.deily priority: release blocker severity: normal status: open title: PyIndex_Check conflicts with PEP 384 type: compile error versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 1 17:57:15 2018 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 01 Jun 2018 21:57:15 +0000 Subject: [New-bugs-announce] [issue33739] pathlib: Allow ellipsis to appear after "/" to navigate to parent path Message-ID: <1527890235.56.0.81473610881.issue33739@psf.upfronthosting.co.za> New submission from Yury Selivanov : We can allow using ... to navigate the "parent" path: >>> import pathlib >>> p = pathlib.Path('a/b/c') >>> p PosixPath('a/b/c') >>> p / ... PosixPath('a/b') >>> p / ... / ... / 'temp' PosixPath('a/temp') The patch is trivial and I think that using "..." instead of ".parent" makes code clearer and cuter. ---------- components: Library (Lib) messages: 318468 nosy: brett.cannon, pitrou, yselivanov priority: normal severity: normal stage: patch review status: open title: pathlib: Allow ellipsis to appear after "/" to navigate to parent path type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 2 17:10:56 2018 From: report at bugs.python.org (Egor Dranischnikow) Date: Sat, 02 Jun 2018 21:10:56 +0000 Subject: [New-bugs-announce] [issue33740] PyByteArray_AsString C-API description lacks the assurance, that the trailing null-byte is appended. Message-ID: <1527973856.37.0.592728768989.issue33740@psf.upfronthosting.co.za> New submission from Egor Dranischnikow : The C-API for Python2.7 https://docs.python.org/2/c-api/bytearray.html#c.PyByteArray_AsString lacks the sentence: "The returned array always has an extra null byte appended." which clarifies, that the returned C-string is null-terminated. This sentence is a part of Python3-documentation: https://docs.python.org/3/c-api/bytearray.html#c.PyByteArray_AsString I might be very wrong, but so far I understand the code this is the case for both versions, Python3 and Python2. Probably parts of this change https://github.com/python/cpython/commit/0a560a11af0ccc816d1172180f44e5afb34ba600 could be integrated in Python2.7 ---------- assignee: docs at python components: Documentation messages: 318515 nosy: docs at python, realead priority: normal severity: normal status: open title: PyByteArray_AsString C-API description lacks the assurance, that the trailing null-byte is appended. versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 2 18:40:36 2018 From: report at bugs.python.org (=?utf-8?q?Lars_P=C3=B6tter?=) Date: Sat, 02 Jun 2018 22:40:36 +0000 Subject: [New-bugs-announce] [issue33741] UnicodeEncodeError onsmtplib.login(MAIL_USER, MAIL_PASSWORD) Message-ID: <1527979236.47.0.592728768989.issue33741@psf.upfronthosting.co.za> New submission from Lars P?tter : if the password contains non ascii characters then the login fails: >>> smtObj.login(MAIL_USER, MAIL_PASSWORD) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/smtplib.py", line 720, in login initial_response_ok=initial_response_ok) File "/usr/lib/python3.5/smtplib.py", line 637, in auth authobject(challenge).encode('ascii'), eol='') File "/usr/lib/python3.5/smtplib.py", line 650, in auth_cram_md5 self.password.encode('ascii'), challenge, 'md5').hexdigest() UnicodeEncodeError: 'ascii' codec can't encode character '' in position : ordinal not in range(128) ---------- components: Library (Lib) messages: 318517 nosy: JustAnother1 priority: normal severity: normal status: open title: UnicodeEncodeError onsmtplib.login(MAIL_USER, MAIL_PASSWORD) type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 02:37:33 2018 From: report at bugs.python.org (Pasha Stetsenko) Date: Sun, 03 Jun 2018 06:37:33 +0000 Subject: [New-bugs-announce] [issue33742] Unsafe memory access in PyStructSequence_InitType Message-ID: <1528007853.29.0.592728768989.issue33742@psf.upfronthosting.co.za> New submission from Pasha Stetsenko : The documentation (https://docs.python.org/3/c-api/tuple.html) for `PyStructSequence_InitType` describes the function as follows: > void PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc) > Initializes a struct sequence type `type` from `desc` in place. And most of the time it does just that. However, when running under python compiled in debug mode, the body of the function will contain the following code at the very beginning: ``` if (type->ob_base.ob_base._ob_next) { _Py_ForgetReference((PyObject*)type); } ``` Since `type` here is a preallocated but an uninitialized piece of memory, it may contain garbage data that when interpreted as a "live" PyObject will result in memory corruption or process crash. Thus, either the description for the `PyStructSequence_InitType` method has to document that the `type` object must be zeroed-out before being passed to the method, or the call to `_Py_ForgetReference` be removed. ---------- messages: 318523 nosy: Pasha Stetsenko priority: normal severity: normal status: open title: Unsafe memory access in PyStructSequence_InitType type: crash versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 03:41:56 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 07:41:56 +0000 Subject: [New-bugs-announce] [issue33743] test_asyncio raises a deprecation warning Message-ID: <1528011716.86.0.592728768989.issue33743@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -We -m test -v -m test__register_task_3 test_asyncio ... ====================================================================== ERROR: test__register_task_3 (test.test_asyncio.test_tasks.CIntrospectionTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_asyncio/test_tasks.py", line 2616, in test__register_task_3 self.assertEqual(asyncio.Task.all_tasks(loop), {task}) PendingDeprecationWarning: Task.all_tasks() is deprecated, use asyncio.all_tasks() instead ====================================================================== ERROR: test__register_task_3 (test.test_asyncio.test_tasks.PyIntrospectionTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_asyncio/test_tasks.py", line 2616, in test__register_task_3 self.assertEqual(asyncio.Task.all_tasks(loop), {task}) PendingDeprecationWarning: Task.all_tasks() is deprecated, use asyncio.all_tasks() instead ---------------------------------------------------------------------- And the test is failed if run with -We. ---------- components: Tests messages: 318524 nosy: asvetlov, giampaolo.rodola, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: test_asyncio raises a deprecation warning type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 05:18:11 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 09:18:11 +0000 Subject: [New-bugs-announce] [issue33744] Fix and improve tests for the uu module Message-ID: <1528017491.17.0.592728768989.issue33744@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Separate tests in test_uu leak files of depend on the file leaked in other tests. $ ./python -m test -m test_decode test_uu ... Warning -- files was modified by test_uu Before: [] After: ['@test_12637_tmpi'] test_uu failed (env changed) $ ./python -m test -m test_decode_filename test_uu ... Warning -- files was modified by test_uu Before: [] After: ['@test_12627_tmpi'] test_uu failed (env changed) $ ./python -m test -m test_decodetwice test_uu ... test test_uu failed -- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_uu.py", line 263, in test_decodetwice f = open(self.tmpin, 'rb') FileNotFoundError: [Errno 2] No such file or directory: '@test_12622_tmpi' ---------- assignee: serhiy.storchaka components: Tests messages: 318530 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Fix and improve tests for the uu module type: behavior versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 07:11:49 2018 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 03 Jun 2018 11:11:49 +0000 Subject: [New-bugs-announce] [issue33745] 3.7.0b5 changes the line number of empty functions with docstrings Message-ID: <1528024309.59.0.592728768989.issue33745@psf.upfronthosting.co.za> New submission from Ned Batchelder : I'm not sure if this is a regression or an intentional change. I know that the behavior has changed. If a function has a docstring but no other body, Python 3.7b5 assigns the line number of the docstring to the implicit "return None". Previous versions (including 3.7b4) used the line number of the "def". Demonstration: $ cat /tmp/empty.py def empty(): pass def empty_with_docstring(): '''Docstring''' def docstring(): '''Docstring''' return 1 import dis, sys print(sys.version) for fn in [empty, empty_with_docstring, docstring]: print(fn.__name__) dis.dis(fn) $ /usr/local/pythonz/pythons/CPython-2.7.14/bin/python2.7 /tmp/empty.py 2.7.14 (default, Oct 4 2017, 09:45:53) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] empty 2 0 LOAD_CONST 0 (None) 3 RETURN_VALUE empty_with_docstring 4 0 LOAD_CONST 1 (None) 3 RETURN_VALUE docstring 9 0 LOAD_CONST 1 (1) 3 RETURN_VALUE $ /usr/local/pythonz/pythons/CPython-3.6.4/bin/python3.6 /tmp/empty.py 3.6.4 (default, Dec 19 2017, 08:11:42) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] empty 2 0 LOAD_CONST 0 (None) 2 RETURN_VALUE empty_with_docstring 4 0 LOAD_CONST 1 (None) 2 RETURN_VALUE docstring 9 0 LOAD_CONST 1 (1) 2 RETURN_VALUE $ /usr/local/pythonz/pythons/CPython-3.7.0b4/bin/python3.7 /tmp/empty.py 3.7.0b4 (default, May 2 2018, 21:07:21) [Clang 9.0.0 (clang-900.0.39.2)] empty 2 0 LOAD_CONST 0 (None) 2 RETURN_VALUE empty_with_docstring 4 0 LOAD_CONST 1 (None) 2 RETURN_VALUE docstring 9 0 LOAD_CONST 1 (1) 2 RETURN_VALUE $ /usr/local/pythonz/pythons/CPython-3.7.0b5/bin/python3.7 /tmp/empty.py 3.7.0b5 (default, Jun 2 2018, 11:27:19) [Clang 9.1.0 (clang-902.0.39.2)] empty 2 0 LOAD_CONST 0 (None) 2 RETURN_VALUE empty_with_docstring 5 0 LOAD_CONST 1 (None) 2 RETURN_VALUE docstring 9 0 LOAD_CONST 1 (1) 2 RETURN_VALUE ---------- keywords: 3.7regression messages: 318532 nosy: nedbat priority: normal severity: normal status: open title: 3.7.0b5 changes the line number of empty functions with docstrings versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 07:33:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 11:33:27 +0000 Subject: [New-bugs-announce] [issue33746] testRegisterResult in test_unittest fails in verbose mode Message-ID: <1528025607.41.0.592728768989.issue33746@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -m testRegisterResult test_unittest Run tests sequentially 0:00:00 load avg: 4.42 [1/1] test_unittest == Tests result: SUCCESS == 1 test OK. Total duration: 98 ms Tests result: SUCCESS $ ./python -m test -v -m testRegisterResult test_unittest == CPython 3.8.0a0 (heads/master-dirty:a801cf164b, Jun 3 2018, 12:58:45) [GCC 7.3.0] == Linux-4.15.0-22-generic-x86_64-with-glibc2.9 little-endian == cwd: /home/serhiy/py/cpython/build/test_python_3610 == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 Run tests sequentially 0:00:00 load avg: 4.17 [1/1] test_unittest testRegisterResult (unittest.test.test_break.TestBreak) ... FAIL testRegisterResult (unittest.test.test_break.TestBreakDefaultIntHandler) ... ok testRegisterResult (unittest.test.test_break.TestBreakSignalDefault) ... ok testRegisterResult (unittest.test.test_break.TestBreakSignalIgnored) ... ok ====================================================================== FAIL: testRegisterResult (unittest.test.test_break.TestBreak) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/unittest/test/test_break.py", line 48, in testRegisterResult self.fail("odd object in result set") AssertionError: odd object in result set ---------------------------------------------------------------------- Ran 4 tests in 0.002s FAILED (failures=1) test test_unittest failed test_unittest failed == Tests result: FAILURE == 1 test failed: test_unittest Total duration: 138 ms Tests result: FAILURE The test is passed in 2.7 and 3.4. It fails only starting from 3.5. ---------- components: Tests messages: 318533 nosy: ezio.melotti, michael.foord, rbcollins, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: testRegisterResult in test_unittest fails in verbose mode type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 07:59:10 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 11:59:10 +0000 Subject: [New-bugs-announce] [issue33747] Failed separate test_patch_propogrates_exc_on_exit in test_unittest Message-ID: <1528027150.62.0.592728768989.issue33747@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m test_patch_propogrates_exc_on_exit test_unittest ... test_patch_propogrates_exc_on_exit (unittest.test.testmock.testpatch.PatchTest) ... ERROR ====================================================================== ERROR: test_patch_propogrates_exc_on_exit (unittest.test.testmock.testpatch.PatchTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/unittest/test/testmock/testpatch.py", line 1699, in test_patch_propogrates_exc_on_exit self.assertRaises(RuntimeError, test) File "/home/serhiy/py/cpython/Lib/unittest/case.py", line 743, in assertRaises return context.handle('assertRaises', args, kwargs) File "/home/serhiy/py/cpython/Lib/unittest/case.py", line 178, in handle callable_obj(*args, **kwargs) File "/home/serhiy/py/cpython/Lib/unittest/mock.py", line 1183, in patched arg = patching.__enter__() File "/home/serhiy/py/cpython/Lib/unittest/mock.py", line 1239, in __enter__ self.target = self.getter() File "/home/serhiy/py/cpython/Lib/unittest/mock.py", line 1409, in getter = lambda: _importer(target) File "/home/serhiy/py/cpython/Lib/unittest/mock.py", line 1092, in _importer thing = __import__(import_path) ModuleNotFoundError: No module named 'squizz' ---------------------------------------------------------------------- ---------- components: Tests messages: 318534 nosy: michael.foord, serhiy.storchaka priority: normal severity: normal status: open title: Failed separate test_patch_propogrates_exc_on_exit in test_unittest type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 08:03:13 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 12:03:13 +0000 Subject: [New-bugs-announce] [issue33748] test_discovery_failed_discovery in test_unittest modifies sys.path Message-ID: <1528027393.44.0.592728768989.issue33748@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m test_discovery_failed_discovery test_unittest ... Warning -- sys.path was modified by test_unittest Before: (139720094056760, ['/home/serhiy/py/cpython', '/usr/local/lib/python38.zip', '/home/serhiy/py/cpython/Lib', '/home/serhiy/py/cpython/build/lib.linux-x86_64-3.8-pydebug', '/home/serhiy/.local/lib/python3.8/site-packages'], ['/home/serhiy/py/cpython', '/usr/local/lib/python38.zip', '/home/serhiy/py/cpython/Lib', '/home/serhiy/py/cpython/build/lib.linux-x86_64-3.8-pydebug', '/home/serhiy/.local/lib/python3.8/site-packages']) After: (139720094056760, ['/home/serhiy/py/cpython', '/usr/local/lib/python38.zip', '/home/serhiy/py/cpython/Lib', '/home/serhiy/py/cpython/build/lib.linux-x86_64-3.8-pydebug', '/home/serhiy/.local/lib/python3.8/site-packages'], ['/home/serhiy/py/cpython/build/test_python_8308/package', '/home/serhiy/py/cpython', '/usr/local/lib/python38.zip', '/home/serhiy/py/cpython/Lib', '/home/serhiy/py/cpython/build/lib.linux-x86_64-3.8-pydebug', '/home/serhiy/.local/lib/python3.8/site-packages']) test_unittest failed (env changed) ---------- components: Tests messages: 318535 nosy: ezio.melotti, michael.foord, rbcollins, serhiy.storchaka priority: normal severity: normal status: open title: test_discovery_failed_discovery in test_unittest modifies sys.path type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 08:03:45 2018 From: report at bugs.python.org (Michiel) Date: Sun, 03 Jun 2018 12:03:45 +0000 Subject: [New-bugs-announce] [issue33749] pdb.Pdb constructor stdout override required to disable use_rawinput Message-ID: <1528027425.26.0.592728768989.issue33749@psf.upfronthosting.co.za> New submission from Michiel : It looks like there's possibly a typo/small bug in the pdb.Pdb code. If I supply the stdin argument to the constructor, and provide e.g. a io.StringIO object, then I expect commands to be read from there. This however doesn't happen. If I additionally supply a stdout argument, then it works. This is because use_rawinput is only disabled if stdout is specified, see https://github.com/python/cpython/blob/3.7/Lib/pdb.py#L144: ... def __init__(self, completekey='tab', stdin=None, stdout=None, skip=None, nosigint=False, readrc=True): bdb.Bdb.__init__(self, skip=skip) cmd.Cmd.__init__(self, completekey, stdin, stdout) if stdout: self.use_rawinput = 0 ... I think it should be disabled if stdin is supplied, or possibly if either is specified (I'm not sure). Repro: import pdb import io pdb_script = io.StringIO("p 'hello';; c") output = io.StringIO() Buggy behaviour: In [5]: pdb.Pdb(stdin=pdb_script).set_trace() --Call-- > /usr/lib/python3.6/site-packages/IPython/core/displayhook.py(247)__call__() -> def __call__(self, result=None): (Pdb) c Expected behaviour: (Pdb) 'hello' Working if stdout is supplied: In [6]: pdb_script.seek(0) Out[6]: 0 In [7]: pdb.Pdb(stdin=pdb_script, stdout=output).set_trace() In [8]: print(output.getvalue()) --Call-- > /usr/lib/python3.6/site-packages/IPython/core/displayhook.py(247)__call__() -> def __call__(self, result=None): (Pdb) 'hello' I would've had a go at fixing this, but even after reading the docs at https://docs.python.org/3/library/cmd.html#cmd.Cmd.use_rawinput it's not entirely obvious to me which combinations of stdin/stdout overrides should be valid and when use_rawinput should be set to 0. However, I'm pretty sure it should at least be set to 0 if stdin is supplied, which currently isn't the case. ---------- components: Library (Lib) messages: 318536 nosy: m01 priority: normal severity: normal status: open title: pdb.Pdb constructor stdout override required to disable use_rawinput type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 08:44:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 12:44:19 +0000 Subject: [New-bugs-announce] [issue33750] Failed separate test_from_tuple in test_decimal Message-ID: <1528029859.0.0.592728768989.issue33750@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m test_from_tuple test_decimal ... test_from_tuple (test.test_decimal.CWhitebox) ... FAIL ====================================================================== FAIL: test_from_tuple (test.test_decimal.CWhitebox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_decimal.py", line 5413, in test_from_tuple self.assertEqual(str(c.create_decimal(x)), '-0E-1000026') AssertionError: '-0E-1000007' != '-0E-1000026' - -0E-1000007 ? ^^ + -0E-1000026 ? ^^ ---------------------------------------------------------------------- ---------- components: Tests messages: 318542 nosy: facundobatista, mark.dickinson, rhettinger, serhiy.storchaka, skrah priority: normal severity: normal status: open title: Failed separate test_from_tuple in test_decimal type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 08:47:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 12:47:27 +0000 Subject: [New-bugs-announce] [issue33751] Failed separate testTruncateOnWindows in test_file Message-ID: <1528030047.94.0.592728768989.issue33751@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m testTruncateOnWindows test_file ... testTruncateOnWindows (test.test_file.COtherFileTests) ... ERROR testTruncateOnWindows (test.test_file.PyOtherFileTests) ... ERROR ====================================================================== ERROR: testTruncateOnWindows (test.test_file.COtherFileTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_file.py", line 188, in testTruncateOnWindows os.unlink(TESTFN) FileNotFoundError: [Errno 2] No such file or directory: '@test_8845_tmp' ====================================================================== ERROR: testTruncateOnWindows (test.test_file.PyOtherFileTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_file.py", line 188, in testTruncateOnWindows os.unlink(TESTFN) FileNotFoundError: [Errno 2] No such file or directory: '@test_8845_tmp' ---------------------------------------------------------------------- ---------- components: Tests messages: 318543 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Failed separate testTruncateOnWindows in test_file type: behavior versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 08:50:26 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 12:50:26 +0000 Subject: [New-bugs-announce] [issue33752] Leaked file in test_anydbm_creation_n_file_exists_with_invalid_contents in test_dbm Message-ID: <1528030226.3.0.592728768989.issue33752@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m test_anydbm_creation_n_file_exists_with_invalid_contents test_dbm ... test_anydbm_creation_n_file_exists_with_invalid_contents (test.test_dbm.TestCase-dbm.gnu) ... ok test_anydbm_creation_n_file_exists_with_invalid_contents (test.test_dbm.TestCase-dbm.ndbm) ... ok test_anydbm_creation_n_file_exists_with_invalid_contents (test.test_dbm.TestCase-dbm.dumb) ... ok ---------------------------------------------------------------------- Ran 3 tests in 0.011s OK Warning -- files was modified by test_dbm Before: [] After: ['@test_17166_tmp.dir'] test_dbm failed (env changed) ---------- components: Tests messages: 318544 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Leaked file in test_anydbm_creation_n_file_exists_with_invalid_contents in test_dbm type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 08:53:11 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 12:53:11 +0000 Subject: [New-bugs-announce] [issue33753] Leaked file in test_nextfile_oserror_deleting_backup in test_fileinput Message-ID: <1528030391.57.0.592728768989.issue33753@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m test_nextfile_oserror_deleting_backup test_fileinput ... Warning -- files was modified by test_fileinput Before: [] After: ['@test_23936_tmp1.bak'] test_fileinput failed (env changed) ---------- components: Tests messages: 318545 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Leaked file in test_nextfile_oserror_deleting_backup in test_fileinput type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 08:59:38 2018 From: report at bugs.python.org (David Halter) Date: Sun, 03 Jun 2018 12:59:38 +0000 Subject: [New-bugs-announce] [issue33754] f-strings should be part of the Grammar Message-ID: <1528030778.27.0.592728768989.issue33754@psf.upfronthosting.co.za> New submission from David Halter : Currently f-strings are a bit of a hack. They certainly work very well for users, but they are implemented in ast.c and therefore not part of the Python grammar and the tokenizer. I want to change this. I wrote an alternative implementation of f-strings in parso (http://parso.readthedocs.io/en/latest/). The idea I have is to modify the Python grammar slightly (https://github.com/davidhalter/parso/blob/master/parso/python/grammar37.txt#L149): fstring: FSTRING_START fstring_content* FSTRING_END fstring_content: FSTRING_STRING | fstring_expr fstring_conversion: '!' NAME fstring_expr: '{' testlist [ fstring_conversion ] [ fstring_format_spec ] '}' fstring_format_spec: ':' fstring_content* We would push most of the hard work to the tokenizer. This obviously means that we have to add a lot of code there. I wrote a tokenizer in Python for parso here: in https://github.com/davidhalter/parso/blob/master/parso/python/tokenize.py. It is definitely working well. The biggest difference to the current tokenizer.c is that you have to work with stacks and be way more context-sensitive. There were attempts to change the Grammar of f-strings like https://www.python.org/dev/peps/pep-0536/. It hasn't caught on, because it tried to change the semantics of f-strings. The implementation in parso has not changed the semantics of f-strings. In a first step I would like to get this working for CPython and not tokenize.py. Modifying tokenize.py will not be part of my initial work here. I have discussed this with ?ukasz Langa, so if you guys have no objections I will start working on it. Please let me know if you support this or not. ---------- components: Interpreter Core messages: 318547 nosy: davidhalter priority: normal severity: normal status: open title: f-strings should be part of the Grammar type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 10:12:34 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 14:12:34 +0000 Subject: [New-bugs-announce] [issue33755] Failed separate tests in test_importlib Message-ID: <1528035154.67.0.592728768989.issue33755@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m test_resource test_importlib ... ====================================================================== ERROR: test_is_submodule_resource (test.test_importlib.test_resource.ResourceFromZipsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_importlib/test_resource.py", line 113, in test_is_submodule_resource submodule = import_module('ziptestdata.subdirectory') File "/home/serhiy/py/cpython/Lib/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 965, in _find_and_load_unlocked ModuleNotFoundError: No module named 'ziptestdata.subdirectory' ====================================================================== ERROR: test_read_submodule_resource_by_name (test.test_importlib.test_resource.ResourceFromZipsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_importlib/test_resource.py", line 119, in test_read_submodule_resource_by_name resources.is_resource('ziptestdata.subdirectory', 'binary.file')) File "/home/serhiy/py/cpython/Lib/importlib/resources.py", line 223, in is_resource package = _get_package(package) File "/home/serhiy/py/cpython/Lib/importlib/resources.py", line 47, in _get_package module = import_module(package) File "/home/serhiy/py/cpython/Lib/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 965, in _find_and_load_unlocked ModuleNotFoundError: No module named 'ziptestdata.subdirectory' ====================================================================== ERROR: test_submodule_contents (test.test_importlib.test_resource.ResourceFromZipsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_importlib/test_resource.py", line 122, in test_submodule_contents submodule = import_module('ziptestdata.subdirectory') File "/home/serhiy/py/cpython/Lib/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 965, in _find_and_load_unlocked ModuleNotFoundError: No module named 'ziptestdata.subdirectory' ====================================================================== ERROR: test_submodule_contents_by_name (test.test_importlib.test_resource.ResourceFromZipsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_importlib/test_resource.py", line 129, in test_submodule_contents_by_name set(resources.contents('ziptestdata.subdirectory')), File "/home/serhiy/py/cpython/Lib/importlib/resources.py", line 248, in contents package = _get_package(package) File "/home/serhiy/py/cpython/Lib/importlib/resources.py", line 47, in _get_package module = import_module(package) File "/home/serhiy/py/cpython/Lib/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 965, in _find_and_load_unlocked ModuleNotFoundError: No module named 'ziptestdata.subdirectory' ---------------------------------------------------------------------- ---------- components: Tests messages: 318551 nosy: brett.cannon, serhiy.storchaka, twouters priority: normal severity: normal status: open title: Failed separate tests in test_importlib type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 10:51:12 2018 From: report at bugs.python.org (Manjusaka) Date: Sun, 03 Jun 2018 14:51:12 +0000 Subject: [New-bugs-announce] [issue33756] Python 3.7.0b5 build error Message-ID: <1528037472.78.0.592728768989.issue33756@psf.upfronthosting.co.za> New submission from Manjusaka : When I build 3.70.b5 in Mac , the compiler raise an error show that "./Modules/posixmodule.c:6018:11: error: implicit declaration of function 'forkpty' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pid = forkpty(&master_fd, NULL, NULL, NULL);" the makefile was generated by './configuration" command without no argument. ---------- components: Build messages: 318555 nosy: Manjusaka priority: normal severity: normal status: open title: Python 3.7.0b5 build error type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 11:43:25 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 15:43:25 +0000 Subject: [New-bugs-announce] [issue33757] Failed separate test_pdb_next_command_in_generator_for_loop in test_pdb Message-ID: <1528040605.03.0.592728768989.issue33757@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m test_pdb_next_command_in_generator_for_loop test_pdb ... test_pdb_next_command_in_generator_for_loop (test.test_pdb) Doctest: test.test_pdb.test_pdb_next_command_in_generator_for_loop ... FAIL ====================================================================== FAIL: test_pdb_next_command_in_generator_for_loop (test.test_pdb) Doctest: test.test_pdb.test_pdb_next_command_in_generator_for_loop ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython-tmp2/Lib/doctest.py", line 2193, in runTest test, out=new.write, clear_globs=False) AssertionError: Failed doctest test for test.test_pdb.test_pdb_next_command_in_generator_for_loop File "/home/serhiy/py/cpython-tmp2/Lib/test/test_pdb.py", line 1035, in test_pdb_next_command_in_generator_for_loop ---------------------------------------------------------------------- File "/home/serhiy/py/cpython-tmp2/Lib/test/test_pdb.py", line 1048, in test.test_pdb.test_pdb_next_command_in_generator_for_loop Failed example: with PdbTestInput(['break test_gen', 'continue', 'next', 'next', 'next', 'continue']): test_function() Expected: > (3)test_function() -> for i in test_gen(): (Pdb) break test_gen Breakpoint 6 at :1 (Pdb) continue > (2)test_gen() -> yield 0 (Pdb) next value 0 > (3)test_gen() -> return 1 (Pdb) next Internal StopIteration: 1 > (3)test_function() -> for i in test_gen(): (Pdb) next > (5)test_function() -> x = 123 (Pdb) continue Got: > (3)test_function() -> for i in test_gen(): (Pdb) break test_gen Breakpoint 1 at :1 (Pdb) continue > (2)test_gen() -> yield 0 (Pdb) next value 0 > (3)test_gen() -> return 1 (Pdb) next Internal StopIteration: 1 > (3)test_function() -> for i in test_gen(): (Pdb) next > (5)test_function() -> x = 123 (Pdb) continue ---------------------------------------------------------------------- ---------- components: Tests messages: 318560 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Failed separate test_pdb_next_command_in_generator_for_loop in test_pdb type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 11:52:01 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 15:52:01 +0000 Subject: [New-bugs-announce] [issue33758] Unexpected success of test_get_type_hints_modules_forwardref in test_typing Message-ID: <1528041121.47.0.592728768989.issue33758@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m test_get_type_hints_modules_forwardref test_typing ... test_get_type_hints_modules_forwardref (test.test_typing.GetTypeHintTests) ... unexpected success ---------------------------------------------------------------------- Ran 1 test in 0.001s FAILED (unexpected successes=1) ---------- components: Tests messages: 318563 nosy: levkivskyi, serhiy.storchaka priority: normal severity: normal status: open title: Unexpected success of test_get_type_hints_modules_forwardref in test_typing type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 12:02:51 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 16:02:51 +0000 Subject: [New-bugs-announce] [issue33759] Failed separate ServerProxyTestCase tests in test_xmlrpc Message-ID: <1528041771.94.0.592728768989.issue33759@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m ServerProxyTestCase test_xmlrpc ... ====================================================================== ERROR: test_close (test.test_xmlrpc.ServerProxyTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_xmlrpc.py", line 1181, in test_close p = xmlrpclib.ServerProxy(self.url) File "/home/serhiy/py/cpython/Lib/xmlrpc/client.py", line 1416, in __init__ type, uri = urllib.parse._splittype(uri) File "/home/serhiy/py/cpython/Lib/urllib/parse.py", line 967, in _splittype match = _typeprog.match(url) TypeError: expected string or bytes-like object ====================================================================== ERROR: test_transport (test.test_xmlrpc.ServerProxyTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/test_xmlrpc.py", line 1186, in test_transport p = xmlrpclib.ServerProxy(self.url, transport=t) File "/home/serhiy/py/cpython/Lib/xmlrpc/client.py", line 1416, in __init__ type, uri = urllib.parse._splittype(uri) File "/home/serhiy/py/cpython/Lib/urllib/parse.py", line 967, in _splittype match = _typeprog.match(url) TypeError: expected string or bytes-like object ---------------------------------------------------------------------- ---------- components: Tests messages: 318565 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Failed separate ServerProxyTestCase tests in test_xmlrpc type: behavior versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 12:12:46 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 16:12:46 +0000 Subject: [New-bugs-announce] [issue33760] Leaked files in test_io Message-ID: <1528042366.45.0.592728768989.issue33760@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m test.test_io.CBufferedReaderTest.test_garbage_collection test_io ... Warning -- files was modified by test_io Before: [] After: ['@test_18627_tmp'] test_io failed (env changed) $ ./python -m test -v -m test.test_io.CBufferedWriterTest.test_garbage_collection test_io ... Warning -- files was modified by test_io Before: [] After: ['@test_18654_tmp'] test_io failed (env changed) $ ./python -m test -v -m test.test_io.CBufferedWriterTest.test_truncate test_io ... Warning -- files was modified by test_io Before: [] After: ['@test_18663_tmp'] test_io failed (env changed) $ ./python -m test -v -m test.test_io.CBufferedWriterTest.test_truncate_after_write test_io ... Warning -- files was modified by test_io Before: [] After: ['@test_18666_tmp'] test_io failed (env changed) And the same for PyBufferedWriterTest, CBufferedRandomTest and PyBufferedRandomTest. ---------- messages: 318567 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Leaked files in test_io _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 12:15:22 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 03 Jun 2018 16:15:22 +0000 Subject: [New-bugs-announce] [issue33761] Leaked file in test_iterparse in test_xml_etree Message-ID: <1528042522.11.0.592728768989.issue33761@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : $ ./python -m test -v -m test_iterparse test_xml_etree ... Warning -- files was modified by test_xml_etree Before: [] After: ['@test_18721_tmp'] test_xml_etree failed (env changed) ---------- components: Tests messages: 318568 nosy: eli.bendersky, scoder, serhiy.storchaka priority: normal severity: normal status: open title: Leaked file in test_iterparse in test_xml_etree type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 16:53:05 2018 From: report at bugs.python.org (Dutcho) Date: Sun, 03 Jun 2018 20:53:05 +0000 Subject: [New-bugs-announce] [issue33762] temp file isn't IOBase Message-ID: <1528059185.23.0.592728768989.issue33762@psf.upfronthosting.co.za> New submission from Dutcho : I'd expect isinstance(tempfile.TemporaryFile(), io.IOBase) to be True as you can read() from and write() to the temp file. However, on Python 3.6.5 64 bit on Windows 7 above isinstance() == False and and type(tempfile.TemporaryFile()) == tempfile._TemporaryFileWrapper, which has no super class (other than object). Whereas, on Python 3.6.1 on iOS 11.4 (Pythonista 3.2) above isinstance() == True and type(tempfile.TemporaryFile()) == io.BufferedRandom, which has io.IOBase as its (indirect) super class. The difference is likely caused by tempfile line 565 that equals TemporaryFile = NamedTemporaryFile in case of Windows. This may be somewhat related to issue 26175, but isn't a duplicate as 26175 is on a temp file's attributes, and this issue is on its type ---------- components: Library (Lib) messages: 318585 nosy: Dutcho priority: normal severity: normal status: open title: temp file isn't IOBase type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 20:11:29 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 04 Jun 2018 00:11:29 +0000 Subject: [New-bugs-announce] [issue33763] IDLE: Use text widget for code context instead of label widget Message-ID: <1528071089.01.0.592728768989.issue33763@psf.upfronthosting.co.za> New submission from Cheryl Sabella : Item 11 from #33610. Use read-only Text instead of Label for context. * Change widget type from Label to Text and remove Label-only arguments. * Add height and state arguments. * Change widget name from self.label to self.context. * Tests: change widget name and method for getting text. ---------- assignee: terry.reedy components: IDLE messages: 318588 nosy: cheryl.sabella, terry.reedy priority: normal severity: normal status: open title: IDLE: Use text widget for code context instead of label widget type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 20:53:32 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 04 Jun 2018 00:53:32 +0000 Subject: [New-bugs-announce] [issue33764] AppVeyor builds interrupted before tests complete Message-ID: <1528073612.86.0.592728768989.issue33764@psf.upfronthosting.co.za> New submission from STINNER Victor : While looking at AppVeyor history, I saw two builds which seem like interrupted in the middle of the test 3.6: https://ci.appveyor.com/project/python/cpython/build/3.6build16876/job/t9nyt59wkwcn68nk ... 0:04:32 [312/407] test_genexps passed -- running: test_largefile (2 min 21 sec), test_mmap (4 min 30 sec) 0:04:32 [313/407] test_weakset passed -- running: test_largefile (2 min 21 sec), test_mmap (4 min 30 sec) 0:04:32 [314/407] test_fractions passed -- running: test_largefile (2 min 21 sec), test_mmap (4 min 31 sec) 3.8: https://ci.appveyor.com/project/python/cpython/build/3.8build16878 ... 0:06:07 [290/416] test_frame passed -- running: test_io (4 min 1 sec), test_mmap (5 min 45 sec) 0:06:09 [291/416] test_codecmaps_cn passed -- running: test_io (4 min 3 sec), test_mmap (5 min 47 sec) fetching http://www.pythontest.net/unicode/gb-18030-2000.xml ... fetching http://www.pythontest.net/unicode/EUC-CN.TXT ... fetching http://www.pythontest.net/unicode/CP936.TXT ... Terry Reedy also noticed the issue: https://mail.python.org/pipermail/python-committers/2018-June/005527.html https://appveyor.statuspage.io/ says that all services are operational. ---------- components: Tests messages: 318590 nosy: vstinner priority: normal severity: normal status: open title: AppVeyor builds interrupted before tests complete _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 3 20:55:46 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 04 Jun 2018 00:55:46 +0000 Subject: [New-bugs-announce] [issue33765] AppVeyor didn't start on my PR 7365 Message-ID: <1528073746.0.0.592728768989.issue33765@psf.upfronthosting.co.za> New submission from STINNER Victor : I created the PR 7365: https://github.com/python/cpython/pull/7365 AppVeyor job is required to pass to allow me to merge my PR. But AppVeyor job didn't start: "continuous-integration/appveyor/pr Expected ? Waiting for status to be reported" I cannot find any job related to my PR in the AppVeyor history: https://ci.appveyor.com/project/python/cpython/history The latest build was 5 hours ago. See also bpo-33764. ---------- components: Tests messages: 318591 nosy: vstinner priority: normal severity: normal status: open title: AppVeyor didn't start on my PR 7365 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 4 00:05:20 2018 From: report at bugs.python.org (Isaac Elliott) Date: Mon, 04 Jun 2018 04:05:20 +0000 Subject: [New-bugs-announce] [issue33766] Grammar Incongruence Message-ID: <1528085120.11.0.592728768989.issue33766@psf.upfronthosting.co.za> New submission from Isaac Elliott : echo 'print("a");print("b")' > test.py This program is grammatically incorrect according to the specification (https://docs.python.org/3.8/reference/grammar.html). But Python 3 runs it without issue. It's this production here simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE which says 'simple_stmt's must be terminated by a newline. However, the program I wrote doesn't contain any newlines. I think the grammar spec is missing some information, but I'm not quite sure what. Does anyone have an idea? ---------- components: Interpreter Core messages: 318617 nosy: Isaac Elliott priority: normal severity: normal status: open title: Grammar Incongruence type: behavior versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 4 00:40:18 2018 From: report at bugs.python.org (Zackery Spytz) Date: Mon, 04 Jun 2018 04:40:18 +0000 Subject: [New-bugs-announce] [issue33767] Improper use of SystemError in the mmap module Message-ID: <1528087218.45.0.592728768989.issue33767@psf.upfronthosting.co.za> New submission from Zackery Spytz : Both mmap_concat() and mmap_repeat() raise a SystemError when invoked. ---------- components: Extension Modules messages: 318623 nosy: ZackerySpytz priority: normal severity: normal status: open title: Improper use of SystemError in the mmap module type: behavior versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 4 01:54:31 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 04 Jun 2018 05:54:31 +0000 Subject: [New-bugs-announce] [issue33768] IDLE: click on context line should jump to line, at top of window Message-ID: <1528091671.87.0.592728768989.issue33768@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Item 8. on #33610. Clicking on a line in the context box jumps the editor to that line, displayed as the first line. If we do item 11, replace Label with Text, this has to start after #33763 is merged. We could determine the context line clicked from click event.y by using .dlineinfo('1.0') on the editor window to get the offset and height of textlines for the font used. Disabled texts still have an 'insert' mark that is moved by clicks. It is just not visible. The line clicked on is int(self.context.index('insert').split('.')[0]), or int(float(index('insert'))), or next(map(int, t.index('insert').split('.'))), or s=t.index('insert'); int(s[:s.find('.')]) the same as if the context were 'normal' with a visible cursor. This only works if the default click handler fires first, so the mark is moved before we look at it. The default handler is a class binding to Button (press), so we should just be able to bind to ButtonRelease, which is generally a better choice anyway "because if the user accidentally presses the button, they can move the mouse off the widget to avoid setting off the event." ---------- assignee: terry.reedy components: IDLE messages: 318636 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: click on context line should jump to line, at top of window type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 4 13:45:55 2018 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 04 Jun 2018 17:45:55 +0000 Subject: [New-bugs-announce] [issue33769] Cleanup start_tls() implementation Message-ID: <1528134355.5.0.592728768989.issue33769@psf.upfronthosting.co.za> New submission from Yury Selivanov : Current start_tls() implementation might raise an incorrect error message. It should also consistently cancel callbacks that it schedules in case of unhandled error. ---------- assignee: yselivanov components: asyncio messages: 318688 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Cleanup start_tls() implementation type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 4 15:53:31 2018 From: report at bugs.python.org (Dmitry) Date: Mon, 04 Jun 2018 19:53:31 +0000 Subject: [New-bugs-announce] [issue33770] base64 throws 'incorrect padding' exception even though the string length is a multiple of 4 Message-ID: <1528142011.45.0.592728768989.issue33770@psf.upfronthosting.co.za> New submission from Dmitry : All base64 decoding methods fail to decode a valid base64 string, throwing 'incorrect padding' regardless of the string padding. Here's an example: >>> base64.urlsafe_b64decode('AQAAQDhAAMAAQAAAAAAAAthAAAAJDczODFmZDM2LTNiOTYtNDVmYS04MjQ2LWRkYzJkMmViYjQ2YQ===') Traceback (most recent call last): File "", line 1, in File "/export/apps/python/3.6/lib/python3.6/base64.py", line 133, in urlsafe_b64decode return b64decode(s) File "/export/apps/python/3.6/lib/python3.6/base64.py", line 87, in b64decode return binascii.a2b_base64(s) binascii.Error: Incorrect padding The same string gets decoded without any issues using Perl's MIME::Base64 module or Java. So far Python's base64 module is the only one that fails to decode it. ---------- components: Extension Modules messages: 318691 nosy: dniq priority: normal severity: normal status: open title: base64 throws 'incorrect padding' exception even though the string length is a multiple of 4 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 5 03:49:14 2018 From: report at bugs.python.org (Svyatoslav) Date: Tue, 05 Jun 2018 07:49:14 +0000 Subject: [New-bugs-announce] [issue33771] Module: timeit. According to documentation default_repeat should have the value 3. Has 5. Message-ID: <1528184954.23.0.592728768989.issue33771@psf.upfronthosting.co.za> Change by Svyatoslav : ---------- components: Library (Lib) nosy: svyatoslav priority: normal severity: normal status: open title: Module: timeit. According to documentation default_repeat should have the value 3. Has 5. type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 5 05:27:42 2018 From: report at bugs.python.org (David Carlier) Date: Tue, 05 Jun 2018 09:27:42 +0000 Subject: [New-bugs-announce] [issue33772] Fix few dead code paths Message-ID: <1528190862.37.0.592728768989.issue33772@psf.upfronthosting.co.za> Change by David Carlier : ---------- components: Interpreter Core nosy: David Carlier priority: normal pull_requests: 7042 severity: normal status: open title: Fix few dead code paths versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 5 07:29:39 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 05 Jun 2018 11:29:39 +0000 Subject: [New-bugs-announce] [issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/ Message-ID: <1528198179.8.0.592728768989.issue33773@psf.upfronthosting.co.za> New submission from STINNER Victor : test.support.fd_count() has two implementation: list /proc/self/fd/ on Linux and FreeBSD, or check all file descriptors from 0 and MAXFD. The problem is that the two implementation don't give the same result... List /proc/self/fd/ (used by default on Linux): vstinner at apu$ ./python -c 'from test.support import fd_count; print(fd_count())' 4 Check all FD (I modified fd_count() to force using this implementation): vstinner at apu$ ./python -c 'from test.support import fd_count; print(fd_count())' 3 On Linux and FreeBSD, listdir() opens internally a file descriptor to list the content of the /proc/self/fd/ directory. So the function should substract one to the result. Attached PR fixes the issue. ---------- components: Tests messages: 318734 nosy: pitrou, vstinner priority: normal severity: normal status: open versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 5 12:58:55 2018 From: report at bugs.python.org (Al-Scandar Solstag) Date: Tue, 05 Jun 2018 16:58:55 +0000 Subject: [New-bugs-announce] [issue33774] Improve doc of @lru_cache to avoid misuse and confusion Message-ID: <1528217935.32.0.592728768989.issue33774@psf.upfronthosting.co.za> New submission from Al-Scandar Solstag : Ni! It is not clear at all in the documentation of @lru_cache that the cache takes into account the exact way the function was called, not the values passed to its arguments, as one could/would expect. I mean that for function(a, b, c=3) the three calls below are not considered equivalent as far as the cache is concerned: function(1, 2, 3) function(1, 2, c=3) function(1, 2) I hope this can be clarified in the documentation. I wasted a great deal of time today trying to understand why my calls were not getting cached and only figured it out when I decided to go read @lru_cache's code. It seems very likely that other people have had the same problem. Or worse, people might be using @lru_cache believing it is working when it isn't. Cheers! ---------- assignee: docs at python components: Documentation messages: 318770 nosy: docs at python, solstag priority: normal severity: normal status: open title: Improve doc of @lru_cache to avoid misuse and confusion _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 5 18:12:35 2018 From: report at bugs.python.org (woutgg) Date: Tue, 05 Jun 2018 22:12:35 +0000 Subject: [New-bugs-announce] [issue33775] argparse: the word 'default' (in help) is not marked as translatable Message-ID: <1528236755.92.0.592728768989.issue33775@psf.upfronthosting.co.za> New submission from woutgg : The word 'default', used to indicate default arguments in the help text (found here: Lib/argparse.py:681) is missing the gettext wrapper, causing it to be untranslatable. ---------- messages: 318784 nosy: woutgg priority: normal severity: normal status: open title: argparse: the word 'default' (in help) is not marked as translatable type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 5 21:17:44 2018 From: report at bugs.python.org (Jason McKellar) Date: Wed, 06 Jun 2018 01:17:44 +0000 Subject: [New-bugs-announce] [issue33776] Segfault when passing invalid argument to asyncio.ensure_future Message-ID: <1528247864.26.0.592728768989.issue33776@psf.upfronthosting.co.za> New submission from Jason McKellar : If time.monotonic() is yielded from a generator that is passed to asyncio.ensure_future a segfault occurs when it's scheduled. The example below shows time.monotonic called in the generator, however the segfault will also occur if a function is called (not a lambda) that uses time.monotonic. I've tested on Python 3.6 and 3.7.0b4. For example: import asyncio import time import faulthandler faulthandler.enable() loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) # Note that ensure_future argument is generator # which yields time.monotonic() return value tasks = [asyncio.ensure_future( time.monotonic() for i in range(1) )] results_future = asyncio.gather(*tasks) # Segmentation fault results = loop.run_until_complete(results_future) The fault handler output: Fatal Python error: Segmentation fault Current thread 0x00007f4b7a042b88 (most recent call first): File "/usr/local/lib/python3.7/asyncio/events.py", line 88 in _run File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1738 in _run_once File "/usr/local/lib/python3.7/asyncio/base_events.py", line 521 in run_forever File "/usr/local/lib/python3.7/asyncio/base_events.py", line 553 in run_until_complete File "/test-seg.py", line 19 in Segmentation fault (core dumped) An example with time.monotonic call nested in a function: import asyncio import time import faulthandler def bad(): return {'nested': time.monotonic()} faulthandler.enable() loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) tasks = [asyncio.ensure_future( bad() for i in range(1) )] results_future = asyncio.gather(*tasks) # Segmentation fault results = loop.run_until_complete(results_future) ---------- components: asyncio messages: 318794 nosy: Jason McKellar, asvetlov, yselivanov priority: normal severity: normal status: open title: Segfault when passing invalid argument to asyncio.ensure_future type: crash versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 5 22:00:05 2018 From: report at bugs.python.org (Nate Atkinson) Date: Wed, 06 Jun 2018 02:00:05 +0000 Subject: [New-bugs-announce] [issue33777] dummy_threading: .is_alive method returns True after execution has completed Message-ID: <1528250405.09.0.592728768989.issue33777@psf.upfronthosting.co.za> New submission from Nate Atkinson : Here's what I expect to happen (Python2 behavior): Python 2.7.14+ (default, Dec 5 2017, 15:17:02) [GCC 7.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from dummy_threading import Thread >>> def f(): print 'foo' ... >>> t = Thread(target=f) >>> t.start() foo >>> t.is_alive() False >>> Here's what actually happens (Python3.6): Python 3.6.4 (default, Jan 5 2018, 02:13:53) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from dummy_threading import Thread >>> def f(): print('foo') ... >>> t = Thread(target=f) >>> t.start() foo >>> t.is_alive() True >>> After completion of the target function, I would expect .is_alive() to return False for an instance of dummy_thread.Thread. Instead, it returns True until the .join() method of the instance of dummy_thread.Thread is called. ---------- components: Interpreter Core messages: 318795 nosy: njatkinson priority: normal severity: normal status: open title: dummy_threading: .is_alive method returns True after execution has completed type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 5 23:10:29 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 06 Jun 2018 03:10:29 +0000 Subject: [New-bugs-announce] [issue33778] update Unicode database to 11.0 Message-ID: <1528254629.86.0.592728768989.issue33778@psf.upfronthosting.co.za> New submission from Benjamin Peterson : http://blog.unicode.org/2018/06/announcing-unicode-standard-version-110.html ---------- assignee: benjamin.peterson components: Unicode messages: 318799 nosy: benjamin.peterson, ezio.melotti, vstinner priority: normal severity: normal status: open title: update Unicode database to 11.0 type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 05:38:17 2018 From: report at bugs.python.org (Siddhartha Bose) Date: Wed, 06 Jun 2018 09:38:17 +0000 Subject: [New-bugs-announce] [issue33779] Error while installing python 3.6.5 on windows 10 Message-ID: <1528277897.55.0.592728768989.issue33779@psf.upfronthosting.co.za> New submission from Siddhartha Bose : Hi Team, I am getting below error while trying to install python 3.6.5 on windows 10. 0X80070005 Access is denied. Logs attached. Also when I see control panel it shows me under program and feartures however unable to uninstall. I am logged in as administrator. ---------- files: Python 3.6.5 (64-bit)_20180606150607.log messages: 318803 nosy: sid1987 priority: normal severity: normal status: open title: Error while installing python 3.6.5 on windows 10 type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47631/Python 3.6.5 (64-bit)_20180606150607.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 06:01:53 2018 From: report at bugs.python.org (Yoni Rozenshein) Date: Wed, 06 Jun 2018 10:01:53 +0000 Subject: [New-bugs-announce] [issue33780] [subprocess] Better Unicode support for shell=True on Windows Message-ID: <1528279313.05.0.592728768989.issue33780@psf.upfronthosting.co.za> New submission from Yoni Rozenshein : In subprocess, the implementation of shell=True on Windows is to launch a subprocess with using {comspec} /c "{args}" (normally comspec=cmd.exe). By default, the output of cmd is encoded with the "active" codepage. In Python 3.6, you can decode this using encoding='oem'. However, this actually loses information. For example, try creating a file with a filename in a language that is not your active codepage, and then doing subprocess.check_output('dir', shell=True). In the output, the filename is replaced with question marks (not by Python, by cmd!). To get the correct output, cmd has a "/u" switch (this switch has probably existed forever - at least since Windows NT 4.0, by my internet search). The output can then be decoded using encoding='utf-16-le', like any native Windows string. Currently, Popen constructs the command line in this hardcoded format: {comspec} /c "{args}", so you can't get the /u in there with the shell=True shortcut, and have to write your own wrapping code. I suggest adding an feature to Popen where /u may be inserted before the /c within the shell=True shortcut. I've thought of several ways to implement this: 1. A new argument to Popen, which indicates that we want Unicode shell output; if True, add the /u. Note that we already have a couple of Windows-only arguments to Popen, so this would not be a precedent. 2. If the encoding argument is 'utf-16-le' or one of its aliases, then add the /u. 3. If the encoding argument is not None, then add the /u. ---------- components: Library (Lib) messages: 318807 nosy: Yoni Rozenshein priority: normal severity: normal status: open title: [subprocess] Better Unicode support for shell=True on Windows type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 06:23:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jun 2018 10:23:24 +0000 Subject: [New-bugs-announce] [issue33781] audioop.c: fbound() casts double to int for its return value Message-ID: <1528280604.0.0.592728768989.issue33781@psf.upfronthosting.co.za> New submission from STINNER Victor : Extract of Python 2.7, Modules/audioop.c: static int fbound(double val, double minval, double maxval) { if (val > maxval) val = maxval; else if (val < minval + 1) val = minval; return val; } Example of usage: double factor, fval, maxval, minval; int len, size, val = 0; fval = (double)val*factor; val = (int)floor(fbound(fval, minval, maxval)); It seems wrong to me to call floor() with an integer. Why fbound() doesn't return a double? fbound() has been modified to explicitly cast its result to an int in the master branch: static int fbound(double val, double minval, double maxval) { if (val > maxval) val = maxval; else if (val < minval + 1) val = minval; return (int)val; } But master still uses something like: val = floor(fbound(val, minval, maxval)); It seems like fbound() result is always passed into floor(). Maybe floor() should be moved into fbound()? Attached PR changes fbound() to round correctly: call floor() into fbound(). -- I looked at the code because of the following compiler warning on Python 2.7: [00:02:21] ..\Modules\audioop.c(38): warning C4244: 'return' : conversion from 'double' to 'int', possible loss of data [C:\projects\cpython\PCbuild\pythoncore.vcxproj] ---------- components: Extension Modules messages: 318808 nosy: vstinner priority: normal severity: normal status: open title: audioop.c: fbound() casts double to int for its return value versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 07:12:44 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jun 2018 11:12:44 +0000 Subject: [New-bugs-announce] [issue33782] VSTS Windows-PR: internal error Message-ID: <1528283564.84.0.592728768989.issue33782@psf.upfronthosting.co.za> New submission from STINNER Victor : On my PR https://github.com/python/cpython/pull/7447 "VSTS: Windows-PR" failed: "Windows-PR_20180606.13 failed". https://python.visualstudio.com/cpython/_build?buildId=6469 "The request was failed due to an internal service error. Please try again." ---------- components: Build, Tests messages: 318812 nosy: steve.dower, vstinner priority: normal severity: normal status: open title: VSTS Windows-PR: internal error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 10:22:42 2018 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 06 Jun 2018 14:22:42 +0000 Subject: [New-bugs-announce] [issue33783] Use proper class markup for random.Random docs Message-ID: <1528294962.84.0.592728768989.issue33783@psf.upfronthosting.co.za> New submission from Nick Coghlan : Talking to Berker on http://psf.upfronthosting.co.za/roundup/meta/issue644 I noticed that docs for random.Random are currently embedded in the module preamble text for https://docs.python.org/3/library/random.html and hence really easy to miss. It would be good if they were broken out into a proper Sphix class directive so that the fact you can create your own dedicated pseudorandom number generators for specific purposes is easier to see on a quick scan of the docs. ---------- keywords: easy messages: 318827 nosy: berker.peksag, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Use proper class markup for random.Random docs type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 11:29:28 2018 From: report at bugs.python.org (Francois Schneider) Date: Wed, 06 Jun 2018 15:29:28 +0000 Subject: [New-bugs-announce] [issue33784] hash collision in instances of ipaddress.ip_network Message-ID: <1528298968.12.0.592728768989.issue33784@psf.upfronthosting.co.za> New submission from Francois Schneider : >>> import ipaddress >>> hash(ipaddress.ip_network(u'20.0.2.3/32')) == hash(ipaddress.ip_network(u'20.0.2.0/30')) True ---------- components: Library (Lib) messages: 318835 nosy: Francois Schneider priority: normal severity: normal status: open title: hash collision in instances of ipaddress.ip_network type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 11:55:54 2018 From: report at bugs.python.org (Romaji Milton Amulo) Date: Wed, 06 Jun 2018 15:55:54 +0000 Subject: [New-bugs-announce] =?utf-8?q?=5Bissue33785=5D_Crash_caused_by_p?= =?utf-8?b?YXN0aW5nIPCQjIjwkIyWIGludG8gcHl0aG9u?= Message-ID: <1528300554.15.0.592728768989.issue33785@psf.upfronthosting.co.za> New submission from Romaji Milton Amulo : On Windows 10, 64 bit, "Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32" crashes if ?? is pasted into the interpreter window, closing the window immediately. Also ??? crashes it too, suggesting the bug might be in text processing of Etruscan runes. ---------- components: Unicode messages: 318839 nosy: ezio.melotti, romaji, vstinner priority: normal severity: normal status: open title: Crash caused by pasting ?? into python type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 13:24:35 2018 From: report at bugs.python.org (Valentin Lavrinenko) Date: Wed, 06 Jun 2018 17:24:35 +0000 Subject: [New-bugs-announce] [issue33786] @asynccontextmanager doesn't work well with async generators Message-ID: <1528305875.22.0.592728768989.issue33786@psf.upfronthosting.co.za> New submission from Valentin Lavrinenko : ``` @asynccontextmanager async def ctx(): yield async def gen(): async with ctx(): yield 'hello' yield 'world' async def main(): async with ctx(): async for value in gen(): print(value) raise RuntimeError() ``` Running main() leads to `RuntimeError: generator didn't stop after throw()`. This happens because async gernerator's `.athrow()` method doesn't re-throw `GeneratorExit` exception; probably, this is wrong. ---------- components: asyncio messages: 318853 nosy: Valentin Lavrinenko, asvetlov, yselivanov priority: normal severity: normal status: open title: @asynccontextmanager doesn't work well with async generators versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 15:49:08 2018 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 06 Jun 2018 19:49:08 +0000 Subject: [New-bugs-announce] [issue33787] Argument clinic and Windows line endings Message-ID: <1528314548.88.0.592728768989.issue33787@psf.upfronthosting.co.za> New submission from Giampaolo Rodola' : If I use "Tools\clinic\clinic.py Modules\somemodule.c" on Windows argument clinic will modify the whole file and use Windows line endings ( "\r\n"). It would be good to use "\n" instead. ---------- assignee: larry components: Argument Clinic messages: 318857 nosy: giampaolo.rodola, larry priority: normal severity: normal status: open title: Argument clinic and Windows line endings versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 15:58:47 2018 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 06 Jun 2018 19:58:47 +0000 Subject: [New-bugs-announce] [issue33788] Argument clinic: use path_t in _winapi.c Message-ID: <1528315127.95.0.592728768989.issue33788@psf.upfronthosting.co.za> New submission from Giampaolo Rodola' : There currently are different functions in Modules/_winapi.c that deals with paths: CreateFile, CreateJunction, CreateNamedPipe and I'm currently working on a patch which will add 3 more. For those functions it would be convenient to be able to use path_t which is currently defined in Modules/posixmodule.c. I started playing with argument clinic only recently so I'm not sure if there's a way to avoid path_t definition. ---------- components: Argument Clinic messages: 318858 nosy: giampaolo.rodola, larry priority: normal severity: normal status: open title: Argument clinic: use path_t in _winapi.c versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 6 18:44:08 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 06 Jun 2018 22:44:08 +0000 Subject: [New-bugs-announce] [issue33789] test_asyncio emits ResourceWarning warnings Message-ID: <1528325048.7.0.592728768989.issue33789@psf.upfronthosting.co.za> New submission from STINNER Victor : vstinner at apu$ ./python -X dev -u -m test test_asyncio -v 2>&1 (...) test_create_connection_ssl_failed_certificate (test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... Exception in thread test-server: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 263, in _run self._handle_client(conn) File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 272, in _handle_client self._prog(TestSocketWrapper(sock)) File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_sslproto.py", line 604, in server server_side=True) File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 153, in start_tls ssl_sock.do_handshake() File "/home/vstinner/prog/python/master/Lib/ssl.py", line 1108, in do_handshake self._sslobj.do_handshake() OSError: [Errno 0] Error During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/threading.py", line 917, in _bootstrap_inner self.run() File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 232, in run self._run() File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 269, in _run self._test._abort_socket_test(ex) File "/home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py", line 122, in _abort_socket_test self.fail(ex) File "/home/vstinner/prog/python/master/Lib/unittest/case.py", line 680, in fail raise self.failureException(msg) AssertionError: [Errno 0] Error /home/vstinner/prog/python/master/Lib/threading.py:951: ResourceWarning: unclosed del exc_type, exc_value, exc_tb ok (...) test_start_tls_client_corrupted_ssl (test.test_asyncio.test_sslproto.SelectorStartTLSTests) ... /home/vstinner/prog/python/master/Lib/test/test_asyncio/functional.py:272: ResourceWarning: unclosed self._prog(TestSocketWrapper(sock)) /home/vstinner/prog/python/master/Lib/asyncio/sslproto.py:322: ResourceWarning: unclosed transport source=self) ok (...) I'm working on a fix. ---------- components: asyncio messages: 318864 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio emits ResourceWarning warnings versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 01:12:25 2018 From: report at bugs.python.org (Salomon) Date: Thu, 07 Jun 2018 05:12:25 +0000 Subject: [New-bugs-announce] [issue33790] Decorated (inner/wrapped) function kwarg defaults dont pass through decorator. Message-ID: <1528348345.08.0.592728768989.issue33790@psf.upfronthosting.co.za> New submission from Salomon : I am seeing an issue when attempting to use default kwargs in decorated functions. I would post reproduction steps, but instead I have written a snippet which should showcase the issue. Snippet: ```python def decorator(): def inner(f): def wrapper(*args, **kwargs): # Zoinks, Scoob! print('Decorator: {}'.format(''.join(kwargs.values()))) print(f(*args, **kwargs)) return wrapper return inner @decorator() def func(foo='wont print in the decorator'): return 'Func: {}'.format(foo)``` The following calls to 'func' should show you what Im talking about clearly: ``` func() -> Decorator: -> Func: wont print in the decorator func(foo='will print in the decorator') -> Decorator: will print in the decorator -> Func: will print in the decorator ``` I would expect, though correct me if I am wrong, that both of these calls should print in the decorator and the function call. For convenience, some REPL.it links: 3.6.1 -> https://repl.it/@SalomonSmeke/Python3-Decorator-Bug 2.7.10 -> https://repl.it/@SalomonSmeke/Python-Decorator-Bug Using @wrap from functools: 2.7.10 -> https://repl.it/@SalomonSmeke/Python-Decorator-Bug-using-FuncTools Thank you for your time. P.S. This is my first issue submitted to Python, please let me know if there is detail lacking. Im happy to provide what I can. ---------- messages: 318892 nosy: ssmeke priority: normal severity: normal status: open title: Decorated (inner/wrapped) function kwarg defaults dont pass through decorator. type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 04:12:27 2018 From: report at bugs.python.org (Austin Garner) Date: Thu, 07 Jun 2018 08:12:27 +0000 Subject: [New-bugs-announce] [issue33791] Error Installing on Mac Message-ID: <1528359147.48.0.592728768989.issue33791@psf.upfronthosting.co.za> New submission from Austin Garner : Python 3.8 would not install on MacOS due to missing SSL ---------- components: macOS messages: 318912 nosy: atg7000, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Error Installing on Mac type: compile error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 06:02:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jun 2018 10:02:04 +0000 Subject: [New-bugs-announce] [issue33792] asyncio: how to set a "Proactor event loop" policy? Issue with asyncio.run() Message-ID: <1528365724.38.0.592728768989.issue33792@psf.upfronthosting.co.za> New submission from STINNER Victor : asyncio documentation suggets to use: --- import asyncio, sys if sys.platform == 'win32': loop = asyncio.ProactorEventLoop() asyncio.set_event_loop(loop) --- https://docs.python.org/dev/library/asyncio-eventloops.html But this code doesn't work with asyncio.run() which creates a new event loop with the current policy, and the default policy on Windows is to use SelectorEventLoop. I cannot find a "Proactor event loop policy" in asyncio, nor how to change the default policy to use Proactor event loop. The workaround is to not use asyncio.run() which has been added in Python 3.7. ---------- components: asyncio messages: 318919 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: asyncio: how to set a "Proactor event loop" policy? Issue with asyncio.run() versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 06:44:35 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jun 2018 10:44:35 +0000 Subject: [New-bugs-announce] [issue33793] asyncio: _ProactorReadPipeTransport reads by chunk of 32 KiB: chunk size should be configurable Message-ID: <1528368275.57.0.592728768989.issue33793@psf.upfronthosting.co.za> New submission from STINNER Victor : _SelectorTransport has the class attribute: max_size = 256 * 1024 # Buffer size passed to recv(). But _ProactorReadPipeTransport uses an hardcoded chunk size of 32 KiB. It would be nice to allow to configure this size. By the way, _SelectorTransport.max_size has no public API to change the default value for the whole process. The attribute can only be set per socket, since _SelectorTransport is private. By the way, is the attribute documented? ---------- components: asyncio messages: 318923 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: asyncio: _ProactorReadPipeTransport reads by chunk of 32 KiB: chunk size should be configurable type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 08:18:36 2018 From: report at bugs.python.org (hhas) Date: Thu, 07 Jun 2018 12:18:36 +0000 Subject: [New-bugs-announce] [issue33794] Python.framework build is missing 'Current' symlink Message-ID: <1528373916.56.0.592728768989.issue33794@psf.upfronthosting.co.za> New submission from hhas : The Python.framework installed at '/Library/Frameworks/Python.framework' should have a subdirectory structure similar to this: Python.framework | |-Headers [symlink to 'Versions/Current/Headers'] | |-Python [symlink to 'Versions/Current/Python'] | |-Resources [symlink to 'Versions/Current/Resources'] | |-Versions | | | |-2.7 [directory created by 2.7 installer] | | | |-3.5 [directory created by 3.5 installer] | | | |-3.6 [directory created by 3.6 installer] | | | ... | | | |- Current [symlink to last installed version, e.g. '3.6'] Current Python.framework installers create a 2.x/3.x directory and Headers+Python+Resources symlinks, but fail to create a 'Current' symlink. This breaks the top-level symlinks and causes importing the framework via NSBundle to fail. Please fix the framework build and/or install script to create the missing symlink. ---------- components: macOS messages: 318926 nosy: hhas, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Python.framework build is missing 'Current' symlink versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 08:27:37 2018 From: report at bugs.python.org (Tim Boddy) Date: Thu, 07 Jun 2018 12:27:37 +0000 Subject: [New-bugs-announce] [issue33795] Memory leak in X509StoreContext class. Message-ID: <1528374457.54.0.592728768989.issue33795@psf.upfronthosting.co.za> New submission from Tim Boddy : I noticed a memory leak /usr/lib/python3.5/site-packages/OpenSSL/crypto.py in the definition of the class X509StoreContext. The problem is that the __init__ function calls self._init() then later the function verify_certificate calls _init() again. In spite of the disclaimer int __init__ about "no adverse effect", the adverse effect here is that if one does two calls to X509_STORE_CTX_init on the same X509_STORE_CTX without any intervening calls to X509_STORE_CTX_cleanup on that same X509_STORE_CTX it will leak one X509_VERIFY_PARAM and one X509_VERIFY_PARAM_ID. Here is most of the relevant class: class X509StoreContext(object): """ An X.509 store context. An X.509 store context is used to carry out the actual verification process of a certificate in a described context. For describing such a context, see :class:`X509Store`. :ivar _store_ctx: The underlying X509_STORE_CTX structure used by this instance. It is dynamically allocated and automatically garbage collected. :ivar _store: See the ``store`` ``__init__`` parameter. :ivar _cert: See the ``certificate`` ``__init__`` parameter. :param X509Store store: The certificates which will be trusted for the purposes of any verifications. :param X509 certificate: The certificate to be verified. """ def __init__(self, store, certificate): store_ctx = _lib.X509_STORE_CTX_new() self._store_ctx = _ffi.gc(store_ctx, _lib.X509_STORE_CTX_free) self._store = store self._cert = certificate # Make the store context available for use after instantiating this # class by initializing it now. Per testing, subsequent calls to # :meth:`_init` have no adverse affect. self._init() def _init(self): """ Set up the store context for a subsequent verification operation. """ Set up the store context for a subsequent verification operation. """ ret = _lib.X509_STORE_CTX_init( self._store_ctx, self._store._store, self._cert._x509, _ffi.NULL ) if ret <= 0: _raise_current_error() def _cleanup(self): """ Internally cleans up the store context. The store context can then be reused with a new call to :meth:`_init`. """ _lib.X509_STORE_CTX_cleanup(self._store_ctx) def _exception_from_context(self): """ Convert an OpenSSL native context error failure into a Python exception. When a call to native OpenSSL X509_verify_cert fails, additional information about the failure can be obtained from the store context. """ errors = [ _lib.X509_STORE_CTX_get_error(self._store_ctx), _lib.X509_STORE_CTX_get_error_depth(self._store_ctx), _native(_ffi.string(_lib.X509_verify_cert_error_string( _lib.X509_STORE_CTX_get_error(self._store_ctx)))), ] # A context error should always be associated with a certificate, so we # expect this call to never return :class:`None`. _x509 = _lib.X509_STORE_CTX_get_current_cert(self._store_ctx) _cert = _lib.X509_dup(_x509) pycert = X509.__new__(X509) pycert._x509 = _ffi.gc(_cert, _lib.X509_free) return X509StoreContextError(errors, pycert) def set_store(self, store): """ Set the context's X.509 store. .. versionadded:: 0.15 :param X509Store store: The store description which will be used for the purposes of any *future* verifications. """ self._store = store def verify_certificate(self): """ Verify a certificate in a context. .. versionadded:: 0.15 :raises X509StoreContextError: If an error occurred when validating a certificate in the context. Sets ``certificate`` attribute to indicate which certificate caused the error. """ # Always re-initialize the store context in case # :meth:`verify_certificate` is called multiple times. self._init() ret = _lib.X509_verify_cert(self._store_ctx) self._cleanup() if ret <= 0: raise self._exception_from_context() ---------- messages: 318927 nosy: timboddy priority: normal severity: normal status: open title: Memory leak in X509StoreContext class. type: resource usage versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 10:34:49 2018 From: report at bugs.python.org (=?utf-8?q?Sigurd_Lj=C3=B8dal?=) Date: Thu, 07 Jun 2018 14:34:49 +0000 Subject: [New-bugs-announce] [issue33796] dataclasses.replace broken with class variables Message-ID: <1528382089.85.0.592728768989.issue33796@psf.upfronthosting.co.za> New submission from Sigurd Lj?dal : The dataclasses.replace function does not work for classes that have class variables. See the console output below for an example. $ python Python 3.7.0b5+ (heads/3.7:3c417610ad, Jun 7 2018, 16:21:29) [Clang 9.1.0 (clang-902.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import typing >>> import dataclasses >>> @dataclasses.dataclass(frozen=True) ... class Test: ... a: int ... class_var: typing.ClassVar[str] = 'foo' ... >>> obj = Test(a=1) >>> dataclasses.replace(obj, a=2) Traceback (most recent call last): File "", line 1, in File "/Users/sigurdljodal/.pyenv/versions/3.7-dev/lib/python3.7/dataclasses.py", line 1179, in replace return obj.__class__(**changes) TypeError: __init__() got an unexpected keyword argument 'class_var' ---------- messages: 318942 nosy: sigurd priority: normal severity: normal status: open title: dataclasses.replace broken with class variables versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 12:32:41 2018 From: report at bugs.python.org (Brad Bishop) Date: Thu, 07 Jun 2018 16:32:41 +0000 Subject: [New-bugs-announce] [issue33797] json int encoding incorrect for dbus.Byte Message-ID: <1528389161.29.0.592728768989.issue33797@psf.upfronthosting.co.za> New submission from Brad Bishop : JSON does not correctly encode dbus.Byte from dbus-python on 2.7: dbus.Byte is a subclass of int with its own __str__ implementation. >>> import json >>> import dbus >>> json.dumps(dbus.Byte(0)) '\x00' On 3.x: >>> import json >>> import dbus >>> json.dumps(dbus.Byte(0)) '0' This seems to have been fixed in 3.x here: https://bugs.python.org/issue18264 and subsequently: https://bugs.python.org/issue26719 I'm interested in backporting these but they are marked as enhancements. However a backport for a similar issue: https://bugs.python.org/issue27934 was accepted. Would the maintainers be amenable to a backport of 18264 & 26719? ---------- components: Library (Lib) messages: 318954 nosy: radsquirrel priority: normal severity: normal status: open title: json int encoding incorrect for dbus.Byte type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 15:12:49 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Thu, 07 Jun 2018 19:12:49 +0000 Subject: [New-bugs-announce] [issue33798] Fix csv module comment regarding dict insertion order Message-ID: <1528398769.16.0.592728768989.issue33798@psf.upfronthosting.co.za> New submission from Andr?s Delfino : The csv module says "Python?s dict objects are not ordered". PR fixes this , leaving a comment on the rationale. ---------- assignee: docs at python components: Documentation messages: 318961 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Fix csv module comment regarding dict insertion order type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 15:28:00 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Thu, 07 Jun 2018 19:28:00 +0000 Subject: [New-bugs-announce] [issue33799] Remove non-ordered dicts comments from FAQ Message-ID: <1528399680.16.0.592728768989.issue33799@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Both Design and Programming sections have comments related to the non-ordered dict implementation. PR removes those comments. ---------- assignee: docs at python components: Documentation messages: 318964 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Remove non-ordered dicts comments from FAQ versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 16:01:29 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Thu, 07 Jun 2018 20:01:29 +0000 Subject: [New-bugs-announce] [issue33800] Fix default argument for parameter dict_type of ConfigParser/RawConfigParser Message-ID: <1528401689.57.0.592728768989.issue33800@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Default argument of parameter dict_type of ConfigParser/RawConfigParser is shown as "collections.OrderedDict", while it recently migrated to "dict". PR fixes this, documents the change to dict, and fixes a versionchanged changed directive in "items" with wrong indentation. ---------- assignee: docs at python components: Documentation messages: 318968 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Fix default argument for parameter dict_type of ConfigParser/RawConfigParser type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 16:12:56 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Thu, 07 Jun 2018 20:12:56 +0000 Subject: [New-bugs-announce] [issue33801] Remove non-ordered dict comment from plistlib Message-ID: <1528402376.25.0.592728768989.issue33801@psf.upfronthosting.co.za> New submission from Andr?s Delfino : plistlib documentation says: "The exact structure of the plist can be recovered by using collections.OrderedDict (although the order of keys shouldn't be important in plist files)" This is no longer necessary, since dict objects preserve insertion order. PR changes this. ---------- assignee: docs at python components: Documentation messages: 318969 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Remove non-ordered dict comment from plistlib type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 19:00:35 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 07 Jun 2018 23:00:35 +0000 Subject: [New-bugs-announce] [issue33802] Regression in logging configuration Message-ID: <1528412435.4.0.592728768989.issue33802@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : This looks like a serious regression in 3.7. @ned.deily - I'm marking this as a release blocker, but feel free of course to downgrade it. Run the following as $ python3.6 badconfig.py Hey, it works! $ python3.7 badconfig.py Traceback (most recent call last): File "../badconfig.py", line 77, in fileConfig(inifile.name, defaults=GUNICORN_DEFAULTS) File "/Users/barry/projects/python/cpython/Lib/logging/config.py", line 65, in fileConfig cp = configparser.ConfigParser(defaults) File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 639, in __init__ self._read_defaults(defaults) File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 1212, in _read_defaults self.read_dict({self.default_section: defaults}) File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 754, in read_dict self.set(section, key, value) File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 1200, in set super().set(section, option, value) File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 895, in set value) File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 403, in before_set "position %d" % (value, tmp_value.find('%'))) ValueError: invalid interpolation syntax in "{'generic': {'format': '%(asctime)s [%(process)d] [%(levelname)s] %(message)s', 'datefmt': '[%Y-%m-%d %H:%M:%S %z]', 'class': 'logging.Formatter'}}" at position 26 I'm still investigating, but wanted to get the bug filed asap. ---------- assignee: barry files: badconfig.py keywords: 3.7regression messages: 318980 nosy: barry, ned.deily priority: release blocker severity: normal stage: needs patch status: open title: Regression in logging configuration type: behavior versions: Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47635/badconfig.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 19:44:54 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 07 Jun 2018 23:44:54 +0000 Subject: [New-bugs-announce] [issue33803] contextvars: hamt_alloc() must initialize h_root and h_count fields Message-ID: <1528415094.5.0.592728768989.issue33803@psf.upfronthosting.co.za> New submission from STINNER Victor : test_asyncio started to crash in https://github.com/python/cpython/pull/7487 I debugged the crash with Yury: _PyHAMT_New() triggers indirectly a GC collection at "o->h_root = hamt_node_bitmap_new(0);". Problem: the object that is being created is already tracked by the GC, whereas its h_root field is not set. Then the GC does crash because the field is a random pointer. hamt_alloc() must initialize h_root and h_count before tracking the object in the GC. Thinking about the GC when writing an object constructor is hard :-( Maybe we should add a debug option to trigger the GC more often to make such random bug more likely. contextvars has been implemented a few months ago, and we only spotted the bug a few days before Python 3.7.0 final release... ---------- components: Interpreter Core messages: 318990 nosy: ned.deily, vstinner, yselivanov priority: release blocker severity: normal status: open type: crash versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 7 20:51:37 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 08 Jun 2018 00:51:37 +0000 Subject: [New-bugs-announce] [issue33804] Document the default value of the size parameter of io.TextIOBase.read Message-ID: <1528419097.71.0.592728768989.issue33804@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Documentation of io.TextIOBase.read makes it look like the size parameter is required. Attached PR fixes this. ---------- assignee: docs at python components: Documentation messages: 319003 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Document the default value of the size parameter of io.TextIOBase.read type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 8 04:51:39 2018 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 08 Jun 2018 08:51:39 +0000 Subject: [New-bugs-announce] [issue33805] dataclasses: replace() give poor error message if using InitVar Message-ID: <1528447899.5.0.592728768989.issue33805@psf.upfronthosting.co.za> New submission from Eric V. Smith : If a dataclass contains an InitVar without a default value, that InitVar must be specified in the call to replace(). This is because replace() works by first creating a new object, and InitVars without defaults, by definition, must be specified when creating the object. There is no other source for the value of the InitVar to use. However, the exception you get is confusing: >>> from dataclasses import * >>> @dataclass ... class C: ... i: int ... j: InitVar[int] ... >>> c = C(1, 2) >>> replace(c, i=3) Traceback (most recent call last): File "", line 1, in File "C:\home\eric\local\python\cpython\lib\dataclasses.py", line 1176, in replace changes[f.name] = getattr(obj, f.name) AttributeError: 'C' object has no attribute 'j' >>> This message really should say something like "InitVar 'j' must be specified". ---------- assignee: eric.smith components: Library (Lib) messages: 319036 nosy: eric.smith priority: normal severity: normal status: open title: dataclasses: replace() give poor error message if using InitVar type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 8 08:16:04 2018 From: report at bugs.python.org (Chandrakanth Reddy) Date: Fri, 08 Jun 2018 12:16:04 +0000 Subject: [New-bugs-announce] [issue33806] Cannot re-open an existing telnet session Message-ID: <1528460164.81.0.592728768989.issue33806@psf.upfronthosting.co.za> New submission from Chandrakanth Reddy : i see from the below link it says "cannot re-open an already existing telnet instance" using Telnetlib. Can this be fixed in the later versions of python or is there any work around for this. I'm surprised that this is something which PERL supports and not python . When I try to open a new session which is already opened the telnet server asks whether to open in a.read only or b.read/write mode and when i try to write 'a' it doesn't take and program fails. my code: tn = telnetlib.Telnet(HOST,PORT) print("established connection") print(tn.read_until(">> ".encode('ascii'))) tn.write(("a".encode('ascii'))) output: established connection b'\r\n a. Connect to Port read/write\r\n b. Connect to Port read only\r\n c. Do not connect, drop this connection request\r\n d. Look at port log file\r\n>> ' ---------- messages: 319056 nosy: ckreddy priority: normal severity: normal status: open title: Cannot re-open an existing telnet session type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 8 08:50:54 2018 From: report at bugs.python.org (Suriyaa Sundararuban) Date: Fri, 08 Jun 2018 12:50:54 +0000 Subject: [New-bugs-announce] [issue33807] CONTRIBUTING.rst: 'Stable buildbots' links with 404 errors Message-ID: <1528462254.16.0.592728768989.issue33807@psf.upfronthosting.co.za> Change by Suriyaa Sundararuban : ---------- assignee: docs at python components: Documentation nosy: docs at python, suriyaa priority: normal severity: normal status: open title: CONTRIBUTING.rst: 'Stable buildbots' links with 404 errors type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 8 08:59:14 2018 From: report at bugs.python.org (Dev Sanghani) Date: Fri, 08 Jun 2018 12:59:14 +0000 Subject: [New-bugs-announce] [issue33808] ssl.get_server_certificate fails with openssl 1.1.0 but works with 1.0.2g for self-signed certificate Message-ID: <1528462754.61.0.592728768989.issue33808@psf.upfronthosting.co.za> New submission from Dev Sanghani : Output from Python3.5 with OpenSSL 1.0.2g: >>> ssl.get_server_certificate(('mail.mani.pt', 993), ssl.PROTOCOL_TLSv1) '-----BEGIN CERTIFICATE-----\nMIIDdDCCAlygAwIBAgIILeR0neMYiyUwDQYJKoZIhvcNAQEFBQAwSzELMAkGA1UE\nBhMCUFQxJTAjBgNVBAoTHE1BTkkgSU5kdXN0cmlhcyBQbGFzdGljYXMgU0ExFTAT\nBgNVBAMTDG1haWwubWFuaS5wdDAeFw0xODAxMjIxNDA3MDVaFw0yMjAxMjMxNDA3\nMDVaMEsxCzAJBgNVBAYTAlBUMSUwIwYDVQQKExxNQU5JIElOZHVzdHJpYXMgUGxh\nc3RpY2FzIFNBMRUwEwYDVQQDEwxtYWlsLm1hbmkucHQwggEiMA0GCSqGSIb3DQEB\nAQUAA4IBDwAwggEKAoIBAQDdSCNqjELZGKgjPf0NAwHmmR6ZUzDpt2HOwA+97DOP\nWwJ5NOYGeJzhM/yw+P/yAWKB8HzJO6CKCfwe4ilEVxcikK7Gj/rVqfzRb+hWTWC9\nr8lPzWCa3siNdf/rieONz2LR0d/Qf8Uml5NFJ3UkJAo5TZbWizjcLO4/mPrVysau\n5S4yE9pW8dkhENs/IVLce5cjn0WwMQvFntX1x303tAlyC362JEInHePxPmGmDDMo\n3sgBYziv90LlsOviJIbpju5/A1P9r0uXzDQmudZZPqlFHjqNXcdprfVyTgg/C4xQ\nE1UbSL8uIW0CVj9TxXp4njaIC/sr97ptJU/86isFveKBAgMBAAGjXDBaMB0GA1Ud\nDgQWBBSt1Z9m+CaYG+nf39Ty0TqabcaE4TALBgNVHQ8EBAMCArwwEwYDVR0lBAww\nCgYIKwYBBQUHAwEwFwYDVR0RBBAwDoIMbWFpbC5tYW5pLnB0MA0GCSqGSIb3DQEB\nBQUAA4IBAQBk7DQ/+1pYE+0yoHNChFVztjjJASQSas6DaPx9FOFYrPhh9lU5NmBy\nHIzMUHTlkgw/OE713+mPRlxegZWceA7akirhaWocQcOCXzeIQKNouMZ/4ktXIoqY\nmdcYVOS2Et+FBBT1+rAA6OMTDftCRPH/19stA7IcwWo+6GVLWIqCk/2lBNNYrZ0V\nMvwxQeeHcCz5HdU2o0ypROvkhG8Er5qGVeHAv+JCj+Q4EERMoDwocwS8eedwqqPe\nLVCWwSqS8SEizDRNZZfOoXT4AJ/L10RLrnz8wtSffoxS2pZMbhHEBr3WhA72v94L\nCDU+vO9t1YN3WpXeRZfKWLw/qEE8b65H\n-----END CERTIFICATE-----\n' Output from Python3.6 with OpenSSL 1.1.0: >>> ssl.get_server_certificate(('mail.mani.pt', 993), ssl.PROTOCOL_TLSv1) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/ssl.py", line 1223, in get_server_certificate with context.wrap_socket(sock) as sslsock: File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket _context=self, _session=session) File "/usr/lib/python3.6/ssl.py", line 814, in __init__ self.do_handshake() File "/usr/lib/python3.6/ssl.py", line 1068, in do_handshake self._sslobj.do_handshake() File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() OSError: [Errno 0] Error ---------- assignee: christian.heimes components: SSL messages: 319059 nosy: christian.heimes, dsanghan priority: normal severity: normal status: open title: ssl.get_server_certificate fails with openssl 1.1.0 but works with 1.0.2g for self-signed certificate type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 8 11:52:20 2018 From: report at bugs.python.org (Ulrich Petri) Date: Fri, 08 Jun 2018 15:52:20 +0000 Subject: [New-bugs-announce] [issue33809] Expose `capture_locals` parameter in `traceback` convenience functions Message-ID: <1528473140.44.0.592728768989.issue33809@psf.upfronthosting.co.za> New submission from Ulrich Petri : Since 3.5 the internal machinery of the `traceback` module has gained the very useful ability to capture locals. It would be useful to also expose that ability through the various convenience functions. ---------- components: Library (Lib) messages: 319079 nosy: ulope priority: normal severity: normal status: open title: Expose `capture_locals` parameter in `traceback` convenience functions versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 8 17:53:38 2018 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 08 Jun 2018 21:53:38 +0000 Subject: [New-bugs-announce] [issue33810] Remove unused code in datetime module Message-ID: <1528494818.43.0.592728768989.issue33810@psf.upfronthosting.co.za> New submission from Alexander Belopolsky : Since implementation of issue 25283, the objects returned by time.localtime always have tm_zone and tm_gmtoff attributes, but the datetime module still has code that anticipates these attributes to be missing. [1] [1]: https://github.com/python/cpython/blob/1cbdb2208aa309cf288ee0b53f0ecd85279bb934/Lib/datetime.py#L1763 ---------- assignee: belopolsky components: Extension Modules, Library (Lib) messages: 319110 nosy: belopolsky priority: normal severity: normal stage: needs patch status: open title: Remove unused code in datetime module type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 8 18:53:47 2018 From: report at bugs.python.org (Lisa Guo) Date: Fri, 08 Jun 2018 22:53:47 +0000 Subject: [New-bugs-announce] [issue33811] asyncio accepting connection limit Message-ID: <1528498427.18.0.592728768989.issue33811@psf.upfronthosting.co.za> New submission from Lisa Guo : https://bugs.python.org/issue27906 describes a situation where accept rate of connection is too slow for use cases where spikes of incoming connection warrants fast accept. The fix for that was to accept socket connection in a tight loop until it reaches "backlog" connections. This doesn't work very well in a web server scenario where we have many processes listening on the same socket. Each process should not accept up to "backlog" connections, for better load balancing among processes. It would be ideal if this is a separate argument for the server configuration so that the application can decide up to how many connections it is willing to accept in the loop, independent of the backlog parameter for listen() system call. Let me know if this makes sense. Lisa ---------- messages: 319116 nosy: lguo priority: normal severity: normal status: open title: asyncio accepting connection limit type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 8 20:02:26 2018 From: report at bugs.python.org (Alexander Belopolsky) Date: Sat, 09 Jun 2018 00:02:26 +0000 Subject: [New-bugs-announce] [issue33812] Different behavior betwee Message-ID: <1528502546.8.0.592728768989.issue33812@psf.upfronthosting.co.za> Change by Alexander Belopolsky : ---------- nosy: belopolsky priority: normal severity: normal status: open title: Different behavior betwee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 9 12:46:24 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 09 Jun 2018 16:46:24 +0000 Subject: [New-bugs-announce] [issue33813] Update overdue 'Deprecated ... removed in 3.x' messages Message-ID: <1528562784.89.0.592728768989.issue33813@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Reported on python-list by Vincent Vande Vivre. """ In Python-3.7.0b5 we can find at the end of html/parser.py: def unescape(self, s): warnings.warn('The unescape method is deprecated and will be removed ' 'in 3.5, use html.unescape() instead.', DeprecationWarning, stacklevel=2) return unescape(s) """ At minimum, /3.5/3.8 or after/ Since we often do not remove when we say we will, perhaps 'or after' should be routine. ---------- messages: 319156 nosy: ezio.melotti, terry.reedy priority: normal severity: normal status: open title: Update overdue 'Deprecated ... removed in 3.x' messages _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 9 12:50:20 2018 From: report at bugs.python.org (Dan Snider) Date: Sat, 09 Jun 2018 16:50:20 +0000 Subject: [New-bugs-announce] [issue33814] exec() maybe has a memory leak Message-ID: <1528563020.57.0.592728768989.issue33814@psf.upfronthosting.co.za> New submission from Dan Snider : Sort of because I'm really not sure if it's working as intended or not. When I found this out today, I noticed that the documentation of `exec` has been updated since the last time I saw it, which is good, but it still leaves much to be desired. Specifically, I don't feel it does enough to explain the supposed justification for `exec`'s ability to very easily trigger a catastrophic memory leak someone unfamiliar with the code they're working on may never have the patience (if not time) to track down.. An illustration: import itertools import sys import weakref def noleak(): def outer(): from itertools import repeat as reeeee def f(): return reeeee(1, 1) return f f = outer() c = sys.getrefcount(f) return c, weakref.ref(f), sys.getrefcount(itertools.repeat) def leaks(): ns = {} co = ('from itertools import repeat as reeeee\n' 'def f(): return reeeee(1, 1)') pre = sys.getrefcount(ns) exec(co, ns) pos = sys.getrefcount(ns) return (pre, pos), weakref.ref(ns['f']), sys.getrefcount(itertools.repeat) for i in range(10): leaks() for i in range(10): noleak() Perhaps I'm wrong in thinking that this is behaving as intended and it actually is a bug. Starting from builtin_exec_impl I got as far as _PyFrame_New_NoTrack before I threw up my hands and decided this is something for someone else. If `exec` with only a `globals` argument is indeed working as intended, I still think it's ridiculous that every item added to that dict has an "extra", non-obvious reference count that is impossible to vanquish of from within Python. I intuited leaving `locals` blank will do what usually happens when functions take optional arguments, and *usually* that is *not* the triggering of a "hidden" memory leak. Perhaps the only solution here is to deprecate `exec` accepting `globals` and `locals` as optional arguments. ---------- assignee: docs at python components: Documentation, Interpreter Core messages: 319157 nosy: bup, docs at python priority: normal severity: normal status: open title: exec() maybe has a memory leak versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 9 13:44:10 2018 From: report at bugs.python.org (Varada) Date: Sat, 09 Jun 2018 17:44:10 +0000 Subject: [New-bugs-announce] [issue33815] List a = []*19 doesn't create a list with index length of 19 Message-ID: <1528566250.8.0.592728768989.issue33815@psf.upfronthosting.co.za> New submission from Varada : Hi, As per my understanding, a = [0]*19 -> creates a list of length 19 with all zeros, >>> a = [0]*19 >>> print (len(a)) 19 >>> a [18] = 2 >>> print (a) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2] >>> In the similar way, >>> a = []*19 --> Must create a blank list with length 19. That is eventhough the contents of the list would be blank or null, I would at least expect the length of the list must 19 and the index must have got memory allocated so I can access it later ? Otherwise, if a = []*19 is going to return length as 0, and it's index cannot be accessed then what difference does it have with a = []. Aren't they the same ? There should be some significance of using a = []*19 compared to a = []. They cant the the same, can they ? >>> a = []*19 >>> a [18] = 2 Traceback (most recent call last): File "", line 1, in IndexError: list assignment index out of range >>> print (len(a)) 0 >>> >>> b = [] >>> print (len(b)) 0 >>> b [18] = 2 Traceback (most recent call last): File "", line 1, in IndexError: list assignment index out of range >>> ----- Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> ---------- components: Windows messages: 319163 nosy: paul.moore, steve.dower, tim.golden, varada86, zach.ware priority: normal severity: normal status: open title: List a = []*19 doesn't create a list with index length of 19 type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 9 13:59:20 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 09 Jun 2018 17:59:20 +0000 Subject: [New-bugs-announce] [issue33816] New metaclass example for Data Model topic Message-ID: <1528567160.68.0.592728768989.issue33816@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Since Python 3.6, when PEP 520 was accepted, class attribute definition order is preserved. That alone is sufficient to replace the example, but then 3.7 came with guaranteed dictionary insertion order. The metaclass example uses OrderedDict, what may cause confusing to new programmers, since it is not needed. I'm creating this issue in case someone who actually has used metaclasses can come up with an example, but I'll try to find/think of an example myself. ---------- assignee: docs at python components: Documentation messages: 319166 nosy: adelfino, docs at python priority: normal severity: normal status: open title: New metaclass example for Data Model topic type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 9 16:36:16 2018 From: report at bugs.python.org (Tey) Date: Sat, 09 Jun 2018 20:36:16 +0000 Subject: [New-bugs-announce] [issue33817] PyString_FromFormatV() fails to build empty strings Message-ID: <1528576576.56.0.592728768989.issue33817@psf.upfronthosting.co.za> New submission from Tey : Making PyString_FromFormatV() build an empty string on 2.7 will fail and raise the following error: SystemError: Objects/stringobject.c:3903: bad argument to internal function It does not matter if format is empty or not (e.g., both PyString_FromFormat("") and PyString_FromFormat("%s", "")). The exception is raised from _PyString_Resize() (called at the end of PyString_FromFormatV()), because the string given to that method has a ref count different than 1. This is expected for empty strings, because PyString_FromStringAndSize() returns a reference to when is 0. A possible fix would be to prevent the call to _PyString_Resize() from PyString_FromFormatV() if is equal to , or if there is no need to resize the string. Python 3 versions before 3.6 might be impacted as well through PyBytes_FromFormatV() (cannot check). The following code can be used to trigger the bug: static int dobug(const char *fmt, ...) { va_list args; va_start(args, fmt); PyObject *str = PyString_FromFormatV(fmt, args); va_end(args); if(str == NULL) { fprintf(stderr, "Error: PyString_FromFormatV(%s) returned NULL\n", fmt); return -1; } Py_DECREF(str); return 0; } static PyObject* bug(PyObject *self) { fprintf(stderr, "dobug(\"\") => %d\n", dobug("")); fprintf(stderr, "dobug(\"%%s\", \"\") => %d\n", dobug("%s", "")); if(PyErr_Occurred()) return NULL; Py_RETURN_NONE; } ---------- components: Interpreter Core messages: 319180 nosy: Tey priority: normal severity: normal status: open title: PyString_FromFormatV() fails to build empty strings type: behavior versions: Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 10 02:35:52 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 10 Jun 2018 06:35:52 +0000 Subject: [New-bugs-announce] [issue33818] Make PyExceptionClass_Name returning a const string Message-ID: <1528612552.69.0.592728768989.issue33818@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : PyExceptionClass_Name() returns just the tp_name field, a pointer to immutable char array. tp_name had type "char *" in old Python versions, but it was changed to "const char *" in revision af68c874a6803b4e90b616077a602c0593719a1d. But PyExceptionClass_Name() still casts tp_name to "char *". I think it would be better to return "const char *". It would be a breaking change, but seems most third-party code uses the result of PyExceptionClass_Name() in context where "const char *" is acceptable [1], and it is easy to add "const" in a variable declaration if the result is assigned to a variable (as in both cases of using PyExceptionClass_Name() in the CPython core). Since several similar breaking changes were made in 3.7 (isee ssue28761 and issue28769), it would be nice to made this change in 3.7 too. But it may be too late for 3.7. [1] https://github.com/search?q=PyExceptionClass_Name&type=Code ---------- components: Interpreter Core messages: 319200 nosy: ned.deily, serhiy.storchaka priority: normal severity: normal status: open title: Make PyExceptionClass_Name returning a const string type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 10 09:13:06 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 10 Jun 2018 13:13:06 +0000 Subject: [New-bugs-announce] [issue33819] Mention "ordered mapping" instead of "ordered dictionary" in email module Message-ID: <1528636386.67.0.592728768989.issue33819@psf.upfronthosting.co.za> New submission from Andr?s Delfino : IMHO, we should replace the "ordered dictionary" with "ordered mapping" now that regular dictionaries are ordered. I'm proposing "ordered mapping" instead of "dictionary" because there's no actual dictionary behind; it's just a "conceptual model". PR changes this. ---------- assignee: docs at python components: Documentation messages: 319218 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Mention "ordered mapping" instead of "ordered dictionary" in email module versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 10 13:31:50 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jun 2018 17:31:50 +0000 Subject: [New-bugs-announce] [issue33820] IDLE subsection of What's New 3.6 Message-ID: <1528651910.74.0.592728768989.issue33820@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Master issue for future IDLE entries in Doc/whatsnew/3.6.rst. This doc has a section 'Improved Modules' with a subsection 'idlelib and IDLE' with subsubsections 'New in 3.6.z:'. This issue starts with 3.6.6. It will close after the last 3.6 maintenance release. This file also exists in the master (3.8) and 3.7 branches. Changes are applied to master and backported to 3.7 and 3.6. Normally, entries are the same as in What's New 3.8 and 3.7, but those files do not exist in 3.6. Hence each file needs different backport. Hence separate PRs are needed for auto backport to work. ---------- assignee: terry.reedy components: IDLE messages: 319223 nosy: terry.reedy priority: normal severity: normal status: open title: IDLE subsection of What's New 3.6 versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 10 13:32:06 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jun 2018 17:32:06 +0000 Subject: [New-bugs-announce] [issue33821] IDLE subsection of What's New 3.7 Message-ID: <1528651926.75.0.592728768989.issue33821@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Following #33820, master issue for future IDLE entries in Doc/whatsnew/3.7.rst. This doc has a section 'Improved Modules' with a subsection 'idlelib and IDLE'. The initial unlabeled subsubsection includes important enhancements to IDLE since 3.6.0. This issue starts with the last of these. Because of IDLE's special backport policy, PEP 434, this initial part concludes with "The changes above have been backported to 3.6 maintenance releases." Future subsubsections 'New in 3.7.z:', z >= 1, will follow for backport to 3.7.z. It will close after the last 3.7 maintenance release. This file also exists in the master (currently 3.8) branch. Changes are applied to master and backported to 3.7. Normally, entries will be the same as in What's New , but this will not exist in 3.6. Hence each What's New file needs different backports. Hence separate PRs are needed for auto backport to work. It seems convenient to have separate issues for each. ---------- assignee: terry.reedy components: IDLE messages: 319224 nosy: terry.reedy priority: normal severity: normal status: open title: IDLE subsection of What's New 3.7 versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 10 13:32:26 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 10 Jun 2018 17:32:26 +0000 Subject: [New-bugs-announce] [issue33822] IDLE subsection of What's New 3.8 Message-ID: <1528651946.69.0.592728768989.issue33822@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Following #33821, master issue for IDLE entries in Doc/whatsnew/3.8.rst. This doc has a section 'Improved Modules' with a subsection 'idlelib and IDLE'. The initial unlabeled subsubsection includes important enhancements to IDLE since 3.7.0. Because of IDLE's special backport policy (PEP 434), this initial part concludes with "The changes above have been backported to 3.7 maintenance releases." Future subsubsections 'New in 3.8.z:', z >= 1, will follow for backports to 3.8.z. This issue will close after the last 3.8 maintenance release. This file will always exists in the master branch. Changes are applied to master and backported as needed at the time. Entries will be the same in the What's New x.y for all x.y branches that get the enhancement. However, each file needs different backports. Hence separate PRs are needed for auto backport to work. It seems convenient to have separate issues for each. ---------- assignee: terry.reedy components: IDLE messages: 319225 nosy: terry.reedy priority: normal severity: normal status: open title: IDLE subsection of What's New 3.8 versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 10 14:05:17 2018 From: report at bugs.python.org (Python++) Date: Sun, 10 Jun 2018 18:05:17 +0000 Subject: [New-bugs-announce] [issue33823] A BUG in concurrent/asyncio Message-ID: <1528653917.32.0.592728768989.issue33823@psf.upfronthosting.co.za> New submission from Python++ : ProcessPoolExecutor cannot specify the number of cores when running the Muti-Sub Event Loops, which results in the resulting statistics of the last code run cannot be promised to be separated. I'm deep hoping some genius can propose a solution and fix these problems. ---------- components: asyncio messages: 319229 nosy: Python++, asvetlov, yselivanov priority: normal severity: normal status: open title: A BUG in concurrent/asyncio type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 10 15:35:37 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 10 Jun 2018 19:35:37 +0000 Subject: [New-bugs-announce] [issue33824] Settign LANG=C modifies the --version behavior Message-ID: <1528659337.7.0.592728768989.issue33824@psf.upfronthosting.co.za> New submission from Miro Hron?ok : On 3.6, setting LANG to C did not affect the --version behavior: $ python3.6 --version Python 3.6.5 $ LANG=C python3.6 --version Python 3.6.5 On 3.7.0b5 it does. $ python3.7 --version Python 3.7.0b5 $ LANG=C python3.7 --version Python 3.7.0b5 (default, Jun 1 2018, 03:54:41) [GCC 8.1.1 20180502 (Red Hat 8.1.1-1)] My locale: LANG=cs_CZ.utf8 LC_CTYPE="cs_CZ.utf8" LC_NUMERIC="cs_CZ.utf8" LC_TIME="cs_CZ.utf8" LC_COLLATE="cs_CZ.utf8" LC_MONETARY="cs_CZ.utf8" LC_MESSAGES="cs_CZ.utf8" LC_PAPER="cs_CZ.utf8" LC_NAME="cs_CZ.utf8" LC_ADDRESS="cs_CZ.utf8" LC_TELEPHONE="cs_CZ.utf8" LC_MEASUREMENT="cs_CZ.utf8" LC_IDENTIFICATION="cs_CZ.utf8" LC_ALL= BTW I'm running Fedora builds of Python, where we have PEP 538 on 3.6 as well https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale ---------- messages: 319238 nosy: hroncok priority: normal severity: normal status: open title: Settign LANG=C modifies the --version behavior type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 10 21:52:46 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Mon, 11 Jun 2018 01:52:46 +0000 Subject: [New-bugs-announce] [issue33825] Change mentions of "magic" attributes to "special" Message-ID: <1528681966.39.0.592728768989.issue33825@psf.upfronthosting.co.za> New submission from Andr?s Delfino : PR makes all documentation use the same term. ---------- assignee: docs at python components: Documentation messages: 319263 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Change mentions of "magic" attributes to "special" versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 02:16:36 2018 From: report at bugs.python.org (Thomas Viehmann) Date: Mon, 11 Jun 2018 06:16:36 +0000 Subject: [New-bugs-announce] [issue33826] enable discovery of class source code in IPython interactively defined classes Message-ID: <1528697796.87.0.592728768989.issue33826@psf.upfronthosting.co.za> New submission from Thomas Viehmann : Hello, thank you for Python! In IPython (or Jupyter), `inspect.getsource` is able to retrieve the source code for functions but not classes. The fundamental reason is that for functions, a "filename" (input reference rather) is available via fn.__code__.co_filename, while for classes, there is no equivalent (and __module__ is __main__, so no "filename" there). This could be helped by providing a "__filename__" (or however named) attribute in classes. Some digging in the Python code suggests that Python/bltinmodule.c might be a good place to resolve this, namely in function builtin___build_class__. In there, there is the func object and so ((PyCodeObject*) PyFunction_GET_CODE(func))->co_filename has the filename. Then one would copy that to an appropriate item in the namespace ns. I do have a patch (against python 3.6), but as this is my first attempt at digging in the internals, it is probably more than just a bit raw (I see test failures in test_dbm test_lib2to3 test_pydoc test_site, at least test_pydoc is due to the patch). Best regards Thomas ---------- components: Interpreter Core, Library (Lib) files: class-filename.diff keywords: patch messages: 319274 nosy: t-vi priority: normal severity: normal status: open title: enable discovery of class source code in IPython interactively defined classes type: enhancement versions: Python 3.8 Added file: https://bugs.python.org/file47638/class-filename.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 03:16:13 2018 From: report at bugs.python.org (Michel Albert) Date: Mon, 11 Jun 2018 07:16:13 +0000 Subject: [New-bugs-announce] [issue33827] Generators with lru_cache can be non-intuituve Message-ID: <1528701373.03.0.592728768989.issue33827@psf.upfronthosting.co.za> New submission from Michel Albert : Consider the following code: # filename: foo.py from functools import lru_cache @lru_cache(10) def bar(): yield 10 yield 20 yield 30 # This loop will work as expected for row in bar(): print(row) # This loop will not loop over anything. # The cache will return an already consumed generator. for row in bar(): print(row) This behaviour is natural, but it is almost invisible to the caller of "foo". The main issue is one of "surprise". When inspecting the output of "foo" it is clear that the output is a generator: >>> import foo >>> foo.bar() **Very** careful inspection will reveal that each call will return the same generator instance. So to an observant user the following is an expected behaviour: >>> result = foo.bar() >>> for row in result: ... print(row) ... 10 20 30 >>> for row in result: ... print(row) ... >>> However, the following is not: >>> import foo >>> result = foo.bar() >>> for row in result: ... print(row) ... 10 20 30 >>> result = foo.bar() >>> for row in result: ... print(row) ... >>> Would it make sense to emit a warning (or even raise an exception) in `lru_cache` if the return value of the cached function is a generator? I can think of situation where it makes sense to combine the two. For example the situation I am currently in: I have a piece of code which loops several times over the same SNMP table. Having a generator makes the application far more responsive. And having the cache makes it even faster on subsequent calls. But the gain I get from the cache is bigger than the gain from the generator. So I would be okay with converting the result to a list before storing it in the cache. What is your opinion on this issue? Would it make sense to add a warning? ---------- messages: 319279 nosy: exhuma priority: normal severity: normal status: open title: Generators with lru_cache can be non-intuituve type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 04:33:19 2018 From: report at bugs.python.org (Xiang Zhang) Date: Mon, 11 Jun 2018 08:33:19 +0000 Subject: [New-bugs-announce] [issue33828] Add versionchanged notes for string.Formatter Message-ID: <1528705999.65.0.592728768989.issue33828@psf.upfronthosting.co.za> New submission from Xiang Zhang : I propose to add versionchanged note about auto-numbering feature of string.Formatter, introduced in #13598. It's quite confusing which version could I use the feature reading the doc. Also it's better to note in 2.7 the feature is not available. Currently the doc gives me the feeling string.Formatter and str.format share the same feature and the auto-numbering feature is available in 2.7 and >3.1. ---------- assignee: docs at python components: Documentation messages: 319284 nosy: docs at python, eric.smith, xiang.zhang priority: normal severity: normal stage: needs patch status: open title: Add versionchanged notes for string.Formatter versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 05:54:30 2018 From: report at bugs.python.org (=?utf-8?q?Bartosz_Go=C5=82aszewski?=) Date: Mon, 11 Jun 2018 09:54:30 +0000 Subject: [New-bugs-announce] [issue33829] C API: provide new object protocol helper Message-ID: <1528710870.35.0.592728768989.issue33829@psf.upfronthosting.co.za> New submission from Bartosz Go?aszewski : If we want to call an object's method from C code and pass it the args and kwargs tuples unchanged, we need to first retrieve the callable object using PyObject_GetAttrString(), then call it using PyObject_Call(). I would like to propose wrapping the two calls in a new helper. ---------- components: Extension Modules messages: 319288 nosy: Bartosz Go?aszewski priority: normal severity: normal status: open title: C API: provide new object protocol helper type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 06:45:03 2018 From: report at bugs.python.org (Aifu LIU) Date: Mon, 11 Jun 2018 10:45:03 +0000 Subject: [New-bugs-announce] [issue33830] example output error Message-ID: <1528713903.44.0.592728768989.issue33830@psf.upfronthosting.co.za> New submission from Aifu LIU : The output of this line: print r2.status, r2.reason should same as: print r1.status, r1.reason from https://docs.python.org/2.7/library/httplib.html >>> import httplib >>> conn = httplib.HTTPSConnection("www.python.org") >>> conn.request("GET", "/") >>> r1 = conn.getresponse() >>> print r1.status, r1.reason 200 OK >>> data1 = r1.read() >>> conn.request("GET", "/") >>> r2 = conn.getresponse() >>> print r2.status, r2.reason 404 Not Found >>> data2 = r2.read() >>> conn.close() ---------- assignee: docs at python components: Documentation messages: 319290 nosy: Aifu LIU, docs at python priority: normal severity: normal status: open title: example output error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 07:48:15 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Mon, 11 Jun 2018 11:48:15 +0000 Subject: [New-bugs-announce] [issue33831] Make htmlview work in make.bat Message-ID: <1528717695.86.0.592728768989.issue33831@psf.upfronthosting.co.za> New submission from Andr?s Delfino : The start command understands the first quoted string as the window title, so nothing is being executed right now. PR fixes this. ---------- components: Windows messages: 319298 nosy: adelfino, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Make htmlview work in make.bat type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 07:56:31 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Mon, 11 Jun 2018 11:56:31 +0000 Subject: [New-bugs-announce] [issue33832] Make "magic methods" a little more discoverable in the docs Message-ID: <1528718191.62.0.592728768989.issue33832@psf.upfronthosting.co.za> New submission from Andr?s Delfino : PR adds "magic method" to the glossary, and adds a mention in Data Model 3.3. Special method names. ---------- assignee: docs at python components: Documentation messages: 319300 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Make "magic methods" a little more discoverable in the docs type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 09:47:30 2018 From: report at bugs.python.org (twisteroid ambassador) Date: Mon, 11 Jun 2018 13:47:30 +0000 Subject: [New-bugs-announce] [issue33833] ProactorEventLoop raises AssertionError Message-ID: <1528724850.44.0.592728768989.issue33833@psf.upfronthosting.co.za> New submission from twisteroid ambassador : Sometimes when a socket transport under ProactorEventLoop is writing while the peer closes the connection, asyncio logs an AssertionError. Attached is a script that fairly reliably reproduces the behavior on my computer. This is caused by _ProactorBasePipeTransport._force_close() being called between two invocations of _ProactorBaseWritePipeTransport._loop_writing(), where the latter call asserts self._write_fut has not changed after being set by the former call. ---------- components: asyncio files: test_proactor_force_close.py messages: 319302 nosy: asvetlov, twisteroid ambassador, yselivanov priority: normal severity: normal status: open title: ProactorEventLoop raises AssertionError versions: Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47639/test_proactor_force_close.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 10:03:22 2018 From: report at bugs.python.org (twisteroid ambassador) Date: Mon, 11 Jun 2018 14:03:22 +0000 Subject: [New-bugs-announce] [issue33834] Test for ProactorEventLoop logs InvalidStateError Message-ID: <1528725802.67.0.592728768989.issue33834@psf.upfronthosting.co.za> New submission from twisteroid ambassador : When running the built-in regression tests, although test_sendfile_close_peer_in_the_middle_of_receiving on ProactorEventLoop completes successfully, an InvalidStateError is logged. Console output below: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_events.ProactorEventLoopTests) ... Exception in callback _ProactorReadPipeTransport._loop_reading(<_OverlappedF...ne, 64, None)>) handle: )> Traceback (most recent call last): File "\cpython\lib\asyncio\windows_events.py", line 428, in finish_recv return ov.getresult() OSError: [WinError 64] The specified network name is no longer available During handling of the above exception, another exception occurred: Traceback (most recent call last): File "\cpython\lib\asyncio\proactor_events.py", line 255, in _loop_reading data = fut.result() File "\cpython\lib\asyncio\windows_events.py", line 732, in _poll value = callback(transferred, key, ov) File "\cpython\lib\asyncio\windows_events.py", line 432, in finish_recv raise ConnectionResetError(*exc.args) ConnectionResetError: [WinError 64] The specified network name is no longer available During handling of the above exception, another exception occurred: Traceback (most recent call last): File "\cpython\lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) File "\cpython\lib\asyncio\proactor_events.py", line 282, in _loop_reading self._force_close(exc) File "\cpython\lib\asyncio\proactor_events.py", line 117, in _force_close self._empty_waiter.set_exception(exc) concurrent.futures._base.InvalidStateError: invalid state ok ---------- components: asyncio messages: 319303 nosy: asvetlov, twisteroid ambassador, yselivanov priority: normal severity: normal status: open title: Test for ProactorEventLoop logs InvalidStateError type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 11:42:19 2018 From: report at bugs.python.org (X. Yan) Date: Mon, 11 Jun 2018 15:42:19 +0000 Subject: [New-bugs-announce] [issue33835] Too strong side effect? Message-ID: <1528731739.92.0.592728768989.issue33835@psf.upfronthosting.co.za> New submission from X. Yan : I am familiar with quite a few languages such as C++, C, PASCAL, Matlab, etc., but starting to practice Python. When I tested the code: def f(a, L=[]): L.append(a) return L followed by calls as follows, v1 = f(1) v2 = f(2) , to my surprise, I saw the v1's content was changed from initial [1] to [1, 2], when the second call, v2=f(2), was executed. This means when you produce the new value for v2, you have to be very very careful for all the results produced by this function previously, such as what in the v1. They can be changed in the background! I wonder if this side-effect was designed on purpose, or is actually a BUG, because it is too dangerous. ---------- messages: 319308 nosy: xgyan priority: normal severity: normal status: open title: Too strong side effect? type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 11:59:35 2018 From: report at bugs.python.org (Zachary Ware) Date: Mon, 11 Jun 2018 15:59:35 +0000 Subject: [New-bugs-announce] [issue33836] [Good first-time issue] Recommend keyword-only param for memoization in FAQ Message-ID: <1528732775.39.0.592728768989.issue33836@psf.upfronthosting.co.za> New submission from Zachary Ware : In https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects there is an example showing memoization using `def expensive(arg1, arg2, _cache={}):`. We should change the signature in that example to make `_cache` a keyword-only parameter and possibly adjust the comment to note that that's been done to prevent accidental calls with three positional arguments. Note to existing contributors: if this wouldn't be within your first couple of patches, please leave this for a new contributor to find. Thanks! ---------- assignee: docs at python components: Documentation keywords: easy messages: 319310 nosy: docs at python, zach.ware priority: normal severity: normal stage: needs patch status: open title: [Good first-time issue] Recommend keyword-only param for memoization in FAQ versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 11:59:40 2018 From: report at bugs.python.org (Martin Liska) Date: Mon, 11 Jun 2018 15:59:40 +0000 Subject: [New-bugs-announce] [issue33837] Closing asyncio.Server on asyncio.ProactorEventLoop causes all active servers to stop listening Message-ID: <1528732780.1.0.592728768989.issue33837@psf.upfronthosting.co.za> New submission from Martin Liska : When calling asyncio.Server.close, the method calls asyncio.AbstractEventLoop._stop_serving for each of its sockets in turn. The implementation of this method in asyncio.ProactorEventLoop calls the _stop_accept_futures method which seems to cancel "accept" futures of all sockets running on the loop, not just the one that was supposed to be stopped. This means that closing one server closes sockets of all existing servers. With asyncio.SelectorEventLoop there is no such issue. ---------- components: asyncio messages: 319311 nosy: asvetlov, mliska, yselivanov priority: normal severity: normal status: open title: Closing asyncio.Server on asyncio.ProactorEventLoop causes all active servers to stop listening type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 13:49:58 2018 From: report at bugs.python.org (Ivan Konovalov) Date: Mon, 11 Jun 2018 17:49:58 +0000 Subject: [New-bugs-announce] [issue33838] Very slow upload with http.client on Windows when setting timeout Message-ID: <1528739398.2.0.592728768989.issue33838@psf.upfronthosting.co.za> New submission from Ivan Konovalov : Normally, when I upload files using the PUT request I get upload speed of about 100 Mb/s. But as soon as I set the timeout, the speed drops to about 4 Mb/s (can vary depending on the server): # Running on Windows 10, using Python 3.6.5 from io import BytesIO import http.client def upload(timeout=None): test_file = BytesIO(b"0" * 15 * 1024**2) if timeout is not None: conn = http.client.HTTPConnection("httpbin.org", timeout=timeout) else: conn = http.client.HTTPConnection("httpbin.org") conn.request("PUT", "/put", body=test_file) conn.getresponse().read() upload(25) # Painfully slow upload() # Pretty fast This problem seems to only affect Windows. ---------- components: IO, Library (Lib), Windows messages: 319323 nosy: ivknv, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Very slow upload with http.client on Windows when setting timeout type: performance versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 16:09:40 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 11 Jun 2018 20:09:40 +0000 Subject: [New-bugs-announce] [issue33839] IDLE tooltips.py: refactor and add docstrings and tests Message-ID: <1528747780.64.0.592728768989.issue33839@psf.upfronthosting.co.za> New submission from Terry J. Reedy : calltip_w.py code is partly based on tooltip.py. The latter is currently unused. But it is needed, with changes, for squeezer (#1529353). So I would like to see if we can make an improved Tooltip class that can be used or subclassed by both. The current subclasses should be deleted unless actually used. Docstrings should be added to what remains. Then test_tooltip, with 100% coverage, should be added. If needed, code can be changed to make testing easier. ---------- assignee: terry.reedy components: IDLE messages: 319337 nosy: taleinat, terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE tooltips.py: refactor and add docstrings and tests type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 11 17:10:29 2018 From: report at bugs.python.org (Lisa Guo) Date: Mon, 11 Jun 2018 21:10:29 +0000 Subject: [New-bugs-announce] [issue33840] connection limit on listening socket in asyncio Message-ID: <1528751429.93.0.592728768989.issue33840@psf.upfronthosting.co.za> New submission from Lisa Guo : I'd like to re-open the discussion on pause_server/resume_server that's been discussed here: https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!topic/python-tulip/btGHbh5kUUM with PR: https://github.com/python/asyncio/pull/448 We would like to set a max_connection parameters to a listening socket. Whenever it reaches this number with open accepted sockets, it stops accepting new connections until a user request is served, response sent back, and the connection closed. This is useful for a web application where the more user requests accepted and processed in-flight isn't necessarily better for performance. It would be great if we could dynamically change this value as well. Some more detailed behavior: - it can be either a per loop parameter, or per server parameter - the number of currently open accepted connections is counted against this limit - if max connection is reached, remove the listening socket from the loop so it back pressures new connections to kernel and other processes can take them - when total number of accepted connections drops below max connection, put the listening socket back in the loop - it can be dynamically configured but has no effect on currently already accepted connections (useful for graceful shutdown) Lisa ---------- components: asyncio messages: 319347 nosy: asvetlov, lguo, yselivanov priority: normal severity: normal status: open title: connection limit on listening socket in asyncio type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 12 01:47:47 2018 From: report at bugs.python.org (Lev Maximov) Date: Tue, 12 Jun 2018 05:47:47 +0000 Subject: [New-bugs-announce] [issue33841] lock not released in threading.Condition Message-ID: <1528782467.05.0.475983251502.issue33841@psf.upfronthosting.co.za> New submission from Lev Maximov : In `Condition.wait()` the `waiter` lock gets acquired twice, but is released only once (both in timeout and no timeout cases). Is it intentional? ---------- components: Library (Lib) messages: 319365 nosy: lev.maximov priority: normal severity: normal status: open title: lock not released in threading.Condition type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 12 05:34:03 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 12 Jun 2018 09:34:03 +0000 Subject: [New-bugs-announce] [issue33842] Remove tarfile.filemode Message-ID: <1528796043.33.0.475983251502.issue33842@psf.upfronthosting.co.za> New submission from INADA Naoki : ref: #14807, ffa1d0b8d53f426f1f9a0d47f25440b8994c4fb0 tarfile.filemode is deprecated since Python 3.3. And it is not exported by __all__. ---------- components: Library (Lib) messages: 319370 nosy: inada.naoki priority: normal severity: normal status: open title: Remove tarfile.filemode versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 12 05:56:46 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 12 Jun 2018 09:56:46 +0000 Subject: [New-bugs-announce] [issue33843] Remove deprecated stuff in cgi module Message-ID: <1528797406.97.0.475983251502.issue33843@psf.upfronthosting.co.za> New submission from INADA Naoki : ref: * cgi.escape is deprecated since 3.3. 67317750aff37489fd3fa279413ef20450e7c808 * parse_qs and parse_qsl are deprecated since 2008, before 3.0 https://github.com/python/cpython/commit/c469d4c3aa0a66579d1927f0e5d9630b3ea4024f ---------- components: Library (Lib) messages: 319372 nosy: inada.naoki priority: normal severity: normal status: open title: Remove deprecated stuff in cgi module versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 12 09:01:04 2018 From: report at bugs.python.org (Stefan Vasilev) Date: Tue, 12 Jun 2018 13:01:04 +0000 Subject: [New-bugs-announce] [issue33844] Writing capital letters with csvwriter.writerow changes the csv file format Message-ID: <1528808464.61.0.475983251502.issue33844@psf.upfronthosting.co.za> New submission from Stefan Vasilev : import csv csv.writer(open('./file.csv', 'a', newline='')).writerow(['ID', 0]) If you try to open file.csv with Excel on Windows 10 it says: The file format and extension of 'file.csv' don't match. The file could be corrupted or unsafe. Unless you trust its source don't open it. Do you want to open it anyway. When you click 'Yes', another msgbox appears saying: Excel has detected that 'file.csv' is a SYLK file, but cannot load it. Either the file has errors or it is not a SYLK fyle format. Click OK to try to open the file in a different format. When you click on 'OK' it opens it as expected. The strange thing is that if you use the following code, there are no problems opening it: import csv csv.writer(open('./file.csv', 'a', newline='')).writerow(['Id', 0]) ---------- components: Windows messages: 319378 nosy: Stefan Vasilev, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Writing capital letters with csvwriter.writerow changes the csv file format type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 12 11:06:34 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Tue, 12 Jun 2018 15:06:34 +0000 Subject: [New-bugs-announce] [issue33845] Update Doc\make.bat on 2.7 to bring it on par to master version Message-ID: <1528815994.24.0.475983251502.issue33845@psf.upfronthosting.co.za> New submission from Andr?s Delfino : PR makes the necessary changes to make Doc\make.bat the same as the master version, except some small differences. This should help backports. ---------- components: Windows messages: 319392 nosy: adelfino, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Update Doc\make.bat on 2.7 to bring it on par to master version type: enhancement versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 12 14:02:33 2018 From: report at bugs.python.org (Johannes Raggam) Date: Tue, 12 Jun 2018 18:02:33 +0000 Subject: [New-bugs-announce] [issue33846] Misleading error message in urllib.parse.unquote Message-ID: <1528826553.26.0.947875510639.issue33846@psf.upfronthosting.co.za> New submission from Johannes Raggam : urllib.parse.unquote gives an misleading error message when: >>> import urllib >>> urllib.parse.unquote(b'bytesurl') *** TypeError: a bytes-like object is required, not 'str' while: >>> urllib.parse.unquote('texturl') texturl The correct behavior is to pass a string/text object to unquote. But passing a bytes object gives a misleading error message. A fix would be to add an assertion in https://github.com/python/cpython/blob/0250de48199552cdaed5a4fe44b3f9cdb5325363/Lib/urllib/parse.py#L614 like: >>> assert isinstance(string, str) ---------- components: Library (Lib) messages: 319396 nosy: thet priority: normal severity: normal status: open title: Misleading error message in urllib.parse.unquote type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 12 14:44:14 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Tue, 12 Jun 2018 18:44:14 +0000 Subject: [New-bugs-announce] [issue33847] doc: Add '@' operator entry to index Message-ID: <1528829054.17.0.947875510639.issue33847@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Currently, the index only refers to decorators for the @ symbol. PR adds entry for the matrix multiplication operator. ---------- assignee: docs at python components: Documentation messages: 319398 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc: Add '@' operator entry to index type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 12 17:31:51 2018 From: report at bugs.python.org (Johannes Raggam) Date: Tue, 12 Jun 2018 21:31:51 +0000 Subject: [New-bugs-announce] [issue33848] Incomplete format string syntax for Exceptions Message-ID: <1528839111.37.0.947875510639.issue33848@psf.upfronthosting.co.za> New submission from Johannes Raggam : The following is valid Python 2: >>> 'okay {0:s}'.format(Exception('test')) 'okay test' >>> 'okay {0}'.format(Exception('test')) 'okay test' The following fails on Python 3.6: >>> 'okay {0:s}'.format(Exception('test')) Traceback (most recent call last): File "", line 1, in TypeError: unsupported format string passed to Exception.__format__ While this doesn't fail: >>> 'okay {0}'.format(Exception('test')) 'okay test' ---------- components: ctypes messages: 319402 nosy: thet priority: normal severity: normal status: open title: Incomplete format string syntax for Exceptions versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 12 18:24:35 2018 From: report at bugs.python.org (Alexander Belopolsky) Date: Tue, 12 Jun 2018 22:24:35 +0000 Subject: [New-bugs-announce] [issue33849] Caught infinite recursion resets the trace function Message-ID: <1528842275.49.0.947875510639.issue33849@psf.upfronthosting.co.za> New submission from Alexander Belopolsky : Consider the following code: import sys def trace(frame, event, arg): pass def f(): f() sys.settrace(trace) print(sys.gettrace()) try: f() except RuntimeError: pass print(sys.gettrace()) When I run it, I get None Apparently, the infinite recursion somehow resets the trace function. This interferes with the coverage tools. ---------- messages: 319409 nosy: belopolsky priority: normal severity: normal stage: needs patch status: open title: Caught infinite recursion resets the trace function type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 13 04:44:21 2018 From: report at bugs.python.org (=?utf-8?q?Cl=C3=A9ment_Boyer?=) Date: Wed, 13 Jun 2018 08:44:21 +0000 Subject: [New-bugs-announce] [issue33850] Json.dump() bug when using generator Message-ID: <1528879461.56.0.947875510639.issue33850@psf.upfronthosting.co.za> New submission from Cl?ment Boyer : I use a class to write easily json when having generator. ```python class StreamArray(list): def __init__(self, generator): super().__init__() self.generator = generator def __iter__(self): return self.generator def __len__(self): return 1 ``` Below a test comparing json.dump and json.dumps. ``` >>> import json >>> class StreamArray(list): ... def __init__(self, generator): ... super().__init__() ... self.generator = generator ... def __iter__(self): ... return self.generator ... def __len__(self): ... return 1 ... >>> g = (i for i in range(0)) >>> json.dumps({"a": StreamArray(g)}) '{"a": []}' >>> f = open("/tmp/test.json", "w+") >>> g = (i for i in range(0)) >>> json.dump({"a": StreamArray(g)}, f) >>> f.close() >>> print(open("/tmp/test.json").read()) {"a": ]} ``` I don't know if it's me or if there is actually a problem, could you help me ? ---------- components: Library (Lib) messages: 319436 nosy: biloup priority: normal severity: normal status: open title: Json.dump() bug when using generator type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 13 07:25:47 2018 From: report at bugs.python.org (Marius Gedminas) Date: Wed, 13 Jun 2018 11:25:47 +0000 Subject: [New-bugs-announce] [issue33851] 3.7 regression: ast.get_docstring() for a node that lacks a docstring Message-ID: <1528889147.74.0.947875510639.issue33851@psf.upfronthosting.co.za> New submission from Marius Gedminas : Python 3.7 removes an isinstance(node.body[0], Expr) check ast.get_docstring() that makes it crash when you pass in AST nodes of modules or functions that do not have docstrings. Steps to reproduce: - git clone https://github.com/mgedmin/findimports - cd findimports - tox -e py37 The failure looks like this: Traceback (most recent call last): ... File "/home/mg/src/findimports/findimports.py", line 337, in find_imports_and_track_names visitor.visit(root) File "/home/mg/opt/python37/lib/python3.7/ast.py", line 262, in visit return visitor(node) File "/home/mg/src/findimports/findimports.py", line 169, in visitSomethingWithADocstring self.processDocstring(ast.get_docstring(node, clean=False), lineno) File "/home/mg/opt/python37/lib/python3.7/ast.py", line 211, in get_docstring node = node.body[0].value AttributeError: 'Import' object has no attribute 'value' ---------- components: Library (Lib) messages: 319453 nosy: mgedmin priority: normal severity: normal status: open title: 3.7 regression: ast.get_docstring() for a node that lacks a docstring type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 13 09:12:22 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Wed, 13 Jun 2018 13:12:22 +0000 Subject: [New-bugs-announce] [issue33852] doc Remove parentheses from Message-ID: <1528895542.1.0.947875510639.issue33852@psf.upfronthosting.co.za> New submission from Andr?s Delfino : I think the idea of having "list" inside parentheses is to document that in case of sequences, only "one-expression" expression lists are legal. That being said, IMHO, explaining that in actual prose would be better, but removing the parentheses (taking into account that there's a description of what the expected evaluation of sequences subscription expression lists is) is enough, plus, it's the production list term's name. If a prose is considered better, it could read: "If the primary is a sequence, the expression list must be formed by only one expression, and it must evaluate to an integer or a slice (as discussed in the following section)." Couldn't find the original author. It was committed before the move to mercurial, and I don't know if there's a subversion repo still available to see historical changes. ---------- assignee: docs at python components: Documentation messages: 319460 nosy: adelfino, docs at python priority: normal pull_requests: 7295 severity: normal status: open title: doc Remove parentheses from type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 13 11:10:40 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 13 Jun 2018 15:10:40 +0000 Subject: [New-bugs-announce] [issue33853] test_multiprocessing_spawn is leaking memory Message-ID: <1528902640.93.0.947875510639.issue33853@psf.upfronthosting.co.za> New submission from Pablo Galindo Salgado : The test `test_multiprocessing_spawn` is leaking memory according to the x86 Gentoo Refleaks 3.x buildbot: x86 Gentoo Refleaks 3.x http://buildbot.python.org/all/#/builders/1/builds/253 test_multiprocessing_spawn leaked [1, 2, 1] memory blocks, sum=4 1 test failed again: test_multiprocessing_spawn x86 Gentoo Refleaks 3.7 http://buildbot.python.org/all/#/builders/114/builds/135 ---------- components: Tests keywords: buildbot messages: 319471 nosy: pablogsal priority: normal severity: normal status: open title: test_multiprocessing_spawn is leaking memory type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 13 23:50:38 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Thu, 14 Jun 2018 03:50:38 +0000 Subject: [New-bugs-announce] [issue33854] doc Add PEP title in seealso of Built-in Types Message-ID: <1528948238.24.0.947875510639.issue33854@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Add PEP 461 title to Built-in Types seealso. ---------- assignee: docs at python components: Documentation messages: 319493 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Add PEP title in seealso of Built-in Types type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 03:13:13 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 14 Jun 2018 07:13:13 +0000 Subject: [New-bugs-announce] [issue33855] IDLE: Minimally test every non-startup module. Message-ID: <1528960393.44.0.947875510639.issue33855@psf.upfronthosting.co.za> New submission from Terry J. Reedy : For module in idlelib modules: Create test_module from new template.py. Add 'module' to docstring and import. Check other minimal imports. Create instance of each class, with requires('gui') if needed. Add initial coverage of this test. I am also reviewing existing tests. PR initially adds template, 1 new file, and edits 3 others. Needs blurb. I will add more, but will likely break this up into multiple PRs. This should, of course, been done years ago. Reviews welcome, non-Windows test would be good. (Tal, what do you have?) ---------- assignee: terry.reedy components: IDLE messages: 319501 nosy: cheryl.sabella, taleinat, terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: Minimally test every non-startup module. type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 03:43:06 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Thu, 14 Jun 2018 07:43:06 +0000 Subject: [New-bugs-announce] [issue33856] Type "help" is not present on win32 Message-ID: <1528962186.04.0.947875510639.issue33856@psf.upfronthosting.co.za> Change by St?phane Wirtel : ---------- nosy: matrixise priority: normal severity: normal status: open title: Type "help" is not present on win32 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 06:37:39 2018 From: report at bugs.python.org (goron) Date: Thu, 14 Jun 2018 10:37:39 +0000 Subject: [New-bugs-announce] [issue33857] python exception on Solaris : code for hash blake2b was not found Message-ID: <1528972659.33.0.947875510639.issue33857@psf.upfronthosting.co.za> New submission from goron : Hi I'm running python 3.6 on solaris and i'm always getting this error: ERROR:root:code for hash blake2b was not found. ValueError: unsupported hash type blake2b ERROR:root:code for hash blake2s was not found. ValueError: unsupported hash type blake2s I have found that hashlib.so is missing in my library and the error is disappear when commenting out the import to 'blake2b' and 'blake2s' @ hashlib.py Is this issue was fixed in later versions or a patches? What should i do? Thanks ---------- components: Extension Modules messages: 319508 nosy: goron priority: normal severity: normal status: open title: python exception on Solaris : code for hash blake2b was not found type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 07:39:18 2018 From: report at bugs.python.org (aruseni) Date: Thu, 14 Jun 2018 11:39:18 +0000 Subject: [New-bugs-announce] [issue33858] A typo in multiprocessing documentation Message-ID: <1528976358.35.0.947875510639.issue33858@psf.upfronthosting.co.za> New submission from aruseni : https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods > locks created using the fork context cannot be passed to a processes started using the spawn or forkserver start methods ---------- assignee: docs at python components: Documentation messages: 319509 nosy: aruseni, docs at python priority: normal severity: normal status: open title: A typo in multiprocessing documentation versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 08:09:39 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 14 Jun 2018 12:09:39 +0000 Subject: [New-bugs-announce] [issue33859] Spelling mistakes found using aspell Message-ID: <1528978179.87.0.947875510639.issue33859@psf.upfronthosting.co.za> New submission from Karthikeyan Singaravelan : I have found some typos in docs folder using aspell. I have fixed them. The changes are as below : Doc/library/codecs.rst - cypher - cipher Doc/library/email.rst - Protcol - Protocol Doc/library/importlib.rst - abstact - abstract Doc/library/xmlrpc.client.rst - unmarsalling - unmarshalling Doc/license.rst - aheared to - adhered to Doc/using/cmdline.rst - descibed - described Doc/whatsnew/3.3.rst - accumlated - accumulated Doc/whatsnew/3.6.rst - Lollilop - Lollipop Doc/whatsnew/3.7.rst - direcory - directory Find typos - find . -iname '*rst' | xargs -I{} sh -c "aspell --master=en_US --extra-dicts=en_GB --ignore 3 list < {}" | sort | uniq > typos.txt Ignore case tr '[:upper:]' '[:lower:]' < typos.txt | sort | uniq | less This requires manually looking at output of less and then making changes. ---------- assignee: docs at python components: Documentation messages: 319510 nosy: docs at python, xtreak priority: normal severity: normal status: open title: Spelling mistakes found using aspell type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 11:25:56 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Thu, 14 Jun 2018 15:25:56 +0000 Subject: [New-bugs-announce] [issue33860] doc Avoid "ordered dictionary" references now that dictionaries are ordered Message-ID: <1528989956.26.0.947875510639.issue33860@psf.upfronthosting.co.za> New submission from Andr?s Delfino : IMHO, using "ordered dictionaries" references is somewhat confusing now that dictionaries preserve insertion order. PR changes this references to "OrderedDict object". ---------- assignee: docs at python components: Documentation messages: 319523 nosy: adelfino, docs at python priority: normal pull_requests: 7308 severity: normal status: open title: doc Avoid "ordered dictionary" references now that dictionaries are ordered type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 12:59:32 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 14 Jun 2018 16:59:32 +0000 Subject: [New-bugs-announce] [issue33861] Minor improvements of tests for os.path. Message-ID: <1528995572.61.0.947875510639.issue33861@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : When working on a path for issue33721 I have found that some tests for os.path can be improved, and these changes are worth backporting to older versions (3.6+). * Test exists(), lexists(), isdir(), isfile(), islink(), ismount() with bytes paths. * Remove unneeded silencing DeprecationWarning for ismount() with bytes path. * Test common functions with unencodable and undecodable paths. * Minor clean up and refactoring. ---------- components: Tests messages: 319529 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Minor improvements of tests for os.path. type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 13:37:32 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Thu, 14 Jun 2018 17:37:32 +0000 Subject: [New-bugs-announce] [issue33862] doc Fix Enum __members__ type Message-ID: <1528997852.32.0.947875510639.issue33862@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Documentation says __members__ attribute returns an "ordered dictionary" but it returns a mappingproxy instead. PR fixes this. ---------- assignee: docs at python components: Documentation messages: 319532 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Fix Enum __members__ type type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 15:57:49 2018 From: report at bugs.python.org (Ethan Furman) Date: Thu, 14 Jun 2018 19:57:49 +0000 Subject: [New-bugs-announce] [issue33863] Enum doc correction relating to __members__ Message-ID: <1529006269.94.0.947875510639.issue33863@psf.upfronthosting.co.za> New submission from Ethan Furman : Checking the docs for Enum I see that section 8.13.15.3.1 says: `__members__` is an `OrderedDict` which is incorrect. It should say "an ordered dictionary". ---------- messages: 319543 nosy: adelfino, barry, eli.bendersky, ethan.furman priority: normal severity: normal stage: needs patch status: open title: Enum doc correction relating to __members__ versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 17:43:36 2018 From: report at bugs.python.org (Jason Fried) Date: Thu, 14 Jun 2018 21:43:36 +0000 Subject: [New-bugs-announce] [issue33864] collections.abc.ByteString does not register memoryview Message-ID: <1529012616.87.0.947875510639.issue33864@psf.upfronthosting.co.za> New submission from Jason Fried : Looking at the typing Module docs in the section for ByteString This type represents the types bytes, bytearray, and memoryview. But collections.abc.ByteString does not have memoryview registered. Is it because memoryview doesn't support .index()? ---------- assignee: docs at python components: Documentation messages: 319557 nosy: docs at python, fried, lukasz.langa priority: normal severity: normal status: open title: collections.abc.ByteString does not register memoryview type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 20:39:11 2018 From: report at bugs.python.org (Prawin Phichitnitikorn) Date: Fri, 15 Jun 2018 00:39:11 +0000 Subject: [New-bugs-announce] [issue33865] unknown encoding: 874 Message-ID: <1529023151.32.0.947875510639.issue33865@psf.upfronthosting.co.za> New submission from Prawin Phichitnitikorn : This Error " Current thread 0x0000238c (most recent call first): Fatal Python error: Py_Initialize: can?t initialize sys standard streams LookupError: unknown encoding: 874" is cause by mapping of 874 encodling is missing in encodings\aliases.py ---------- components: Unicode files: Capture.PNG messages: 319569 nosy: ezio.melotti, vstinner, winvinc priority: normal severity: normal status: open title: unknown encoding: 874 type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47642/Capture.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 22:47:04 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 15 Jun 2018 02:47:04 +0000 Subject: [New-bugs-announce] [issue33866] Stop using OrderedDict in enum Message-ID: <1529030824.94.0.947875510639.issue33866@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- components: Library (Lib) nosy: inada.naoki priority: normal severity: normal status: open title: Stop using OrderedDict in enum versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 14 23:34:11 2018 From: report at bugs.python.org (natedogith1) Date: Fri, 15 Jun 2018 03:34:11 +0000 Subject: [New-bugs-announce] [issue33867] Module dicts are wiped on module garbage collection Message-ID: <1529033651.78.0.947875510639.issue33867@psf.upfronthosting.co.za> New submission from natedogith1 : When a module is garbage collected, it fills it's __dict__ with None. issue19255 and issue18214 seem to suggest that this was fixed, along with github pull request 7140 (commit 196b0925ca55bf22ffbb97733cff3e63d4fb6e18). However, this still seems to be an issue in 2.7.14 and 3.6.2. >>> import sys >>> a = type(sys)('a') >>> b = a.__dict__ >>> b['__name__'] is None False >>> del a >>> b['__name__'] is None True ---------- components: Interpreter Core messages: 319581 nosy: natedogith1 priority: normal severity: normal status: open title: Module dicts are wiped on module garbage collection type: behavior versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 15 04:53:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 15 Jun 2018 08:53:52 +0000 Subject: [New-bugs-announce] [issue33868] test__xxsubinterpreters: test_subinterpreter() fails randomly on AMD64 Ubuntu Shared 3.x Message-ID: <1529052832.87.0.947875510639.issue33868@psf.upfronthosting.co.za> New submission from STINNER Victor : AMD64 Ubuntu Shared 3.x: http://buildbot.python.org/all/#/builders/141/builds/98 Run tests in parallel using 2 child processes ... 0:21:40 load avg: 3.69 [352/417/1] test__xxsubinterpreters failed -- running: test_concurrent_futures (2 min 35 sec) ... ====================================================================== FAIL: test_subinterpreter (test.test__xxsubinterpreters.IsRunningTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test__xxsubinterpreters.py", line 480, in test_subinterpreter self.assertTrue(interpreters.is_running(interp)) AssertionError: False is not true test__xxsubinterpreters passed when run again in verbose mode. ---------- assignee: eric.snow components: Tests messages: 319597 nosy: eric.snow, vstinner priority: normal severity: normal status: open title: test__xxsubinterpreters: test_subinterpreter() fails randomly on AMD64 Ubuntu Shared 3.x versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 15 10:43:21 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 15 Jun 2018 14:43:21 +0000 Subject: [New-bugs-announce] [issue33869] doc Add set, frozen set, and tuple entries to Glossary Message-ID: <1529073801.77.0.947875510639.issue33869@psf.upfronthosting.co.za> New submission from Andr?s Delfino : PR adds entries for these three terms and a link to the list definition. ---------- assignee: docs at python components: Documentation messages: 319619 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Add set, frozen set, and tuple entries to Glossary type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 15 11:20:11 2018 From: report at bugs.python.org (Philip Rowlands) Date: Fri, 15 Jun 2018 15:20:11 +0000 Subject: [New-bugs-announce] [issue33870] pdb continue + breakpoint Message-ID: <1529076011.32.0.947875510639.issue33870@psf.upfronthosting.co.za> New submission from Philip Rowlands : Please extend pdb's continue to support an optional argument, identical to break. When debugging I frequently want to quickly run to a certain line number then break. Rather than break / continue / clear (or tbreak / continue), it would be handy to type (Pdb) cont 99 to run to line 99 as a one-off breakpoint. ---------- messages: 319622 nosy: philiprowlands priority: normal severity: normal status: open title: pdb continue + breakpoint type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 15 14:14:37 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 15 Jun 2018 18:14:37 +0000 Subject: [New-bugs-announce] [issue33871] Possible integer overflow in iov_setup() Message-ID: <1529086477.01.0.579493977442.issue33871@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The iov_setup() helper in posixmodule.c returns the total size of all buffers. But there is possible an integer overflow because the sequence of buffers can contain the same buffer repeated multiple times. On 32-bit platform: >>> import os >>> f = open('/tmp/temp', 'wb') >>> os.writev(f.fileno(), [b'x' * 2**16] * 2**15) -1 Since the overflowed sum is negative, os_writev_impl() returns -1 as a signal of error, but since the exception is not set, -1 is returned as the result of os.writev(). If the overflowed sum is not negative, the sequence of buffers is passed to OS and an OSError is raised: >>> os.writev(f.fileno(), [b'x' * 2**16] * 2**16) Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument I have not tested (because have not installed corresponding 32-bit OSes, and it is harder to reproduce on 64-bit), but seems this can even cause a crash in os.sendfile() on FreeBSD, DragonFly BSD and Mac OS. This sum is used only in os.sendfile() on Mac OS. In all other cases it is enough to return just an error flag. I can't find the documentation for os.sendfile() on Mac OS for checking if this value actually is needed. ---------- components: Library (Lib) messages: 319636 nosy: ned.deily, ronaldoussoren, serhiy.storchaka priority: normal severity: normal status: open title: Possible integer overflow in iov_setup() type: crash versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 15 17:54:35 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 15 Jun 2018 21:54:35 +0000 Subject: [New-bugs-announce] [issue33872] doc Add list access time to list definition Message-ID: <1529099675.69.0.56676864532.issue33872@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Glossary talks about list access complexity, but the actual list definition doesn't. I think glossary entries should have more information than actual definitions. PR adds list access complexity to list definition. ---------- assignee: docs at python components: Documentation messages: 319678 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Add list access time to list definition type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 15 18:42:06 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 15 Jun 2018 22:42:06 +0000 Subject: [New-bugs-announce] [issue33873] False positives when running refleaks tests with -R 1:1 Message-ID: <1529102526.45.0.56676864532.issue33873@psf.upfronthosting.co.za> New submission from Pablo Galindo Salgado : I am not sure is a problem we can do something about but right know if you run the refleak tests with low repetitions it reports leaks: ./python -m test test_list -R 1:1 Run tests sequentially 0:00:00 load avg: 0.66 [1/1] test_list beginning 2 repetitions 12 .. test_list leaked [3] memory blocks, sum=3 test_list failed == Tests result: FAILURE == 1 test failed: test_list Total duration: 1 sec 759 ms Tests result: FAILURE This also happens with other low numbers: ./python -m test test_list -R 1:2 Obviously using this numbers is "wrong" (there is not enough repetitions to get meaningful results). The only problem I see is that if you are not aware of this limitation (in the case this is a real limitation on how `dash_R` works) the output is a bit misleading. Should we leave this as it is or try to improve the output? ---------- components: Tests messages: 319688 nosy: pablogsal, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: False positives when running refleaks tests with -R 1:1 type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 15 22:27:21 2018 From: report at bugs.python.org (Forest) Date: Sat, 16 Jun 2018 02:27:21 +0000 Subject: [New-bugs-announce] [issue33874] dictviews set operations do not follow pattern of set or frozenset Message-ID: <1529116041.48.0.56676864532.issue33874@psf.upfronthosting.co.za> New submission from Forest : Views of dictionary keys and items admit set operations, but the behavior of operations differs significantly from that of set and frozenset. >>> {}.keys() & [] set() >>> set() & [] Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for &: 'set' and 'list' >>> set() & [] set() >>> {}.keys() & frozenset([]) set() >>> frozenset([]) & {}.keys() set() >>> set() & frozenset([]) set() >>> frozenset([]) & set() frozenset() Similar for |, ^, - >>> [1, 2, 3] - {2:None}.keys() {1, 3} Is perhaps particularly surprising The operators <, <=, >, >= do work as expected. >>> [1, 2, 3] > {}.keys() Traceback (most recent call last): File "", line 1, in TypeError: unorderable types: list() > dict_keys() I'm not sure if these differences between dictviews and set/frozenset should be considered bugs. If no, it may be good to document that the behavior is different. ---------- components: Library (Lib) messages: 319696 nosy: fgregg priority: normal severity: normal status: open title: dictviews set operations do not follow pattern of set or frozenset versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 15 22:54:38 2018 From: report at bugs.python.org (Joel Perras) Date: Sat, 16 Jun 2018 02:54:38 +0000 Subject: [New-bugs-announce] [issue33875] Allow dynamic password evaluation in pypirc configuration file. Message-ID: <1529117678.87.0.56676864532.issue33875@psf.upfronthosting.co.za> New submission from Joel Perras : In its current implementation, a user is required to provide their cleartext PyPi password in their .pypirc configuration file for authenticated interactions with PyPi servers to succeed. For hopefully obvious reasons, this is sub-optimal from a security standpoint. In some popular utilities (e.g. msmtp), the ability to provide a `passwordeval` field is made optional to the user. The value to this field is executed by the OS-dependent shell, and the return value is then used as the password. For example, instead of this: ``` index-servers= pypi [pypi] username=jperras password=mygreatpassword ``` we can instead have this: ``` index-servers= pypi [pypi] username=jperras passwordeval="gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.pypipwd.gpg" ``` ---------- components: Distutils messages: 319699 nosy: dstufft, eric.araujo, jperras priority: normal severity: normal status: open title: Allow dynamic password evaluation in pypirc configuration file. type: enhancement versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 15 23:15:10 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 16 Jun 2018 03:15:10 +0000 Subject: [New-bugs-announce] [issue33876] doc Mention the MicroPython implementation in Introduction Message-ID: <1529118910.74.0.56676864532.issue33876@psf.upfronthosting.co.za> New submission from Andr?s Delfino : IMHO, mentioning MicroPython is a plus because it's a mature project with a focus not covered by any of the other mentioned implementations. PR adds the mention. ---------- assignee: docs at python components: Documentation messages: 319700 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Mention the MicroPython implementation in Introduction versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 15 23:33:50 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 16 Jun 2018 03:33:50 +0000 Subject: [New-bugs-announce] [issue33877] doc Mention Windows along UNIX for script running instructions Message-ID: <1529120030.12.0.56676864532.issue33877@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Reference 9.1. says: "Under Unix, a complete program can be passed to the interpreter in three forms...". This also applies to Windows. PR fixes this. ---------- assignee: docs at python components: Documentation messages: 319703 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Mention Windows along UNIX for script running instructions type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 16 09:01:46 2018 From: report at bugs.python.org (Julien Palard) Date: Sat, 16 Jun 2018 13:01:46 +0000 Subject: [New-bugs-announce] [issue33878] Doc: Assignment statement to tuple or list: case missing. Message-ID: <1529154106.75.0.56676864532.issue33878@psf.upfronthosting.co.za> New submission from Julien Palard : In [1] I read: > If the target list is a comma-separated list of targets, or a single target in square brackets This come from https://bugs.python.org/issue23275 (patch is [2]). I suspect there's a missing case "list of targets in square brackets" (and to be pedantic "list of targets in parenthesis"). The specialized documentation about single-valued targets in sequence-like construction come from this difference: >>> (a) = 42 >>> a 42 >>> [a] = [42] >>> a 42 which is correctly described the line before: > If the target list is a single target in parentheses: The object is assigned to that target. So the correct way to state it may be: > Else the object must be an iterable with the same number of items as there are targets in the target list, and the items are assigned, from left to right, to the corresponding targets. The `Else`, coupled with the existing "Assignment of an object to a target list, optionally enclosed in parentheses or square brackets" covers properly the cases: - Multiple target separated by comas (already covered) - Multiple target enclosed by parenthesis and brackets (not covered) - Single target enclosed by angle brackets (already covered) [1]: https://docs.python.org/3.7/reference/simple_stmts.html#assignment-statements [2]: https://bugs.python.org/file42878/issue23275_v4.diff ---------- assignee: docs at python components: Documentation messages: 319735 nosy: docs at python, martin.panter, mdk priority: normal severity: normal status: open title: Doc: Assignment statement to tuple or list: case missing. type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 16 11:13:15 2018 From: report at bugs.python.org (njayinthehouse) Date: Sat, 16 Jun 2018 15:13:15 +0000 Subject: [New-bugs-announce] [issue33879] Item assignment in tuple mutates list despite throwing error Message-ID: <1529161995.75.0.56676864532.issue33879@psf.upfronthosting.co.za> New submission from njayinthehouse : Seems like a bug. >>> a = (1, [1]) >>> a[1] += [2] Traceback (most recent call last): File "", line 1, in TypeError: 'tuple' object does not support item assignment >>> a (1, [1, 2]) ---------- messages: 319748 nosy: njayinthehouse priority: normal severity: normal status: open title: Item assignment in tuple mutates list despite throwing error type: behavior versions: Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 16 13:12:33 2018 From: report at bugs.python.org (John Cooke) Date: Sat, 16 Jun 2018 17:12:33 +0000 Subject: [New-bugs-announce] [issue33880] namedtuple should use NFKD to find duplicate members Message-ID: <1529169153.27.0.56676864532.issue33880@psf.upfronthosting.co.za> New submission from John Cooke : from collections import namedtuple # create a namedtuple whose members are: # 00B5;MICRO SIGN;Ll; # 03BC;GREEK SMALL LETTER MU;Ll # these are both legal identifier names names = ['\u00b5', '\u03bc'] for name in names: assert name.isidentifier() mu = namedtuple('mu', names) # should have raised ValueError, but instead get SyntaxError ---------- components: Library (Lib) messages: 319763 nosy: John Cooke priority: normal severity: normal status: open title: namedtuple should use NFKD to find duplicate members type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 16 14:02:08 2018 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 16 Jun 2018 18:02:08 +0000 Subject: [New-bugs-announce] [issue33881] dataclasses should use NFKD to find duplicate members Message-ID: <1529172128.32.0.56676864532.issue33881@psf.upfronthosting.co.za> New submission from Eric V. Smith : See issue 33880 for the same issue with namedtuple. This shows up on dataclasses only through make_dataclass. This is an expected ValueError: >>> make_dataclass('a', ['a', 'b', 'c', 'a']) Traceback (most recent call last): File "", line 1, in File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 1123, in make_dataclass raise TypeError(f'Field name duplicated: {name!r}') TypeError: Field name duplicated: 'a' But this is a SyntaxError: >>> make_dataclass('a', ['\u00b5', '\u03bc']) Traceback (most recent call last): File "", line 1, in File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 1133, in make_dataclass unsafe_hash=unsafe_hash, frozen=frozen) File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 958, in dataclass return wrap(_cls) File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 950, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen) File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 871, in _process_class else 'self', File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 490, in _init_fn return_type=None) File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 356, in _create_fn exec(txt, globals, locals) File "", line 1 SyntaxError: duplicate argument '?' in function definition ---------- assignee: eric.smith components: Library (Lib) messages: 319766 nosy: eric.smith priority: low severity: normal status: open title: dataclasses should use NFKD to find duplicate members versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 16 19:49:13 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 16 Jun 2018 23:49:13 +0000 Subject: [New-bugs-announce] [issue33882] doc Mention breakpoint() in debugger-related FAQ Message-ID: <1529192953.25.0.56676864532.issue33882@psf.upfronthosting.co.za> New submission from Andr?s Delfino : IMHO, it's a good opportunity to advertise the convenience of breakpoint(). PR adds a mention. ---------- assignee: docs at python components: Documentation messages: 319796 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Mention breakpoint() in debugger-related FAQ type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 16 20:52:16 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 17 Jun 2018 00:52:16 +0000 Subject: [New-bugs-announce] [issue33883] doc Mention mypy, pytype and PyAnnotate in FAQ Message-ID: <1529196736.16.0.56676864532.issue33883@psf.upfronthosting.co.za> New submission from Andr?s Delfino : As far as I know, mypy and pytype are more advanced that any of the other tools mentioned in the FAQ for static analysis, however we are not touching them. PR adds mentions. ---------- assignee: docs at python components: Documentation messages: 319798 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Mention mypy, pytype and PyAnnotate in FAQ type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 17 06:45:32 2018 From: report at bugs.python.org (Yoni Rozenshein) Date: Sun, 17 Jun 2018 10:45:32 +0000 Subject: [New-bugs-announce] [issue33884] [multiprocessing] Multiprocessing in spawn mode doesn't work when the target is a method in a unittest.TestCase subclass, when run either with unittest or with pytest Message-ID: <1529232332.71.0.56676864532.issue33884@psf.upfronthosting.co.za> New submission from Yoni Rozenshein : multiprocessing will attempt to pickle things using ForkingPickler when starting a new process in spawn mode (in Windows this is the only mode, in Linux this is a non-default but settable mode). When run within the context of a unit test, if it has to pickle a TestCase subclass, it encounters objects that can't be pickled. The attached file shows a minimum working example (uncomment the two commented lines under __main__ to run with pytest). When run with unittest.main(), it raises: TypeError: cannot serialize '_io.TextIOWrapper' object When run with pytest.main(), it raises: AttributeError: Can't pickle local object 'ArgumentParser.__init__..identity' Note that changing the _child_process in my example to a classmethod/staticmethod or moving it to a top-level function outside the class works around this issue (both with unittest and with pytest). ---------- components: Library (Lib) files: mp_pickle_issues.py messages: 319811 nosy: Yoni Rozenshein priority: normal severity: normal status: open title: [multiprocessing] Multiprocessing in spawn mode doesn't work when the target is a method in a unittest.TestCase subclass, when run either with unittest or with pytest type: behavior versions: Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47645/mp_pickle_issues.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 17 13:21:31 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 17 Jun 2018 17:21:31 +0000 Subject: [New-bugs-announce] [issue33885] doc Replace "hook function" with "callable" in urllib.request.urlretrieve Message-ID: <1529256091.43.0.56676864532.issue33885@psf.upfronthosting.co.za> New submission from Andr?s Delfino : The reporthook of urllib.request.urlretrieve is treated as a function hook, while the right term is "callable". PR fixes this. ---------- assignee: docs at python components: Documentation messages: 319822 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Replace "hook function" with "callable" in urllib.request.urlretrieve type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 17 13:41:30 2018 From: report at bugs.python.org (Andrey) Date: Sun, 17 Jun 2018 17:41:30 +0000 Subject: [New-bugs-announce] [issue33886] SSL on aiomysql hangs on reconnection Message-ID: <1529257290.59.0.56676864532.issue33886@psf.upfronthosting.co.za> New submission from Andrey : On reconnect from aiomysql (after the pool has recycled the old connection) by using ssl context it hangs forever. Interrupting gives the following Traceback: File "/usr/local/lib/python3.6/site-packages/aiomysql/connection.py", line 464, in _connect await self._request_authentication() File "/usr/local/lib/python3.6/site-packages/aiomysql/connection.py", line 670, in _request_authentication server_hostname=self._host File "/usr/lib/python3.6/asyncio/streams.py", line 81, in open_connection lambda: protocol, host, port, **kwds) File "/usr/lib/python3.6/asyncio/base_events.py", line 804, in create_connection sock, protocol_factory, ssl, server_hostname) File "/usr/lib/python3.6/asyncio/base_events.py", line 830, in _create_connection_transport yield from waiter concurrent.futures._base.CancelledError Probably it is related with issue30698 and issue29406. ---------- components: asyncio messages: 319823 nosy: andr04, asvetlov, yselivanov priority: normal severity: normal status: open title: SSL on aiomysql hangs on reconnection type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 17 14:05:50 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 17 Jun 2018 18:05:50 +0000 Subject: [New-bugs-announce] [issue33887] doc Add TOC in Design and History FAQ Message-ID: <1529258750.3.0.56676864532.issue33887@psf.upfronthosting.co.za> New submission from Andr?s Delfino : IHMO, having all questions put together is really useful. ---------- assignee: docs at python components: Documentation messages: 319824 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Add TOC in Design and History FAQ type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 17 14:13:18 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 17 Jun 2018 18:13:18 +0000 Subject: [New-bugs-announce] [issue33888] Use CPython instead of Python when talking about implementation details Message-ID: <1529259198.28.0.56676864532.issue33888@psf.upfronthosting.co.za> New submission from Andr?s Delfino : The FAQ talks about list and dictionary implementation details using "Python". I believe this should be changed to CPython. ---------- assignee: docs at python components: Documentation messages: 319825 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Use CPython instead of Python when talking about implementation details versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 17 15:32:50 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 17 Jun 2018 19:32:50 +0000 Subject: [New-bugs-announce] [issue33889] doc Mention Python on-line shell in Tutorial Message-ID: <1529263970.37.0.56676864532.issue33889@psf.upfronthosting.co.za> New submission from Andr?s Delfino : If having a link to that specific console is not deemed appropriate, perhaps we can point to PythonAnywhere. IMHO, it's good to let users know that they can try Python right away without needing to install. ---------- assignee: docs at python components: Documentation messages: 319829 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Mention Python on-line shell in Tutorial type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 17 18:20:32 2018 From: report at bugs.python.org (Patrick Lehmann) Date: Sun, 17 Jun 2018 22:20:32 +0000 Subject: [New-bugs-announce] [issue33890] Pathlib does not compare Windows and MinGW paths as equal Message-ID: <1529274032.96.0.56676864532.issue33890@psf.upfronthosting.co.za> New submission from Patrick Lehmann : pathlib does not compare absolute paths from Windows and MinGW as equal. Windows absolute path: "C:\path\to\tool" MinGW absolute path: "/c/path/to/tool" Cygwin absolute path: "/cygdrive/c/path/to/tool" I consider this a bug, because it's the same bug but 3 different writings and pathlib is not able to identify the equality. Environment: Windows 10 Latest MinGW identified in Python 3.6.2 as MINGW64_NT-10.0 Question on Stack Overflow: https://stackoverflow.com/questions/50900779/how-to-compare-absolute-windows-and-mingw-paths-with-pathlib ---------- components: Windows messages: 319832 nosy: Patrick Lehmann, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Pathlib does not compare Windows and MinGW paths as equal type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 17 19:13:30 2018 From: report at bugs.python.org (=?utf-8?q?=C3=96mer_FADIL_USTA?=) Date: Sun, 17 Jun 2018 23:13:30 +0000 Subject: [New-bugs-announce] [issue33891] ntpath join doesnt check whether path variable None or not Message-ID: <1529277210.6.0.56676864532.issue33891@psf.upfronthosting.co.za> New submission from ?mer FADIL USTA : In https://github.com/python/cpython/blob/master/Lib/ntpath.py#L76 def join(path, *paths): path = os.fspath(path) the path variable used directly in fspath method without checking is exist or not so it cause : File "d:\python\37\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "d:\python\37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\Python\37\Scripts\pipenv.exe\__main__.py", line 9, in File "d:\python\37\lib\site-packages\pipenv\vendor\click\core.py", line 722, in __call__ return self.main(*args, **kwargs) File "d:\python\37\lib\site-packages\pipenv\vendor\click\core.py", line 697, in main rv = self.invoke(ctx) File "d:\python\37\lib\site-packages\pipenv\vendor\click\core.py", line 1043, in invoke return Command.invoke(self, ctx) File "d:\python\37\lib\site-packages\pipenv\vendor\click\core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "d:\python\37\lib\site-packages\pipenv\vendor\click\core.py", line 535, in invoke return callback(*args, **kwargs) File "d:\python\37\lib\site-packages\pipenv\vendor\click\decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "d:\python\37\lib\site-packages\pipenv\cli.py", line 217, in cli do_py() File "d:\python\37\lib\site-packages\pipenv\core.py", line 1703, in do_py click.echo(which('python', allow_global=system)) File "d:\python\37\lib\site-packages\pipenv\core.py", line 125, in which os.path.join(location, 'Scripts'), command File "d:\python\37\lib\ntpath.py", line 76, in join path = os.fspath(path) TypeError: expected str, bytes or os.PathLike object, not NoneType'. Make sure pipenv is on the PATH. ---------- messages: 319835 nosy: usta priority: normal severity: normal status: open title: ntpath join doesnt check whether path variable None or not type: crash versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 17 20:44:00 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Mon, 18 Jun 2018 00:44:00 +0000 Subject: [New-bugs-announce] [issue33892] doc Add a couple of "or she/her" Message-ID: <1529282640.33.0.56676864532.issue33892@psf.upfronthosting.co.za> New submission from Andr?s Delfino : PR adds some "or she/her". ---------- assignee: docs at python components: Documentation messages: 319840 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Add a couple of "or she/her" type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 18 00:49:48 2018 From: report at bugs.python.org (sebastin) Date: Mon, 18 Jun 2018 04:49:48 +0000 Subject: [New-bugs-announce] [issue33893] Linux terminal shortcuts support in python shell Message-ID: <1529297388.32.0.56676864532.issue33893@psf.upfronthosting.co.za> New submission from sebastin : simple linux terminal support in python shell, like clear, ctrl + r, up arrow would be really good to have. ---------- assignee: terry.reedy components: IDLE, IO, Interpreter Core messages: 319857 nosy: sebastin, terry.reedy priority: normal severity: normal status: open title: Linux terminal shortcuts support in python shell type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 18 03:34:43 2018 From: report at bugs.python.org (Philip Rowlands) Date: Mon, 18 Jun 2018 07:34:43 +0000 Subject: [New-bugs-announce] [issue33894] tempfile.tempdir cannot be unset Message-ID: <1529307283.94.0.56676864532.issue33894@psf.upfronthosting.co.za> New submission from Philip Rowlands : Quoting https://docs.python.org/3/library/tempfile.html """ tempfile.tempdir When set to a value other than None, this variable defines the default value for the dir argument to the functions defined in this module. If tempdir is unset or None at any call to any of the above functions except gettempprefix() it is initialized following the algorithm described in gettempdir(). """ "If tempdir is unset ..." is not true: $ python3 -c 'import tempfile; del tempfile.tempdir; t = tempfile.mkdtemp()' Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.2/tempfile.py", line 298, in mkdtemp dir = gettempdir() File "/usr/lib/python3.2/tempfile.py", line 238, in gettempdir if tempdir is None: NameError: global name 'tempdir' is not defined No strong preference whether the docs change to match the implementation, or vice-versa. ---------- messages: 319867 nosy: philiprowlands priority: normal severity: normal status: open title: tempfile.tempdir cannot be unset type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 18 06:45:01 2018 From: report at bugs.python.org (Tony Roberts) Date: Mon, 18 Jun 2018 10:45:01 +0000 Subject: [New-bugs-announce] [issue33895] LoadLibraryExW called with GIL held can cause deadlock Message-ID: <1529318701.15.0.56676864532.issue33895@psf.upfronthosting.co.za> New submission from Tony Roberts : In dynload_win.c LoadLibraryExW is called with the GIL held. This can cause a deadlock in an uncommon case where the GIL also needs to be acquired when another thread is being detached. Both LoadLibrary and FreeLibrary acquire the Windows loader-lock. If FreeLibrary is called on a module that acquires the GIL when detaching, a dead-lock occurs when another thread with the GIL held blocks on the loader-lock by calling LoadLibrary. This can happen when Python is embedded in another application via an extension, and where that application may create threads that call into that extension that results in Python code being called. Because the application is creating the thread, the extension that's embedding Python doesn't know when the thread will terminate. The first time the extension is called from that thread and it needs to run some Python code it has to create a new thread state, and when the thread terminates that thread state should be destroyed. In other situations the thread state would be destroyed as part of cleaning up the thread, but here the extension does not know when the thread terminates and so must do it on thread detach in DllMain. Attempting to destroy the thread state this way requires acquiring the GIL, which can cause the deadlock described above. The safest way to avoid this deadlock (without potentially leaking thread states) would be to release the GIL before calling LoadLibrary. ---------- components: Windows messages: 319876 nosy: Tony Roberts, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: LoadLibraryExW called with GIL held can cause deadlock versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 18 14:18:51 2018 From: report at bugs.python.org (Dean Morin) Date: Mon, 18 Jun 2018 18:18:51 +0000 Subject: [New-bugs-announce] [issue33896] filecmp.cmp returns True on files that differ Message-ID: <1529345931.78.0.56676864532.issue33896@psf.upfronthosting.co.za> New submission from Dean Morin : By default `filecmp.cmp()` has `shallow=True` which can produce some surprising behavior. In the docs it states: > If shallow is true, files with identical os.stat() signatures are taken to be equal. However the "signature" only considers the file mode, file size, and file modification time, which is not sufficient. `cmp()` will return `True` (files are equal) in some circumstances for files that actually differ. Depending on the underlying file system, the same python script will return `True` or `False` when `cmp()` is called on the exact same files. I'll add the long-winded details at the bottom. To fix, I believe `st.st_ino` should be included in `_sig` (https://github.com/python/cpython/blob/3.7/Lib/filecmp.py#L68). I'm in the middle of a move, but I can make a PR in the next couple weeks if this seems like a reasonable fix and no one else gets around to it. The long version is that we're migrating some existing reports to a new data source. The goal is to produce identical csv files from both data sources. I have a python script that pulls down both csv files and uses `cmp()` to compare them. On my machine, the script correctly discovers the differences between the two. One of the date columns has incorrect dates in the new version. However on my colleagues machine, the script fails to discover the differences and shows that the csv files are identical. The difference is that on my machine, `os.stat(f).st_mtime` is a timestamp which includes fractional seconds (1529108360.1955538), but only includes the seconds (1529108360.0) on my colleagues machine. Since only the dates differed within the csvs, both files had the same file mode, file size, and both were downloaded within the same second. We got a few more people to see what they got for `st_mtime`. The link could be the file system used. We're all using macs, but for those of us using an APFS Volume disk, `st_mtime` returns a timestamp which includes fractional seconds, and for those of us using a Logical Volume Mac OS Extended disk, it returns a timestamp which only includes the seconds (1529108360.0). When comparing os.stat() between the two differing csv files, the only difference (other than fractional seconds for various timestamps) was `st_ino` which is why I believe it should be included in `_sig()`. ---------- components: Library (Lib) messages: 319904 nosy: Dean Morin priority: normal severity: normal status: open title: filecmp.cmp returns True on files that differ type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 18 16:39:17 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 18 Jun 2018 20:39:17 +0000 Subject: [New-bugs-announce] [issue33897] Add a restart option to logging.basicConfig() Message-ID: <1529354357.8.0.56676864532.issue33897@psf.upfronthosting.co.za> New submission from Raymond Hettinger : Once a logger or basicConfig() has been called, later calls to basicConfig() are silent ignored. The makes it very difficult to experiment with or teach the various options at the interactive prompt or in a Jupyter notebook. What we have: >>> import logging >>> logging.warning('Too much data') WARNING:root:Too much data >>> logging.info('Volume is at 80%') >>> logging.basicConfig(level=logging.INFO) >>> logging.info('Volume is at 80%') >>> # Note, no output was created What we need: >>> import logging >>> logging.warning('Too much data') WARNING:root:Too much data >>> logging.info('Volume is at 80%') >>> logging.basicConfig(level=logging.INFO, restart=True) >>> logging.info('Volume is at 80%') INFO:rootVolume is at 80% ---------- assignee: vinay.sajip components: Library (Lib) messages: 319911 nosy: rhettinger, vinay.sajip priority: normal severity: normal status: open title: Add a restart option to logging.basicConfig() type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 18 18:40:30 2018 From: report at bugs.python.org (Eryk Sun) Date: Mon, 18 Jun 2018 22:40:30 +0000 Subject: [New-bugs-announce] [issue33898] pathlib issues with Windows device paths Message-ID: <1529361630.0.0.56676864532.issue33898@psf.upfronthosting.co.za> New submission from Eryk Sun : For \\?\ extended device paths, pathlib removes the trailing slash for the root directory if the device isn't UNC or a logical (A-Z) drive. Correct: >>> str(Path('//?/UNC/')) '\\\\?\\UNC\\' >>> str(Path('//?/Z:/')) '\\\\?\\Z:\\' Incorrect: >>> str(Path('//?/BootPartition/')) '\\\\?\\BootPartition' >>> str(Path('//?/Volume{}/')) '\\\\?\\Volume{}' >>> str(Path('//?/Global/Z:/')) '\\\\?\\Global\\Z:' It keeps the trailing slash for some \\.\ paths, but not all. Correct: >>> str(Path('//./BootPartition/')) '\\\\.\\BootPartition\\' Incorrect: >>> str(Path('//./Global/Z:/')) '\\\\.\\Global\\Z:' It adds a root directory to \\.\ device paths where none was specified. Incorrect: >>> str(Path('//./nul')) '\\\\.\\nul\\' >>> str(Path('//./PhysicalDrive0')) '\\\\.\\PhysicalDrive0\\' >>> str(Path('//./C:')) '\\\\.\\C:\\' "\\\\.\\C:" refers to the volume device, whereas "\\\\.\\C:\\" is the root directory in the file system. pathlib should parse \\?\ and \\.\ device paths the same way with respect to the drive and root. The difference in practice is only how Windows does (\\.\) or does not (\\?\) canonicalize the path. Additionally, pathlib fails to identify the drive correctly in these cases. Incorrect: >>> Path('//?/Global/Z:/').drive '\\\\?\\' >>> Path('//?/BootPartition/Temp').drive '\\\\?\\' Except for "UNC" and "Global" paths, the drive should be the first component after the local-device prefix. The "UNC" device also includes subsequent server and share components, if any. For the reserved "Global" symlink, it should look to the next component. For example, r'\\?\Global\UNC\server\share' is a drive. There's also the "GlobalRoot" symlink (or "Global\\GlobalRoot" to be pedantic), but that can't be handled generically. ---------- components: Library (Lib), Windows messages: 319921 nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: test needed status: open title: pathlib issues with Windows device paths type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 19 03:41:52 2018 From: report at bugs.python.org (Ammar Askar) Date: Tue, 19 Jun 2018 07:41:52 +0000 Subject: [New-bugs-announce] [issue33899] Tokenize module does not mirror "end-of-input" is newline behavior Message-ID: <1529394112.27.0.56676864532.issue33899@psf.upfronthosting.co.za> New submission from Ammar Askar : As was pointed out in https://bugs.python.org/issue33766 there is an edge case in the tokenizer whereby it will implicitly treat the end of input as a newline. The tokenize module in stdlib does not mirror the C code's behavior in this case. tokenizer.c: ~/cpython $ echo -n 'x' | ./python ---------- NAME ("x") NEWLINE ENDMARKER tokenize module: ~/cpython $ echo -n 'x' | ./python -m tokenize 1,0-1,1: NAME 'x' 2,0-2,0: ENDMARKER '' The instrumentation to have the C tokenizer dump out its tokens is mine, can provide a diff to produce that output if needed. ---------- assignee: ammar2 components: Library (Lib) messages: 319934 nosy: ammar2 priority: normal severity: normal status: open title: Tokenize module does not mirror "end-of-input" is newline behavior type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 19 03:54:27 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 19 Jun 2018 07:54:27 +0000 Subject: [New-bugs-announce] [issue33900] collections.counter update method without argument gives misleading error Message-ID: <1529394867.73.0.56676864532.issue33900@psf.upfronthosting.co.za> New submission from Karthikeyan Singaravelan : There was a change made in collections.Counter that made it accept self as the first parameter and hence while doing *args in the method signature args[0] is always set as the self. Hence the check for `not args` becomes a no-op during collection_object.update() calls and the type error is not raised. This is only triggered when it's called as a class method like `Counter.update` and the error message is misleading "descriptor 'update' of 'Counter' object "needs an argument" which says update method of Counter object needs an argument though we are calling the method on class and also calling update on Counter object doesn't need an argument since counter_object.update() works fine as no-op. I think the error message could be improved since argument is not necessary for counter_object.update. Relevant commit : https://github.com/python/cpython/commit/ae5cb214d2cd41d96943a0ef43a4e95bd9a10b7a#diff-f30cb98704c3ccaf71deaf5503f7f4a1R587 No argument to counter object update test case : https://github.com/python/cpython/blob/ae5cb214d2cd41d96943a0ef43a4e95bd9a10b7a/Lib/test/test_collections.py#L1077 Calling update on Counter class test case : https://github.com/python/cpython/commit/20994f1e27c38973f1854dbdcf9b29fe8e3cd6be#diff-b5f669eab2fa576572b6115caa24427fR928 # Python 3 ? cpython git:(master) ? ./python Python 3.8.0a0 (heads/bpo33830-httplib-docs-fix-dirty:9bf0fb8, Jun 18 2018, 17:09:54) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from collections import Counter >>> c = Counter("Hello") >>> Counter.update() Traceback (most recent call last): File "", line 1, in File "/user/karthik/cpython/Lib/collections/__init__.py", line 638, in update raise TypeError("descriptor 'update' of 'Counter' object " TypeError: descriptor 'update' of 'Counter' object needs an argument >>> Counter.update(1) # No error since we check for the first argument to be iterable >>> c.update() # No args works fine though there was an above error with TypeError: descriptor 'update' of 'Counter' object needs an argument when called on class >>> Counter.update(1, foo=1) # 1 is considered as self here, a valid counter object works fine and is updated Traceback (most recent call last): File "", line 1, in File "/user/karthik/cpython/Lib/collections/__init__.py", line 655, in update self.update(kwds) AttributeError: 'int' object has no attribute 'update' Thanks ---------- components: Library (Lib) messages: 319935 nosy: xtreak priority: normal severity: normal status: open title: collections.counter update method without argument gives misleading error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 19 04:50:25 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 19 Jun 2018 08:50:25 +0000 Subject: [New-bugs-announce] [issue33901] test_dbm_gnu.test_reorganize() failed on x86-64 High Sierra 3.x Message-ID: <1529398225.31.0.56676864532.issue33901@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/145/builds/81 x86-64 High Sierra 3.x: ====================================================================== FAIL: test_reorganize (test.test_dbm_gnu.TestGdbm) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/test_dbm_gnu.py", line 77, in test_reorganize self.assertTrue(size0 < size1) AssertionError: False is not true The only change of this build is the commit cb970730e3ca2522e9b1700dcaf0a06b7e898db6: bpo-33630. But I hardly believe that it's related. ---------- components: Tests, macOS messages: 319942 nosy: ned.deily, ronaldoussoren, vstinner priority: normal severity: normal status: open title: test_dbm_gnu.test_reorganize() failed on x86-64 High Sierra 3.x versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 19 10:34:17 2018 From: report at bugs.python.org (George King) Date: Tue, 19 Jun 2018 14:34:17 +0000 Subject: [New-bugs-announce] [issue33902] entry_points/console_scripts is too slow Message-ID: <1529418857.83.0.56676864532.issue33902@psf.upfronthosting.co.za> New submission from George King : On my newish macOS laptop using Python 3.6 or 3.7, a no-op script takes 3 times as long to invoke using the entry_points machinery as it does to invoke directly. Here are some exemplary times (best times after several tries). $ time python3.6 entrypoint.py real 0m0.047s user 0m0.033s sys 0m0.010s $ time python3.6 /Library/Frameworks/Python.framework/Versions/3.6/bin/entrypoint real 0m0.153s user 0m0.129s sys 0m0.020s In this example, entrypoint.py consists of `def main(): pass`; the second script is that generated by `pip3 install ...`. I have confirmed that the `-e` flag to pip is not the culprit. I look at a cprofile trace of the invocation and I do not see an obvious single culprit, but I'm not an expert at reading such traces either. I know that there has been some previous debate about "how slow is slow", whether to try to improve import times, etc. I'm not trying to fan any flames here, but from a practical perspective, this discrepancy is showing up in developer tools that I'm writing, and is driving me to abandon entry_points in favor of less standard, less cross-platform install hackery in my setup.py scripts. An extra 0.1s per invocation is visibly detrimental to shell scripts calling out to installed python programs. ---------- messages: 319971 nosy: gwk priority: normal severity: normal status: open title: entry_points/console_scripts is too slow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 19 10:47:37 2018 From: report at bugs.python.org (=?utf-8?b?TWlja2HDq2wgUy4=?=) Date: Tue, 19 Jun 2018 14:47:37 +0000 Subject: [New-bugs-announce] [issue33903] Can't use lib2to3 with embeddable zip file Message-ID: <1529419657.22.0.56676864532.issue33903@psf.upfronthosting.co.za> New submission from Micka?l S. : As stated by https://bugs.python.org/issue24960, the bug should be fixed in 3.6.5 (if it is the same, not sure). Simple reproduction steps are: 1) Download and unzip python-3.6.5-embed-win32.zip. 2) Install pip (OK): C:\Users\TestW764\python-3.6.5-embed-win32> python get-pip.py Collecting pip Using cached https://files.pythonhosted.org/packages/0f/74/.../pip-10.0.1-py2.py3-none-any.whl Collecting setuptools Using cached https://files.pythonhosted.org/packages/7f/e1/.../setuptools-39.2.0-py2.py3-none-any.whl Collecting wheel Using cached https://files.pythonhosted.org/packages/81/30/.../wheel-0.31.1-py2.py3-none-any.whl Installing collected packages: pip, setuptools, wheel The script wheel.exe is installed in 'C:\Users\TestW764\python-3.6.5-embed-win32\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pip-10.0.1 setuptools-39.2.0 wheel-0.31.1 3) In python36._pth, uncomment "import site". 4) Try to install anything else: C:\Users\TestW764\python-3.6.5-embed-win32> python -m pip install nuxeo Collecting nuxeo Using cached https://files.pythonhosted.org/packages/b3/c9/.../nuxeo-2.0.1.tar.gz Complete output from command python setup.py egg_info: running egg_info creating pip-egg-info\nuxeo.egg-info writing pip-egg-info\nuxeo.egg-info\PKG-INFO writing dependency_links to pip-egg-info\nuxeo.egg-info\dependency_links.txt writing requirements to pip-egg-info\nuxeo.egg-info\requires.txt writing top-level names to pip-egg-info\nuxeo.egg-info\top_level.txt writing manifest file 'pip-egg-info\nuxeo.egg-info\SOURCES.txt' error: [Errno 0] Error: 'lib2to3\\Grammar3.6.5.final.0.pickle' ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in C:\Users\TestW764\AppData\Local\Temp\pip-install-0gzz8yfg\nuxeo\ Do you think it is a sub-issue of 24960, something new or I bug from my side? ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 319974 nosy: Tiger-222 priority: normal severity: normal status: open title: Can't use lib2to3 with embeddable zip file versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 19 18:20:25 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 19 Jun 2018 22:20:25 +0000 Subject: [New-bugs-announce] [issue33904] IDLE: In rstrip, change class RstripExtension to Rstrip Message-ID: <1529446825.25.0.56676864532.issue33904@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Rstrip is no longer an extension. Change all occurrences throughout idlelib, including tests. Some may not be covered in tests. Branch after #33855 is merged. ---------- assignee: terry.reedy components: IDLE messages: 320001 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: In rstrip, change class RstripExtension to Rstrip type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 19 18:26:07 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 19 Jun 2018 22:26:07 +0000 Subject: [New-bugs-announce] [issue33905] IDLE: stackbrowser.Stackbrowser should accept exception. Message-ID: <1529447167.34.0.56676864532.issue33905@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Stackbrowser is currently initialized with a traceback and/or the sys.last_xyz attributes. The latter are not set when unittesting; the test framework somehow prevents this. The tests needed are the ones that will be enabled by Stackbrower accepting an exception, which has everything needed. ---------- assignee: terry.reedy components: IDLE messages: 320002 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: stackbrowser.Stackbrowser should accept exception. type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 19 18:52:37 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 19 Jun 2018 22:52:37 +0000 Subject: [New-bugs-announce] [issue33906] IDLE: change windows.py to window.py Message-ID: <1529448757.46.0.56676864532.issue33906@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Change module 'windows' to 'window':: 1. 'calltips' and 'windows' are the only two plural module names. 2. The top menu entry was changed from 'Windows' to 'Window' some time ago. 3. 'windows' is also a OS. With all modules at least imported in a test, all imports in modules should be checked, so running test_idle after changing the file name should reveal all imports that need to be changed. What could have been the 'Window' class is called 'ListedTopLevel'. ---------- assignee: terry.reedy components: IDLE messages: 320003 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: change windows.py to window.py type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 19 19:04:35 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 19 Jun 2018 23:04:35 +0000 Subject: [New-bugs-announce] [issue33907] IDLE: Rename calltips and CallTips as calltip and Calltip. Message-ID: <1529449475.59.0.56676864532.issue33907@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Rename module 'calltips' as 'calltip' 1. 'calltips' and 'windows' are the only two plural module names. 2. 'calltip' fits better with 'calltip_w' (which may, however, be merged in 'calltip'. Module rename can be checked as with 'window', #33906. and class CallTips as Calltip. 3. This may be the only plural class name. 4. ToolTip is singular and will be changed to Tooltip in #33839. See the 6/17 and 6/19 messages. Needed changes in other modules will not necessarily be caught by existing tests. Use grep for 'CallTips'. I will not change tooltip.py (currently not used or tested) as change here would conflict with current PR for #33839. ---------- assignee: terry.reedy components: IDLE messages: 320004 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: Rename calltips and CallTips as calltip and Calltip. type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 00:56:23 2018 From: report at bugs.python.org (Srinivas Reddy T) Date: Wed, 20 Jun 2018 04:56:23 +0000 Subject: [New-bugs-announce] [issue33908] remove unecessary variable assignments Message-ID: <1529470583.19.0.56676864532.issue33908@psf.upfronthosting.co.za> New submission from Srinivas Reddy T : https://github.com/python/cpython/pull/7116 ---------- messages: 320018 nosy: thatiparthy priority: normal severity: normal status: open title: remove unecessary variable assignments type: resource usage versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 04:23:24 2018 From: report at bugs.python.org (Eric Wieser) Date: Wed, 20 Jun 2018 08:23:24 +0000 Subject: [New-bugs-announce] [issue33909] PyObject_CallFinalizerFromDealloc is not referenced in any documentation Message-ID: <1529483004.36.0.56676864532.issue33909@psf.upfronthosting.co.za> New submission from Eric Wieser : PEP 442 states that: > Two new C API functions are provided to ease calling of tp_finalize, especially from custom deallocators. But it does not give the names of these functions, nor do any python docs I can discover. >From grepping for tp_finalize, it seems the functions in question are: - PyObject_CallFinalizerFromDealloc - PyObject_CallFinalizer It would be great if these could be documented, and perhaps even an example given of when it's appropriate to call each one. ---------- assignee: docs at python components: Documentation messages: 320036 nosy: Eric.Wieser, docs at python priority: normal severity: normal status: open title: PyObject_CallFinalizerFromDealloc is not referenced in any documentation versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 04:40:15 2018 From: report at bugs.python.org (Matthias Bussonnier) Date: Wed, 20 Jun 2018 08:40:15 +0000 Subject: [New-bugs-announce] [issue33910] update random.Random 's parameter to have a proper name. Message-ID: <1529484015.93.0.56676864532.issue33910@psf.upfronthosting.co.za> New submission from Matthias Bussonnier : Docs of random.Random always refer to it with Random([seed]) (`lib/random.py`), tough the parameter is actually named `x` making it : - non obvious what it does. - hard to search for. - hard to remember when using kwargs. Obviously changing the name is a change in API, though I doubt it is used much as a kwarg... I suggest renaming it to `seed=`, deprecating but still allowing the usage of `x=` for now, until proper removal of `x=` ---------- components: Library (Lib) messages: 320037 nosy: mbussonn priority: normal severity: normal status: open title: update random.Random 's parameter to have a proper name. versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 05:56:55 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 20 Jun 2018 09:56:55 +0000 Subject: [New-bugs-announce] [issue33911] [EASY] test_docxmlrpc fails when run with -Werror Message-ID: <1529488615.5.0.56676864532.issue33911@psf.upfronthosting.co.za> New submission from STINNER Victor : Ok, but notice the two warnings: vstinner at apu$ ./python -m test test_docxmlrpc Run tests sequentially 0:00:00 load avg: 1.19 [1/1] test_docxmlrpc /home/vstinner/prog/python/master/Lib/xmlrpc/server.py:791: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly formatvalue=self.formatvalue) /home/vstinner/prog/python/master/Lib/xmlrpc/server.py:784: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly formatvalue=self.formatvalue == Tests result: SUCCESS == 1 test OK. Total duration: 2 sec 698 ms Tests result: SUCCESS Fail: vstinner at apu$ ./python -Werror -m test -v test_docxmlrpc test_annotations (test.test_docxmlrpc.DocXMLRPCHTTPGETServer) Test that annotations works as expected ... ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 45060) Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/socketserver.py", line 313, in _handle_request_noblock self.process_request(request, client_address) File "/home/vstinner/prog/python/master/Lib/socketserver.py", line 344, in process_request self.finish_request(request, client_address) File "/home/vstinner/prog/python/master/Lib/socketserver.py", line 357, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/vstinner/prog/python/master/Lib/socketserver.py", line 717, in __init__ self.handle() File "/home/vstinner/prog/python/master/Lib/http/server.py", line 426, in handle self.handle_one_request() File "/home/vstinner/prog/python/master/Lib/http/server.py", line 414, in handle_one_request method() File "/home/vstinner/prog/python/master/Lib/xmlrpc/server.py", line 936, in do_GET response = self.server.generate_html_documentation().encode('utf-8') File "/home/vstinner/prog/python/master/Lib/xmlrpc/server.py", line 910, in generate_html_documentation methods File "/home/vstinner/prog/python/master/Lib/xmlrpc/server.py", line 828, in docserver contents.append(self.docroutine(value, key, funcs=fdict)) File "/home/vstinner/prog/python/master/Lib/xmlrpc/server.py", line 791, in docroutine formatvalue=self.formatvalue) File "/home/vstinner/prog/python/master/Lib/inspect.py", line 1225, in formatargspec stacklevel=2) DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly ---------------------------------------- ERROR (...) == Tests result: FAILURE == 1 test failed: test_docxmlrpc Total duration: 3 sec 234 ms Tests result: FAILURE It seems like the fix is explained in the error message: Lib/xmlrpc/server.py, line 791, in docroutine(): DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly ---------- keywords: easy messages: 320043 nosy: vstinner priority: normal severity: normal status: open title: [EASY] test_docxmlrpc fails when run with -Werror versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 05:59:24 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 20 Jun 2018 09:59:24 +0000 Subject: [New-bugs-announce] [issue33912] [EASY] test_warnings: test_exec_filename() fails when run with -Werror Message-ID: <1529488764.99.0.56676864532.issue33912@psf.upfronthosting.co.za> New submission from STINNER Victor : vstinner at apu$ ./python -W error -m test -v test_warnings ====================================================================== ERROR: test_exec_filename (test.test_warnings.CWarnTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/test/test_warnings/__init__.py", line 450, in test_exec_filename exec(codeobj) File "", line 2, in UserWarning: hello ====================================================================== ERROR: test_exec_filename (test.test_warnings.PyWarnTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/master/Lib/test/test_warnings/__init__.py", line 450, in test_exec_filename exec(codeobj) File "", line 2, in File "/home/vstinner/prog/python/master/Lib/warnings.py", line 318, in warn globals, source) File "/home/vstinner/prog/python/master/Lib/warnings.py", line 363, in warn_explicit raise message UserWarning: hello It seems to be a regression introduced by bpo-33375: commit 11a896652ee98aa44e59ed25237f9efb56635dcf. ---------- components: Tests keywords: easy messages: 320044 nosy: vstinner priority: normal severity: normal status: open title: [EASY] test_warnings: test_exec_filename() fails when run with -Werror versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 06:32:47 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 20 Jun 2018 10:32:47 +0000 Subject: [New-bugs-announce] [issue33913] test_multiprocessing_spawn random failures on x86 Windows7 3.6 Message-ID: <1529490767.83.0.56676864532.issue33913@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/90/builds/414 ====================================================================== FAIL: test_ipython_workaround (test.test_multiprocessing_main_handling.SpawnCmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\test\test_multiprocessing_main_handling.py", line 184, in test_ipython_workaround self._check_script(script_no_suffix) File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\test\test_multiprocessing_main_handling.py", line 157, in _check_script rc, out, err = assert_python_ok(*run_args, __isolated=False) File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\test\support\script_helper.py", line 155, in assert_python_ok return _assert_python(True, *args, **env_vars) File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\test\support\script_helper.py", line 141, in _assert_python err)) AssertionError: Process return code is 1 command line: ['D:\\cygwin\\home\\db3l\\buildarea\\3.6.bolen-windows7\\build\\PCbuild\\win32\\python_d.exe', '-X', 'faulthandler', '-E', 'd:\\temp\\tmp4zf7ti6l\\ipython', 'spawn'] stdout: --- --- stderr: --- Traceback (most recent call last): File "d:\temp\tmp4zf7ti6l\ipython", line 23, in raise RuntimeError("Timed out waiting for results") RuntimeError: Timed out waiting for results --- ====================================================================== FAIL: test_timeout (test.test_multiprocessing_spawn.WithThreadsTestQueue) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 883, in test_timeout self.assertGreaterEqual(delta, 0.170) AssertionError: 0.16714811325073242 not greater than or equal to 0.17 ====================================================================== FAIL: test_package (test.test_multiprocessing_main_handling.SpawnCmdLineTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\test\test_multiprocessing_main_handling.py", line 257, in test_package self._check_script(launch_name) File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\test\test_multiprocessing_main_handling.py", line 157, in _check_script rc, out, err = assert_python_ok(*run_args, __isolated=False) File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\test\support\script_helper.py", line 155, in assert_python_ok return _assert_python(True, *args, **env_vars) File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\test\support\script_helper.py", line 141, in _assert_python err)) AssertionError: Process return code is 1 command line: ['D:\\cygwin\\home\\db3l\\buildarea\\3.6.bolen-windows7\\build\\PCbuild\\win32\\python_d.exe', '-X', 'faulthandler', '-E', 'd:\\temp\\tmp3xpannzo\\launch.py', 'spawn'] stdout: --- --- stderr: --- Traceback (most recent call last): File "d:\temp\tmp3xpannzo\launch.py", line 3, in runpy._run_module_as_main('test_pkg') File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "D:\cygwin\home\db3l\buildarea\3.6.bolen-windows7\build\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "d:\temp\tmp3xpannzo\test_pkg\__main__.py", line 23, in raise RuntimeError("Timed out waiting for results") RuntimeError: Timed out waiting for results --- => see bpo-30317 for test_timeout() failure. ---------- components: Tests messages: 320059 nosy: vstinner priority: normal severity: normal status: open title: test_multiprocessing_spawn random failures on x86 Windows7 3.6 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 06:39:13 2018 From: report at bugs.python.org (Vibhuti) Date: Wed, 20 Jun 2018 10:39:13 +0000 Subject: [New-bugs-announce] [issue33914] test_gdb fails for Python 2.7.15 Message-ID: <1529491153.96.0.56676864532.issue33914@psf.upfronthosting.co.za> New submission from Vibhuti : ====================================================================== FAIL: test_down_at_bottom (test.test_gdb.StackNavigationTests) Verify handling of "py-down" at the bottom of the stack ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 708, in test_down_at_bottom cmds_after_breakpoint=['py-down']) File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 221, in get_stack_trace self.assertEqual(unexpected_errlines, []) AssertionError: Lists differ: ['Cannot create process: Opera... != [] First list contains 4 additional elements. First extra element 0: 'Cannot create process: Operation not permitted' + [] - ['Cannot create process: Operation not permitted', - 'During startup program exited with code 127.', - "Python Exception No frame is currently selected.: ", - 'Error occurred in Python command: No frame is currently selected.'] ---------------------------------------------------------------------- Ran 49 tests in 0.170s FAILED (failures=1, skipped=48) test test_gdb failed -- Traceback (most recent call last): File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 708, in test_down_at_bottom cmds_after_breakpoint=['py-down']) File "/home/test/Python-2.7.15/Lib/test/test_gdb.py", line 221, in get_stack_trace self.assertEqual(unexpected_errlines, []) AssertionError: Lists differ: ['Cannot create process: Opera... != [] First list contains 4 additional elements. First extra element 0: 'Cannot create process: Operation not permitted' + [] - ['Cannot create process: Operation not permitted', - 'During startup program exited with code 127.', - "Python Exception No frame is currently selected.: ", - 'Error occurred in Python command: No frame is currently selected.'] 1 test failed: test_gdb ---------- components: Build messages: 320060 nosy: vibhutisawant priority: normal severity: normal status: open title: test_gdb fails for Python 2.7.15 type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 08:30:21 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 20 Jun 2018 12:30:21 +0000 Subject: [New-bugs-announce] [issue33915] VSTS: Initialize phase: failed Message-ID: <1529497821.28.0.56676864532.issue33915@psf.upfronthosting.co.za> New submission from STINNER Victor : Just one example: VSTS: Linux-PR ? Linux-PR_20180620.24 failed: https://python.visualstudio.com/cpython/cpython%20Team/_build/results?buildId=11119&view=logs "Initialize phase: failed" """ 2018-06-20T12:20:59.9720705Z ##[section]Starting: Expand phase phase1 2018-06-20T12:20:59.9876970Z Execution: 2018-06-20T12:20:59.9876970Z MaxConcurrency: 2018-06-20T12:20:59.9876970Z Default Value: 1 2018-06-20T12:20:59.9876970Z ##[section]Finishing: Expand phase phase1 """ ---------- components: Tests messages: 320072 nosy: brett.cannon, eric.snow, steve.dower, vstinner priority: normal severity: normal status: open title: VSTS: Initialize phase: failed versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 11:59:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 20 Jun 2018 15:59:40 +0000 Subject: [New-bugs-announce] [issue33916] test_lzma: test_refleaks_in_decompressor___init__() leaks 100 handles on Windows Message-ID: <1529510380.41.0.56676864532.issue33916@psf.upfronthosting.co.za> New submission from STINNER Victor : Using my PR 7827, I saw that test_refleaks_in_decompressor___init__() of test_lzma leaks 100 handles on Windows. Extract of the code: @support.refcount_test def test_refleaks_in_decompressor___init__(self): gettotalrefcount = support.get_attribute(sys, 'gettotalrefcount') lzd = LZMADecompressor() refs_before = gettotalrefcount() for i in range(100): lzd.__init__() self.assertAlmostEqual(gettotalrefcount() - refs_before, 0, delta=10) The test comes from bpo-31787: commit d019bc8319ea35e93bf4baa38098ff1b57cd3ee5. ---------- components: Windows messages: 320087 nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: test_lzma: test_refleaks_in_decompressor___init__() leaks 100 handles on Windows type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 12:54:43 2018 From: report at bugs.python.org (Matthias Klose) Date: Wed, 20 Jun 2018 16:54:43 +0000 Subject: [New-bugs-announce] [issue33917] idlelib/idle_test/template.py has invalid syntax Message-ID: <1529513683.65.0.56676864532.issue33917@psf.upfronthosting.co.za> New submission from Matthias Klose : Seen with the 3.6 branch and the 3.7 branch at least. This file is installed by default, so should be valid syntax? If it's supposed to be that way, maybe call the template like template.py.in? Unpacking libpython3.6-testsuite (3.6.6~rc1-3) ... Setting up libpython3.6-testsuite (3.6.6~rc1-3) ... File "/usr/lib/python3.6/idlelib/idle_test/template.py", line 3 from idlelib import ^ SyntaxError: invalid syntax ---------- assignee: terry.reedy components: IDLE keywords: 3.6regression, 3.7regression messages: 320099 nosy: doko, terry.reedy priority: release blocker severity: normal status: open title: idlelib/idle_test/template.py has invalid syntax _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 14:24:16 2018 From: report at bugs.python.org (Liran Nuna) Date: Wed, 20 Jun 2018 18:24:16 +0000 Subject: [New-bugs-announce] [issue33918] Hooking into pause/resume of iterators/coroutines Message-ID: <1529519056.15.0.56676864532.issue33918@psf.upfronthosting.co.za> New submission from Liran Nuna : An interesting property of async programming is that execution order is nondeterministic and async function "pause" and "resume" execution as events come in. This can play havok with context managers, especially ones that wrap a global state change. I can best explain it with code - see attached file. If you were to run this, you'd notice that "Should be logged" does not get logged - this is because the execution order runs the context manager immediately and that affects the entire batch (created by asyncio.gather). Is there a way to hook into a pause/resume handling of coroutines so this kind of thing could be done correctly? I'm aware that this particular problem could be solved with the new context variables introduced with python3.7, however it is just a simplification of our actual issue. Iterators also suffer from this issue, as `yield` pauses and resumes execution. ---------- components: Interpreter Core files: async_context_managers.py messages: 320101 nosy: Liran Nuna priority: normal severity: normal status: open title: Hooking into pause/resume of iterators/coroutines type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47646/async_context_managers.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 16:06:15 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 20 Jun 2018 20:06:15 +0000 Subject: [New-bugs-announce] [issue33919] Expose _PyCoreConfig structure to Python Message-ID: <1529525175.44.0.56676864532.issue33919@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : The _PyCoreConfig structure in pystate.h has some interesting fields that I don't think are exposed anywhere else to Python-land. I was particularly interested recently in hash_seed and use_hash_seed. I'm thinking that it may be useful to expose this structure in the sys module. ---------- assignee: barry components: Interpreter Core messages: 320107 nosy: barry priority: normal severity: normal stage: needs patch status: open title: Expose _PyCoreConfig structure to Python type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 17:47:58 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 20 Jun 2018 21:47:58 +0000 Subject: [New-bugs-announce] [issue33920] test_asyncio: test_run_coroutine_threadsafe_with_timeout() failed on AMD64 FreeBSD 10.x Shared 3.7 Message-ID: <1529531278.55.0.56676864532.issue33920@psf.upfronthosting.co.za> New submission from STINNER Victor : AMD64 FreeBSD 10.x Shared 3.7: http://buildbot.python.org/all/#/builders/124/builds/397 ====================================================================== FAIL: test_run_coroutine_threadsafe_with_timeout (test.test_asyncio.test_tasks.RunCoroutineThreadsafeTests) Test coroutine submission from a thread to an event loop ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.7.koobs-freebsd10/build/Lib/test/test_asyncio/test_tasks.py", line 3108, in test_run_coroutine_threadsafe_with_timeout self.loop.run_until_complete(future) AssertionError: TimeoutError not raised ---------- components: asyncio messages: 320121 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio: test_run_coroutine_threadsafe_with_timeout() failed on AMD64 FreeBSD 10.x Shared 3.7 versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 18:56:35 2018 From: report at bugs.python.org (John Hagen) Date: Wed, 20 Jun 2018 22:56:35 +0000 Subject: [New-bugs-announce] [issue33921] Explain that '' can be used to bind to all interfaces for the AF_INET address family in the docs Message-ID: <1529535395.97.0.56676864532.issue33921@psf.upfronthosting.co.za> New submission from John Hagen : The socket documentation (https://docs.python.org/3/library/socket.html#socket-families) does not list '' as a way to bind to all interfaces for the AF_INET/AF_INET6 address family. This is answered on SO here: https://stackoverflow.com/a/8034146 but it took me a while to find it. Ideally if this was mentioned in the docs, that would be great. ---------- assignee: docs at python components: Documentation messages: 320125 nosy: John Hagen, docs at python priority: normal severity: normal status: open title: Explain that '' can be used to bind to all interfaces for the AF_INET address family in the docs type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 19:43:42 2018 From: report at bugs.python.org (Robert) Date: Wed, 20 Jun 2018 23:43:42 +0000 Subject: [New-bugs-announce] [issue33922] Enforce 64bit Python by Launcher Message-ID: <1529538222.45.0.56676864532.issue33922@psf.upfronthosting.co.za> New submission from Robert : When using the Python Launcher "py.exe", it uses 64bit by default and I can enforce using 32bit. But there is no way to enforce 64bit. If I run "py -3.6" the actual called interpreter depends on the interpreter versions installed on my system. Thus "py -3.6-64" is missing. This is important if 64bit features are required. ---------- components: Windows messages: 320127 nosy: mrh1997, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Enforce 64bit Python by Launcher type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 19:54:32 2018 From: report at bugs.python.org (Robert) Date: Wed, 20 Jun 2018 23:54:32 +0000 Subject: [New-bugs-announce] [issue33923] py.ini cannot set 32/64bits for specific version Message-ID: <1529538872.06.0.56676864532.issue33923@psf.upfronthosting.co.za> New submission from Robert : Currently py.ini allows to set default interpreters for python 3 and 2. i.e.: python3=3.6-32 python2=2.7-32 But it is not possible to set a default interpreter on a specific version. I.e. when running "py -3.6" it would be nice to set the default to 32bit. i.e.: python3.6=3.6-32 Of course this makes only sense in combination with https://bugs.python.org/issue33922 as one requires the possibility to override the 32bit default then. ---------- messages: 320128 nosy: mrh1997 priority: normal severity: normal status: open title: py.ini cannot set 32/64bits for specific version _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 20 22:06:39 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 21 Jun 2018 02:06:39 +0000 Subject: [New-bugs-announce] [issue33924] In IDLE menudefs, change 'windows' to 'window' Message-ID: <1529546799.59.0.56676864532.issue33924@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Some time ago, IDLE's main menu item 'Windows' was changed to 'Window'. The latter seems to be pretty standard for a list of open windows. Issue #33906 changed the implementation module name accordingly, from 'windows' to 'window'. This issue is about changing the 'windows' key in mainmenu.menudef to 'window'. All other keys are the lower case version of the uppercase menu item. editor subscripts derived menudict with ['windows'] and menu_specs, which maps menudef keys to menu names, includes ('windows': '_Window'). pyshell also has menu_specs Function and pseudoevent names that include 'windows'should be left alone. Besides the automated tests passing, the manual test will be that 'Window' works properly in all of Shell, editor window, and output window, as each is added. ---------- assignee: terry.reedy components: IDLE messages: 320133 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: In IDLE menudefs, change 'windows' to 'window' type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 06:07:32 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 21 Jun 2018 10:07:32 +0000 Subject: [New-bugs-announce] [issue33925] builtin_function_or_method compares __self__ by identity instead of equality Message-ID: <1529575652.49.0.56676864532.issue33925@psf.upfronthosting.co.za> New submission from Jeroen Demeyer : Methods of Python functions compare equal if the functions are equal and if __self__ is equal: >>> class X: ... def __eq__(self, other): return True ... def meth(self): pass >>> X().meth == X().meth True This is because X() == X() even though X() is not X(). For extension types, we get instead: >>> [].append == [].append False This is because comparison is done with "is" instead of "==". This is a needless difference. ---------- messages: 320148 nosy: jdemeyer priority: normal severity: normal status: open title: builtin_function_or_method compares __self__ by identity instead of equality _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 06:35:39 2018 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 21 Jun 2018 10:35:39 +0000 Subject: [New-bugs-announce] [issue33926] test_gdb is skipped in builds since gdb is not installed as part of build script Message-ID: <1529577339.32.0.56676864532.issue33926@psf.upfronthosting.co.za> New submission from Karthikeyan Singaravelan : I was checking on https://bugs.python.org/issue30345 and https://bugs.python.org/issue33914. I looked into Travis and VSTS builds for test_gdb. Though python is built with `--with-pydebug` gdb is not installed in the builds and hence the test_gdb is skipped. Adding installation of gdb will help in making sure test_gdb is run. # test_gdb skipped : * https://travis-ci.org/python/cpython/jobs/394900803#L1532 # After installation of gdb My build fails due to urllib errors and trying to install gdb using sudo apt-get install gdb on MacOS. The config can be fixed. test_gdb tests : https://travis-ci.org/tirkarthi/cpython/jobs/394947895#L2501 I am willing to make a PR for Travis but I don't know how VSTS config works to test it on VSTS builds with an account. Thanks ---------- components: Build messages: 320149 nosy: xtreak priority: normal severity: normal status: open title: test_gdb is skipped in builds since gdb is not installed as part of build script versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 06:45:40 2018 From: report at bugs.python.org (Michael Kuhlmann) Date: Thu, 21 Jun 2018 10:45:40 +0000 Subject: [New-bugs-announce] [issue33927] Allow json.tool to have identical infile and outfile Message-ID: <1529577940.46.0.56676864532.issue33927@psf.upfronthosting.co.za> New submission from Michael Kuhlmann : It would be nice to have same infile and outfile for json.tool to replace json files with their pretty-printed version. Currently, if I try this I get an error: $ python3 -m json.tool example.json example.json Expecting value: line 1 column 1 (char 0) ---------- messages: 320151 nosy: kuhlmann priority: normal severity: normal status: open title: Allow json.tool to have identical infile and outfile type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 06:55:58 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 21 Jun 2018 10:55:58 +0000 Subject: [New-bugs-announce] [issue33928] _Py_DecodeUTF8Ex() creates surrogate pairs on Windows Message-ID: <1529578558.62.0.56676864532.issue33928@psf.upfronthosting.co.za> New submission from STINNER Victor : _Py_DecodeUTF8Ex() creates surrogate pairs with 16-bit wchar_t (on Windows), whereas input bytes should be escaped. I'm quite sure that it's a bug. ---------- components: Interpreter Core messages: 320154 nosy: serhiy.storchaka, vstinner priority: normal severity: normal status: open title: _Py_DecodeUTF8Ex() creates surrogate pairs on Windows versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 07:02:52 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 21 Jun 2018 11:02:52 +0000 Subject: [New-bugs-announce] [issue33929] test_multiprocessing_spawn leaks 5 handles Message-ID: <1529578972.56.0.56676864532.issue33929@psf.upfronthosting.co.za> New submission from STINNER Victor : The following test leaks 5 open handles when checking for leaks using my PR 7827: test.test_multiprocessing_spawn.WithProcessesTestProcess.test_many_processes Command to reproduce the leak (using my PR 7827): python -m test -R 3:3 test_multiprocessing_spawn -m test.test_multiprocessing_spawn.WithProcessesTestProcess.test_many_processes ---------- components: Library (Lib) messages: 320160 nosy: vstinner priority: normal severity: normal status: open title: test_multiprocessing_spawn leaks 5 handles versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 07:27:57 2018 From: report at bugs.python.org (Alistair Buxton) Date: Thu, 21 Jun 2018 11:27:57 +0000 Subject: [New-bugs-announce] [issue33930] Segfault with deep recursion into object().__dir__ Message-ID: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> New submission from Alistair Buxton : The following small snippet of code will crash 3.6.5 with a segfault. The crash occurs at cleanup, so it won't happen in the interactive interpreter (until you exit). # --- code --- o = object() for x in range(1000000): o = o.__dir__ print(x, id(o.__dir__)) # --- end code --- ---------- components: Interpreter Core messages: 320167 nosy: a-j-buxton priority: normal severity: normal status: open title: Segfault with deep recursion into object().__dir__ type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 08:45:50 2018 From: report at bugs.python.org (Anselm Kruis) Date: Thu, 21 Jun 2018 12:45:50 +0000 Subject: [New-bugs-announce] [issue33931] Building 2.7 on Windows with PC\VS9.0 is broken Message-ID: <1529585150.62.0.56676864532.issue33931@psf.upfronthosting.co.za> New submission from Anselm Kruis : Currently 2.7 fails to build on Win32 using PC\VS90\build.bat -e for two reasons: 1. Wrong openssl version: PC\VS9.0 is still at version 1.0.2k, whereas PCbuild/get_externals.bat downloads version 1.0.2o. 2. Building tcl fails with well known "nmakehlp" not found problem. It is caused by the following line in PC\VS90\build.bat: "nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" clean all". Separate invocations of nmake for "clean" and "all" fix the problem. I'll provide a pull request for both issues. I hope it is OK to make just a single PR, because the changes are trivial. Relevant output from PC\VS90\build.bat: Setting environment for using Microsoft Visual Studio 2008 x86 tools. Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. =============================================================================== *** Compiler has 'Optimizations' *** Compiler does not have 'Pentium 0x0f fix' *** Linker has 'Win98 alignment problem' *** Intermediate directory will be '.\Release_VC9\tcl_Dynamic' *** Output directory will be '.\Release_VC9' *** Suffix for binaries will be '' *** Optional defines are '-DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DNDEBUG -DTCL_CFG_OPTIMIZED' *** Compiler version 9. Target machine is IX86 *** Host architecture is AMD64 *** Compiler options '-W3 -Ot -Oi -fp:strict -Gs -GS -GL -RTC1 -W3' *** Link options '-ltcg' *** Dependency rules are not being used. Cleaning .\Release_VC9\tcl_Dynamic\* ... Cleaning ..\win\nmakehlp.obj ... Cleaning ..\win\nmakehlp.exe ... Cleaning ..\win\_junk.pch ... Cleaning ..\win\vercl.x ... Cleaning ..\win\vercl.i ... Cleaning ..\win\versions.vc ... cl -nologo -c -W3 -W3 -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE -Fp.\Release_VC9\tcl_Dynamic\ -O2 -Ot -Oi -fp:strict -Gs -GS -GL -MD -I" ..\win" -I"..\generic" -I"..\libtommath" -DTCL_PIPE_DLL=\"tclpip85.dll\" -DTCL_TOMMATH -DMP_PREC=4 -Dinline=__inline -DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEA DERS -DNDEBUG -DTCL_CFG_OPTIMIZED -DTCL_USE_STATIC_PACKAGES=0 -Fo.\Release_VC9\tcl_Dynamic\tclAppInit.obj ..\win\tclAppInit.c tclAppInit.c Der Befehl "nmakehlp" ist entweder falsch geschrieben oder konnte nicht gefunden werden. NMAKE : fatal error U1077: 'nmakehlp' : return code '0x1' Stop. Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. =============================================================================== *** Compiler has 'Optimizations' *** Compiler does not have 'Pentium 0x0f fix' *** Linker has 'Win98 alignment problem' *** Intermediate directory will be '.\Release_VC9\tcl_Dynamic' *** Output directory will be '.\Release_VC9' *** Suffix for binaries will be '' *** Optional defines are '-DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DNDEBUG -DTCL_CFG_OPTIMIZED' *** Compiler version 9. Target machine is IX86 *** Host architecture is AMD64 *** Compiler options '-W3 -Ot -Oi -fp:strict -Gs -GS -GL -RTC1 -W3' *** Link options '-ltcg' *** Dependency rules are not being used. Installing to 'D:\kruis_F\fg2\stackless\python\PC\VS9.0\..\..\externals\tcltk' Installing tcl85.dll Datei tcl85.dll nicht gefunden NMAKE : fatal error U1077: 'xcopy' : return code '0x4' Stop. ---------- assignee: christian.heimes components: SSL, Tkinter messages: 320172 nosy: anselm.kruis, christian.heimes, steve.dower, zach.ware priority: normal severity: normal status: open title: Building 2.7 on Windows with PC\VS9.0 is broken type: compile error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 09:08:48 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 21 Jun 2018 13:08:48 +0000 Subject: [New-bugs-announce] [issue33932] Calling Py_Initialize() twice now triggers a fatal error (Python 3.7) Message-ID: <1529586528.15.0.56676864532.issue33932@psf.upfronthosting.co.za> New submission from STINNER Victor : It would help to document that calling Py_Initialize() twice in Python 3.7 now triggers a fatal error, whereas previous the second call did nothing. Document it at: https://docs.python.org/dev/whatsnew/3.7.html#changes-in-the-c-api ... Or should it be considered as a regression? -- My colleague Miro Hron?ok reported a Python crash (SIGABRT) when running https://github.com/konlpy/konlpy test suite on Python 3.7: "Fatal Python error: _Py_InitializeCore: main interpreter already initialized" konlpy uses the JPype project, the bug is in JPype initialization function (it's a C extension): * https://github.com/originell/jpype/issues/331 * https://github.com/originell/jpype/pull/332 ---------- assignee: docs at python components: Documentation keywords: easy messages: 320175 nosy: docs at python, eric.snow, ncoghlan, ned.deily, vstinner priority: normal severity: normal status: open title: Calling Py_Initialize() twice now triggers a fatal error (Python 3.7) versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 09:25:21 2018 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 21 Jun 2018 13:25:21 +0000 Subject: [New-bugs-announce] [issue33933] Error message says dict has no len Message-ID: <1529587521.24.0.56676864532.issue33933@psf.upfronthosting.co.za> New submission from Vedran ?a?i? : Look at this: >>> import bisect >>> bisect.bisect({}, None) Traceback (most recent call last): File "", line 1, in bisect.bisect({}, None) TypeError: object of type 'dict' has no len() Of course, objects of type 'dict' do have len. The problem is that bisect considers its first argument a sequence, which is very sensible to do (although, with ordered dicts, it's not the only sensible choice), but it gives a very wrong error message given that context. At https://bugs.python.org/issue32500, R. David Murray told me to open this. ---------- components: Interpreter Core messages: 320178 nosy: veky priority: normal severity: normal status: open title: Error message says dict has no len versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 12:00:37 2018 From: report at bugs.python.org (Nicolas Hainaux) Date: Thu, 21 Jun 2018 16:00:37 +0000 Subject: [New-bugs-announce] [issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux) Message-ID: <1529596837.65.0.56676864532.issue33934@psf.upfronthosting.co.za> New submission from Nicolas Hainaux : Expected behaviour: When unset, the locale in use is `C` (as stated in python documentation) and `locale.getlocale()` returns `(None, None)` on Linux with python2.7 or on Windows with python2.7 and python 3.6 (at least): $ python2 Python 2.7.15 (default, May 1 2018, 20:16:04) [GCC 7.3.1 20180406] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.getlocale() (None, None) >>> Issue: But when using python3.4+ on Linux, instead of `(None, None)`, `locale.getlocale()` returns the same value as `locale.getdefaultlocale()`: $ python Python 3.6.3 (default, Oct 24 2017, 14:48:20) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.getlocale() ('fr_FR', 'UTF-8') >>> locale.localeconv() {'int_curr_symbol': '', 'currency_symbol': '', 'mon_decimal_point': '', 'mon_thousands_sep': '', 'mon_grouping': [], 'positive_sign': '', 'negative_sign': '', 'int_frac_digits': 127, 'frac_digits': 127, 'p_cs_precedes': 127, 'p_sep_by_space': 127, 'n_cs_precedes': 127, 'n_sep_by_space': 127, 'p_sign_posn': 127, 'n_sign_posn': 127, 'decimal_point': '.', 'thousands_sep': '', 'grouping': []} >>> locale.str(2.5) '2.5' Though the locale actually in use is still `C` (as shown above by the output of `locale.localeconv()` and confirmed by the result of `locale.str(2.5)`, which shows a dot as decimal point and not a comma (as expected with `fr_FR.UTF-8`)). I could observe this confusing behaviour on Linux with python3.4, 3.5, 3.6 and 3.7 (rc1). (Also on FreeBSD with python3.6.1). A problematic consequence of this behaviour is that it becomes impossible to detect whether the locale has already been set by the user, or not. I could not find any other similar issue and hope this is not a duplicate. ---------- components: Library (Lib) messages: 320192 nosy: zezollo priority: normal severity: normal status: open title: locale.getlocale() seems wrong when the locale is yet unset (python3 on linux) type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 20:38:26 2018 From: report at bugs.python.org (Deniz Bozyigit) Date: Fri, 22 Jun 2018 00:38:26 +0000 Subject: [New-bugs-announce] [issue33935] shutil.copyfile throws incorrect SameFileError Message-ID: <1529627906.69.0.56676864532.issue33935@psf.upfronthosting.co.za> New submission from Deniz Bozyigit : When using shutil.copyfile on the Google Drive File Stream file system, a incorrect SameFileError can occur. MWE (assuming foo.txt exists in your google drive G:\\): >>> f1 = 'G:\\My Drive\\foo.txt' >>> f2 = 'G:\\My Drive\\foo2.txt' >>> import shutil >>> shutil.copyfile(f1, f2) >>> shutil.copyfile(f1, f2) --> Last line throws incorrect SameFileError. In comparison, executing the same code on a different file system (e.g. local hard drive) will result in no errors. More details described here: https://github.com/jupyter/notebook/issues/3615 The error originates in the library in generalpath.py in the function samestat: Google Drive File Stream reports inode==0 which makes os.path.samefile(f1, f2) == True for any files f1 and f2 on Google File Stream. I propose the following patch, which currently works for me: --- genericpath.py 2018-06-22 02:14:27.145744900 +0200 +++ genericpath_new.py 2018-06-22 02:10:44.485961100 +0200 @@ -86,8 +86,11 @@ # describing the same file? def samestat(s1, s2): """Test whether two stat buffers reference the same file""" - return (s1.st_ino == s2.st_ino and - s1.st_dev == s2.st_dev) + return (s1.st_ino != 0 and + s2.st_ino != 0 and + s1.st_ino == s2.st_ino and + s1.st_dev == s2.st_dev) + # Are two filenames really pointing to the same file? ---------- components: Library (Lib), Windows messages: 320199 nosy: Deniz Bozyigit, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: shutil.copyfile throws incorrect SameFileError type: crash versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 21 22:50:21 2018 From: report at bugs.python.org (Quentin Minster) Date: Fri, 22 Jun 2018 02:50:21 +0000 Subject: [New-bugs-announce] [issue33936] OPENSSL_VERSION_1_1 never defined in _hashopenssl.c Message-ID: <1529635821.29.0.56676864532.issue33936@psf.upfronthosting.co.za> New submission from Quentin Minster : I'm getting a compile error in Modules/_hashopenssl.c because the file uses some pre-1.1.0 APIs even though I'm running OpenSSL 1.1.0. This is because this file doesn't define the OPENSSL_VERSION_1_1 macro, like Modules/_ssl.c does. ---------- components: Extension Modules messages: 320207 nosy: laomaiweng priority: normal severity: normal status: open title: OPENSSL_VERSION_1_1 never defined in _hashopenssl.c type: compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 22 03:32:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 22 Jun 2018 07:32:56 +0000 Subject: [New-bugs-announce] [issue33937] [3.6] test_socket: testSendmsgTimeout() failed on Travis CI Message-ID: <1529652776.13.0.56676864532.issue33937@psf.upfronthosting.co.za> New submission from STINNER Victor : https://travis-ci.org/python/cpython/jobs/395349473 ====================================================================== ERROR: testSendmsgTimeout (test.test_socket.SendmsgSCTPStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/travis/build/python/cpython/Lib/test/test_socket.py", line 281, in _tearDown raise exc File "/home/travis/build/python/cpython/Lib/test/test_socket.py", line 299, in clientRun test_func() File "/home/travis/build/python/cpython/Lib/test/test_socket.py", line 2319, in _testSendmsgTimeout self.sendmsgToServer([b"a"*512]) File "/home/travis/build/python/cpython/Lib/test/test_socket.py", line 2008, in sendmsgToServer *(args + self.sendmsg_to_server_defaults[len(args):])) OSError: [Errno 12] Cannot allocate memory ====================================================================== FAIL: testSendmsgDontWait (test.test_socket.SendmsgSCTPStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/travis/build/python/cpython/Lib/test/test_socket.py", line 281, in _tearDown raise exc File "/home/travis/build/python/cpython/Lib/test/test_socket.py", line 299, in clientRun test_func() File "/home/travis/build/python/cpython/Lib/test/test_socket.py", line 2343, in _testSendmsgDontWait (errno.EAGAIN, errno.EWOULDBLOCK)) AssertionError: 12 not found in (11, 11) test_socket failed when run in parallel, but also when the test has been re-run sequentially in verbose mode. == Tests result: FAILURE then FAILURE == 393 tests OK. 10 slowest tests: - test_multiprocessing_spawn: 2 min 36 sec - test_multiprocessing_forkserver: 1 min 41 sec - test_multiprocessing_fork: 1 min 26 sec - test_asyncio: 1 min 8 sec - test_concurrent_futures: 1 min 7 sec - test_subprocess: 59 sec - test_zipfile: 47 sec - test_io: 42 sec - test_lib2to3: 33 sec - test_lzma: 29 sec 1 test failed: test_socket 13 tests skipped: test_devpoll test_gdb test_kqueue test_msilib test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly test_winconsoleio test_winreg test_winsound test_zipfile64 1 re-run test: test_socket ---------- components: Tests messages: 320217 nosy: vstinner priority: normal severity: normal status: open title: [3.6] test_socket: testSendmsgTimeout() failed on Travis CI versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 22 06:51:54 2018 From: report at bugs.python.org (David) Date: Fri, 22 Jun 2018 10:51:54 +0000 Subject: [New-bugs-announce] [issue33938] Cross compilation fail for ARM Message-ID: <1529664714.01.0.56676864532.issue33938@psf.upfronthosting.co.za> New submission from David : Hi all, I fail on cross compiling Python 2.7.14 for ARM using a self built toolchain. Build host: Linux x86-64 CentOS 7 Target: arm cortex-a9 My steps are compiling python for the host, after that compiling python for the target using the PYTHON_FOR_BUILD flag with the prior built python. Compile settings: cd /home/op/Projekte/Cross_Linux/src/Python-2.7.15 && ./configure --host=arm-cortexa9_neon-linux-gnueabihf ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_have_long_long_format=yes --enable-shared --disable-ipv6 --build=x86_64-pc-linux-gnu PYTHON_FOR_BUILD=/home/op/Projekte/Cross_Linux/hostsrc/../root/bin/python --prefix=/home/op/Projekte/Cross_Linux/src/Python-2.7.15/_install || exit 11 ;\ make -C /home/op/Projekte/Cross_Linux/src/Python-2.7.15 V=1 || exit 12 ;\ make -C /home/op/Projekte/Cross_Linux/src/Python-2.7.15 install V=1 || exit 13 ;\ Last snippet from the build log for the target: building 'ossaudiodev' extension arm-cortexa9_neon-linux-gnueabihf-gcc -fPIC -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I. -IInclude -I/usr/local/include -I/usr/include/python2.7 -c ossaudiodev.c -o build/temp.linux-x86_64-2.7/ossaudiodev.o arm-cortexa9_neon-linux-gnueabihf-gcc: Fehler: nicht erkanntes Kommandozeilenargument in Option ?-mtune=generic? arm-cortexa9_neon-linux-gnueabihf-gcc: Anmerkung: g?ltige Argumente f?r ?-mtune=? sind: arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e arm9tdmi cortex-a12 cortex-a15 cortex-a15.cortex-a7 cortex-a5 cortex-a53 cortex-a57 cortex-a57.cortex-a53 cortex-a7 cortex-a8 cortex-a9 cortex-m0 cortex-m0plus cortex-m1 cortex-m3 cortex-m4 cortex-r4 cortex-r4f cortex-r5 cortex-r7 ep9312 fa526 fa606te fa626 fa626te fa726te fmp626 generic-armv7-a iwmmxt iwmmxt2 marvell-pj4 mpcore mpcorenovfp native strongarm strongarm110 strongarm1100 strongarm1110 xscale arm-cortexa9_neon-linux-gnueabihf-gcc: Fehler: nicht erkanntes Kommandozeilenargument in Option ?-mtune=generic? arm-cortexa9_neon-linux-gnueabihf-gcc: Anmerkung: g?ltige Argumente f?r ?-mtune=? sind: arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e arm9tdmi cortex-a12 cortex-a15 cortex-a15.cortex-a7 cortex-a5 cortex-a53 cortex-a57 cortex-a57.cortex-a53 cortex-a7 cortex-a8 cortex-a9 cortex-m0 cortex-m0plus cortex-m1 cortex-m3 cortex-m4 cortex-r4 cortex-r4f cortex-r5 cortex-r7 ep9312 fa526 fa606te fa626 fa626te fa726te fmp626 generic-armv7-a iwmmxt iwmmxt2 marvell-pj4 mpcore mpcorenovfp native strongarm strongarm110 strongarm1100 strongarm1110 xscale arm-cortexa9_neon-linux-gnueabihf-gcc: Fehler: ossaudiodev.c: Datei oder Verzeichnis nicht gefunden arm-cortexa9_neon-linux-gnueabihf-gcc: Fehler: nicht erkannte Kommandozeilenoption ?-m64? arm-cortexa9_neon-linux-gnueabihf-gcc: Fehler: nicht erkannte Kommandozeilenoption ?-m64? arm-cortexa9_neon-linux-gnueabihf-gcc: schwerwiegender Fehler: keine Eingabedateien Kompilierung beendet. error: /builddir/build/BUILD/Python-2.7.5/Modules/_ctypes/libffi: No such file or directory make[1]: *** [sharedmods] Fehler 1 I can't get rid of the wrong compiler flags -m64 and -mtune=generic. Target python build log attached. ---------- components: Cross-Build files: targetpython_build.log messages: 320222 nosy: Alex.Willmer, n0s69z priority: normal severity: normal status: open title: Cross compilation fail for ARM type: compile error versions: Python 2.7 Added file: https://bugs.python.org/file47647/targetpython_build.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 22 08:48:14 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 22 Jun 2018 12:48:14 +0000 Subject: [New-bugs-announce] [issue33939] Raise TypeError in __length_hint__ for consistently infinite iterators Message-ID: <1529671694.59.0.56676864532.issue33939@psf.upfronthosting.co.za> New submission from Nick Coghlan : This is a simpler proposal born out of https://bugs.python.org/issue31815: adding __length_hint__ implementations to some known-infinite iterators in itertools that always raise TypeError. This means that iterator consumers that use the operator.length_hint() API will throw an error when asked to consume them, rather than entering an uninterruptible infinite loop. The proposed methods added by this proposal would be: * itertools.count.__length_hint__ * itertools.cycle.__length_hint__ * itertools.repeat.__length_hint__ Each of these would raise TypeError (to indicate an explicitly non-finite length), rather than returning the default of 0 (which length hint API consumers typically interpret as indicating an unknown-but-finite length) ---------- messages: 320229 nosy: ncoghlan, rhettinger priority: normal severity: normal stage: needs patch status: open title: Raise TypeError in __length_hint__ for consistently infinite iterators type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 22 08:57:29 2018 From: report at bugs.python.org (Raghunath Lingutla) Date: Fri, 22 Jun 2018 12:57:29 +0000 Subject: [New-bugs-announce] [issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name Message-ID: <1529672249.4.0.56676864532.issue33940@psf.upfronthosting.co.za> New submission from Raghunath Lingutla : Python3.6 module datetime.strptime didn't have directive to convert date values having Era designator (AD or BC) and time zone (Ex: EST, PST, -07:00) Below are few example for date values which are not supported 2018-04-14 12:08:56 EST 2018-05-23 11:03:43 PST 2017-12-24 AD 12:08:56 2018-05-23 11:03:43 +05:30 ---------- components: Extension Modules messages: 320231 nosy: RaghunathLingutla priority: normal severity: normal status: open title: datetime.strptime have no directive to convert date values with Era and Time Zone name type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 22 09:03:38 2018 From: report at bugs.python.org (Raghunath Lingutla) Date: Fri, 22 Jun 2018 13:03:38 +0000 Subject: [New-bugs-announce] [issue33941] datetime.strptime not able to recognize invalid date formats Message-ID: <1529672618.24.0.56676864532.issue33941@psf.upfronthosting.co.za> New submission from Raghunath Lingutla : Can not recognize invalid date values for %Y%m%d, %y%m%d, %Y%m%d %H:%M and few more formats. In Java we have setLenient option which help us to validate to pattern and convert only valid formats Ex: datetime.strptime('181223', '%Y%m%d') For above input I am getting output as 1812-02-03 00:00:00 but expected output is error as ValueError: time data '181223' does not match format '%Y%m%d' I tested below mentioned 4 modules. All modules giving same output 1) datetime.strptime 2) timestring.Date 3) parser.parse from dateutil 4) dateparser.parse ---------- components: Tests messages: 320233 nosy: Raghunath Lingutla priority: normal severity: normal status: open title: datetime.strptime not able to recognize invalid date formats type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 22 11:12:18 2018 From: report at bugs.python.org (Jasper Trooster) Date: Fri, 22 Jun 2018 15:12:18 +0000 Subject: [New-bugs-announce] [issue33942] IDLE crash when typing opening bracket Message-ID: <1529680338.33.0.56676864532.issue33942@psf.upfronthosting.co.za> New submission from Jasper Trooster : Sometimes when I type print in my code, the application crashes. Then a window pops up, saying that the program suddenly stopped (description of error message below). When I click on the option to reopen IDLE, nothing happens, I have to manually reopen it again. I have already sent a report to Apple. Description of the error message: IDLE suddenly stopped. Click on 'Reopen' to reopen the program. Click on 'Report' to view more information and send a report to Apple. (?) (Ignore) (Report...) (Open) I am coding on a Macbook from late 2008 on OSX El Capitan, version 10.11.6. ---------- assignee: terry.reedy components: IDLE files: bug report.mov messages: 320240 nosy: Japsert, terry.reedy priority: normal severity: normal status: open title: IDLE crash when typing opening bracket type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47648/bug report.mov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 22 11:45:56 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 22 Jun 2018 15:45:56 +0000 Subject: [New-bugs-announce] [issue33943] doc Add references to logging.basicConfig Message-ID: <1529682356.57.0.56676864532.issue33943@psf.upfronthosting.co.za> New submission from Andr?s Delfino : IMHO, the logging.basicConfig documentation could have some useful references for filemodes, time.strftime, printf-formatting, and logging level. PR adds them. ---------- assignee: docs at python components: Documentation messages: 320242 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Add references to logging.basicConfig versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 22 13:22:20 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 22 Jun 2018 17:22:20 +0000 Subject: [New-bugs-announce] [issue33944] Deprecate and remove pth files Message-ID: <1529688140.44.0.56676864532.issue33944@psf.upfronthosting.co.za> New submission from Barry A. Warsaw : pth files are evil. They are very difficult to debug because they're processed too early. They usually contain globs of inscrutable code. Exceptions in pth files can get swallowed in some cases. They are loaded in indeterminate order. They are also unnecessary to support namespace packages in Python 3 (ignoring straddling code). Let's start the process for removing them. 1. Deprecate pth files in Python 3.8 and turn them off with the -3 option. 2. Kill off pth file support once Python 2 is EOL'd. ---------- components: Library (Lib) messages: 320246 nosy: barry, brett.cannon, eric.snow priority: normal severity: normal status: open title: Deprecate and remove pth files versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 22 15:38:44 2018 From: report at bugs.python.org (Daniel Barcay) Date: Fri, 22 Jun 2018 19:38:44 +0000 Subject: [New-bugs-announce] [issue33945] concurrent.futures ProcessPoolExecutor submit() blocks on results being written Message-ID: <1529696324.57.0.56676864532.issue33945@psf.upfronthosting.co.za> New submission from Daniel Barcay : I have tracked down the exact cause of a sizable performance issue in using concurrent.futures.ProcessPoolExecutors, especially visible in cases where large amounts of data are being copied across the result. The line-number causing the bad behavior, and several remediation paths are included below. Since this affects core behavior of the module, I'm reticent to try out a patch myself unless someone chimes in on the approach. ---Bug Symptoms: ProcessPoolExecutor.submit() hangs for long periods of time non-deterministically (over 20 seconds in my job). See causes section below for exact cause. This hanging makes multiprocess job submissions impossible from a real-time constrained main thread, where the results are large objects. ---Ideal behavior: submit() should not block on any results of other jobs, and non-blocking wake signal should be used instead of a blocking put() call. ---Bug Cause: In ProcessPoolExecutor.submit() line 473, a wake signal is being sent to the management thread in the form of posting a message to the result queue, waking the thread if it was in recv() mode. I'm not even sure that this wake-up is necessary, as removing it seems to work just fine for my use-case on OSX. However, let's presume that it is for the time being.. The fact that submit() blocks on the result_queue being serviced is unnecessary, and hinders large results from being sent back across in concurrent.futures.result(). ---Possible remediations: If a more fully-fledged Queue implementation were used, this signal could be replaced by the non-blocking version. Alternately multiprocess.Queue implementation could be extended to implement non-blocking put() --- Reproduction Details I'm using concurrent.futures.ProcessPoolExecutor for a complicated data-processing use-case where the result is a large object to be sent across the result() channel. Create any such setup where the results are on the order of 50MB strings, submit 5-10 jobs at a time, and watch the time it takes to call submit(). ---------- components: Extension Modules messages: 320257 nosy: dbarcay priority: normal severity: normal status: open title: concurrent.futures ProcessPoolExecutor submit() blocks on results being written type: performance versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 22 18:26:07 2018 From: report at bugs.python.org (Ethan Smith) Date: Fri, 22 Jun 2018 22:26:07 +0000 Subject: [New-bugs-announce] [issue33946] os.symlink on Windows should use the new non-admin flag Message-ID: <1529706367.1.0.56676864532.issue33946@psf.upfronthosting.co.za> New submission from Ethan Smith : In the creators update CreateSymbolicLink added a dwflag SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE, which will allow any user to create a symlink (not only an admin). I think we should detect and try to use this flag if possible. I also think it would be nice to suggest turning on developer mode if the windows version is at or newer than the creators update. This should probably happen after https://bugs.python.org/issue28113 ---------- messages: 320288 nosy: Ethan Smith, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: os.symlink on Windows should use the new non-admin flag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 23 08:58:46 2018 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 23 Jun 2018 12:58:46 +0000 Subject: [New-bugs-announce] [issue33947] Dataclasses can raise RecursionError in __repr__ Message-ID: <1529758726.17.0.56676864532.issue33947@psf.upfronthosting.co.za> New submission from Eric V. Smith : >>> @dataclass ... class C: ... f: "C" ... >>> c = C(None) >>> c.f = c >>> c Traceback (most recent call last): File "", line 1, in File "", line 2, in __repr__ File "", line 2, in __repr__ File "", line 2, in __repr__ [Previous line repeated 328 more times] RecursionError: maximum recursion depth exceeded >>> It would be better to produce "C(f=...)". ---------- components: Library (Lib) messages: 320305 nosy: eric.smith priority: low severity: normal status: open title: Dataclasses can raise RecursionError in __repr__ type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 23 12:52:55 2018 From: report at bugs.python.org (Mikhail) Date: Sat, 23 Jun 2018 16:52:55 +0000 Subject: [New-bugs-announce] [issue33948] doc truncated lines in PDF Message-ID: <1529772775.32.0.56676864532.issue33948@psf.upfronthosting.co.za> New submission from Mikhail : Hello, Python Team, In reference.pdf I came across truncated lines in Python syntax that are not wrapped and carried forward to the next line, but instead run across the right margin. Examples "2.3 Identifiers and keywords" line contains "id_start ::= " expression" It would be VERY convenient to fix this for printing. Thank you ---------- assignee: docs at python components: Documentation messages: 320313 nosy: Mikhail_D, docs at python priority: normal severity: normal status: open title: doc truncated lines in PDF versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 23 15:27:09 2018 From: report at bugs.python.org (daniel hahler) Date: Sat, 23 Jun 2018 19:27:09 +0000 Subject: [New-bugs-announce] [issue33949] tests: allow to select tests using loadTestsFromName Message-ID: <1529782029.77.0.56676864532.issue33949@psf.upfronthosting.co.za> New submission from daniel hahler : I was not aware of `python -m test -m ?`, but think that supporting `python -m test test.module.class.name` should be supported for selecting a single test. ---------- components: Tests messages: 320325 nosy: blueyed priority: normal pull_requests: 7489 severity: normal status: open title: tests: allow to select tests using loadTestsFromName type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 23 17:10:41 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 23 Jun 2018 21:10:41 +0000 Subject: [New-bugs-announce] [issue33950] IDLE htest: don't try to test deleted tabbedpages.py Message-ID: <1529788241.37.0.56676864532.issue33950@psf.upfronthosting.co.za> New submission from Terry J. Reedy : About last September, idlelib.tabbedpages was replaced in configdialog by ttk.notebook and deleted. Delete the testing spec, which causes htest to fail when attempting to run all htests. ---------- messages: 320332 nosy: terry.reedy priority: normal severity: normal stage: commit review status: open title: IDLE htest: don't try to test deleted tabbedpages.py type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 24 02:17:16 2018 From: report at bugs.python.org (Tal Einat) Date: Sun, 24 Jun 2018 06:17:16 +0000 Subject: [New-bugs-announce] [issue33951] IDLE test failing only when called by itself: HighPageTest.test_highlight_target_text_mouse Message-ID: <1529821036.21.0.56676864532.issue33951@psf.upfronthosting.co.za> New submission from Tal Einat : The issue occurs when running the following on Windows 10 Pro 64-bit on the latest master branch (ea737751b10fff752aafed0231e8a02b82ba365d): python -m test -ugui -m test_highlight_target_text_mouse test_idle (This test failed for perhaps an unrelated reason on Travis CI for GH-7887. I encountered the issue while investigating that failure.) ---------- assignee: terry.reedy components: IDLE messages: 320357 nosy: taleinat, terry.reedy priority: normal severity: normal status: open title: IDLE test failing only when called by itself: HighPageTest.test_highlight_target_text_mouse type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 24 22:36:12 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Mon, 25 Jun 2018 02:36:12 +0000 Subject: [New-bugs-announce] [issue33952] doc Fix typo in str.upper() documentation Message-ID: <1529894172.0.0.56676864532.issue33952@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Doc says: Note that str.upper().isupper() might be False if s... Should say: Note that s.upper().isupper() might be False if s... PR fixes this. ---------- assignee: docs at python components: Documentation messages: 320395 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Fix typo in str.upper() documentation type: enhancement versions: Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 03:59:11 2018 From: report at bugs.python.org (Serge Matveenko) Date: Mon, 25 Jun 2018 07:59:11 +0000 Subject: [New-bugs-announce] [issue33953] The DEFAULT_ENTROPY variable used to store the current default random bytes value should be documented for `secrets` module Message-ID: <1529913551.53.0.56676864532.issue33953@psf.upfronthosting.co.za> New submission from Serge Matveenko : There is the corresponding section on the topic here https://github.com/python/cpython/blob/3.6/Doc/library/secrets.rst#how-many-bytes-should-tokens-use The current value of 32 bytes is mentioned there correctly. Unfortunately, there is no way to know which constant in the `secrets` stores this value. It is easy to imagine a use case to use say `DEFAULT_ENTROPY * 4` in the code and stay updated with the default entropy being increased over time. Thus, it looks reasonable to document the `secrets.DEFAULT_ENTROPY` constant in the module docs. ---------- assignee: docs at python components: Documentation messages: 320402 nosy: docs at python, lig priority: normal severity: normal status: open title: The DEFAULT_ENTROPY variable used to store the current default random bytes value should be documented for `secrets` module type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 04:23:46 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 25 Jun 2018 08:23:46 +0000 Subject: [New-bugs-announce] [issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error Message-ID: <1529915026.11.0.56676864532.issue33954@psf.upfronthosting.co.za> New submission from STINNER Victor : Example: vstinner at apu$ ./python Python 3.8.0a0 (heads/master-dirty:bcd3a1a18d, Jun 23 2018, 10:31:03) [GCC 8.1.1 20180502 (Red Hat 8.1.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.str(2.5) '2.5' >>> '{:n}'.format(2.5) '2.5' >>> locale.setlocale(locale.LC_ALL, '') 'fr_FR.UTF-8' >>> locale.str(2.5) '2,5' >>> '{:n}'.format(2.5) python: Objects/unicodeobject.c:474: _PyUnicode_CheckConsistency: Assertion `maxchar < 128' failed. Aborted (core dumped) Another example: vstinner at apu$ ./python Python 3.8.0a0 (heads/master-dirty:bcd3a1a18d, Jun 23 2018, 10:31:03) >>> import locale; locale.setlocale(locale.LC_ALL, '') 'fr_FR.UTF-8' >>> (2.5).__format__('n') python: Objects/unicodeobject.c:474: _PyUnicode_CheckConsistency: Assertion `maxchar < 128' failed. Aborted (core dumped) Result of my system Python 3.6 of Fedora 28: vstinner at apu$ python3 Python 3.6.5 (default, Mar 29 2018, 18:20:46) [GCC 8.0.1 20180317 (Red Hat 8.0.1-0.19)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.str(2.5) '2.5' >>> '{:n}'.format(2.5) '2.5' >>> locale.setlocale(locale.LC_ALL, '') 'fr_FR.UTF-8' >>> locale.str(2.5) '2,5' >>> '{:n}'.format(2.5) '?,5' >>> '{:n}'.format(3.5) '?,5' >>> '{:n}'.format(33.5) '?\x18,5' >>> '{:n}'.format(333.5) '?\x186,5' ---------- components: Unicode messages: 320403 nosy: ezio.melotti, vstinner priority: normal severity: normal status: open title: float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 07:18:15 2018 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 25 Jun 2018 11:18:15 +0000 Subject: [New-bugs-announce] [issue33955] Implement PyOS_CheckStack on macOS using pthread_get_stack*_np Message-ID: <1529925495.69.0.56676864532.issue33955@psf.upfronthosting.co.za> New submission from Ronald Oussoren : The (non-portable) pthread APIs "pthread_get_stacksize_np()" and "pthread_get_stackaddr_np()" can be used to implement PyOS_CheckStack on macOS, which would give nicer behavior than crashing when the recursion limit is too high for the stack size of the current thread. Creating a patch should be fairly easy, but does require C knowledge. ---------- components: Interpreter Core messages: 320415 nosy: ronaldoussoren priority: low severity: normal stage: needs patch status: open title: Implement PyOS_CheckStack on macOS using pthread_get_stack*_np type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 12:41:47 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 25 Jun 2018 16:41:47 +0000 Subject: [New-bugs-announce] [issue33956] update vendored expat to 2.2.5 Message-ID: <1529944907.38.0.56676864532.issue33956@psf.upfronthosting.co.za> New submission from Benjamin Peterson : https://github.com/libexpat/libexpat/releases/tag/R_2_2_5 Release 2.2.5 Tue October 31 2017 Bug fixes: #8 If the parser runs out of memory, make sure its internal state reflects the memory it actually has, not the memory it wanted to have. #11 The default handler wasn't being called when it should for a SYSTEM or PUBLIC doctype if an entity declaration handler was registered. #137 #138 Fix a case of mistakenly reported parsing success where XML_StopParser was called from an element handler #162 Function XML_ErrorString was returning NULL rather than a message for code XML_ERROR_INVALID_ARGUMENT introduced with release 2.2.1 Other changes: #106 xmlwf: Add argument -N adding notation declarations #75 #106 Test suite: Resolve expected failure cases where xmlwf output was incomplete #127 Windows: Fix test suite compilation #126 #127 Windows: Fix compilation for Visual Studio 2012 #33 #132 tests: Mass-fix compilation for XML_UNICODE_WCHAR_T #129 examples: Fix compilation for XML_UNICODE_WCHAR_T #130 benchmark: Fix compilation for XML_UNICODE_WCHAR_T #144 xmlwf: Fix compilation for XML_UNICODE_WCHAR_T; still needs Windows or MinGW for 2-byte wchar_t #9 Address two Clang Static Analyzer false positives #59 Resolve troublesome macros hiding parser struct membership and dereferencing that pointer #6 Resolve superfluous internal malloc/realloc switch #153 #155 Improve docbook2x-man detection #160 Undefine NDEBUG in the test suite (rather than rejecting it) #161 Address compiler warnings Version info bumped from 7:6:6 to 7:7:6 ---------- components: Extension Modules, XML messages: 320428 nosy: benjamin.peterson priority: normal severity: normal stage: needs patch status: open title: update vendored expat to 2.2.5 versions: Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 14:36:53 2018 From: report at bugs.python.org (Srinivas Reddy T) Date: Mon, 25 Jun 2018 18:36:53 +0000 Subject: [New-bugs-announce] [issue33957] use correct term than generic wording Message-ID: <1529951813.18.0.56676864532.issue33957@psf.upfronthosting.co.za> New submission from Srinivas Reddy T : I think it is better to use "Big-O notation" than a generic wording "computer science notation". I understand the use of latter, but i guess it helps the programmer since it makes him/her to google it or ask some one if he/she didn't know it yet. ---------- assignee: docs at python components: Documentation messages: 320433 nosy: docs at python, thatiparthy priority: normal pull_requests: 7515 severity: normal status: open title: use correct term than generic wording versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 15:56:29 2018 From: report at bugs.python.org (Philip Kendall) Date: Mon, 25 Jun 2018 19:56:29 +0000 Subject: [New-bugs-announce] [issue33958] Unused variable in pur embedding example Message-ID: <1529956589.29.0.56676864532.issue33958@psf.upfronthosting.co.za> New submission from Philip Kendall : Line 6 of the "Pure Embedding" example at https://docs.python.org/3/extending/embedding.html#pure-embedding : PyObject *pName, *pModule, *pDict, *pFunc; contains the pDict variable which is not used anywhere else in the code, giving a compiler warning. Simple fix: just remove pDict from the list of variables. I can make a PR if you need one. ---------- assignee: docs at python components: Documentation messages: 320436 nosy: Philip Kendall, docs at python priority: normal severity: normal status: open title: Unused variable in pur embedding example type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 16:20:02 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Mon, 25 Jun 2018 20:20:02 +0000 Subject: [New-bugs-announce] [issue33959] doc Remove time complexity mention from list Glossary entry Message-ID: <1529958002.86.0.56676864532.issue33959@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Per Raymond's comment in msg319931 I believe time complexity for list items access should be removed from the Glossary. ---------- assignee: docs at python components: Documentation messages: 320437 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Remove time complexity mention from list Glossary entry type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 16:40:17 2018 From: report at bugs.python.org (Julien Palard) Date: Mon, 25 Jun 2018 20:40:17 +0000 Subject: [New-bugs-announce] [issue33960] IDLE REPL: Strange indentation Message-ID: <1529959217.21.0.56676864532.issue33960@psf.upfronthosting.co.za> New submission from Julien Palard : Using IDLE REPL, I found confusing the absence of a "secondary prompt" while typing multiline statements, see attached screenshot where the "correctly aligned" code raises a SyntaxError while a strangely unaligned code is given correctly to the interpreter. ---------- assignee: terry.reedy components: IDLE files: 2018-06-25-223359_1920x1080_scrot.png messages: 320440 nosy: mdk, terry.reedy priority: normal severity: normal status: open title: IDLE REPL: Strange indentation versions: Python 3.6 Added file: https://bugs.python.org/file47651/2018-06-25-223359_1920x1080_scrot.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 17:54:55 2018 From: report at bugs.python.org (Chris Cogdon) Date: Mon, 25 Jun 2018 21:54:55 +0000 Subject: [New-bugs-announce] [issue33961] Inconsistency in exceptions for dataclasses.dataclass documentation Message-ID: <1529963695.74.0.56676864532.issue33961@psf.upfronthosting.co.za> New submission from Chris Cogdon : The documentation for dataclasses.dataclass includes this text: "If any of the added methods already exist on the class, a TypeError will be raised." However, the documentation for various options has ONE case of TypeError, some cases of ValueError and other cases of "does nothing". I'll attempt a fix and create a PR for this. ---------- assignee: docs at python components: Documentation messages: 320444 nosy: chriscog, docs at python priority: normal severity: normal status: open title: Inconsistency in exceptions for dataclasses.dataclass documentation versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 23:29:08 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 26 Jun 2018 03:29:08 +0000 Subject: [New-bugs-announce] [issue33962] IDLE: use ttk.spinbox Message-ID: <1529983748.27.0.56676864532.issue33962@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Spinoff from #27755, which has a image of tk and ttk versions of a spinbox on Mac and asks about using ttk.spinbox. ttk Spinbox was added to tcl/tk in 8.5.9 and to tkinter.ttk in 3.7. I believe there are three cases to consider. tcl/tk python action >= 8.5.9 >=3.7 from tkinter.tkk import Spinbox >= 8.5.9 3.6 import Entry and copy class Spinbox(Entry) code < 8.5.9 from tkinter import Spinbox Serhiy, is tcl/tk < 8.5.9 something we realistically need to worry about, on Linux? In Dec 2018 or Jan 2019, when 3.6 switches to security fixes only, the 3.6 code can be deleted. For the present, only use config options in the common subset: cursor, takefocus, validate, validatecommond, invalidcommand, xscrollcommand, command, to, from_, increment, values, wrap, format. Is this sufficient? Whenever we make 8.5.9 or later a requirement, the tkinter Spinbox can be dropped and the class and style options used. Or we can subclass tkinter.Spinbox and accept and somehow deal with class and style options. (We are not presently using custom styles.) For the present, the code can go in query.py, presently only 300 lines. When we only need to cater to 3.7+ and 8.5.9+, the code will be replaced by normal import from ttk. Comman methods: identify, bbox, delete, icursor, index, insert, get. ttk has set, while tk sets through a textvariable. If we subclass tk.spinbox, it could have a set method that uses a private Var. Do the universal widget methods listed on http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/universal.html all apply to ttk widgets? identify, ---------- assignee: terry.reedy components: IDLE messages: 320465 nosy: cheryl.sabella, markroseman, serhiy.storchaka, terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: use ttk.spinbox type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 25 23:50:35 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 26 Jun 2018 03:50:35 +0000 Subject: [New-bugs-announce] [issue33963] IDLE macosc: add tests. Message-ID: <1529985035.66.0.56676864532.issue33963@psf.upfronthosting.co.za> New submission from Terry J. Reedy : For overrideRootMenu, move nested functions to module level. Try to move 3 imports to module level. Test startup on mac. Mock 'window' with mock functions. ---------- messages: 320468 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE macosc: add tests. type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 00:01:56 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 26 Jun 2018 04:01:56 +0000 Subject: [New-bugs-announce] [issue33964] IDLE maxosc.overrideRootMenu: remove unused menudict Message-ID: <1529985716.89.0.56676864532.issue33964@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Function local name 'menudict' is initialized empty, two key value pairs are added, and it is never touched again. ---------- messages: 320470 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE maxosc.overrideRootMenu: remove unused menudict type: performance versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 04:05:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 26 Jun 2018 08:05:40 +0000 Subject: [New-bugs-announce] [issue33965] [Windows WSL] Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time, after year 2038 Message-ID: <1530000340.86.0.56676864532.issue33965@psf.upfronthosting.co.za> New submission from STINNER Victor : Petter S commented the closed bpo-25155, so I open a new issue. Copy of messages starting at https://bugs.python.org/issue25155#msg320431: msg320431 - (view) Author: Petter S (Petter S) * Date: 2018-06-25 17:52 I get this error when starting the interpreter in Windows subsystem for Linux (WSL). I am using Python 2.7.15rc1 $ python --version Python 2.7.15rc1 $ python Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time OverflowError: timestamp too large to convert to C _PyTime_t Current thread 0x00007fe547231080 (most recent call first): Aborted (core dumped) msg320432 - (view) Author: Petter S (Petter S) * Date: 2018-06-25 17:55 For Python 3: $ python3 --version Python 3.7.0b3 $ python3 Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time OverflowError: timestamp too large to convert to C _PyTime_t Current thread 0x00007f0232c21080 (most recent call first): Aborted (core dumped) msg320441 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-25 21:06 > I get this error when starting the interpreter in Windows subsystem for Linux (WSL). This bug is currently closed, please open a new bug. About your issue. I'm not sure if Windows subsystem for Linux is officially supported. How did you install Python 2.7 and 3.7? Are you testing 32-bit or 64-bit Python? (Again, please answer in your new issue.) msg320447 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-25 22:05 I tried 64-bit builds of Python 2.7 and 3.7rc1 (binaries from python.org) on Windows 10 on year 2045: start with no error, time.time() and datetime.datetime.now() don't fail. I tried Python 2.7.12 and 3.5.2 on Ubuntu 16.04 in WSL on my Windows 10: same, start with no error, time.time() and datetime.datetime.now() don't fail. It's 64-bit Ubuntu with 64-bit binaries for Python 2 and Python 3 (check sys.maxsize). I even compiled Python 2.7.15 and 3.7rc1 on Ubuntu 16.04 in WSL on my Windows 10: same again, start with no error, time.time() and datetime.datetime.now() don't fail. Python 2 and 3 have been compiled in 64-bit mode, since it's a 64-bit Ubuntu. Everything is fine. I failed to reproduce your bug. msg320473 - (view) Author: Petter S (Petter S) * Date: 2018-06-26 07:26 I also compiled Python myself on WSL. The bug seemed to appear after computer had been running for a while. Before that, the interpreters were working normally. And after rebooting the problem disappeared. ---------- components: Interpreter Core, Windows messages: 320475 nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: [Windows WSL] Fatal Python error: _Py_InitializeMainInterpreter: can't initialize time, after year 2038 versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 07:55:02 2018 From: report at bugs.python.org (STINNER Victor) Date: Tue, 26 Jun 2018 11:55:02 +0000 Subject: [New-bugs-announce] [issue33966] test_multiprocessing_spawn.WithProcessesTestPool.test_traceback() leaks 4 handles on Windows Message-ID: <1530014102.79.0.56676864532.issue33966@psf.upfronthosting.co.za> New submission from STINNER Victor : Using my PR 7827, the following command shows a leak of 4 Windows handles per run: python -m test -R 3:3 test_multiprocessing_spawn -v -m test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback See also bpo-33929: test_multiprocessing_spawn: WithProcessesTestProcess.test_many_processes() leaks 5 handles on Windows. ---------- components: Library (Lib), Windows messages: 320484 nosy: davin, paul.moore, pitrou, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: test_multiprocessing_spawn.WithProcessesTestPool.test_traceback() leaks 4 handles on Windows versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 07:57:10 2018 From: report at bugs.python.org (=?utf-8?q?Walter_D=C3=B6rwald?=) Date: Tue, 26 Jun 2018 11:57:10 +0000 Subject: [New-bugs-announce] [issue33967] functools.singledispatch: Misleading exception when calling without arguments Message-ID: <1530014230.86.0.56676864532.issue33967@psf.upfronthosting.co.za> New submission from Walter D?rwald : When I call a function decorated with functools.singledispatch without an argument, I get the following: $ python Python 3.6.5 (default, Jun 17 2018, 12:13:06) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import functools >>> @functools.singledispatch ... def f(x): ... pass ... >>> f() Traceback (most recent call last): File "", line 1, in File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/functools.py", line 803, in wrapper return dispatch(args[0].__class__)(*args, **kw) IndexError: tuple index out of range I would have expected a TypeError along the lines of TypeError: f() missing 1 required positional argument: 'x' ---------- components: Library (Lib) messages: 320485 nosy: doerwalter priority: normal severity: normal status: open title: functools.singledispatch: Misleading exception when calling without arguments type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 08:01:22 2018 From: report at bugs.python.org (Carl Andersson) Date: Tue, 26 Jun 2018 12:01:22 +0000 Subject: [New-bugs-announce] [issue33968] os.makedirs and empty string Message-ID: <1530014482.98.0.56676864532.issue33968@psf.upfronthosting.co.za> New submission from Carl Andersson : os.makedirs does not handle the empty string the same way as the os.path.XX functions does. This is (to me) unexpected behaviour, since calls like `os.makedirs(os.path.dirname(filename), exist_ok=True)` raises an exception if `filename` does not contain any directories. Also, it raises an `FileNotFoundError` regardless of the `exist_ok` flag. I would expect `os.makedirs('')` to fail with `FileExistsError` and `os.makedirs('', exist_ok=True)` to not do anything. ---------- components: Library (Lib) messages: 320486 nosy: CarlAndersson priority: normal severity: normal status: open title: os.makedirs and empty string type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 08:04:51 2018 From: report at bugs.python.org (James Stevens) Date: Tue, 26 Jun 2018 12:04:51 +0000 Subject: [New-bugs-announce] [issue33969] "copytree" refuses to copy to a mount point Message-ID: <1530014691.54.0.56676864532.issue33969@psf.upfronthosting.co.za> New submission from James Stevens : Even if the mount-point directory is empty, "copytree" refuses to copy to a it becuase it will not perform a copy if the destination directory already exists - although it will accept any of the parents of destination existing, or not. Therefore, "copytree" is unable to copy to the top directory of (say) a USB Stick. This also means "copytree" can't be used to merge the contents of two source directories into a single destination. etc,etc This one flaw means that the use scenarios for "copytree" are actually extremely limited when compared to (say) "cp" - but running "subprocess.call(["cp","-a",...])" as commonly recommended on StackOverflow is not an ideal solution for lots of reasons. ---------- components: Distutils messages: 320487 nosy: dstufft, eric.araujo, james_r_c_stevens priority: normal severity: normal status: open title: "copytree" refuses to copy to a mount point type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 08:25:30 2018 From: report at bugs.python.org (James Stevens) Date: Tue, 26 Jun 2018 12:25:30 +0000 Subject: [New-bugs-announce] [issue33970] bugs.python.org silently refuses registrations Message-ID: <1530015930.72.0.56676864532.issue33970@psf.upfronthosting.co.za> New submission from James Stevens : bugs.python.org silently refuses registration if the user's "homepage" does not match some undisclosed URL validation test. The fact of the validation failure of the "homepage" is not disclosed at any time, including both the initial registration and at activation time. This appears to have been a "known" issue for at least a year, but is still not fixed. http://psf.upfronthosting.co.za/roundup/meta/issue591 ---------- assignee: docs at python components: Documentation messages: 320488 nosy: docs at python, james_r_c_stevens priority: normal severity: normal status: open title: bugs.python.org silently refuses registrations versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 09:35:56 2018 From: report at bugs.python.org (James Stevens) Date: Tue, 26 Jun 2018 13:35:56 +0000 Subject: [New-bugs-announce] [issue33971] os.mknod is subject to "umask" Message-ID: <1530020156.39.0.56676864532.issue33971@psf.upfronthosting.co.za> New submission from James Stevens : As per the underlying "libc" call, the node created with "mknod" is subjected to the user's current umask setting. This is not made clear in the Python documentation, but the "libc" documentation makes this clear (see attached). ---------- assignee: docs at python components: Documentation files: Selection_2018-06-26_003.png messages: 320490 nosy: docs at python, james_r_c_stevens priority: normal severity: normal status: open title: os.mknod is subject to "umask" versions: Python 3.6 Added file: https://bugs.python.org/file47653/Selection_2018-06-26_003.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 10:43:31 2018 From: report at bugs.python.org (Sven Krohlas) Date: Tue, 26 Jun 2018 14:43:31 +0000 Subject: [New-bugs-announce] [issue33972] AttributeError in email.message.iter_attachments() Message-ID: <1530024211.47.0.56676864532.issue33972@psf.upfronthosting.co.za> New submission from Sven Krohlas : Hello everyone, Today I stumbled over unexpected behaviour when parsing emails with Python 3.5. mail is of type: Traceback (most recent call last): File "XXX", line YYY, in ZZZ for attachment in mail.iter_attachments(): File "/usr/lib/python3.5/email/message.py", line 1025, in iter_attachments parts = self.get_payload().copy() AttributeError: 'str' object has no attribute 'copy' /usr/lib/python3.5/email/message.py calls self.get_payload().copy() without distinguishing between different possible return types of get_payload(). get_payload() belongs to class MIMEPart(Message) >From the (base) class Message: "def get_payload(self, i=None, decode=False): """Return a reference to the payload. The payload will either be a list object or a string." So, it might return a string, which seems to be the case I'm hitting here. The code in cpython trunk still looks identical apart from a few line offsets, so newer versions might be affected, too. Am I doing something wrong or do we have a bug to squash here? Thanks, Sven ---------- components: email messages: 320494 nosy: barry, r.david.murray, skrohlas priority: normal severity: normal status: open title: AttributeError in email.message.iter_attachments() type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 14:39:29 2018 From: report at bugs.python.org (Tim Burke) Date: Tue, 26 Jun 2018 18:39:29 +0000 Subject: [New-bugs-announce] [issue33973] HTTP request-line parsing splits on Unicode whitespace Message-ID: <1530038369.47.0.56676864532.issue33973@psf.upfronthosting.co.za> New submission from Tim Burke : This causes (admittedly, buggy) clients that would work with a Python 2 server to stop working when the server upgrades to Python 3. To demonstrate, run `python2.7 -m SimpleHTTPServer 8027` in one terminal and `curl -v http://127.0.0.1:8027/??` in another -- curl reports * Trying 127.0.0.1... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 8027 (#0) > GET /?? HTTP/1.1 > Host: 127.0.0.1:8027 > User-Agent: curl/7.54.0 > Accept: */* > * HTTP 1.0, assume close after body < HTTP/1.0 404 File not found < Server: SimpleHTTP/0.6 Python/2.7.10 < Date: Tue, 26 Jun 2018 17:23:25 GMT < Content-Type: text/html < Connection: close < Error response

Error response

Error code 404.

Message: File not found.

Error code explanation: 404 = Nothing matches the given URI. * Closing connection 0 ...while repeating the experiment with `python3.6 -m http.server 8036` and `curl -v http://127.0.0.1:8036/??` gives * Trying 127.0.0.1... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 8036 (#0) > GET /?? HTTP/1.1 > Host: 127.0.0.1:8036 > User-Agent: curl/7.54.0 > Accept: */* > Error response

Error response

Error code: 400

Message: Bad request syntax ('GET /??\xa0??? HTTP/1.1').

Error code explanation: HTTPStatus.BAD_REQUEST - Bad request syntax or unsupported method.

* Connection #0 to host 127.0.0.1 left intact Granted, a well-behaved client would have quoted the UTF-8 '??' as '%E4%BD%A0%E5%A5%BD' (in which case everything would have behaved as expected), but RFC 7230 is pretty clear that the request-line should be SP-delimited. While it notes that "recipients MAY instead parse on whitespace-delimited word boundaries and, aside from the CRLF terminator, treat any form of whitespace as the SP separator", it goes on to say that "such whitespace includes one or more of the following octets: SP, HTAB, VT (%x0B), FF (%x0C), or bare CR" with no mention of characters like the (ISO-8859-1 encoded) non-breaking space that caused the 400 response. FWIW, there was a similar unicode-separators-are-not-the-right-separators bug in header parsing a while back: https://bugs.python.org/issue22233 ---------- components: Library (Lib), Unicode messages: 320507 nosy: ezio.melotti, tburke, vstinner priority: normal severity: normal status: open title: HTTP request-line parsing splits on Unicode whitespace type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 14:52:55 2018 From: report at bugs.python.org (Gauchj) Date: Tue, 26 Jun 2018 18:52:55 +0000 Subject: [New-bugs-announce] [issue33974] _stringify handles quoted strings incorrectly Message-ID: <1530039175.35.0.56676864532.issue33974@psf.upfronthosting.co.za> New submission from Gauchj : _stringify escapes special characters so they can be processed by tcl/tk. To that end, two different escaping techniques are implemented: put a backslash in front of every special character or put the entire string in curly braces. However, a string like the following one: '"C:\\Windows\\System32\\notepad.exe" "afile.txt"' will be incorrectly escaped to '"C:\\\\Windows\\\\System32\\\\notepad.exe"\\ "afile.txt"' Tcl/TK will interpret this as a quoted string, but with a backslash after it (the one escaping the space between the quoted strings), throwing this exception: TclError('list element in quotes followed by "\\" instead of space',) The attached patch escapes this to '{"C:\\\\Windows\\\\System32\\\\notepad.exe" "afile.txt"}' I am not 100% sure that this is correct since double backslashes seem to be displayed now. ---------- components: Tkinter files: 0001-improve-escaping-of-quoted-strings.patch keywords: patch messages: 320508 nosy: gauchj priority: normal severity: normal status: open title: _stringify handles quoted strings incorrectly type: behavior versions: Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47654/0001-improve-escaping-of-quoted-strings.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 26 22:22:16 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 27 Jun 2018 02:22:16 +0000 Subject: [New-bugs-announce] [issue33975] IDLE: only adjust DPI before Tk() Message-ID: <1530066136.74.0.56676864532.issue33975@psf.upfronthosting.co.za> New submission from Terry J. Reedy : #33656 patched PyShell to call SetProcessDpiAwareness on Windows nearly first thing, *at module level*, well before calling tkinter.Tk(). The Microsoft docs warn that making the Windows API call after starting the graphics system may not work as expected. With tk 8.6,8, the result is sharp, but small type -- perhaps 7 points instead of 10. This issue is about avoiding type shrinkage, both when running the htest suite as a whole and when running the test for an individual file after running the unittests. To do that in any process, pyshell must be imported before Tk() is called. The patch adds the following to htest.py. import idlelib.pyshell # Set Windows DPI awareness before Tk(). I will add the same where needed to the top of if __name__ == '__main__': clauses in idlelib modules, before running unittests. ---------- assignee: terry.reedy components: IDLE messages: 320531 nosy: terry.reedy priority: normal severity: normal stage: patch review status: open title: IDLE: only adjust DPI before Tk() type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 00:00:50 2018 From: report at bugs.python.org (Edward Wang) Date: Wed, 27 Jun 2018 04:00:50 +0000 Subject: [New-bugs-announce] [issue33976] Enums don't support nested classes Message-ID: <1530072050.24.0.56676864532.issue33976@psf.upfronthosting.co.za> New submission from Edward Wang : Methods defined in Enums behave 'normally' but classes defined in Enums get mistaken for regular values and can't be used as classes out of the box. ```python class Outer(Enum): a = 1 b = 2 class Inner(Enum): foo = 10 bar = 11 ``` ---------- messages: 320541 nosy: edwardw priority: normal severity: normal status: open title: Enums don't support nested classes type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 05:16:35 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 27 Jun 2018 09:16:35 +0000 Subject: [New-bugs-announce] [issue33977] [Windows] test_compileall fails randomly with PermissionError: [WinError 5] Access is denied: (...).pyc Message-ID: <1530090995.62.0.56676864532.issue33977@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/130/builds/87 ====================================================================== FAIL: test_no_args_respects_force_flag (test.test_compileall.CommandLineTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\buildbot.python.org\3.7.kloth-win64\build\lib\test\test_compileall.py", line 301, in test_no_args_respects_force_flag self.assertRunOK('-f', PYTHONPATH=self.directory) File "C:\buildbot.python.org\3.7.kloth-win64\build\lib\test\test_compileall.py", line 252, in assertRunOK *self._get_run_args(args), **env_vars) File "C:\buildbot.python.org\3.7.kloth-win64\build\lib\test\support\script_helper.py", line 157, in assert_python_ok return _assert_python(True, *args, **env_vars) File "C:\buildbot.python.org\3.7.kloth-win64\build\lib\test\support\script_helper.py", line 143, in _assert_python res.fail(cmd_line) File "C:\buildbot.python.org\3.7.kloth-win64\build\lib\test\support\script_helper.py", line 84, in fail err)) AssertionError: Process return code is 1 command line: ['C:\\buildbot.python.org\\3.7.kloth-win64\\build\\PCbuild\\amd64\\python_d.exe', '-X', 'faulthandler', '-S', '-m', 'compileall', '-f'] stdout: --- (...) Compiling 'C:\\buildbot.python.org\\3.7.kloth-win64\\build\\lib\\sndhdr.py'... Compiling 'C:\\buildbot.python.org\\3.7.kloth-win64\\build\\lib\\socket.py'... *** PermissionError: [WinError 5] Access is denied: 'C:\\buildbot.python.org\\3.7.kloth-win64\\build\\lib\\__pycache__\\socket.cpython-37.pyc.30129088' -> 'C:\\buildbot.python.org\\3.7.kloth-win64\\build\\lib\\__pycache__\\socket.cpython-37.pyc' Compiling (...) (...) --- ---------- components: Tests, Windows messages: 320558 nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: [Windows] test_compileall fails randomly with PermissionError: [WinError 5] Access is denied: (...).pyc versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 05:29:16 2018 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Wed, 27 Jun 2018 09:29:16 +0000 Subject: [New-bugs-announce] [issue33978] logging.config.dictConfig with file handler leaks resources Message-ID: <1530091756.08.0.56676864532.issue33978@psf.upfronthosting.co.za> New submission from G?ry : Calling logging.config.dictConfig several times with a file handler in the same Python process leaks resources. INPUT: $ python3 -Wall < self.common_logger_config(root, config, incremental) ---------- components: Library (Lib) messages: 320560 nosy: maggyero priority: normal severity: normal status: open title: logging.config.dictConfig with file handler leaks resources type: resource usage versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 06:26:14 2018 From: report at bugs.python.org (Vincent Lefoulon) Date: Wed, 27 Jun 2018 10:26:14 +0000 Subject: [New-bugs-announce] [issue33979] Display type of not JSON serializable object Message-ID: <1530095174.89.0.56676864532.issue33979@psf.upfronthosting.co.za> New submission from Vincent Lefoulon : When we call `json.dumps` on a non JSON serializable object, we obtain an error: ``` TypeError: 4 is not JSON serializable ``` Here, 4 was actually a `numpy.int64` object and not a native int. But it is not explicit in the error message. We should mention the type of the object as well: ``` TypeError: 4 of type numpy.int64 is not JSON serializable ``` ---------- messages: 320570 nosy: Vayel priority: normal severity: normal status: open title: Display type of not JSON serializable object type: enhancement versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 08:28:06 2018 From: report at bugs.python.org (javi) Date: Wed, 27 Jun 2018 12:28:06 +0000 Subject: [New-bugs-announce] [issue33980] SSL Error when uploading package to your own pypi Message-ID: <1530102486.37.0.56676864532.issue33980@psf.upfronthosting.co.za> New submission from javi : Hi I am trying to upload a package to a local Pypi repo i have created, and when trying to do it, im having an ssl error since this repository is under a self signed certificate Using pip, there is an option, --trusted-host, that you can use to ignore ssl validation. Is there a similar option like that when using distutils? The command i am running is python setup.py sdist upload -r myrepo Thanks ---------- components: Distutils messages: 320573 nosy: dstufft, eric.araujo, javidr priority: normal severity: normal status: open title: SSL Error when uploading package to your own pypi type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 10:26:05 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 27 Jun 2018 14:26:05 +0000 Subject: [New-bugs-announce] [issue33981] test_asyncio: test_sendfile_close_peer_in_the_middle_of_receiving() logs a big error Message-ID: <1530109565.62.0.56676864532.issue33981@psf.upfronthosting.co.za> New submission from STINNER Victor : Python 3.8 (master) on Windows 10: C:\vstinner\python\master>python -m test test_asyncio -m test_sendfile_close_peer_in_the_middle_of_receiving -v Running Debug|x64 interpreter... == CPython 3.8.0a0 (heads/wip:dd08b85c84, Jun 26 2018, 12:47:56) [MSC v.1914 64 bit (AMD64)] == Windows-10-10.0.16299-SP0 little-endian == cwd: C:\vstinner\python\master\build\test_python_7020 == CPU count: 2 == encodings: locale=cp1252, FS=utf-8 Run tests sequentially 0:00:00 [1/1] test_asyncio test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_events.ProactorEventLoopTests) ... Exception in callback _ProactorReadPipeTransport._loop_reading(<_OverlappedF...ne, 64, None)>) handle: )> Traceback (most recent call last): File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 428, in finish_recv return ov.getresult() OSError: [WinError 64] The specified network name is no longer available During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 255, in _loop_reading data = fut.result() File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 732, in _poll value = callback(transferred, key, ov) File "C:\vstinner\python\master\lib\asyncio\windows_events.py", line 432, in finish_recv raise ConnectionResetError(*exc.args) ConnectionResetError: [WinError 64] The specified network name is no longer available During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\vstinner\python\master\lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 282, in _loop_reading self._force_close(exc) File "C:\vstinner\python\master\lib\asyncio\proactor_events.py", line 117, in _force_close self._empty_waiter.set_exception(exc) concurrent.futures._base.InvalidStateError: invalid state ok test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_events.SelectEventLoopTests) ... ok ---------------------------------------------------------------------- Ran 2 tests in 0.111s OK == Tests result: SUCCESS == 1 test OK. Total duration: 453 ms Tests result: SUCCESS ---------- components: asyncio messages: 320583 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio: test_sendfile_close_peer_in_the_middle_of_receiving() logs a big error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 12:06:08 2018 From: report at bugs.python.org (Daniel Klein) Date: Wed, 27 Jun 2018 16:06:08 +0000 Subject: [New-bugs-announce] [issue33982] cgi.FieldStorage doesn't parse QUERY_STRING with POST that is not application/x-www-form-urlencoded Message-ID: <1530115568.42.0.56676864532.issue33982@psf.upfronthosting.co.za> New submission from Daniel Klein : The documentation says "A form submitted via POST that also has a query string will contain both FieldStorage and MiniFieldStorage items." suggesting that I can have a query with bost a QUERY_STRING and POST parameters. The code backs this up most of the time... In read_urlencoded() the initial query string is read from STDIN, and self.qs_on_post (i.e., env['QUERY_STRING']) is appended to that. This is what is called when the CONTENT_TYPE of the POST request is application/x-www-form-urlencoded. This leads to a FieldStorage object containing a list of MiniFieldStorage objects, like: FieldStorage(None, None, [MiniFieldStorage('action', 'rate'), MiniFieldStorage('seq', '3'), MiniFieldStorage('version', '15')]) However, I am using a webhook interface from Google cloud, and it (legitimately!) does a POST with a CONTENT_TYPE of application/json. When I call cgi.Fieldstorage(), the __init__ routine ultimately calls read_single(). This results in a FieldStorage object containing a single string as FieldStorage(None, None, '{"incident": {"incident_id": "0.ktptjso969s0","res...the rest of the JSON') This results in a few problems. 1) The QUERY_STRING args are not parsed as promised 2) The FeildStorage object does not contain a list, and so will raise TypeError, "not indexable" if I try to use most of the other FieldStorage methods. ---------- components: Library (Lib) messages: 320597 nosy: Daniel Klein priority: normal severity: normal status: open title: cgi.FieldStorage doesn't parse QUERY_STRING with POST that is not application/x-www-form-urlencoded type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 16:38:19 2018 From: report at bugs.python.org (John Reese) Date: Wed, 27 Jun 2018 20:38:19 +0000 Subject: [New-bugs-announce] [issue33983] unify types for lib2to3.pytree.Base.children Message-ID: <1530131899.35.0.56676864532.issue33983@psf.upfronthosting.co.za> New submission from John Reese : When type checking applications using lib2to3, the difference in types for lib2to3.pytree.Base.children versus Node.children makes it difficult to accept both leaves and nodes and programatically work with child nodes/leaves. Base/Leaf both have `children` defined as an empty Tuple, while Node defines it as an empty list. It would be more useful for Base/Leaf to also use an empty list, so that the type is the same, regardless of which type of object you are given. ---------- components: Library (Lib) messages: 320616 nosy: jreese, lukasz.langa priority: normal severity: normal status: open title: unify types for lib2to3.pytree.Base.children type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 18:44:57 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 27 Jun 2018 22:44:57 +0000 Subject: [New-bugs-announce] [issue33984] test_multiprocessing_forkserver leaked [1, 2, 1] memory blocks on x86 Gentoo Refleaks 3.x Message-ID: <1530139497.53.0.56676864532.issue33984@psf.upfronthosting.co.za> New submission from STINNER Victor : http://buildbot.python.org/all/#/builders/1/builds/267 1:47:06 load avg: 4.77 [161/417/1] test_multiprocessing_forkserver failed (16 min 32 sec) -- running: test_support (56 sec 282 ms) beginning 6 repetitions 123456 ...... test_multiprocessing_forkserver leaked [1, 2, 1] memory blocks, sum=4 (...) Re-running failed tests in verbose mode Re-running test 'test_multiprocessing_forkserver' in verbose mode (...) OK (skipped=27) ---------- messages: 320636 nosy: vstinner priority: normal severity: normal status: open title: test_multiprocessing_forkserver leaked [1, 2, 1] memory blocks on x86 Gentoo Refleaks 3.x _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 18:45:59 2018 From: report at bugs.python.org (Rajiv Vijayakumar) Date: Wed, 27 Jun 2018 22:45:59 +0000 Subject: [New-bugs-announce] [issue33985] ContextVar does not have a "name" attribute Message-ID: <1530139559.69.0.56676864532.issue33985@psf.upfronthosting.co.za> New submission from Rajiv Vijayakumar : Per PEP 567 and the contextvars documentation, I expected that a ContextVar would have a "name" read-only attribute. However I get an AttributeError when accessing ContextVar.name with 3.7.0rc1: > python Python 3.7.0rc1 (v3.7.0rc1:dfad352267, Jun 12 2018, 01:00:10) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from contextvars import ContextVar >>> var = ContextVar('var') >>> var.name Traceback (most recent call last): File "", line 1, in AttributeError: 'ContextVar' object has no attribute 'name' ---------- components: Library (Lib) messages: 320637 nosy: rvijayak, yselivanov priority: normal severity: normal status: open title: ContextVar does not have a "name" attribute type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 27 18:46:14 2018 From: report at bugs.python.org (Bumsik Kim) Date: Wed, 27 Jun 2018 22:46:14 +0000 Subject: [New-bugs-announce] [issue33986] Typo: BaseSubprocessTransport -> SubprocessTransport Message-ID: <1530139574.74.0.56676864532.issue33986@psf.upfronthosting.co.za> New submission from Bumsik Kim : https://docs.python.org/3/library/asyncio-protocol.html#basesubprocesstransport I belive the doc has a wrong name "basesubprocesstransport" and it should be "Subprocesstransport". You can see this in the source code: https://github.com/python/cpython/blob/3.6/Lib/asyncio/transports.py ---------- assignee: docs at python components: Documentation messages: 320638 nosy: docs at python, kbumsik priority: normal severity: normal status: open title: Typo: BaseSubprocessTransport -> SubprocessTransport versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 28 00:02:30 2018 From: report at bugs.python.org (Mark Roseman) Date: Thu, 28 Jun 2018 04:02:30 +0000 Subject: [New-bugs-announce] [issue33987] need ttk.Frame inside Toplevel(s) Message-ID: <1530158550.76.0.56676864532.issue33987@psf.upfronthosting.co.za> New submission from Mark Roseman : When adding a bunch of ttk widgets into a toplevel window, there needs to be an intervening ttk.Frame to ensure the background of the widgets matches the overall background. The reason is the 'toplevel' is part of the classic tk widgets and not ttk, so it isn't guaranteed to have the same background. In practice, the only platform where the toplevel and ttk.Frame have different backgrounds is macOS. Check out topframe.png for an example, top is without the intervening ttk.Frame, bottom adds it in. (Adding bug mainly so we have a place to store a concrete example of what this looks like) ---------- assignee: terry.reedy components: IDLE files: topframe.png messages: 320646 nosy: markroseman, terry.reedy priority: normal severity: normal status: open title: need ttk.Frame inside Toplevel(s) type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47655/topframe.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 28 06:37:19 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 28 Jun 2018 10:37:19 +0000 Subject: [New-bugs-announce] [issue33988] [EASY] [3.7] test_platform fails when run with -Werror Message-ID: <1530182239.82.0.56676864532.issue33988@psf.upfronthosting.co.za> New submission from STINNER Victor : vstinner at apu$ ./python -Werror -m test -v test_platform ====================================================================== ERROR: test_dist (test.test_platform.PlatformTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/3.7/Lib/test/test_platform.py", line 270, in test_dist res = platform.dist() File "/home/vstinner/prog/python/3.7/Lib/platform.py", line 379, in dist "in Python 3.5", DeprecationWarning, stacklevel=2) DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5 ====================================================================== ERROR: test_linux_distribution_encoding (test.test_platform.PlatformTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/prog/python/3.7/Lib/test/test_platform.py", line 346, in test_linux_distribution_encoding distname, version, distid = platform.linux_distribution() File "/home/vstinner/prog/python/3.7/Lib/platform.py", line 305, in linux_distribution "in Python 3.5", DeprecationWarning, stacklevel=2) DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5 The code calling the deprecated function should be surrounded by something like that: with support.check_warnings(('cgi.parse_qs is deprecated', DeprecationWarning)): ---------- components: Tests keywords: easy messages: 320657 nosy: vstinner priority: normal severity: normal status: open title: [EASY] [3.7] test_platform fails when run with -Werror versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 28 13:43:06 2018 From: report at bugs.python.org (Pochang Chen) Date: Thu, 28 Jun 2018 17:43:06 +0000 Subject: [New-bugs-announce] [issue33989] ms.key_compare is not initialized in all pathes of list_sort_impl Message-ID: <1530207786.09.0.56676864532.issue33989@psf.upfronthosting.co.za> New submission from Pochang Chen : Relevant code (Objects/listobject.c lines 2268 -- 2286 as of commit e76ac9d): /* Choose the best compare, given what we now know about the keys. */ if (keys_are_all_same_type) { if (key_type == &PyUnicode_Type && strings_are_latin) { ms.key_compare = unsafe_latin_compare; } else if (key_type == &PyLong_Type && ints_are_bounded) { ms.key_compare = unsafe_long_compare; } else if (key_type == &PyFloat_Type) { ms.key_compare = unsafe_float_compare; } else if ((ms.key_richcompare = key_type->tp_richcompare) != NULL) { ms.key_compare = unsafe_object_compare; } } else { ms.key_compare = safe_object_compare; } Clearly, ms.key_compare is not assigned here if keys_are_all_same_type is true but key_type->tp_richcompare is NULL. I don't know how to obtain an object with ob_type->tp_richcompare being NULL, though. ---------- components: Interpreter Core messages: 320679 nosy: johnchen902 priority: normal severity: normal status: open title: ms.key_compare is not initialized in all pathes of list_sort_impl type: crash versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 28 15:13:38 2018 From: report at bugs.python.org (Eric N. Vander Weele) Date: Thu, 28 Jun 2018 19:13:38 +0000 Subject: [New-bugs-announce] [issue33990] CPPFLAGS during ./configure are not passed-through in sysconfig.customize_compiler Message-ID: <1530213218.16.0.56676864532.issue33990@psf.upfronthosting.co.za> New submission from Eric N. Vander Weele : When specifying CPPFLAGS during `./configure`, `sysconfig.get_config_var('CPPFLAGS')` does capture the originally specified flags. However, when building a C/C++ extension, any flags specified via CPPFLAGS are not present during compilation of extension source files. Since preprocessor flags (e.g., '-I' rules) may be used during `./configure` instead of `CFLAGS`, it appears that the `CPPFLAGS` captured should also be injected when customizing the compiler executable to be invoked. I have PR that will be submitted and linked shortly. ---------- components: Build, Distutils messages: 320683 nosy: dstufft, eric.araujo, ericvw priority: normal severity: normal status: open title: CPPFLAGS during ./configure are not passed-through in sysconfig.customize_compiler type: behavior versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 28 18:16:04 2018 From: report at bugs.python.org (skreft) Date: Thu, 28 Jun 2018 22:16:04 +0000 Subject: [New-bugs-announce] [issue33991] lib2to3 should parse f-strings Message-ID: <1530224164.23.0.56676864532.issue33991@psf.upfronthosting.co.za> New submission from skreft : Currently f-strings are parsed just as regular strings by lib2to3. However, this has the problem that the invariant of a string node being a literal is now broken. This poses two problems. On one hand, if I want to compare that two string nodes are equivalent I would need to do something like: def string_nodes_are_eqivalent(node1, node2): if is_f_string(node1) and is_f_string(node2): # This would require to parse the nodes using ast.parse return f_strings_are_equivalent(node1, node2) if not is_f_string(node1) and not is_f_string(node2): return ast.literal_eval(node1.value) == ast.literal_eval(node2.value) return False Note that ast.literal_eval does not accept f-strings. Also note that ast.parse returns an ast.JoinedString for f-strings, whose elements are either ast.Str or ast.FormattedValue, the latter being ast expressions. On the other hand, this has the problem of not being able to refactor the expressions inside an f-string. ---------- messages: 320687 nosy: skreft priority: normal severity: normal status: open title: lib2to3 should parse f-strings _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 28 19:05:09 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 28 Jun 2018 23:05:09 +0000 Subject: [New-bugs-announce] [issue33992] Compilation fails on AMD64 Windows8.1 Non-Debug 3.6: The Windows SDK version 10.0.15063.0 was not found Message-ID: <1530227109.75.0.56676864532.issue33992@psf.upfronthosting.co.za> New submission from STINNER Victor : Build FAILED. "D:\buildarea\3.6.ware-win81-release\build\PCbuild\pcbuild.proj" (Build target) (1) -> "D:\buildarea\3.6.ware-win81-release\build\PCbuild\pythoncore.vcxproj" (Build target) (2) -> (Desktop_PlatformPrepareForBuild target) -> C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 10.0.15063.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [D:\buildarea\3.6.ware-win81-release\build\PCbuild\pythoncore.vcxproj] 0 Warning(s) 1 Error(s) ---------- components: Tests messages: 320689 nosy: vstinner, zach.ware priority: normal severity: normal status: open title: Compilation fails on AMD64 Windows8.1 Non-Debug 3.6: The Windows SDK version 10.0.15063.0 was not found versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 28 20:57:40 2018 From: report at bugs.python.org (Micheal Gardner) Date: Fri, 29 Jun 2018 00:57:40 +0000 Subject: [New-bugs-announce] [issue33993] zipfile module weird behavior when used with zipinfo Message-ID: <1530233860.61.0.56676864532.issue33993@psf.upfronthosting.co.za> Change by Micheal Gardner : ---------- components: Library (Lib) nosy: Micheal Gardner priority: normal severity: normal status: open title: zipfile module weird behavior when used with zipinfo type: behavior versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 01:18:50 2018 From: report at bugs.python.org (Saba Kauser) Date: Fri, 29 Jun 2018 05:18:50 +0000 Subject: [New-bugs-announce] [issue33994] python build egg fails with error while compiling test cases Message-ID: <1530249530.09.0.56676864532.issue33994@psf.upfronthosting.co.za> New submission from Saba Kauser : Hello, Everything was working perfectly until recently, may be a week back, when I first started to see the error while generating egg for python ibm_db package. Every time I execute the command : python setup.py bdsit_egg, my flow stops with below error: byte-compiling build\bdist.win-amd64\egg\tests\test_131_PrepareExecuteSelectStatementParams.py to test_131_PrepareExecuteSelectStatementParams.cpython-36.pyc error: [Errno 2] No such file or directory: 'build\\bdist.win-amd64\\egg\\tests\\__pycache__\\test_131_PrepareExecuteSelectStatementParams.cpython-36.pyc.1942660169328' Please note that, every time I run, the file name is getting appended with a random number. e.g test_131_PrepareExecuteSelectStatementParams.cpython-36.pyc.1942660169328' when the file name placed under tests/__pycache__ should be test_131_PrepareExecuteSelectStatementParams.cpython-36.pyc. There are however other test cases upto test_130* that are getting compiled correctly. e.g: byte-compiling build\bdist.win-amd64\egg\tests\test_112_FieldNumDiffCaseColNames.py to test_112_FieldNumDiffCaseColNames.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_113_DateTest.py to test_113_DateTest.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_114_NumericTest_01.py to test_114_NumericTest_01.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_115_NumericTest_02.py to test_115_NumericTest_02.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_116_ConnActive.py to test_116_ConnActive.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_120_FieldName.py to test_120_FieldName.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_121_FieldNameAddCol.py to test_121_FieldNameAddCol.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_122_FieldNameDiffCaseColNames.py to test_122_FieldNameDiffCaseColNames.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_123_FieldNamePos_01.py to test_123_FieldNamePos_01.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_124_FieldNamePos_02.py to test_124_FieldNamePos_02.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_125_FieldNamePos_03.py to test_125_FieldNamePos_03.cpython-36.pyc byte-compiling build\bdist.win-amd64\egg\tests\test_130_PrepExecuteSelectStmt.py to test_130_PrepExecuteSelectStmt.cpython-36.pyc Can you guide me on what is leading to this? What is making to have the file name appended with random number. Appreciate your assitance! Thank you, Saba. ---------- components: Build messages: 320700 nosy: sabakauser priority: normal severity: normal status: open title: python build egg fails with error while compiling test cases type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 01:32:25 2018 From: report at bugs.python.org (Alan Huang) Date: Fri, 29 Jun 2018 05:32:25 +0000 Subject: [New-bugs-announce] [issue33995] test_min_max_version in test_ssl.py fails when Python is built against LibreSSL; {min,max}imum_version behavior differs from OpenSSL Message-ID: <1530250345.83.0.56676864532.issue33995@psf.upfronthosting.co.za> New submission from Alan Huang : LibreSSL's implementation of the function used to get the minimum and maximum SSL versions supported differs from OpenSSL's. In short, the issue is in the implementations of `SSL_CTX_new` - OpenSSL initializes variables `ret->{min,max}_proto_version` to 0, while LibreSSL initializes corresponding variables to those of the `SSL_METHOD` given. As such, when Python is built with LibreSSL, the default values for an instance of ssl.SSLContext are, in the case of ssl.SSLContext(), ctx.minimum_version = ; ctx.maximum_version = . This is NOT what test_ssl.py expects; it expects OpenSSL's behavior of initializing the version variables to zero, which _ssl.c then translates to PY_PROTO_{MIN,MAX}IMUM_SUPPORTED -> ssl.TLSVersion.{MIN,MAX}IMUM_SUPPORTED. Additionally, LibreSSL, when `SSL_CTX_set_{min,max}_proto_version` is called with `version` equal to zero, explicitly sets the minimum / maximum values equal to the minimum / maximum values for the `SSL_METHOD` it was called with (namely, 769/770/771, in the case of `TLS_method()`), not the minimum / maximum values supported by the library. I have sent an email to the LibreSSL mailing list asking for clarification on this point, namely, if this is intended behavior. If it is, there are two ways that come to mind to work around this behavior. Both ways would only be necessary if `IS_LIBRESSL`. 1. Skip `test_min_max_version`. 2. Instead of testing that ctx is equal *to* the extremes after it's been set to one of the extremes, test that it's equal to the actual constants. There are two ways this could be accomplished as well: a. Use PY_PROTO_{MIN,MAX}IMUM_AVAILABLE, defined in _ssl.c (this may require the addition of another call to `PyModule_AddIntConstant` to provide access to the constant from _ssl). The downside to this approach is that it assumes that `TLS_method()`, or whatever `SSL_METHOD` test_ssl.py uses has lower and upper bounds equal to PY_PROTO_{MIN,MAX}IMUM_AVAILABLE, which may not always be the case. b. Access and store the values for ctx.{min,max}imum_value on creation, then reference them after setting. Either of these approaches would likely also have the benefit of removing the need for `self.assertIn(ctx.minimum_version, {ssl.TLSVersion.TLSv1_2, ssl.TLSVersion.TLSv1_3})`. The test that failed was: ====================================================================== FAIL: test_min_max_version (test.test_ssl.ContextTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alan/src/cpython/Lib/test/test_ssl.py", line 1066, in test_min_max_version ctx.minimum_version, ssl.TLSVersion.MINIMUM_SUPPORTED AssertionError: != Addendum: I found the documentation for ssl.TLSVersion.{MAX,MIN}IMUM_SUPPORTED confusing at first - it took me quite a while to realize what the purpose of the constants were; I would have expected them to contain the maximum and minimum protocol versions supported by the library; I see why it was phrased that way, after having boned up on ssl.py, _ssl.c, and OpenSSL/LibreSSL, but think it could could be made clearer. ---------- assignee: docs at python components: Documentation, SSL, Tests messages: 320703 nosy: Alan.Huang, alex, christian.heimes, docs at python, dstufft, janssen priority: normal severity: normal status: open title: test_min_max_version in test_ssl.py fails when Python is built against LibreSSL; {min,max}imum_version behavior differs from OpenSSL type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 08:35:51 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 29 Jun 2018 12:35:51 +0000 Subject: [New-bugs-announce] [issue33996] Crash in gen_send_ex(): _PyErr_GetTopmostException() returns freed memory Message-ID: <1530275751.35.0.56676864532.issue33996@psf.upfronthosting.co.za> New submission from STINNER Victor : Attached dagpool_test.py script triggers a crash on Python 3.7, but works well on Python 3.6. The script is a highly simplified code of tests/dagpool_tests.py of eventlet. To reproduce the crash, you only need a single dependency: greenlet. Example using a venv: python3.7 -m venv ENV ENV/bin/python -m pip install greenlet Then run the script: $ test_venv/bin/python dagpool_test.py Segmentation fault (core dumped) eventlet bug report: https://github.com/eventlet/eventlet/issues/475 I suspected that the bug is caused by the new exc_info attribute of PyThreadState: commit ae3087c6382011c47db82fea4d05f8bbf514265d. $ gdb -args test_venv/bin/python -X faulthandler dagpool_test.py (gdb) run Program received signal SIGSEGV, Segmentation fault. 0x000000000056c9d2 in PyErr_SetObject (exception=, value=0x0) at Python/errors.c:101 101 Py_INCREF(exc_value); (gdb) where #0 0x000000000056c9d2 in PyErr_SetObject (exception=, value=0x0) at Python/errors.c:101 #1 0x000000000056cd4e in PyErr_SetNone (exception=) at Python/errors.c:162 #2 0x000000000067cb0c in gen_send_ex (gen=0x7fffea651d78, arg=0x0, exc=0, closing=0) at Objects/genobject.c:241 #3 0x000000000067dd86 in gen_iternext (gen=0x7fffea651d78) at Objects/genobject.c:542 #4 0x00000000005461b1 in _PyEval_EvalFrameDefault (...) ... (gdb) p tstate $1 = (PyThreadState *) 0xa132a0 (gdb) p tstate->exc_info $2 = (_PyErr_StackItem *) 0x7fffea651930 (gdb) p *tstate->exc_info $3 = { exc_type = 0x0, exc_value = 0x0, exc_traceback = 0x0, previous_item = 0x7fffea651d20 } (gdb) p *tstate->exc_info->previous_item $4 = { exc_type = , exc_value = , exc_traceback = , previous_item = 0xdbdbdbdbdbdbdbdb } ---------- components: Interpreter Core files: dagpool_test.py keywords: 3.7regression messages: 320712 nosy: Mark.Shannon, ned.deily, vstinner, yselivanov priority: release blocker severity: normal status: open title: Crash in gen_send_ex(): _PyErr_GetTopmostException() returns freed memory versions: Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47658/dagpool_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 08:37:53 2018 From: report at bugs.python.org (Erik Wolf) Date: Fri, 29 Jun 2018 12:37:53 +0000 Subject: [New-bugs-announce] [issue33997] multiprocessing Pool hangs in terminate() Message-ID: <1530275873.32.0.56676864532.issue33997@psf.upfronthosting.co.za> New submission from Erik Wolf : The terminate() method of multiprocessing.Pool hangs sporadically. I could track this issue down to the fact that _handle_results() hangs in the outqueue-cleanup. poll() returned True but get() actually hangs endlessly never returning any data. ---------- components: Windows messages: 320713 nosy: Erik Wolf, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: multiprocessing Pool hangs in terminate() type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 09:52:13 2018 From: report at bugs.python.org (Dan Snider) Date: Fri, 29 Jun 2018 13:52:13 +0000 Subject: [New-bugs-announce] [issue33998] random.randrange completely ignores the step argument when stop is None Message-ID: <1530280333.65.0.56676864532.issue33998@psf.upfronthosting.co.za> New submission from Dan Snider : This "bug" is present even in 2.7. I have a really hard time believing that, even if it would be incredibly rare for someone to stumble upon this, may others haven't noticed this rather glaring flaw in the code. I couldn't find any similar issues though. My idea of how conservative a standard library function should be may be skewed too far to right. So perhaps I'm mistaken that it's reasonable to assume `random.randrange(10, step=2)` should either: * raise an error warning users that providing an alternate `step` value has no effect unless `stop` is also provided; * go ahead and allow it to work. Logically, the above function call is no different than `random.randrange(0, 10, 2)`. While I have created a patch that allows alternate (positive) `step` values even if `stop` is `None`, I still think my first instinct is to say that it really should just behave like `range` by raising an error when `stop is None and step != 1`. In that way it emulates the fact `range` only takes positional arguments while keeping the performance boost the current signature has over an `*args` implementation. I'll try to attach a PR to this after posting but I've never done this before. The patch also includes a simple but effective optimization which at the very least speeds the 1 argument form by 8.5% despite the extra `step==1` check, with the only "cost" of (rightfully, imo) ensuring that only integers are used. ---------- components: Library (Lib) messages: 320717 nosy: bup priority: normal severity: normal status: open title: random.randrange completely ignores the step argument when stop is None versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 11:20:47 2018 From: report at bugs.python.org (Peter) Date: Fri, 29 Jun 2018 15:20:47 +0000 Subject: [New-bugs-announce] [issue33999] `pip3 install past` does not work Message-ID: <1530285647.9.0.56676864532.issue33999@psf.upfronthosting.co.za> New submission from Peter : When trying to install the `past` module using pip 10.0.1 using python 3.6.5 I get: ==================================================================== $ pip3 install past --no-compile Collecting past Could not find a version that satisfies the requirement past (from versions: ) No matching distribution found for past ==================================================================== Confirming package exists with pip search: ==================================================================== $ pip3 search past | grep past past (0.11.1) - [Experimental] Run Python 2 code from Python 3 ==================================================================== ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 320719 nosy: PeterGhimself priority: normal severity: normal status: open title: `pip3 install past` does not work type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 11:48:52 2018 From: report at bugs.python.org (Geoffrey Sneddon) Date: Fri, 29 Jun 2018 15:48:52 +0000 Subject: [New-bugs-announce] [issue34000] Document when compile returns a code object v. AST Message-ID: <1530287332.99.0.56676864532.issue34000@psf.upfronthosting.co.za> New submission from Geoffrey Sneddon : The compile built-in documentation says: > Compile the source into a code or AST object. It doesn't however go on to say when it returns each! It does however note: > If you want to parse Python code into its AST representation, see ast.parse(). So compile can compile the source into an AST object, but if I want to parse Python code into an AST I should use ast.parse? As far as I can tell, this goes back to Python 2.5: https://docs.python.org/2/whatsnew/2.5.html#build-and-c-api-changes >From the What's New page: > It?s possible for Python code to obtain AST objects by using the compile() built-in and specifying _ast.PyCF_ONLY_AST as the value of the flags parameter So that would seem to be the case when compile returns an AST! Interestingly, the implementation of ast.parse *literally just calls compile* (https://github.com/python/cpython/blob/58ed7307ea0b5c5aa052291ebc3030f314f938d8/Lib/ast.py#L30-L35). Note, however, this means a further part of the compile documentation is wrong: > The optional arguments flags and dont_inherit control which future statements (see PEP 236) affect the compilation of source. flags is therefore something more general than just controlling which future statements affect the source, given it also controls the output type of the function. In short, we should: * document the flags argument can take _ast.PyCF_ONLY_AST *or* change the documentation to say it returns a code object (and not an AST object) ---------- assignee: docs at python components: Documentation messages: 320721 nosy: docs at python, gsnedders priority: normal severity: normal status: open title: Document when compile returns a code object v. AST versions: Python 2.7, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 12:09:13 2018 From: report at bugs.python.org (Alan Huang) Date: Fri, 29 Jun 2018 16:09:13 +0000 Subject: [New-bugs-announce] [issue34001] LibreSSL does not tolerate setting minimum_version greater than maximum_version Message-ID: <1530288553.74.0.56676864532.issue34001@psf.upfronthosting.co.za> New submission from Alan Huang : LibreSSL has a function called `ssl_clamp_version_range` that is called before attempting to set the minimum and maximum protocol versions in `ssl_version_set_{min,max}`. The function disallows setting ranges that are invalid (i.e., where minimum_version > maximum_version). OpenSSL does not disallow this behavior. As a result, attempting to set a minimum_version greater than a maximum_version results in a ValueError when Python is built with LibreSSL. There are two things that might need fixing here: 1. Replace the ValueError "Unsupported protocol version 0x%x" message with a more generic one. The assumption that the only way the operation can fail is if the underlying library does not support the protocol version is incorrect. This can be done by either making the message more generic or by introducing another error message to handle this case. 2. Change test_min_max_version lines 3575-3576 to set the maximum_version before the minimum_version. Here's some Python code to reproduce the above-mentioned error: ``` import ssl ctx = ssl.SSLContext() ctx.maximum_version = ssl.TLSVersion.TLSv1_1 ctx.minimum_version = ssl.TLSVersion.TLSv1_2 Traceback (most recent call last): File "", line 1, in File "/home/alan/src/cpython/Lib/ssl.py", line 491, in minimum_version super(SSLContext, SSLContext).minimum_version.__set__(self, value) ValueError: Unsupported protocol version 0x303 ``` Here's some example C code: ``` #include #include #include int main(){ SSL_CTX *ctx = NULL; ctx = SSL_CTX_new(TLS_method()); printf("setting max to TLSv1.1: "); if(SSL_CTX_set_max_proto_version(ctx, TLS1_1_VERSION)){ printf("success\n"); } else{ printf("failure\n"); } printf("setting min to TLSv1.2: "); if(SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION)){ printf("success\n"); } else{ printf("failure\n"); } printf("min ver: %d\n", SSL_CTX_get_min_proto_version(ctx)); printf("max ver: %d\n", SSL_CTX_get_max_proto_version(ctx)); return 0; } ``` Under LibreSSL 2.7.4, this produces: ``` setting max to TLSv1.1: success setting min to TLSv1.2: failure min ver: 769 max ver: 770 ``` Under OpenSSL 1.1.0g, this produces: ``` setting max to TLSv1.1: success setting min to TLSv1.2: success min ver: 771 max ver: 770 ``` The test that failed: ====================================================================== ERROR: test_min_max_version (test.test_ssl.ThreadedTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alan/src/cpython/Lib/test/test_ssl.py", line 3575, in test_min_max_version server_context.minimum_version = ssl.TLSVersion.TLSv1_2 File "/home/alan/src/cpython/Lib/ssl.py", line 491, in minimum_version super(SSLContext, SSLContext).minimum_version.__set__(self, value) ValueError: Unsupported protocol version 0x303 ---------- assignee: christian.heimes components: SSL, Tests messages: 320722 nosy: Alan.Huang, alex, christian.heimes, dstufft, janssen priority: normal severity: normal status: open title: LibreSSL does not tolerate setting minimum_version greater than maximum_version type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 15:02:30 2018 From: report at bugs.python.org (Michael Selik) Date: Fri, 29 Jun 2018 19:02:30 +0000 Subject: [New-bugs-announce] [issue34002] minor efficiency and clarity improvements in email package Message-ID: <1530298950.25.0.56676864532.issue34002@psf.upfronthosting.co.za> New submission from Michael Selik : The primary motivation for these improvements was avoiding a while/pop pattern for looping. A for-loop is a big improvement over copying a list, then repeatedly popping the 0th element. A lesser improvement is the use of ``a.intersection(b)`` instead of ``c = set(b); len(c) > len(c - a)``. The check for intersection is more clear, and it avoids an unnecessary set construction. https://github.com/python/cpython/pull/7999/ ---------- messages: 320730 nosy: selik priority: normal severity: normal status: open title: minor efficiency and clarity improvements in email package _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 15:47:39 2018 From: report at bugs.python.org (Michael Selik) Date: Fri, 29 Jun 2018 19:47:39 +0000 Subject: [New-bugs-announce] [issue34003] csv.DictReader can return basic dict instead of OrderedDict Message-ID: <1530301659.14.0.56676864532.issue34003@psf.upfronthosting.co.za> New submission from Michael Selik : Since dicts are now keeping insertion order as of 3.7, we can switch to the more efficient construction of dict rather than OrderedDict for each row in the CSV file. ---------- messages: 320734 nosy: selik priority: normal severity: normal status: open title: csv.DictReader can return basic dict instead of OrderedDict versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 17:43:37 2018 From: report at bugs.python.org (Joseph Sible) Date: Fri, 29 Jun 2018 21:43:37 +0000 Subject: [New-bugs-announce] [issue34004] Acquiring locks not interrupted by signals on musl libc Message-ID: <1530308617.47.0.56676864532.issue34004@psf.upfronthosting.co.za> New submission from Joseph Sible : When Python is built on Alpine Linux or in any other configuration that uses musl libc, calls to Lock.acquire() can't be interrupted by signals. This bug is caught by test_lock_acquire_interruption and test_rlock_acquire_interruption in 3.6/Lib/test/test_threadsignals.py, both of which fail when Python is built on musl. POSIX explicitly says that sem_timedwait ever failing with EINTR is optional: http://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_timedwait.html#tag_16_508_05 And musl deliberately chooses not to support it: http://www.openwall.com/lists/musl/2018/02/24/3 http://git.musl-libc.org/cgit/musl/commit/?id=c0ed5a201b2bdb6d1896064bec0020c9973db0a1 However, we incorrectly rely on it for correct operation. Our documentation https://docs.python.org/3.6/library/threading.html#threading.Lock.acquire just says that "Lock acquires can now be interrupted by signals on POSIX", not that any optional POSIX features are required for it. A similar bug was #11223, which was the same problem but with pthread_cond_timedwait, which is used when semaphores aren't available. ---------- components: Extension Modules messages: 320742 nosy: Joseph Sible priority: normal severity: normal status: open title: Acquiring locks not interrupted by signals on musl libc type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 18:03:03 2018 From: report at bugs.python.org (=?utf-8?q?R=C3=A9mi_Lapeyre?=) Date: Fri, 29 Jun 2018 22:03:03 +0000 Subject: [New-bugs-announce] [issue34005] Replace inspect.formatargspec by inspect.signature in xmlrpc module Message-ID: <1530309783.11.0.56676864532.issue34005@psf.upfronthosting.co.za> New submission from R?mi Lapeyre : xmlrpc still makes use of formatargspec which is deprecated since Python 3.5 and raises a deprecation warning: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly The proposed patch replace both uses of inspect.formatargspec by inspect.signature as the documentation suggest in https://docs.python.org/3/library/inspect.html#inspect.formatargspec. ---------- messages: 320743 nosy: remi.lapeyre priority: normal severity: normal status: open title: Replace inspect.formatargspec by inspect.signature in xmlrpc module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 19:04:41 2018 From: report at bugs.python.org (Roel Schroeven) Date: Fri, 29 Jun 2018 23:04:41 +0000 Subject: [New-bugs-announce] [issue34006] Windows HTML Help (chm) has fixed line length Message-ID: <1530313481.18.0.56676864532.issue34006@psf.upfronthosting.co.za> New submission from Roel Schroeven : Since 3.7 (and possibly 3.6.6) the .chm Windows help file uses fixed line lenghts, instead of properly adapting to the window width. Please revert to the old behavior. See screenshot: the empty space on the right is just silly. ---------- components: Windows files: python manual.PNG messages: 320746 nosy: paul.moore, roelschroeven, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows HTML Help (chm) has fixed line length type: enhancement versions: Python 3.7 Added file: https://bugs.python.org/file47660/python manual.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 29 20:24:59 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 30 Jun 2018 00:24:59 +0000 Subject: [New-bugs-announce] [issue34007] test_gdb fails in s390x SLES buildbots Message-ID: <1530318299.83.0.56676864532.issue34007@psf.upfronthosting.co.za> New submission from Pablo Galindo Salgado : test_gdb is currently failing on the following buildbots: http://buildbot.python.org/all/#/builders/54/builds/465 http://buildbot.python.org/all/#/builders/66/builds/178 http://buildbot.python.org/all/#/builders/16/builds/1279 http://buildbot.python.org/all/#/builders/122/builds/481 Sample error lines: ====================================================================== FAIL: test_threads (test.test_gdb.PyBtTests) Verify that "py-bt" indicates threads that are waiting for the GIL ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.7.edelsohn-sles-z/build/Lib/test/test_gdb.py", line 776, in test_threads cmds_after_breakpoint=['thread apply all py-bt']) File "/home/dje/cpython-buildarea/3.7.edelsohn-sles-z/build/Lib/test/test_gdb.py", line 213, in get_stack_trace self.assertEqual(unexpected_errlines, []) AssertionError: Lists differ: ["Python Exception PC [58 chars]ved'] != [] First list contains 2 additional elements. First extra element 0: "Python Exception PC not saved: " + [] - ["Python Exception PC not saved: ", - 'Error occurred in Python command: PC not saved'] ---------------------------------------------------------------------- Ran 46 tests in 19.888s FAILED (failures=1) 1 test failed again: test_gdb ---------- components: Tests messages: 320747 nosy: pablogsal priority: normal severity: normal status: open title: test_gdb fails in s390x SLES buildbots type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 30 02:58:41 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 30 Jun 2018 06:58:41 +0000 Subject: [New-bugs-announce] [issue34008] Do we support calling Py_Main() after Py_Initialize()? Message-ID: <1530341921.37.0.56676864532.issue34008@psf.upfronthosting.co.za> New submission from Nick Coghlan : In the current documentation, Py_Main is listed as a regular C API function: https://docs.python.org/3/c-api/veryhigh.html#c.Py_Main We also didn't add Py_Main() to https://docs.python.org/3/c-api/init.html#before-python-initialization when we did the review for "Functions which are safe to call before Py_Initialize()". If it truly is a regular C API function, then this suggests that Py_Main() should be called *after* Py_Initialize(). However, Py_Main() has historically called Py_Initialize() *itself*, and generally assumes it has total control over management of the current process - it doesn't expect to be sharing the current process with an embedding application. In Python 3.7, Py_Main() was changed to call _Py_InitializeCore() and _Py_InitializeMainInterpreter() as separate steps, allowing it to detect cases where an embedding application had already called Py_Initialize(), meaning that Py_Main()'s config setting changes wouldn't be applied. In effect, we've converted a silent failure (settings not read and applied as expected) into a noisy one (attempting to call Py_Main() in an already initialised interpreter). (The test suite is silent on the matter, since the idea of an embedding application calling Py_Initialize() before calling Py_Main() never even occurred to us) So the question is, what should we do about this for Python 3.7: 1. Treat it as a regression, try to replicate the old behaviour of partially (but not completely) ignoring the config settings read by Py_Main() 2. Treat it as a regression, but don't try to replicate the old config-settings-are-partially-applied behaviour - just ignore the settings read by Py_Main() completely 3. Treat it as a long standing documentation error, update the docs to make it clear that Py_Main() expects to handle calling Py_Initialize() itself, and update the Python 3.7 porting guide accordingly ---------- messages: 320758 nosy: eric.snow, ncoghlan, vstinner priority: normal severity: normal stage: test needed status: open title: Do we support calling Py_Main() after Py_Initialize()? type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 30 05:26:42 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 30 Jun 2018 09:26:42 +0000 Subject: [New-bugs-announce] [issue34009] Document Travis CI / Ubuntu 14.04 OpenSSL compatibility issues Message-ID: <1530350802.86.0.56676864532.issue34009@psf.upfronthosting.co.za> New submission from Nick Coghlan : As noted in https://github.com/travis-ci/travis-ci/issues/9069, Travis CI's Ubuntu 14.04 environment includes an OpenSSL that's too old to meet Python 3.7's security requirements. According to https://github.com/travis-ci/travis-ci/issues/9069#issuecomment-395471575, setting "dist: xenial" instead (giving Ubuntu 16.04) provides a testing environment with a new enough OpenSSL for 3.7 to work. I'm thinking it would make the most sense as a subsection under https://docs.python.org/dev/whatsnew/3.7.html#platform-support-removals (https://docs.python.org/dev/whatsnew/3.7.html#ssl does mention this information in a note, but that uses the OpenSSL version numbers directly, which folks aren't necessarily going to know to go to distrowatch to check which Travis environment they need to select: https://distrowatch.com/table.php?distribution=Ubuntu ) ---------- messages: 320762 nosy: christian.heimes, ncoghlan, ned.deily priority: normal severity: normal stage: needs patch status: open title: Document Travis CI / Ubuntu 14.04 OpenSSL compatibility issues type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 30 05:27:00 2018 From: report at bugs.python.org (hajoscher) Date: Sat, 30 Jun 2018 09:27:00 +0000 Subject: [New-bugs-announce] [issue34010] tarfile stream read performance Message-ID: <1530350820.63.0.56676864532.issue34010@psf.upfronthosting.co.za> New submission from hajoscher : Buffer read of large files in a compressed tarfile stream performs poorly. The buffered read in tarfile _Stream is extending a bytes object. It is much more efficient to use a list followed by a join. Using a list can mean seconds instead of minutes. This performance regression was introduced in b506dc32c1a. How to test: # create random tarfile 50Mb dd if=/dev/urandom of=test.bin count=50 bs=1M tar czvf test.tgz test.bin # read with tarfile as stream (note pipe symbol in 'r|gz') import tarfile tfile = tarfile.open("test.tgz", 'r|gz') for t in tfile: file = tfile.extractfile(t) if file: print(len(file.read())) ---------- components: Library (Lib) messages: 320763 nosy: hajoscher priority: normal severity: normal status: open title: tarfile stream read performance type: performance versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 30 06:07:43 2018 From: report at bugs.python.org (Jonathan) Date: Sat, 30 Jun 2018 10:07:43 +0000 Subject: [New-bugs-announce] [issue34011] Default preference not given to venv DLL's Message-ID: <1530353263.14.0.56676864532.issue34011@psf.upfronthosting.co.za> New submission from Jonathan : I don't know if this is a bug or an odd design decision or just something that hasn't been considered or maybe I'm missing something. On Windows and I create a venv with Python 3.6.3: > python -m venv venv This creates a subdirectory called /venv. Inside this, there's: ./venv/Scripts/sqlite3.dll This is the sqlite library - except it's not, because Python isn't using this file. If I upgrade this library by replacing it with a newer sqlite3.dll version, Python keep using the original version of the library. Turns out, Python is by default reading the DLL in the root Python install: c:\Python36\DLLs\sqlite3.dll Now, I can change that file and sure enough my VENV (*all* VENVs) then get the newer version of SQLite, or I can delete that file and the VENV's will all use their local versions, or I can possibly play with some sys.path to try and get the VENV version loaded first. But this raises a few questions: 1) This seems like a rather odd default - copying a file that is never used by default. 2) Surely either the correct option is to use the VENV version by default? 3) Otherwise, what's the point in copying across this DLL file into the VENV by default? ---------- messages: 320765 nosy: jonathan-lp priority: normal severity: normal status: open title: Default preference not given to venv DLL's versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 30 11:29:14 2018 From: report at bugs.python.org (Dan Hemberger) Date: Sat, 30 Jun 2018 15:29:14 +0000 Subject: [New-bugs-announce] [issue34012] No option to include system headers in distutils.core.Extension Message-ID: <1530372554.62.0.56676864532.issue34012@psf.upfronthosting.co.za> New submission from Dan Hemberger : The distutils.core.Extension class has a constructor argument `include_dirs`, which includes each directory with `-I`. However, it is sometimes desirable to include additional system headers using `-isystem`. Currently, this is only possible by manually constructing the compiler argument and passing it to the `extra_compile_args` argument of distutils.core.Extension. Since `-isystem` is a commonly used compiler option, I think it would be useful to add a new argument and attribute to distutils.core.Extension called `system_include_dirs`, which would use `-isystem` instead of `-I` when building the compiler command. ---------- components: Distutils messages: 320788 nosy: danh, dstufft, eric.araujo priority: normal severity: normal status: open title: No option to include system headers in distutils.core.Extension versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 30 13:42:58 2018 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 30 Jun 2018 17:42:58 +0000 Subject: [New-bugs-announce] [issue34013] Inconsistent SyntaxError for print Message-ID: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> New submission from Dong-hee Na : Python 3.8.0a0 (heads/master-dirty:0cdf5f4289, Jul 1 2018, 02:30:31) [Clang 9.1.0 (clang-902.0.39.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> print "hi" File "", line 1 print "hi" ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("hi")? >>> def add(a,b): ... return a + b ... >>> print add(3,5) File "", line 1 print add(3,5) ^ SyntaxError: invalid syntax IMHO, an error message should be 'SyntaxError: Missing parentheses in call to 'print'. Did you mean print(add(3,5))?' but it is not. ---------- messages: 320797 nosy: corona10 priority: normal severity: normal status: open title: Inconsistent SyntaxError for print versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 30 19:26:24 2018 From: report at bugs.python.org (Viktor Kovtun) Date: Sat, 30 Jun 2018 23:26:24 +0000 Subject: [New-bugs-announce] [issue34014] loop.run_in_executor should propagate current contextvars Message-ID: <1530401184.74.0.56676864532.issue34014@psf.upfronthosting.co.za> New submission from Viktor Kovtun : PEP 567 supports copying context into another threads, but for asyncio users each call `run_in_executor` requires explicit context propagation For end users expected behavior that context is copied automatically ---------- components: asyncio messages: 320814 nosy: asvetlov, hellysmile, yselivanov priority: normal severity: normal status: open title: loop.run_in_executor should propagate current contextvars versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 30 21:34:22 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 01 Jul 2018 01:34:22 +0000 Subject: [New-bugs-announce] [issue34015] doc Add link to Descriptor HowTo Guide in Data Model Message-ID: <1530408862.0.0.56676864532.issue34015@psf.upfronthosting.co.za> New submission from Andr?s Delfino : IMHO, it would be useful to make the Descriptor HowTo Guide more discoverable. As far as I can see, we are not linking to it from anywhere except the HOWTO index. Section 3.3.2.2., "Implementing Descriptors", in "Data Model" seems to be the most appropriate place. ---------- assignee: docs at python components: Documentation messages: 320821 nosy: adelfino, docs at python priority: normal severity: normal status: open title: doc Add link to Descriptor HowTo Guide in Data Model type: enhancement versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________