From report at bugs.python.org Sun Apr 1 00:33:27 2018 From: report at bugs.python.org (Nathaniel Smith) Date: Sun, 01 Apr 2018 04:33:27 +0000 Subject: [issue33194] Path-file objects does not have method to delete itself if its a file In-Reply-To: <1522550854.13.0.467229070634.issue33194@psf.upfronthosting.co.za> Message-ID: <1522557207.64.0.467229070634.issue33194@psf.upfronthosting.co.za> Nathaniel Smith added the comment: You're looking for 'Path.unlink'. Agreed though that the name makes it hard to find. (I guess it makes sense to old-school Unix greybeards, but Python does generally try to be useful for more people than just them...) There was some discussion on python-dev a few weeks ago about smoothing over some of these rough edges in the Path API, but it kinda fizzled out without anyone volunteering to do the work of going through and curating a good list of changes and writing down a case for each of them. ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 00:46:01 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Apr 2018 04:46:01 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1522557961.57.0.467229070634.issue33185@psf.upfronthosting.co.za> Nick Coghlan added the comment: I guess this confirms our suspicion from issue 33053 that making "-m" no longer track the current working directory had the potential to pose some non-trivial compatibility risks :( I can reproduce the issue in a 3.7 checkout without a virtual environment: ``` $ ./python -m pydoc itertools No module named 'ast' ``` There's an odd discrepancy between the behaviour when running pydoc and the behaviour when running runpy, though: ``` $ ./python -im runpy No module specified for execution >>> import sys; print(len(sys.path)); print(sys.path) 5 ['/home/ncoghlan/devel/py37', '/usr/local/lib/python37.zip', '/home/ncoghlan/devel/py37/Lib', '/home/ncoghlan/devel/py37/build/lib.linux-x86_64-3.7', '/home/ncoghlan/.local/lib/python3.7/site-packages'] >>> $ ./python -im pydoc itertools No module named 'ast' >>> import sys; print(len(sys.path)); print(sys.path) 5 ['.', '/home/ncoghlan/devel/py37', '/usr/local/lib/python37.zip', '/home/ncoghlan/devel/py37/build/lib.linux-x86_64-3.7', '/home/ncoghlan/.local/lib/python3.7/site-packages'] >>> ``` The path in the `runpy` case is correct, while the path in the `pydoc` case is missing the expected `Lib` directory (and hence can't import standard library modules), and has had a `.` inserted at the start of `sys.path`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 01:25:14 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Apr 2018 05:25:14 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1522560314.68.0.467229070634.issue33185@psf.upfronthosting.co.za> Nick Coghlan added the comment: It turns out pydoc's CLI is looking specifically for '' in sys.path, but *not* looking for "os.getcwd()". The resulting sys.path manipulation then goes completely wrong for "python -m pydoc", since it ends up removing "scriptdir" from sys.path, and that's the directory containing "pydoc" and the rest of the standard library. It surprised me that you were getting the misbehaviour for the direct pydoc command though, as for me, that's a separate script living in `*/bin`, so the misbehaviour doesn't happen (only the bin directory gets removed from sys.path, which is the desired behaviour). It turns out that behaviour is due to a difference between venv and virtualenv, where the latter defines a shell alias to hide the filesystem level pydoc scripts installed system wide: ``` $ which pydoc pydoc () { python -m pydoc "$@" } ``` and hence will encounter the problem. So I think there are two changes needed here: 1. Update pydoc.cli() to search sys.path for "os.getcwd()" in addition to searching for the empty string. 2. Rewording the note in the porting guide to explicitly call out checks for "'' in sys.path" in start-up code as potentially requiring updates ---------- assignee: -> ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 01:26:13 2018 From: report at bugs.python.org (INADA Naoki) Date: Sun, 01 Apr 2018 05:26:13 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. Message-ID: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> New submission from INADA Naoki : https://docs.python.org/3/c-api/arg.html Py_UNICODE usage is not deprecated in this document. Before thinking about raising warning, deprecate it in document first. But... from when? Can I backport the "deprecated" doc to 3.6 or 3.5? ---------- assignee: docs at python components: Documentation messages: 314761 nosy: docs at python, inada.naoki priority: normal severity: normal status: open title: PyArg_Parse* should deprecate 'u' and 'z' family. versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 01:28:24 2018 From: report at bugs.python.org (INADA Naoki) Date: Sun, 01 Apr 2018 05:28:24 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. In-Reply-To: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> Message-ID: <1522560504.78.0.467229070634.issue33195@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- keywords: +patch pull_requests: +6042 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 01:58:11 2018 From: report at bugs.python.org (Arcadiy Ivanov) Date: Sun, 01 Apr 2018 05:58:11 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched Message-ID: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> New submission from Arcadiy Ivanov : While working on GH gevent/gevent#993 I've encountered a stall trying to read from an mp.Queue passed to mp.Process's target as an argument. Trying to print out the lock state in child process I encountered as SEGV in Lock's __repr__. I originally thought it was due to gevent/greenlet stack magic, but it wasn't. This happens when `fork` context Queue (default) is used with `spawn` context Process (obvious stupidity on my part, alas shouldn't crash). Python 3.6.4 from PyEnv Fedora 27 ``` $ python test_lock_sigsegv.py Parent r_q: , , -11 ``` ``` Program terminated with signal SIGSEGV, Segmentation fault. #0 __new_sem_getvalue (sem=0x7fc877f54000, sval=sval at entry=0x7fffb130db9c) at sem_getvalue.c:38 38 *sval = atomic_load_relaxed (&isem->data) & SEM_VALUE_MASK; ... #0 __new_sem_getvalue (sem=0x7fc877f54000, sval=sval at entry=0x7fffb130db9c) at sem_getvalue.c:38 #1 0x00007f1116aeb202 in semlock_getvalue (self=) at /tmp/python-build.20171219170845.6548/Python-3.6.4/Modules/_multiprocessing/semaphore.c:531 ``` At a minimum I think there should be a check trying to reduce arguments via incompatible context's process to prevent a SEGV. Test attached. ---------- components: Library (Lib) files: test_lock_sigsegv.py messages: 314762 nosy: arcivanov priority: normal severity: normal status: open title: SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched type: crash versions: Python 3.6 Added file: https://bugs.python.org/file47510/test_lock_sigsegv.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 02:38:24 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Apr 2018 06:38:24 +0000 Subject: [issue33130] functools.reduce signature/docstring discordance In-Reply-To: <1521849944.24.0.467229070634.issue33130@psf.upfronthosting.co.za> Message-ID: <1522564704.82.0.467229070634.issue33130@psf.upfronthosting.co.za> Nick Coghlan added the comment: +1 for switching over to `iterable` in the reduce docstring. As a possible enhancement for 3.8+ only, it would be reasonable to start converting functools over to Argument Clinic in order to improve the introspection support. (Note that only some APIs could be converted though, as others have more complex signatures that AC doesn't yet support: https://bugs.python.org/issue20291) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 03:14:32 2018 From: report at bugs.python.org (Antony Lee) Date: Sun, 01 Apr 2018 07:14:32 +0000 Subject: [issue33197] Confusing error message when constructing invalid inspect.Parameters Message-ID: <1522566872.11.0.467229070634.issue33197@psf.upfronthosting.co.za> New submission from Antony Lee : Python 3.6.4 In [15]: inspect.Parameter("foo", kind=inspect.Parameter.VAR_KEYWORD, default=42) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in () ----> 1 inspect.Parameter("foo", kind=inspect.Parameter.VAR_KEYWORD, default=42) /usr/lib/python3.6/inspect.py in __init__(self, name, kind, default, annotation) 2442 if kind in (_VAR_POSITIONAL, _VAR_KEYWORD): 2443 msg = '{} parameters cannot have default values'.format(kind) -> 2444 raise ValueError(msg) 2445 self._default = default 2446 self._annotation = annotation ValueError: 4 parameters cannot have default values Note the "interesting" error message that starts with "4 parameters ..." (yes, I guess that inspect.Parameter == 4 internally...). Probably just a matter of making the error f'{kind.name} parameters ...'. ---------- components: Library (Lib) messages: 314764 nosy: Antony.Lee priority: normal severity: normal status: open title: Confusing error message when constructing invalid inspect.Parameters versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 03:18:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 07:18:19 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. In-Reply-To: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> Message-ID: <1522567099.65.0.467229070634.issue33195@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See also issue24009. We should get rid of using these units in the stdlib. I'm not sure about deprecating Py_BuildValue() units right now. They can be redefined in terms of wchar_t, and they are already implemented with PyUnicode_FromWideChar(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 03:26:35 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 07:26:35 +0000 Subject: [issue33132] Possible refcount issues in the compiler In-Reply-To: <1521894745.19.0.467229070634.issue33132@psf.upfronthosting.co.za> Message-ID: <1522567595.67.0.467229070634.issue33132@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 72f3e0887500e00867fa16ce5aaab12fae853b63 by Serhiy Storchaka in branch '2.7': [2.7] bpo-33132: Fix reference counting issues in the compiler. (GH-6209). (GH-6322) https://github.com/python/cpython/commit/72f3e0887500e00867fa16ce5aaab12fae853b63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 03:42:56 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 07:42:56 +0000 Subject: [issue33132] Possible refcount issues in the compiler In-Reply-To: <1521894745.19.0.467229070634.issue33132@psf.upfronthosting.co.za> Message-ID: <1522568576.48.0.467229070634.issue33132@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 03:43:55 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 07:43:55 +0000 Subject: [issue33096] ttk.Treeview.insert() does not allow to insert item with "False" iid In-Reply-To: <1521364150.91.0.467229070634.issue33096@psf.upfronthosting.co.za> Message-ID: <1522568635.58.0.467229070634.issue33096@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 04:00:45 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 08:00:45 +0000 Subject: [issue32713] tarfile.itn breaks if n is a negative float In-Reply-To: <1517260556.9.0.467229070634.issue32713@psf.upfronthosting.co.za> Message-ID: <1522569645.85.0.467229070634.issue32713@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 04:38:58 2018 From: report at bugs.python.org (Florian Schulze) Date: Sun, 01 Apr 2018 08:38:58 +0000 Subject: [issue33198] Build on Linux with --enable-optimizations fails Message-ID: <1522571938.21.0.467229070634.issue33198@psf.upfronthosting.co.za> New submission from Florian Schulze : While the tests run there is a segfault: https://travis-ci.org/collective/buildout.python/jobs/360190312#L2529 Started with b2 and still happens in b3, b1 built fine. ---------- components: Build, Tests messages: 314767 nosy: fschulze priority: normal severity: normal status: open title: Build on Linux with --enable-optimizations fails versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 04:56:59 2018 From: report at bugs.python.org (pdox) Date: Sun, 01 Apr 2018 08:56:59 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized Message-ID: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> New submission from pdox : PyDict_Copy leaves 'ma_version_tag' uninitialized when the dictionary being copied has a split table. ---------- components: Interpreter Core messages: 314768 nosy: pdox priority: normal severity: normal status: open title: PyDict_Copy() can leave 'ma_version_tag' uninitialized type: behavior versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 06:29:26 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 10:29:26 +0000 Subject: [issue33200] Optimize the empty set "literal" Message-ID: <1522578566.75.0.467229070634.issue33200@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The following PR optimizes bytecode for the empty set "literal": {*()}. Currently it is compiled to LOAD_CONST 0 (()) BUILD_SET_UNPACK 1 It will optimized to BUILD_SET 0 $ ./python -m perf timeit --duplicate 1000 '{*()}' Unpatched: Mean +- std dev: 68.6 ns +- 1.1 ns Patched: Mean +- std dev: 31.8 ns +- 2.8 ns ---------- components: Interpreter Core messages: 314769 nosy: benjamin.peterson, brett.cannon, ncoghlan, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Optimize the empty set "literal" type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 06:35:12 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 10:35:12 +0000 Subject: [issue33200] Optimize the empty set "literal" In-Reply-To: <1522578566.75.0.467229070634.issue33200@psf.upfronthosting.co.za> Message-ID: <1522578912.97.0.467229070634.issue33200@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6043 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 07:27:38 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 11:27:38 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522582058.93.0.467229070634.issue20104@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I'm trying to fix issues with os.posix_spawn(), but there are so much of them, that perhaps it would be better to remove this undocumented feature from 3.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 07:35:45 2018 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 01 Apr 2018 11:35:45 +0000 Subject: [issue33200] Optimize the empty set "literal" In-Reply-To: <1522578566.75.0.467229070634.issue33200@psf.upfronthosting.co.za> Message-ID: <1522582545.25.0.467229070634.issue33200@psf.upfronthosting.co.za> Mark Dickinson added the comment: Does anyone seriously write "{*()}" instead of "set()"? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 07:56:26 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 11:56:26 +0000 Subject: [issue33200] Optimize the empty set "literal" In-Reply-To: <1522578566.75.0.467229070634.issue33200@psf.upfronthosting.co.za> Message-ID: <1522583786.12.0.467229070634.issue33200@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Don't know. :-) Consider this as a 1st April egg. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 09:41:21 2018 From: report at bugs.python.org (Marco Rougeth) Date: Sun, 01 Apr 2018 13:41:21 +0000 Subject: [issue33194] Path-file objects does not have method to delete itself if its a file In-Reply-To: <1522550854.13.0.467229070634.issue33194@psf.upfronthosting.co.za> Message-ID: <1522590081.21.0.467229070634.issue33194@psf.upfronthosting.co.za> Marco Rougeth added the comment: Wow, I never saw unlink term related to removing files (obviously I'm not an old-school Unix greybeard). @nsj could you point me the thread you talked about? or help me find it? I looked in the archive in the last three months and couldn't find it. Thank you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 09:58:03 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 01 Apr 2018 13:58:03 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522591083.88.0.467229070634.issue20104@psf.upfronthosting.co.za> Ned Deily added the comment: > perhaps it would be better to remove this undocumented feature from 3.7 We need to make a decision about this before the b4 cutoff in 4 weeks. But it would not be fair to ask people to put in the effort to try to fix things if there is not a good chance for success and if people's time could be better spent on currently more important issues. Greg, Pablo, others: opinions? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 11:03:21 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Apr 2018 15:03:21 +0000 Subject: [issue33191] Refleak in posix_spawn In-Reply-To: <1522444171.85.0.467229070634.issue33191@psf.upfronthosting.co.za> Message-ID: <1522595001.74.0.467229070634.issue33191@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- pull_requests: +6044 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 11:05:10 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Apr 2018 15:05:10 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522595110.5.0.467229070634.issue20104@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: In PR6331 I am trying to address all issues identified by Serhiy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 11:05:47 2018 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 01 Apr 2018 15:05:47 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1522595147.14.0.467229070634.issue33189@psf.upfronthosting.co.za> Stefan Behnel added the comment: Is there really a use case for this? I would normally expect place holders to get replaced *after* translation, i.e. in the translated text, not before. ---------- nosy: +scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 11:06:41 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Apr 2018 15:06:41 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522595201.32.0.467229070634.issue20104@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Notice that some of the errors identified at the end of 5109 were already corrected by the other PRs in this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 12:18:14 2018 From: report at bugs.python.org (Marc Le Roy) Date: Sun, 01 Apr 2018 16:18:14 +0000 Subject: [issue29753] Ctypes Packing Bitfields Incorrectly - Linux In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1522599494.56.0.467229070634.issue29753@psf.upfronthosting.co.za> Marc Le Roy added the comment: No solution found to solve this issue ? The anomaly is not a cross platform inconsistency, it is an inconsistency between the behaviours of GCC and ctypes, both under Linux or Cygwin, when defining packed structures : [Marc at I7-860 ~/dev/python/ctypes-bitfields-bug] make test ./bitfield_test1 sizeof(BF32) = 12 ; Memory dump of BF32 = 0xffffffffffffffffffffffff sizeof(BF64) = 12 ; Memory dump of BF64 = 0xffffffffffffffffffffffff python3 bitfield_test1.py sizeof(BF32) = 16 ; Memory dump of BF32 = 0xffffff00ffffff00ffffff00ffffff00 sizeof(BF64) = 16 ; Memory dump of BF64 = 0xffffffffffff0000ffffffffffff0000 ---------- Added file: https://bugs.python.org/file47511/ctypes-bitfields-bug.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 12:23:37 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 16:23:37 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522599817.83.0.467229070634.issue20104@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6045 stage: commit review -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 12:28:02 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 16:28:02 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522600082.17.0.467229070634.issue20104@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 6332 fixes issues found by me in os.posix_spawn(). It is not completed yet, needed documentation and tests. And I have doubts about API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 12:45:43 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Apr 2018 16:45:43 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1522601143.97.0.467229070634.issue33189@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I agree that pygettext should not and can not support f-strings, but the error should be better. The problem is that an f-string expression is tokenized as literal strings, but eval() can't evaluate it out of context. ---------- nosy: +eric.smith, serhiy.storchaka versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 14:55:46 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 01 Apr 2018 18:55:46 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522608946.93.0.467229070634.issue20104@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +6046 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 15:01:50 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 01 Apr 2018 19:01:50 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522609310.4.0.467229070634.issue20104@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 79760ed256987cead08d668b95675afba6b3760f by Gregory P. Smith in branch 'master': bpo-20104: Add os.posix_spawn documentation. (#6334) https://github.com/python/cpython/commit/79760ed256987cead08d668b95675afba6b3760f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 15:02:11 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 01 Apr 2018 19:02:11 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522609331.42.0.467229070634.issue20104@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6047 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 15:03:03 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Apr 2018 19:03:03 +0000 Subject: [issue33201] Modernize "Extension types" documentation Message-ID: <1522609383.56.0.467229070634.issue33201@psf.upfronthosting.co.za> New submission from Antoine Pitrou : The "Defining New Types" in the C extension docs uses outdated idioms (e.g. pre-C99 struct initialization) and could do with a good refresh. ---------- assignee: docs at python components: Documentation messages: 314782 nosy: docs at python, pitrou priority: normal severity: normal stage: needs patch status: open title: Modernize "Extension types" documentation type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 15:11:10 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 01 Apr 2018 19:11:10 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522609870.88.0.467229070634.issue20104@psf.upfronthosting.co.za> Gregory P. Smith added the comment: PR 6332 is overall a good cleanup. I pushed a couple changes to that PR and left comments for some others. It should go in. There are basic tests for os.posix_spawn in test_posix.py. More would be nice as we don't currently have any for the error paths. The API is intentionally low level and simple as that is what the os (posix) module is all about. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 15:13:40 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 01 Apr 2018 19:13:40 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522610020.05.0.467229070634.issue20104@psf.upfronthosting.co.za> miss-islington added the comment: New changeset ab8457232121dfdfb1d4bfcf806a842fbe402722 by Miss Islington (bot) in branch '3.7': bpo-20104: Add os.posix_spawn documentation. (GH-6334) https://github.com/python/cpython/commit/ab8457232121dfdfb1d4bfcf806a842fbe402722 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 15:15:43 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 01 Apr 2018 19:15:43 +0000 Subject: [issue33191] Refleak in posix_spawn In-Reply-To: <1522444171.85.0.467229070634.issue33191@psf.upfronthosting.co.za> Message-ID: <1522610143.62.0.467229070634.issue33191@psf.upfronthosting.co.za> Gregory P. Smith added the comment: https://github.com/python/cpython/pull/6332 appears to address this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 15:18:16 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Apr 2018 19:18:16 +0000 Subject: [issue33201] Modernize "Extension types" documentation In-Reply-To: <1522609383.56.0.467229070634.issue33201@psf.upfronthosting.co.za> Message-ID: <1522610296.96.0.467229070634.issue33201@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- keywords: +patch pull_requests: +6048 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 15:21:50 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 01 Apr 2018 19:21:50 +0000 Subject: [issue33202] os.walk mentions os.listdir instead of os.scandir Message-ID: <1522610510.25.0.467229070634.issue33202@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Documentation states that, for walk, "errors from the listdir() call are ignored". That's no longer the case since 3.5. Change mention to listdir() to scandir(). ---------- assignee: docs at python components: Documentation messages: 314786 nosy: adelfino, docs at python priority: normal pull_requests: 6049 severity: normal status: open title: os.walk mentions os.listdir instead of os.scandir versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 16:04:10 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Sun, 01 Apr 2018 20:04:10 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally Message-ID: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> New submission from Wolfgang Maier : from https://docs.python.org/3/library/random.html#random.choice: Return a random element from the non-empty sequence seq. If seq is empty, raises IndexError. Indeed: >>> import random >>> random.choice([]) Traceback (most recent call last): File "", line 1, in File "/home/wolma/cpython/random.py", line 259, in choice raise IndexError('Cannot choose from an empty sequence') from None IndexError: Cannot choose from an empty sequence but when not using getrandbits internally: >>> class MyRandom(random.Random): ... def random(self): ... return super().random() ... >>> my_random=MyRandom() >>> my_random.choice([]) Traceback (most recent call last): File "", line 1, in File "/home/wolma/cpython/random.py", line 257, in choice i = self._randbelow(len(seq)) File "/home/wolma/cpython/random.py", line 245, in _randbelow rem = maxsize % n ZeroDivisionError: integer division or modulo by zero This is because the ValueError that random.choice tries to catch gets raised only in the getrandbits-dependent branch of Random._randbelow, but not in the branch using only Random.random (even though Random._randbelow suggests uniform behaviour. ---------- components: Library (Lib) messages: 314787 nosy: rhettinger, serhiy.storchaka, wolma priority: normal severity: normal status: open title: random.choice: raise IndexError on empty sequence even when not using getrandbits internally type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 16:13:45 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Sun, 01 Apr 2018 20:13:45 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522613625.88.0.467229070634.issue33203@psf.upfronthosting.co.za> Change by Wolfgang Maier : ---------- keywords: +patch pull_requests: +6050 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 16:16:38 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Sun, 01 Apr 2018 20:16:38 +0000 Subject: [issue33144] random._randbelow optimization In-Reply-To: <1522076428.25.0.467229070634.issue33144@psf.upfronthosting.co.za> Message-ID: <1522613798.26.0.467229070634.issue33144@psf.upfronthosting.co.za> Wolfgang Maier added the comment: ok, I've created issue 33203 to deal with raising ValueError in _randbelow consistently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 18:03:34 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Apr 2018 22:03:34 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522620213.99.0.467229070634.issue33199@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- nosy: +inada.naoki, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 18:36:33 2018 From: report at bugs.python.org (Martin Panter) Date: Sun, 01 Apr 2018 22:36:33 +0000 Subject: [issue22781] ctypes: Differing results between Python and C. In-Reply-To: <1414862185.49.0.654024451078.issue22781@psf.upfronthosting.co.za> Message-ID: <1522622193.08.0.467229070634.issue22781@psf.upfronthosting.co.za> Martin Panter added the comment: Eryk Sun?s explanation makes this sound like a duplicate of Issue 15453, which shows GCC on Linux packing structures into a single byte, and ctypes using the size of the expanded integer type. ---------- nosy: +martin.panter resolution: -> duplicate superseder: -> ctype with packed bitfields does not match native compiler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 18:53:37 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 01 Apr 2018 22:53:37 +0000 Subject: [issue27212] Doc for itertools, 'islice()' implementation have unwanted behavior for recipe 'consume()' In-Reply-To: <1465018426.98.0.63725897135.issue27212@psf.upfronthosting.co.za> Message-ID: <1522623217.63.0.467229070634.issue27212@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- pull_requests: +6051 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 19:32:45 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Apr 2018 23:32:45 +0000 Subject: [issue33200] Optimize the empty set "literal" In-Reply-To: <1522578566.75.0.467229070634.issue33200@psf.upfronthosting.co.za> Message-ID: <1522625565.13.0.467229070634.issue33200@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Does anyone seriously write "{*()}" instead of "set()"? It doesn't seem to be laughing to me. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 19:35:09 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Apr 2018 23:35:09 +0000 Subject: [issue33192] asyncio should use signal.set_wakeup_fd on Windows In-Reply-To: <1522536295.45.0.467229070634.issue33192@psf.upfronthosting.co.za> Message-ID: <1522625709.56.0.467229070634.issue33192@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- components: +Library (Lib) stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 19:41:10 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Apr 2018 23:41:10 +0000 Subject: [issue15088] PyGen_NeedsFinalizing is public, but undocumented In-Reply-To: <1339906861.99.0.42415214654.issue15088@psf.upfronthosting.co.za> Message-ID: <1522626070.52.0.467229070634.issue15088@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Cheryl: it may be useful to do a code search to find out whether any third-party projects are relying on PyGen_NeedsFinalizing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 19:45:19 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 01 Apr 2018 23:45:19 +0000 Subject: [issue33196] SEGV in mp.synchronize.Lock.__repr__ in spawn'ed proc if ctx mismatched In-Reply-To: <1522562291.13.0.467229070634.issue33196@psf.upfronthosting.co.za> Message-ID: <1522626319.79.0.467229070634.issue33196@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thanks for the report. Indeed I think it would be worth preventing this programmer error. ---------- nosy: +pitrou stage: -> needs patch versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 20:27:32 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 02 Apr 2018 00:27:32 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522628852.29.0.467229070634.issue33199@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 20:33:39 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 02 Apr 2018 00:33:39 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522629219.32.0.467229070634.issue33199@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- keywords: +patch pull_requests: +6052 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 20:55:27 2018 From: report at bugs.python.org (Lisa Roach) Date: Mon, 02 Apr 2018 00:55:27 +0000 Subject: [issue30940] Documentation for round() is incorrect. In-Reply-To: <1500223918.38.0.72996478594.issue30940@psf.upfronthosting.co.za> Message-ID: <1522630527.32.0.467229070634.issue30940@psf.upfronthosting.co.za> Change by Lisa Roach : ---------- keywords: +patch pull_requests: +6053 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 23:37:29 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 02 Apr 2018 03:37:29 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix Message-ID: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> New submission from Terry J. Reedy : Lib\idlelib\colorizer.py, line 25, is: stringprefix = r"(?i:\br|u|f|fr|rf|b|br|rb)?" The r prefix, but only the r prefix, must be preceded by a non-word character. On pydev thread "IDLE colorizer", MRAB noted: "The \b will apply only to the first choice. Shouldn't it be more like: stringprefix = r"(?:\b(?i:r|u|f|fr|rf|b|br|rb))?" I think the \b should be removed instead. Currently uf'a' gets f'a' colored, while ur'a' only gets 'a' colored. (Tim Peters pointed out the difference with a different example.) I prefer coloring the maximal legal string rather than the minimum. I think the contrast between two chars legal by themselves, but differently colored when put together, makes the bug more obvious. ---------- assignee: terry.reedy components: IDLE messages: 314793 nosy: terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: remove \b from colorizer string prefix type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 23:45:33 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 02 Apr 2018 03:45:33 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522640733.25.0.467229070634.issue33204@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The current test is part of the htest. The section # All valid prefixes for unicode and byte strings should be colored contains "ur'is invalid'". This should be moved to a new section with other invalid combinations. # Invalid combinations of legal characters should be half colored. ur'x', ru'x', uf'x', fu'x', UR'x' (only one CAPS example is needed now). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 1 23:52:54 2018 From: report at bugs.python.org (Martin Panter) Date: Mon, 02 Apr 2018 03:52:54 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1522641173.99.0.467229070634.issue33012@psf.upfronthosting.co.za> Martin Panter added the comment: Siddhesh, it looks like your fixes make the C function signatures match the signature expected in the PyMethodDef structure. If so, I suggest to remove the (PyCFunction) casts from those structure definitions as well. For instance, now that we have PyObject *Noddy_name(Noddy *self, PyObject *Py_UNUSED(ignored)) I suggest changing PyMethodDef Noddy_methods[] = { {"name", (PyCFunction)Noddy_name, METH_NOARGS, ... to PyMethodDef Noddy_methods[] = { {"name", Noddy_name, METH_NOARGS, ... I suspect the casts were only added to hide compiler warnings related to this bug. If you are proposing to add an ellipsis (...) to the definition of PyCFunction, that seems misguided. I understand this is incompatible under standard C. Are you relying on a GCC extension perhaps? Python is used with other compilers too. ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 00:21:22 2018 From: report at bugs.python.org (Tim Peters) Date: Mon, 02 Apr 2018 04:21:22 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522642882.45.0.467229070634.issue33204@psf.upfronthosting.co.za> Tim Peters added the comment: Sounds good (removing \b) to me, Terry! ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 00:34:21 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 02 Apr 2018 04:34:21 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522643661.28.0.467229070634.issue33204@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +6054 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 00:37:01 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 02 Apr 2018 04:37:01 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522643821.66.0.467229070634.issue33204@psf.upfronthosting.co.za> Terry J. Reedy added the comment: To see the visually verified test, run Lib/idlelib/colorizer as the main module, either from a command line or editor, and click the button. ---------- stage: patch review -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 00:37:11 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 02 Apr 2018 04:37:11 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522643831.63.0.467229070634.issue33204@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 01:15:49 2018 From: report at bugs.python.org (Nitish) Date: Mon, 02 Apr 2018 05:15:49 +0000 Subject: [issue33197] Confusing error message when constructing invalid inspect.Parameters In-Reply-To: <1522566872.11.0.467229070634.issue33197@psf.upfronthosting.co.za> Message-ID: <1522646149.96.0.467229070634.issue33197@psf.upfronthosting.co.za> Nitish added the comment: @Antony Lee since you know the fix, do you want to submit a PR? ---------- nosy: +nitishch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 01:20:03 2018 From: report at bugs.python.org (Nitish) Date: Mon, 02 Apr 2018 05:20:03 +0000 Subject: [issue33197] Confusing error message when constructing invalid inspect.Parameters In-Reply-To: <1522566872.11.0.467229070634.issue33197@psf.upfronthosting.co.za> Message-ID: <1522646403.66.0.467229070634.issue33197@psf.upfronthosting.co.za> Nitish added the comment: Also, _ParameterKind class has a __str__ method. So, I guess it's better to use "{!s}" in the format string instead of using kind.name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 01:29:05 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 02 Apr 2018 05:29:05 +0000 Subject: [issue27212] Doc for itertools, 'islice()' implementation have unwanted behavior for recipe 'consume()' In-Reply-To: <1465018426.98.0.63725897135.issue27212@psf.upfronthosting.co.za> Message-ID: <1522646945.04.0.467229070634.issue27212@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 325191bd6b3a2d5e3012adee868f19baf3e2c3ab by Raymond Hettinger (Cheryl Sabella) in branch '2.7': [2.7] bpo-27212: Modify islice recipe to consume initial values preceding start (GH-6195) (GH-6339) https://github.com/python/cpython/commit/325191bd6b3a2d5e3012adee868f19baf3e2c3ab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 01:29:54 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 02 Apr 2018 05:29:54 +0000 Subject: [issue27212] Doc for itertools, 'islice()' implementation have unwanted behavior for recipe 'consume()' In-Reply-To: <1465018426.98.0.63725897135.issue27212@psf.upfronthosting.co.za> Message-ID: <1522646994.12.0.467229070634.issue27212@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Thanks Cheryl. This was nice work :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 01:47:48 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 02 Apr 2018 05:47:48 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522648068.72.0.467229070634.issue33204@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset da58533ac67b01ce8f6466e6f03ff6b8b3bb04d5 by Terry Jan Reedy in branch 'master': bpo-33204: IDLE: consistently color invalid string prefixes (#6344) https://github.com/python/cpython/commit/da58533ac67b01ce8f6466e6f03ff6b8b3bb04d5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 01:48:09 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Apr 2018 05:48:09 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522648089.25.0.467229070634.issue33204@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6055 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 01:48:54 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Apr 2018 05:48:54 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522648134.0.0.467229070634.issue33204@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6056 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 01:54:16 2018 From: report at bugs.python.org (Nitish) Date: Mon, 02 Apr 2018 05:54:16 +0000 Subject: [issue33162] TimedRotatingFileHandler in logging module In-Reply-To: <1522224170.9.0.467229070634.issue33162@psf.upfronthosting.co.za> Message-ID: <1522648456.89.0.467229070634.issue33162@psf.upfronthosting.co.za> Change by Nitish : ---------- nosy: +nitishch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 02:09:20 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Apr 2018 06:09:20 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522649360.82.0.467229070634.issue33204@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 6130675efeb3c23cebc43ab07c49eb62cd03cacf by Miss Islington (bot) in branch '3.7': bpo-33204: IDLE: consistently color invalid string prefixes (GH-6344) https://github.com/python/cpython/commit/6130675efeb3c23cebc43ab07c49eb62cd03cacf ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 02:33:28 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Apr 2018 06:33:28 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522650808.07.0.467229070634.issue33204@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 16cf84b4fbe78f9d876e0335f33459f1b92b7bf0 by Miss Islington (bot) in branch '3.6': bpo-33204: IDLE: consistently color invalid string prefixes (GH-6344) https://github.com/python/cpython/commit/16cf84b4fbe78f9d876e0335f33459f1b92b7bf0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 03:55:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Apr 2018 07:55:49 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522655749.14.0.467229070634.issue33204@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Is ''or'' correctly colorized? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 07:55:51 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 02 Apr 2018 11:55:51 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking Message-ID: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> New submission from INADA Naoki : GROWTH_RATE is changed from (used*2) to (used*2 + dk_size/2) in #17563, at Python 3.4. It was for avoid resizing dict for massive del/insert use case, by increasing possibility of overwriting DUMMY entry. >From Python 3.6, there are no DUMMY entry. While there are dummy keys, we resize (repack) when entries are full. So there are no benefit from "possibility of overwriting dummy entry". (Of course, there are still benefit from slow repacking rate for new dict. So I don't propose to change it back to (used*2), but (used*3).) This GROWTH_RATE prevents dict is shrinked in insertion_resize(). For example, consider this dict: >>> d = dict.fromkeys(range(10900)) >>> len(d) 10900 >>> sys.getsizeof(d) 295008 >>> for i in range(10900): ... del d[i] ... >>> len(d) 0 >>> sys.getsizeof(d) 295008 `del d[i]` doesn't shrink the dict. This is another issue (#32623). Current dk_size is 16384 and entries length is dk_size * 2 // 3 = 10922. So dictresize will called when next 923 entries are added. New dk_size is round_up_to_power_of_two(922 + 16384/2) = 16384. So dict is not shrinked! >>> for i in range(923): ... d[i] = i ... >>> sys.getsizeof(d) 295008 round_up_to_power_of_two(used + dk_size/2) means dict is shrinked only when used == 0. I propose changing GROWTH_RATE again to `used*3` from `used*2 + dk_size/2` In case of dict growing without deletion, dk_size is doubled for each resize as current behavior. When there are deletion, dk_size is growing aggressively than Python 3.3 (used*2 -> used*3). And it allows dict shrinking after massive deletions. >>> import sys >>> d = dict.fromkeys(range(10900)) >>> sys.getsizeof(d) 295008 >>> for i in range(10900): ... del d[i] ... >>> len(d) 0 >>> sys.getsizeof(d) 295008 >>> for i in range(923): ... d[i] = i ... >>> sys.getsizeof(d) 36968 I want to backport this change to Python 3.7. While it's beta3, "dict can't be shrinked unless empty" behavior looks resource usage bug to me. ---------- components: Interpreter Core messages: 314806 nosy: Mark.Shannon, Yury.Selivanov, eric.snow, inada.naoki, rhettinger, vstinner priority: normal severity: normal status: open title: GROWTH_RATE prevents dict shrinking type: resource usage versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 07:56:14 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 02 Apr 2018 11:56:14 +0000 Subject: [issue32623] Resize dict on del/pop In-Reply-To: <1516639058.13.0.467229070634.issue32623@psf.upfronthosting.co.za> Message-ID: <1522670174.69.0.467229070634.issue32623@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- dependencies: +GROWTH_RATE prevents dict shrinking _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 07:59:24 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 02 Apr 2018 11:59:24 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1522670364.43.0.467229070634.issue33205@psf.upfronthosting.co.za> INADA Naoki added the comment: # cap2.json is master (used*2 + dk_size/2) # used3.json is patched (used*3) $ ./python-master -m perf compare_to cap2.json used3.json -G Slower (2): - rand_access(size=20): 2.67 ms +- 0.01 ms -> 2.80 ms +- 0.04 ms: 1.05x slower (+5%) - rand_access(size=10): 2.70 ms +- 0.03 ms -> 2.80 ms +- 0.04 ms: 1.04x slower (+4%) Faster (1): - rand_access(size=50): 2.76 ms +- 0.06 ms -> 2.74 ms +- 0.02 ms: 1.01x faster (-1%) Benchmark hidden because not significant (5): rand_access(size=2), rand_access(size=5), rand_access(size=100), rand_access(size=200), rand_access(size=500) ---------- Added file: https://bugs.python.org/file47512/dict_rand.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 10:24:24 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Apr 2018 14:24:24 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1522679064.7.0.467229070634.issue33205@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 10:30:19 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 02 Apr 2018 14:30:19 +0000 Subject: [issue15088] PyGen_NeedsFinalizing is public, but undocumented In-Reply-To: <1339906861.99.0.42415214654.issue15088@psf.upfronthosting.co.za> Message-ID: <1522679419.73.0.467229070634.issue15088@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Thanks Antoine. Do you have a good way for searching third party projects? I searched on Github and I'm getting a lot of references to the CPython filenames. I don't know how to check if anyone is making calls to the function. But, maybe that's the point and it can't be removed if there's a chance that anyone uses it? Thanks! This is what I tried on Github: PyGen_NeedsFinalizing -filename:ceval -filename:genobject -filename:gcmodule ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 10:32:36 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 02 Apr 2018 14:32:36 +0000 Subject: [issue15088] PyGen_NeedsFinalizing is public, but undocumented In-Reply-To: <1339906861.99.0.42415214654.issue15088@psf.upfronthosting.co.za> Message-ID: <1522679556.1.0.467229070634.issue15088@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I think https://searchcode.com/ may have a larger indexing base than GitHub alone. And, yes, you'll see many duplicates of the CPython source code... Visual inspection may be needed :-/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 10:56:55 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 02 Apr 2018 14:56:55 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522681015.45.0.467229070634.issue33204@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Yes, still correct, as a keyword. Legal "x or''" is colored as "x" "or" "''" . Legal "if'':" is colored as "if" "''" ":" ". New PR revises colorizer test and add the above. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 10:58:25 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 02 Apr 2018 14:58:25 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522681105.79.0.467229070634.issue33204@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- pull_requests: +6057 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 11:18:06 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 02 Apr 2018 15:18:06 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522682286.27.0.467229070634.issue33204@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 55966f3a0d5f1bf823bd22ce1abbde267b06552f by Terry Jan Reedy in branch 'master': bpo-33204: IDLE - revise and extend colorizer test. (GH-6347) https://github.com/python/cpython/commit/55966f3a0d5f1bf823bd22ce1abbde267b06552f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 11:19:30 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Apr 2018 15:19:30 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522682370.23.0.467229070634.issue33204@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6058 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 11:20:16 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Apr 2018 15:20:16 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522682416.61.0.467229070634.issue33204@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6059 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 12:00:28 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 02 Apr 2018 16:00:28 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1522684828.4.0.467229070634.issue33205@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- keywords: +patch pull_requests: +6060 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 12:03:55 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Apr 2018 16:03:55 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522685035.21.0.467229070634.issue33204@psf.upfronthosting.co.za> miss-islington added the comment: New changeset fa91aff07c16ad48a63580c2909934be92a5e9c8 by Miss Islington (bot) in branch '3.7': bpo-33204: IDLE - revise and extend colorizer test. (GH-6347) https://github.com/python/cpython/commit/fa91aff07c16ad48a63580c2909934be92a5e9c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 12:12:59 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Apr 2018 16:12:59 +0000 Subject: [issue33204] IDLE: remove \b from colorizer string prefix In-Reply-To: <1522640249.89.0.467229070634.issue33204@psf.upfronthosting.co.za> Message-ID: <1522685579.28.0.467229070634.issue33204@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 306559e6ca15b86eb230609f484f48132b7ca383 by Miss Islington (bot) in branch '3.6': bpo-33204: IDLE - revise and extend colorizer test. (GH-6347) https://github.com/python/cpython/commit/306559e6ca15b86eb230609f484f48132b7ca383 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 13:18:03 2018 From: report at bugs.python.org (Vitaly Kruglikov) Date: Mon, 02 Apr 2018 17:18:03 +0000 Subject: [issue33206] Windows inet_pton(socket.AF_INET6, 'localhost') raises ValueError instead of socket.error Message-ID: <1522689483.28.0.467229070634.issue33206@psf.upfronthosting.co.za> New submission from Vitaly Kruglikov : I am seeing this with `socket.AF_INET6` on Windows running python 2.7.14 ``` [00:02:33] File "C:\projects\pika\pika\adapters\host_tcp_connector.py", line 153, in _check_already_resolved [00:02:33] socket.inet_pton(socket.AF_INET6, 'localhost') [00:02:33] File "C:\Python27\lib\site-packages\twisted\python\compat.py", line 68, in inet_pton [00:02:33] raise ValueError("Illegal characters: %r" % (''.join(x),)) [00:02:33] ValueError: Illegal characters: 't' ``` With `socket.AF_INET`, `socket.inet_pton(socket.AF_INET, 'localhost')` raises `socket.error` as expected. For comparison, with Python 2.7.10 running on OS X, both AF_INET and AF_INET6 raise `socket.error`. ---------- components: Library (Lib), Windows messages: 314814 nosy: paul.moore, steve.dower, tim.golden, vitaly.krug, zach.ware priority: normal severity: normal status: open title: Windows inet_pton(socket.AF_INET6, 'localhost') raises ValueError instead of socket.error versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 13:18:22 2018 From: report at bugs.python.org (Vitaly Kruglikov) Date: Mon, 02 Apr 2018 17:18:22 +0000 Subject: [issue33206] Windows inet_pton(socket.AF_INET6, 'localhost') raises ValueError instead of socket.error In-Reply-To: <1522689483.28.0.467229070634.issue33206@psf.upfronthosting.co.za> Message-ID: <1522689502.42.0.467229070634.issue33206@psf.upfronthosting.co.za> Change by Vitaly Kruglikov : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 13:27:12 2018 From: report at bugs.python.org (Vitaly Kruglikov) Date: Mon, 02 Apr 2018 17:27:12 +0000 Subject: [issue33206] Windows inet_pton(socket.AF_INET6, 'localhost') raises ValueError instead of socket.error In-Reply-To: <1522689483.28.0.467229070634.issue33206@psf.upfronthosting.co.za> Message-ID: <1522690032.19.0.467229070634.issue33206@psf.upfronthosting.co.za> Vitaly Kruglikov added the comment: This behavior goes against the socket documentation https://docs.python.org/2/library/socket.html which states "Supported values for address_family are currently AF_INET and AF_INET6. If the IP address string ip_string is invalid, *socket.error* will be raised." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 13:36:40 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 02 Apr 2018 17:36:40 +0000 Subject: [issue27212] Doc for itertools, 'islice()' implementation have unwanted behavior for recipe 'consume()' In-Reply-To: <1465018426.98.0.63725897135.issue27212@psf.upfronthosting.co.za> Message-ID: <1522690600.49.0.467229070634.issue27212@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Thanks! :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 13:40:29 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Apr 2018 17:40:29 +0000 Subject: [issue32380] functools.singledispatch interacts poorly with methods In-Reply-To: <1513722188.44.0.213398074469.issue32380@psf.upfronthosting.co.za> Message-ID: <1522690829.81.0.467229070634.issue32380@psf.upfronthosting.co.za> ?ukasz Langa added the comment: +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 13:46:21 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Apr 2018 17:46:21 +0000 Subject: [issue30891] importlib: _find_and_load() race condition on sys.modules[name] check In-Reply-To: <1499679864.46.0.419806460775.issue30891@psf.upfronthosting.co.za> Message-ID: <1522691181.63.0.467229070634.issue30891@psf.upfronthosting.co.za> ?ukasz Langa added the comment: In the context of this issue: zipimport doesn't properly lock on imports happening in multiple threads at the same time. This causes one thread to receive a partially imported module while the other thread is still performing the import. zipimport also doesn't properly check __pycache__ directories but *does* look for old-style .pyc files next to the corresponding .py file. IIRC Brett chooses not to deal with zipimport's warts and has no time to rewrite it in Python. Since the rest of the core team is less qualified, they steer clear, too. So, don't use zipimport. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 13:52:06 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Apr 2018 17:52:06 +0000 Subject: [issue30760] configparse module in python3 can not write '%' to config file In-Reply-To: <1498470490.58.0.585332868378.issue30760@psf.upfronthosting.co.za> Message-ID: <1522691526.09.0.467229070634.issue30760@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 13:57:03 2018 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 02 Apr 2018 17:57:03 +0000 Subject: [issue30891] importlib: _find_and_load() race condition on sys.modules[name] check In-Reply-To: <1499679864.46.0.419806460775.issue30891@psf.upfronthosting.co.za> Message-ID: <1522691823.53.0.467229070634.issue30891@psf.upfronthosting.co.za> Guido van Rossum added the comment: That's rather disturbing, and none of that is reflected in the zipimport docs. Is there at least a bpo issue about it? I may be the last person in the world to still recommend putting a zipfile on sys.path -- I used to believe it's faster than directory searches, is that no longer the case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 14:11:36 2018 From: report at bugs.python.org (Zachary Ware) Date: Mon, 02 Apr 2018 18:11:36 +0000 Subject: [issue33206] Windows inet_pton(socket.AF_INET6, 'localhost') raises ValueError instead of socket.error In-Reply-To: <1522689483.28.0.467229070634.issue33206@psf.upfronthosting.co.za> Message-ID: <1522692696.59.0.467229070634.issue33206@psf.upfronthosting.co.za> Zachary Ware added the comment: Your traceback seems to include both pika and twisted, and as best I can tell, `socket.inet_pton` does not exist on Windows in Python 2.7. If I've diagnosed this incorrectly, please reopen the ticket with a reproducer that does not depend on pika or twisted. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 14:57:07 2018 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 02 Apr 2018 18:57:07 +0000 Subject: [issue32861] urllib.robotparser: incomplete __str__ methods In-Reply-To: <1518828766.79.0.467229070634.issue32861@psf.upfronthosting.co.za> Message-ID: <1522695427.87.0.467229070634.issue32861@psf.upfronthosting.co.za> Senthil Kumaran added the comment: > But two unnecessary trailing newlines should be kept for compatibility in maintained versions. Yup, that sounds good to me. It doesn't seem like any RFC requirements. It's just kept for the compatibility and we can do away with it in 3.8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 14:57:42 2018 From: report at bugs.python.org (Vitaly Kruglikov) Date: Mon, 02 Apr 2018 18:57:42 +0000 Subject: [issue33206] Windows inet_pton(socket.AF_INET6, 'localhost') raises ValueError instead of socket.error In-Reply-To: <1522689483.28.0.467229070634.issue33206@psf.upfronthosting.co.za> Message-ID: <1522695462.69.0.467229070634.issue33206@psf.upfronthosting.co.za> Vitaly Kruglikov added the comment: Zachary, thank you for noticing that Twisted is involved. inet_pton definitely exists on Windows 2.7.14, but it turns out that Twisted monkey-patches it if `socket.inet_pton(socket.AF_INET6, "::")` fails. Aha! - but this suggests that Window's Python 2.7.14 implementation of `socket.inet_pton()` has a bug in that it fails to recognize '::' as the the IPv6 unspecified address 0:0:0:0:0:0:0:0, so `socket.inet_pton(socket.AF_INET6, "::")` fails. I wonder if this exists on Windows Python3 implementations? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 15:25:31 2018 From: report at bugs.python.org (Lino Mastrodomenico) Date: Mon, 02 Apr 2018 19:25:31 +0000 Subject: [issue32216] Document PEP 557 Data Classes (dataclasses module) In-Reply-To: <1512439511.23.0.213398074469.issue32216@psf.upfronthosting.co.za> Message-ID: <1522697131.61.0.467229070634.issue32216@psf.upfronthosting.co.za> Lino Mastrodomenico added the comment: Friendly ping, there's still no documentation for this wonderful new module and there's only one planned beta left for 3.7 before the release candidates. Needless to say, https://www.python.org/dev/peps/pep-0557/ has lots of information that could be a starting point. ---------- nosy: +mastrodomenico _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 15:50:02 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 02 Apr 2018 19:50:02 +0000 Subject: [issue33162] TimedRotatingFileHandler in logging module In-Reply-To: <1522224170.9.0.467229070634.issue33162@psf.upfronthosting.co.za> Message-ID: <1522698602.59.0.467229070634.issue33162@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 16:08:48 2018 From: report at bugs.python.org (Will T) Date: Mon, 02 Apr 2018 20:08:48 +0000 Subject: [issue32162] typing.Generic breaks __init_subclass__ In-Reply-To: <1511908063.67.0.213398074469.issue32162@psf.upfronthosting.co.za> Message-ID: <1522699728.43.0.467229070634.issue32162@psf.upfronthosting.co.za> Will T added the comment: I believe I'm experiencing a related bug in the new (3.7) version unfortunately. The current version of typing.Generic.__init_subclass__ isn't chaining to super(Generic, cls).__init_subclass__, meaning Generic's position in class bases can prevent subsequent bases from working properly. I can currently work around it with this unsightly hack but it's obviously suboptimal: _old_generic_init_subclass = object.__getattribute__(ta.Generic, '__init_subclass__').__func__ @classmethod # noqa def _new_generic_init_subclass(cls, *args, **kwargs): # noqa _old_generic_init_subclass(cls, *args, **kwargs) super(ta.Generic, cls).__init_subclass__(*args, **kwargs) ta.Generic.__init_subclass__ = _new_generic_init_subclass # noqa ---------- nosy: +wrmsr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 16:18:40 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Mon, 02 Apr 2018 20:18:40 +0000 Subject: [issue32162] typing.Generic breaks __init_subclass__ In-Reply-To: <1511908063.67.0.213398074469.issue32162@psf.upfronthosting.co.za> Message-ID: <1522700320.08.0.467229070634.issue32162@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: Thanks Will! I think this is actually a different (although very similar issue). It looks like it is easy to fix. Could you please open a separate issue (and mention it here)? Also could you please provide a typical example when this breaks so that I can add an appropriate test with the fix? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 16:24:53 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 02 Apr 2018 20:24:53 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1522700693.89.0.467229070634.issue20104@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for adding the doc updates. There are a few rendering issues: https://docs.python.org/3.7/library/os.html#os.posix_spawn ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 17:36:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Apr 2018 21:36:49 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522705009.88.0.467229070634.issue29922@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6061 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 17:48:36 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Apr 2018 21:48:36 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522705716.57.0.467229070634.issue29922@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This issue looks unrelated to issue25538. PR 6352 improves error messages without changing bytecode. It is so simple that could be backported to 3.7 if Ned approves this. But it conflicts with issue32949. This way will not work after merging any of current issue32949 PRs. We will have to find other way for issue32949. ---------- nosy: +Mark.Shannon, ned.deily, serhiy.storchaka superseder: Traceback from __exit__ method is misleading -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:01:55 2018 From: report at bugs.python.org (Will T) Date: Mon, 02 Apr 2018 22:01:55 +0000 Subject: [issue33207] typing.Generic does not correctly call super().__init_subclass__ Message-ID: <1522706515.12.0.467229070634.issue33207@psf.upfronthosting.co.za> New submission from Will T : Per the docs ( https://docs.python.org/3/reference/datamodel.html#object.__init_subclass__ ) this should be chain-calling super but currently doesn't, and thus breaks base classes listed after it which depend on this functionality. Attached a test for a real-world usecase of mine. Originally noted in https://bugs.python.org/issue32162? but on a new ticket as requested. Thanks :) ---------- components: Library (Lib) files: generic_init_subclass.py messages: 314828 nosy: wrmsr priority: normal severity: normal status: open title: typing.Generic does not correctly call super().__init_subclass__ type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file47513/generic_init_subclass.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:02:33 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 02 Apr 2018 22:02:33 +0000 Subject: [issue33207] typing.Generic does not correctly call super().__init_subclass__ In-Reply-To: <1522706515.12.0.467229070634.issue33207@psf.upfronthosting.co.za> Message-ID: <1522706553.5.0.467229070634.issue33207@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:03:02 2018 From: report at bugs.python.org (Will T) Date: Mon, 02 Apr 2018 22:03:02 +0000 Subject: [issue32162] typing.Generic breaks __init_subclass__ In-Reply-To: <1511908063.67.0.213398074469.issue32162@psf.upfronthosting.co.za> Message-ID: <1522706582.25.0.467229070634.issue32162@psf.upfronthosting.co.za> Will T added the comment: Done: https://bugs.python.org/issue33207 - thanks for the quick response! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:20:41 2018 From: report at bugs.python.org (Lukasz) Date: Mon, 02 Apr 2018 22:20:41 +0000 Subject: [issue33208] Lib2to3 grammar.txt error Message-ID: <1522707641.37.0.467229070634.issue33208@psf.upfronthosting.co.za> New submission from Lukasz : Hello I have problem with script Im am totaly beginner in python I'm using Qpython ( python 2.7 on android) So this is my error: /data/user/0/org.qpython.qpy/files/bin/qpython-android5.sh "/storage/emulated/0/qpython/scripts/InstaPy-master/quickstart.py" && exit ipts/InstaPy-master/quickstart.py" && exit < Traceback (most recent call last): File "/storage/emulated/0/qpython/scripts/InstaPy-master/quickstart.py", line 7, in from instapy import InstaPy File "/storage/emulated/0/qpython/scripts/InstaPy-master/instapy/__init__.py", line 2, in from .instapy import InstaPy File "/storage/emulated/0/qpython/scripts/InstaPy-master/instapy/instapy.py", line 22, in from .clarifai_util import check_image File "/storage/emulated/0/qpython/scripts/InstaPy-master/instapy/clarifai_util.py", line 3, in from clarifai.rest import ClarifaiApp, Image as ClImage File "/storage/emulated/0/qpython/lib/python2.7/site-packages/clarifai/rest/__init__.py", line 3, in from .client import ApiClient, ApiError, UserError, TokenError File "/storage/emulated/0/qpython/lib/python2.7/site-packages/clarifai/rest/client.py", line 21, in from past.builtins import basestring File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/future-0.16.0-py2.7.egg/past/__init__.py", line 88, in from past.translation import install_hooks as autotranslate File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/future-0.16.0-py2.7.egg/past/translation/__init__.py", line 42, in from lib2to3.refactor import RefactoringTool File "/data/user/0/org.qpython.qpy/files/lib/python27.zip/lib2to3/refactor.py", line 27, in File "/data/user/0/org.qpython.qpy/files/lib/python27.zip/lib2to3/fixer_util.py", line 9, in File "/data/user/0/org.qpython.qpy/files/lib/python27.zip/lib2to3/pygram.py", line 32, in File "/data/user/0/org.qpython.qpy/files/lib/python27.zip/lib2to3/pgen2/driver.py", line 121, in load_grammar File "/data/user/0/org.qpython.qpy/files/lib/python27.zip/lib2to3/pgen2/pgen.py", line 385, in generate_grammar File "/data/user/0/org.qpython.qpy/files/lib/python27.zip/lib2to3/pgen2/pgen.py", line 15, in __init__ IOError: [Errno 20] Not a directory: '/data/user/0/org.qpython.qpy/files/lib/python27.zip/lib2to3/Grammar.txt' 1|dream2lte:/ $ ---------- messages: 314830 nosy: Lukasz00500 priority: normal severity: normal status: open title: Lib2to3 grammar.txt error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:23:06 2018 From: report at bugs.python.org (Lukasz) Date: Mon, 02 Apr 2018 22:23:06 +0000 Subject: [issue33208] Lib2to3 grammar.txt error In-Reply-To: <1522707641.37.0.467229070634.issue33208@psf.upfronthosting.co.za> Message-ID: <1522707786.11.0.467229070634.issue33208@psf.upfronthosting.co.za> Change by Lukasz : ---------- components: +IO type: -> crash versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:23:53 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 02 Apr 2018 22:23:53 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522707833.51.0.467229070634.issue29922@psf.upfronthosting.co.za> Ned Deily added the comment: PR 6352 smells like a bug fix to me and I think it should be OK for 3.7.0b4. ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:28:04 2018 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 02 Apr 2018 22:28:04 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522708084.32.0.467229070634.issue29922@psf.upfronthosting.co.za> Yury Selivanov added the comment: > PR 6352 smells like a bug fix to me and I think it should be OK for 3.7.0b4. Can we backport it to 3.6 too? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:28:14 2018 From: report at bugs.python.org (Vitaly Kruglikov) Date: Mon, 02 Apr 2018 22:28:14 +0000 Subject: [issue33206] Windows inet_pton(socket.AF_INET6, 'localhost') raises ValueError instead of socket.error In-Reply-To: <1522689483.28.0.467229070634.issue33206@psf.upfronthosting.co.za> Message-ID: <1522708094.35.0.467229070634.issue33206@psf.upfronthosting.co.za> Vitaly Kruglikov added the comment: Indeed, confirmed no `inet_pton()` on Windows in Python 2.7 :(. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:31:43 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 02 Apr 2018 22:31:43 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522708303.04.0.467229070634.issue29922@psf.upfronthosting.co.za> Ned Deily added the comment: > Can we backport it to 3.6 too? I suppose so. (Though you'll owe me if you break anything.) ---------- versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:33:36 2018 From: report at bugs.python.org (Michael Selik) Date: Mon, 02 Apr 2018 22:33:36 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522708416.49.0.467229070634.issue33203@psf.upfronthosting.co.za> Michael Selik added the comment: If you're going to tackle this problem, this should probably be solved for the general case of n <= 0 rather than just n == 0. In [1]: import random In [2]: class Random(random.Random): ...: def random(self): ...: return super().random() ...: In [3]: r = Random() In [4]: r._randbelow(-1) # Should raise a ValueError Out[4]: 0 But honestly, if someone is going to override ``random`` I think we can expect them to realize they're stepping into the deep end. ---------- nosy: +selik _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:38:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Apr 2018 22:38:27 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1522708707.72.0.467229070634.issue23403@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:41:48 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Apr 2018 22:41:48 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522708908.39.0.467229070634.issue29922@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a68f2f0578bbf812fa2264d0e0bb388340d6e230 by Serhiy Storchaka in branch 'master': bpo-29922: Improve error messages in 'async with' (GH-6352) https://github.com/python/cpython/commit/a68f2f0578bbf812fa2264d0e0bb388340d6e230 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:42:04 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Apr 2018 22:42:04 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522708924.36.0.467229070634.issue29922@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6062 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:42:48 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Apr 2018 22:42:48 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522708968.46.0.467229070634.issue29922@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6063 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:43:06 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 02 Apr 2018 22:43:06 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522708986.04.0.467229070634.issue33203@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FWIW, it was intended that the error checking (when required) occur at higher levels in the API rather than in the inner-most non-public utility function. Some calls to _randbelow cannot be zero or negative, so they shouldn't have to pay an penalty for the extra error check. A comment to this effect should be added but I don't think the design should be changed. ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:51:09 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Apr 2018 22:51:09 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522709469.32.0.467229070634.issue29922@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It would be hard to backport this to 3.5. Wordcode allows scanning back. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 18:56:38 2018 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 02 Apr 2018 22:56:38 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522709798.93.0.467229070634.issue29922@psf.upfronthosting.co.za> Yury Selivanov added the comment: 3.5 is in security fixes only, so don't bother. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 19:01:09 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 02 Apr 2018 23:01:09 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522710069.06.0.467229070634.issue33203@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I'll mull this over for while. There is some merit in getting the various components to fit together more uniformly. There's also the option of having choice() catch either a ZeroDivisionError or ValueError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 19:07:01 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Apr 2018 23:07:01 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1522710421.44.0.467229070634.issue23403@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Now that Python 3.3 is dead and 3.4 is soon to follow, it's safe to bump DEFAULT_PROTOCOL to 4. ---------- assignee: -> lukasz.langa resolution: duplicate -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 19:07:05 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Apr 2018 23:07:05 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1522710425.98.0.467229070634.issue23403@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 19:19:19 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Apr 2018 23:19:19 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1522711159.53.0.467229070634.issue23403@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- keywords: +patch pull_requests: +6064 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 19:19:21 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Apr 2018 23:19:21 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1522711161.53.0.467229070634.issue23403@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- keywords: +patch, patch pull_requests: +6064, 6065 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 19:47:37 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Mon, 02 Apr 2018 23:47:37 +0000 Subject: [issue33207] typing.Generic does not correctly call super().__init_subclass__ In-Reply-To: <1522706515.12.0.467229070634.issue33207@psf.upfronthosting.co.za> Message-ID: <1522712857.82.0.467229070634.issue33207@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- keywords: +patch pull_requests: +6066 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 20:24:39 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Apr 2018 00:24:39 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1522715079.04.0.467229070634.issue23403@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Should we bump the pickle protocol for shelve? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 20:47:25 2018 From: report at bugs.python.org (Ned Deily) Date: Tue, 03 Apr 2018 00:47:25 +0000 Subject: [issue25170] 3.4.4, 3.4.5, 3.5.0, 3.5.1, 3.5.2 documentation archives missing In-Reply-To: <1442601694.39.0.291720811899.issue25170@psf.upfronthosting.co.za> Message-ID: <1522716445.16.0.467229070634.issue25170@psf.upfronthosting.co.za> Ned Deily added the comment: https://www.python.org/ftp/python/doc/3.5.0/ now contains copies of the 3.5.0 final downloadable docs and no longer contains any pre-release versions. Thanks everyone! ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 20:57:37 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Apr 2018 00:57:37 +0000 Subject: [issue31814] subprocess_fork_exec more stable with vfork In-Reply-To: <1508343864.17.0.213398074469.issue31814@psf.upfronthosting.co.za> Message-ID: <1522717057.33.0.467229070634.issue31814@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Greg, the flip side is that now any Python user is at the mercy of third-party library providers to do the right thing in terms of pthread_atfork(). It won't always be feasible for the user to influence the third party to fix the problem. You're right that vfork() won't solve the fundamental issue but will at least remove one case where it currently causes crashes. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 21:01:36 2018 From: report at bugs.python.org (wwq) Date: Tue, 03 Apr 2018 01:01:36 +0000 Subject: [issue32174] nonASCII punctuation characters can not display in python363.chm. In-Reply-To: <1512013530.29.0.213398074469.issue32174@psf.upfronthosting.co.za> Message-ID: <1522717296.2.0.467229070634.issue32174@psf.upfronthosting.co.za> wwq added the comment: In python365.chm, it loss the style in any page but can show in IE. ---------- Added file: https://bugs.python.org/file47514/QQ??20180403085952.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 21:08:09 2018 From: report at bugs.python.org (wwq) Date: Tue, 03 Apr 2018 01:08:09 +0000 Subject: [issue32174] nonASCII punctuation characters can not display in python363.chm. In-Reply-To: <1512013530.29.0.213398074469.issue32174@psf.upfronthosting.co.za> Message-ID: <1522717689.24.0.467229070634.issue32174@psf.upfronthosting.co.za> wwq added the comment: And in python365.chm, also had some non ascii chars can not display. ---------- Added file: https://bugs.python.org/file47515/QQ??20180403090715.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 21:08:23 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Apr 2018 01:08:23 +0000 Subject: [issue33209] Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle Message-ID: <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : test_clear_pickler_memo tested only the default protocol and fails when bump the default protocol to 4. For some reasons C implementation writes FRAME before PROTO when call Pickler.dump() repeatedly. Python implementation: b'\x80\x04\x95\x13\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x07abcdefg\x94h\x01K,e.' 0: \x80 PROTO 4 2: \x95 FRAME 19 11: ] EMPTY_LIST 12: \x94 MEMOIZE (as 0) 13: ( MARK 14: \x8c SHORT_BINUNICODE 'abcdefg' 23: \x94 MEMOIZE (as 1) 24: h BINGET 1 26: K BININT1 44 28: e APPENDS (MARK at 13) 29: . STOP highest protocol among opcodes = 4 C implementation: b'\x95\x15\x00\x00\x00\x00\x00\x00\x00\x80\x04]\x94(\x8c\x07abcdefg\x94h\x01K,e.' 0: \x95 FRAME 21 9: \x80 PROTO 4 11: ] EMPTY_LIST 12: \x94 MEMOIZE (as 0) 13: ( MARK 14: \x8c SHORT_BINUNICODE 'abcdefg' 23: \x94 MEMOIZE (as 1) 24: h BINGET 1 26: K BININT1 44 28: e APPENDS (MARK at 13) 29: . STOP highest protocol among opcodes = 4 ---------- components: Extension Modules messages: 314847 nosy: alexandre.vassalotti, pitrou, serhiy.storchaka priority: normal severity: normal status: open title: Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 21:08:54 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Apr 2018 01:08:54 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1522717734.21.0.467229070634.issue23403@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- dependencies: +Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle superseder: parameterize what serialization is used in multiprocessing -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 21:12:46 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Apr 2018 01:12:46 +0000 Subject: [issue33209] Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle In-Reply-To: <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za> Message-ID: <1522717966.76.0.467229070634.issue33209@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- keywords: +patch pull_requests: +6067 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 21:24:19 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Apr 2018 01:24:19 +0000 Subject: [issue31814] subprocess_fork_exec more stable with vfork In-Reply-To: <1508343864.17.0.213398074469.issue31814@psf.upfronthosting.co.za> Message-ID: <1522718659.51.0.467229070634.issue31814@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- versions: -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 22:13:22 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 03 Apr 2018 02:13:22 +0000 Subject: [issue30416] constant folding opens compiler to quadratic time hashing In-Reply-To: <1522011541.13.0.714561066657.issue30416@psf.upfronthosting.co.za> Message-ID: <1522721599.4070109.1324342224.37BE2968@webmail.messagingengine.com> Benjamin Peterson added the comment: We should revert the breaking 2.7 changes. On Sun, Mar 25, 2018, at 13:59, Gregory P. Smith wrote: > > Change by Gregory P. Smith : > > > ---------- > assignee: -> benjamin.peterson > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 22:15:45 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Tue, 03 Apr 2018 02:15:45 +0000 Subject: [issue33200] Optimize the empty set "literal" In-Reply-To: <1522578566.75.0.467229070634.issue33200@psf.upfronthosting.co.za> Message-ID: <1522721745.13.0.467229070634.issue33200@psf.upfronthosting.co.za> Josh Rosenberg added the comment: I may have immediately latched onto this, dubbing it the "one-eyed monkey operator", the moment the generalized unpacking released. I always hated the lack of an empty set literal, and enjoyed having this exist just to fill that asymmetry with the other built-in collection types (that said, I never use it in production code, nor teach it in classes I run). ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 22:25:38 2018 From: report at bugs.python.org (Cyker Way) Date: Tue, 03 Apr 2018 02:25:38 +0000 Subject: [issue33210] pkgutil.walk_packages gives incomplete results Message-ID: <1522722338.23.0.467229070634.issue33210@psf.upfronthosting.co.za> New submission from Cyker Way : The current implementation of `pkgutil.walk_packages()` is confusing. Users may be given incomplete results while no exception is raised if they don't explicitly provide the `prefix` parameter. The doc says: > prefix is a string to output on the front of every module name on output. But the fact is, `prefix` is not merely an output formatter at all. This function cannot handle an empty prefix (which is the default) and will often encounter import errors which are then simply ignored without an `onerror` function (which is default again). See test program for details. Doc: https://docs.python.org/3.6/library/pkgutil.html#pkgutil.walk_packages Source: https://github.com/python/cpython/blob/3.6/Lib/pkgutil.py ---------- components: Library (Lib) files: test.py messages: 314850 nosy: cykerway priority: normal severity: normal status: open title: pkgutil.walk_packages gives incomplete results type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47516/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 22:43:56 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 03 Apr 2018 02:43:56 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522723436.23.0.467229070634.issue33199@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset d1c82c5cc7be0c21dddf86fd19c1702f6218459b by INADA Naoki in branch 'master': bpo-33199: Initialize ma_version_tag in PyDict_Copy (GH-6341) https://github.com/python/cpython/commit/d1c82c5cc7be0c21dddf86fd19c1702f6218459b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 22:45:12 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 02:45:12 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522723512.75.0.467229070634.issue33199@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6068 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 22:46:04 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 02:46:04 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522723564.94.0.467229070634.issue33199@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6069 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 22:48:56 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 03 Apr 2018 02:48:56 +0000 Subject: [issue33202] os.walk mentions os.listdir instead of os.scandir In-Reply-To: <1522610510.25.0.467229070634.issue33202@psf.upfronthosting.co.za> Message-ID: <1522723736.69.0.467229070634.issue33202@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset badb894bbbb8aaa8b669c4a6f675a0bc7d98e188 by Benjamin Peterson (Andr?s Delfino) in branch 'master': closes bpo-33202: fix os.walk mentioning os.listdir instead of os.scandir (GH-6335) https://github.com/python/cpython/commit/badb894bbbb8aaa8b669c4a6f675a0bc7d98e188 ---------- nosy: +benjamin.peterson resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 22:50:04 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 02:50:04 +0000 Subject: [issue33202] os.walk mentions os.listdir instead of os.scandir In-Reply-To: <1522610510.25.0.467229070634.issue33202@psf.upfronthosting.co.za> Message-ID: <1522723804.54.0.467229070634.issue33202@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6070 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 22:51:02 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 02:51:02 +0000 Subject: [issue33202] os.walk mentions os.listdir instead of os.scandir In-Reply-To: <1522610510.25.0.467229070634.issue33202@psf.upfronthosting.co.za> Message-ID: <1522723862.3.0.467229070634.issue33202@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6071 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 23:00:28 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 03:00:28 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522724428.87.0.467229070634.issue33199@psf.upfronthosting.co.za> miss-islington added the comment: New changeset de755129a7a14cb3bee89aa256ca2e4a9a6605ce by Miss Islington (bot) in branch '3.7': bpo-33199: Initialize ma_version_tag in PyDict_Copy (GH-6341) https://github.com/python/cpython/commit/de755129a7a14cb3bee89aa256ca2e4a9a6605ce ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 23:22:16 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 03:22:16 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522725736.54.0.467229070634.issue33199@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 9a90826c9b64183713ebe5a98ec82423d9cae3ee by Miss Islington (bot) in branch '3.6': bpo-33199: Initialize ma_version_tag in PyDict_Copy (GH-6341) https://github.com/python/cpython/commit/9a90826c9b64183713ebe5a98ec82423d9cae3ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 23:33:40 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 03:33:40 +0000 Subject: [issue33202] os.walk mentions os.listdir instead of os.scandir In-Reply-To: <1522610510.25.0.467229070634.issue33202@psf.upfronthosting.co.za> Message-ID: <1522726420.56.0.467229070634.issue33202@psf.upfronthosting.co.za> miss-islington added the comment: New changeset f6d1d65803f290dfe14048f17d8125f8093a61ec by Miss Islington (bot) in branch '3.7': closes bpo-33202: fix os.walk mentioning os.listdir instead of os.scandir (GH-6335) https://github.com/python/cpython/commit/f6d1d65803f290dfe14048f17d8125f8093a61ec ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 23:33:52 2018 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 03 Apr 2018 03:33:52 +0000 Subject: [issue33162] TimedRotatingFileHandler in logging module In-Reply-To: <1522224170.9.0.467229070634.issue33162@psf.upfronthosting.co.za> Message-ID: <1522726432.05.0.467229070634.issue33162@psf.upfronthosting.co.za> Vinay Sajip added the comment: You can already roll your own, see https://docs.python.org/3/library/logging.handlers.html#baserotatinghandler ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 23:36:47 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 03 Apr 2018 03:36:47 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522726607.7.0.467229070634.issue33199@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 23:37:04 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 03 Apr 2018 03:37:04 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522726624.2.0.467229070634.issue33199@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 23:37:15 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 03 Apr 2018 03:37:15 +0000 Subject: [issue33199] PyDict_Copy() can leave 'ma_version_tag' uninitialized In-Reply-To: <1522573019.92.0.467229070634.issue33199@psf.upfronthosting.co.za> Message-ID: <1522726635.98.0.467229070634.issue33199@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 23:39:17 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 03:39:17 +0000 Subject: [issue33202] os.walk mentions os.listdir instead of os.scandir In-Reply-To: <1522610510.25.0.467229070634.issue33202@psf.upfronthosting.co.za> Message-ID: <1522726757.28.0.467229070634.issue33202@psf.upfronthosting.co.za> miss-islington added the comment: New changeset fa5157e0499f7afdb59e220e3f4fdbf44adb5ac8 by Miss Islington (bot) in branch '3.6': closes bpo-33202: fix os.walk mentioning os.listdir instead of os.scandir (GH-6335) https://github.com/python/cpython/commit/fa5157e0499f7afdb59e220e3f4fdbf44adb5ac8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 23:39:49 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 03 Apr 2018 03:39:49 +0000 Subject: [issue32360] Save OrderedDict imports in various stdlibs. In-Reply-To: <1513591210.99.0.213398074469.issue32360@psf.upfronthosting.co.za> Message-ID: <1522726789.83.0.467229070634.issue32360@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 629338f1404ea9cd75e4fb0389a2fbe1b589de43 by INADA Naoki in branch 'master': bpo-32360: Remove object_pairs_hook=OrderedDict examples (GH-5001) https://github.com/python/cpython/commit/629338f1404ea9cd75e4fb0389a2fbe1b589de43 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 2 23:41:56 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 03:41:56 +0000 Subject: [issue32360] Save OrderedDict imports in various stdlibs. In-Reply-To: <1513591210.99.0.213398074469.issue32360@psf.upfronthosting.co.za> Message-ID: <1522726916.88.0.467229070634.issue32360@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6072 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 00:01:37 2018 From: report at bugs.python.org (Ben Elliston) Date: Tue, 03 Apr 2018 04:01:37 +0000 Subject: [issue1222585] C++ compilation support for distutils Message-ID: <1522728097.92.0.467229070634.issue1222585@psf.upfronthosting.co.za> Ben Elliston added the comment: Is there a simple workaround that one can put into setup.py in the meantime? I tried using compiler.compiler.remove('-Wstrict-prototypes') to no avail. ---------- nosy: +bje _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 00:31:30 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 04:31:30 +0000 Subject: [issue32360] Save OrderedDict imports in various stdlibs. In-Reply-To: <1513591210.99.0.213398074469.issue32360@psf.upfronthosting.co.za> Message-ID: <1522729890.12.0.467229070634.issue32360@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 0c533573c527c63dacab5921becb66dc3eb274c1 by Miss Islington (bot) in branch '3.7': bpo-32360: Remove object_pairs_hook=OrderedDict examples (GH-5001) https://github.com/python/cpython/commit/0c533573c527c63dacab5921becb66dc3eb274c1 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 01:13:29 2018 From: report at bugs.python.org (Gil Forcada) Date: Tue, 03 Apr 2018 05:13:29 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators Message-ID: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> New submission from Gil Forcada : Given the following code: class MyClass(object): @property def my_function(self): pass Parsing it with ast module, the lineno and col_offset of the ast.FunctionDef is reported to be where the decorator starts (i.e. line 3 column 4) rather than where the actual def statement is (i.e. line 4 column 4). This is due to the decorator that is part of the ast.FunctionDef, but as there can be multiple decorators (which they don't provide their own lineno and col_offset arguments) and they can span across multiple lines, there is no reliable way to actually know where the actual def statement starts physically. See this bug report on flake8-builtins plugin (I'm the author) reported by @dhood user on github: https://github.com/gforcada/flake8-builtins/issues/22#issuecomment-377961642 ---------- components: Library (Lib) messages: 314861 nosy: gforcada priority: normal severity: normal status: open title: lineno and col_offset are wrong on function definitions with decorators 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 Tue Apr 3 01:29:09 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 03 Apr 2018 05:29:09 +0000 Subject: [issue32360] Save OrderedDict imports in various stdlibs. In-Reply-To: <1513591210.99.0.213398074469.issue32360@psf.upfronthosting.co.za> Message-ID: <1522733349.38.0.467229070634.issue32360@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 02:12:08 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 03 Apr 2018 06:12:08 +0000 Subject: [issue32360] Save OrderedDict imports in various stdlibs. In-Reply-To: <1513591210.99.0.213398074469.issue32360@psf.upfronthosting.co.za> Message-ID: <1522735928.02.0.467229070634.issue32360@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- dependencies: -Dict order is now guaranteed, so add tests and doc for it stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 02:20:11 2018 From: report at bugs.python.org (umedoblock) Date: Tue, 03 Apr 2018 06:20:11 +0000 Subject: [issue33212] add several options to msgfmt.py Message-ID: <1522736411.29.0.467229070634.issue33212@psf.upfronthosting.co.za> New submission from umedoblock : = Why do I add several options ? I'd like to effectively know a progress of translate about some po files when KiCad dev team announce to public KiCad 5.0 major. Because KiCad dev team separates PCB design tools to exe files. And I used the poedit to translate work. Then I'd like to know progress per a po file. Please take my idea in msgfmt.py. == help {{{ Usage: msgfmt.py [OPTIONS] filename.po Options: ... -d --dump Show all msg_id_NO, msgid and msgstr in filename.po. -p --progress Show translate progress. -r --remaining Show no translated msgid with msg_id_NO. ... }}} == progress option {{{ $ python3 ~/KiCad/kicad-doc/src/translate-set/msgfmt.py --progress ~/KiCad/kicad-doc/src/eeschema/po/ja.po translated: 1151 of 1427 (80%), Remaining: 276 }}} == dump option {{{ $ python3 ~/KiCad/kicad-doc/src/translate-set/msgfmt.py --dump ~/KiCad/kicad-doc/src/eeschema/po/ja.po | head -20 msg_id_NO=1 Eeschema Eeschema msg_id_NO=2 _Reference manual_ _????????????_ msg_id_NO=3 *Copyright* *???* ... }}} == remaining option {{{ $ python3 ~/KiCad/kicad-doc/src/translate-set/msgfmt.py --remaining ~/KiCad/kicad-doc/src/eeschema/po/ja.po | head -20 msg_id_NO=4 This document is Copyright (C) 2010-2018 by its contributors as listed below. Yo u may distribute it and/or modify it under the terms of either the GNU General Public License (http://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0/), version 3.0 or later. msg_id_NO=12 About KiCad translation: https://github.com/KiCad/kicad-i18n/issues msg_id_NO=14 Published on May 30, 2015. msg_id_NO=15 Symbol Annotation Tool ... }}} ---------- components: Demos and Tools files: msgfmt.py messages: 314862 nosy: umedoblock priority: normal severity: normal status: open title: add several options to msgfmt.py type: enhancement versions: Python 3.6 Added file: https://bugs.python.org/file47517/msgfmt.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 02:27:07 2018 From: report at bugs.python.org (umedoblock) Date: Tue, 03 Apr 2018 06:27:07 +0000 Subject: [issue33212] add several options to msgfmt.py In-Reply-To: <1522736411.29.0.467229070634.issue33212@psf.upfronthosting.co.za> Message-ID: <1522736827.31.0.467229070634.issue33212@psf.upfronthosting.co.za> umedoblock added the comment: Sorry, I forgot to add a patch file. ---------- keywords: +patch Added file: https://bugs.python.org/file47518/a.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 03:39:24 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Apr 2018 07:39:24 +0000 Subject: [issue33209] Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle In-Reply-To: <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za> Message-ID: <1522741164.97.0.467229070634.issue33209@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6073 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 03:50:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Apr 2018 07:50:28 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1522741828.75.0.467229070634.issue33211@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See how similar issue was solved in Pyflakes: https://github.com/PyCQA/pyflakes/pull/273. Python tests also needed special workaround, see Lib/test/test_sys_settrace.py and issue17288. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 04:23:52 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 03 Apr 2018 08:23:52 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. In-Reply-To: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> Message-ID: <1522743832.51.0.467229070634.issue33195@psf.upfronthosting.co.za> INADA Naoki added the comment: OK, I replaced Py_UNICODE with wchar_t in Py_BuildValue document. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 04:26:58 2018 From: report at bugs.python.org (Ron Reiter) Date: Tue, 03 Apr 2018 08:26:58 +0000 Subject: [issue33213] crypt function not hashing properly Message-ID: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> New submission from Ron Reiter : import crypt Expected result: >>> crypt.crypt("test") == crypt.crypt("test") False >>> crypt.crypt("test", crypt.mksalt()) == crypt.crypt("test", crypt.mksalt()) False Unexpected results: >>> crypt.crypt("test", crypt.METHOD_SHA512) == crypt.crypt("test", crypt.METHOD_SHA512) True >>> crypt.crypt("test", crypt.mksalt(crypt.METHOD_SHA512)) == crypt.crypt("test", crypt.mksalt(crypt.METHOD_SHA512)) False ---------- components: Extension Modules messages: 314866 nosy: Ron Reiter priority: normal severity: normal status: open title: crypt function not hashing properly versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 04:28:10 2018 From: report at bugs.python.org (Ron Reiter) Date: Tue, 03 Apr 2018 08:28:10 +0000 Subject: [issue33213] crypt function not hashing properly In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522744090.25.0.467229070634.issue33213@psf.upfronthosting.co.za> Ron Reiter added the comment: import crypt Expected result: >>> crypt.crypt("test") == crypt.crypt("test") False >>> crypt.crypt("test", crypt.mksalt()) == crypt.crypt("test", crypt.mksalt()) False Unexpected results: >>> crypt.crypt("test", crypt.METHOD_SHA512) == crypt.crypt("test", crypt.METHOD_SHA512) True >>> crypt.crypt("test", crypt.mksalt(crypt.METHOD_SHA512)) == crypt.crypt("test", crypt.mksalt(crypt.METHOD_SHA512)) True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 04:39:23 2018 From: report at bugs.python.org (Ron Reiter) Date: Tue, 03 Apr 2018 08:39:23 +0000 Subject: [issue33213] crypt function not hashing properly In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522744763.29.0.467229070634.issue33213@psf.upfronthosting.co.za> Ron Reiter added the comment: You guessed it, the salt is "$6" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 04:43:42 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Tue, 03 Apr 2018 08:43:42 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522745022.83.0.467229070634.issue33203@psf.upfronthosting.co.za> Wolfgang Maier added the comment: @rhettinger: the reason the ValueError gets raised correctly in the getrandbits-dependent branch is because getrandbits itself does a n<=0 check (in C for random.Random, in Python for random.SystemRandom). So I thought the real reason why _randbelow does not perform the check was that it would be redundant, which it isn't when only random is used. So instead of thinking about the suggested check as something that impacts performance (which certainly it does), I would rather see it as adding something into that second branch that was forgotten and gave that branch a performance benefit over the other one, which it never deserved. It is also worthwhile to remember that any performance impact of this will only hit subclasses of random.Random that define random, but not getrandbits. Your alternative idea of having random.choice catch (ValueError, ZeroDivisionError) would affect random.Random and all subclasses. If a subclass defines getrandbits, it needs to perform that check anyway and, thinking about this more, I suggest that the requirement for any user-provided getrandbits to raise ValueError on k <= 0 should actually be added to the getrandbits docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 04:50:00 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Tue, 03 Apr 2018 08:50:00 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522745400.3.0.467229070634.issue33203@psf.upfronthosting.co.za> Wolfgang Maier added the comment: @selik: it's true _randbelow doesn't work for negative numbers, but the difference is that both branches are affected, the docstring does not make any guarantees about it, and no public part of the random module is affected by this behavior. In addition, "fixing" _randbelow for negative input cannot be done without impacting performance of several public methods of random.Random so I don't think this should be done. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 04:54:29 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Apr 2018 08:54:29 +0000 Subject: [issue33213] crypt function not hashing properly In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522745669.48.0.467229070634.issue33213@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I can't reproduce this result. Does your os.urandom() broken and return a short repeated sequence? ---------- nosy: +mark.dickinson, rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 05:47:25 2018 From: report at bugs.python.org (Ron Reiter) Date: Tue, 03 Apr 2018 09:47:25 +0000 Subject: [issue33213] crypt function not hashing properly In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522748845.69.0.467229070634.issue33213@psf.upfronthosting.co.za> Ron Reiter added the comment: Apparently it's a Mac issue. My crypt.methods only contains [] which is probably why this fails. It's a silent failure of some sort that is causing this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 06:12:43 2018 From: report at bugs.python.org (Christian Heimes) Date: Tue, 03 Apr 2018 10:12:43 +0000 Subject: [issue33213] crypt function not hashing properly In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522750363.66.0.467229070634.issue33213@psf.upfronthosting.co.za> Christian Heimes added the comment: The crypt module is a thin wrapper around the OS' crypt(3) function. The function should return NULL for unsupported salt types. The module turns NULL into None. What's the return value of crypt.crypt("test", crypt.METHOD_SHA512) ? ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 06:46:00 2018 From: report at bugs.python.org (Ron Reiter) Date: Tue, 03 Apr 2018 10:46:00 +0000 Subject: [issue33213] crypt function not hashing properly In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522752360.2.0.467229070634.issue33213@psf.upfronthosting.co.za> Ron Reiter added the comment: Python 3.6.4 (default, Mar 22 2018, 23:35:12) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import crypt >>> crypt.crypt("test", crypt.METHOD_SHA512) '$6asQOJRqB1i2' >>> crypt.crypt("test", crypt.METHOD_SHA512) '$6asQOJRqB1i2' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 06:47:08 2018 From: report at bugs.python.org (Ron Reiter) Date: Tue, 03 Apr 2018 10:47:08 +0000 Subject: [issue33213] crypt function not hashing properly In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522752428.17.0.467229070634.issue33213@psf.upfronthosting.co.za> Ron Reiter added the comment: Also: >>> crypt.crypt("test", "$5") '$5yVOkTkyRzn.' >>> crypt.crypt("test", "$6") '$6asQOJRqB1i2' >>> crypt.crypt("test", "$7") '$7tSOkvDyiL6U' So the salt is "$6" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 06:48:23 2018 From: report at bugs.python.org (Ron Reiter) Date: Tue, 03 Apr 2018 10:48:23 +0000 Subject: [issue33213] crypt function not hashing properly on Mac (uses a specific salt) In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522752503.11.0.467229070634.issue33213@psf.upfronthosting.co.za> Change by Ron Reiter : ---------- title: crypt function not hashing properly -> crypt function not hashing properly on Mac (uses a specific salt) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 07:02:24 2018 From: report at bugs.python.org (Matt Eaton) Date: Tue, 03 Apr 2018 11:02:24 +0000 Subject: [issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301 In-Reply-To: <1522339721.91.0.467229070634.issue33181@psf.upfronthosting.co.za> Message-ID: <1522753344.42.0.467229070634.issue33181@psf.upfronthosting.co.za> Matt Eaton added the comment: Wanted to check in on this to see if there was any feedback by any community or core members? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 07:02:55 2018 From: report at bugs.python.org (Matt Eaton) Date: Tue, 03 Apr 2018 11:02:55 +0000 Subject: [issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port In-Reply-To: <1520583841.64.0.467229070634.issue33034@psf.upfronthosting.co.za> Message-ID: <1522753375.22.0.467229070634.issue33034@psf.upfronthosting.co.za> Matt Eaton added the comment: Wanted to check in on this to see if there was any feedback on this topic? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 07:39:25 2018 From: report at bugs.python.org (Riccardo Polignieri) Date: Tue, 03 Apr 2018 11:39:25 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1522755565.17.0.467229070634.issue33189@psf.upfronthosting.co.za> Riccardo Polignieri added the comment: > the error should be better Yes, that's what I maeant - sorry I should have phrased better. I marked by mistake a couple of f-strings for translation and totally forgot about it for a while... it took me some time to figure out what was going on with this NameError popping out of nowhere. Curiously, xgettext handles this thing better (...or, far worse actually): it just parses the f-string as a regular one, producing something like msgid "hello {x}" msgstr "" But then of course Python will fail *silently* at runtime, never picking up the translated version of the string... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 09:32:33 2018 From: report at bugs.python.org (Steve Dower) Date: Tue, 03 Apr 2018 13:32:33 +0000 Subject: [issue30891] importlib: _find_and_load() race condition on sys.modules[name] check In-Reply-To: <1499679864.46.0.419806460775.issue30891@psf.upfronthosting.co.za> Message-ID: <1522762353.67.0.467229070634.issue30891@psf.upfronthosting.co.za> Steve Dower added the comment: I recommend and use it without trouble, but then I rarely defer imports to worker threads. Barry may have some ideas, but I think this really shouldn't be difficult to do. importlib is pretty extensible, and it's not difficult to read from a zip file. ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 09:55:36 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Tue, 03 Apr 2018 13:55:36 +0000 Subject: [issue33193] Cannot create a venv on Windows when directory path contains dollar character In-Reply-To: <1522549543.99.0.467229070634.issue33193@psf.upfronthosting.co.za> Message-ID: <1522763736.55.0.467229070634.issue33193@psf.upfronthosting.co.za> Wolfgang Maier added the comment: An exotic case, but it also affects Linux: python3.7 -m venv 'at$test' Error: Command '['/home/maier/at$test/bin/python3.7', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 2. [maier at nb19 ~]$ mkdir 'at$test' mkdir: cannot create directory ?at$test?: File exists [maier at nb19 ~]$ cd 'at$test' [maier at nb19 at$test]$ bin/python -m ensurepip Collecting setuptools Collecting pip Installing collected packages: setuptools, pip Exception: Traceback (most recent call last): File "/usr/lib64/python3.7/distutils/util.py", line 187, in subst_vars return re.sub(r'\$([a-zA-Z_][a-zA-Z_0-9]*)', _subst, s) File "/usr/lib64/python3.7/re.py", line 198, in sub return _compile(pattern, flags).sub(repl, string, count) File "/usr/lib64/python3.7/distutils/util.py", line 184, in _subst return os.environ[var_name] File "/usr/lib64/python3.7/os.py", line 678, in __getitem__ raise KeyError(key) from None KeyError: 'test' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/tmpppaapmyk/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/tmp/tmpppaapmyk/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/tmp/tmpppaapmyk/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 784, in install **kwargs File "/tmp/tmpppaapmyk/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/tmp/tmpppaapmyk/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 1064, in move_wheel_files isolated=self.isolated, File "/tmp/tmpppaapmyk/pip-9.0.1-py2.py3-none-any.whl/pip/wheel.py", line 247, in move_wheel_files prefix=prefix, File "/tmp/tmpppaapmyk/pip-9.0.1-py2.py3-none-any.whl/pip/locations.py", line 153, in distutils_scheme i.finalize_options() File "/usr/lib64/python3.7/distutils/command/install.py", line 307, in finalize_options self.expand_basedirs() File "/usr/lib64/python3.7/distutils/command/install.py", line 486, in expand_basedirs self._expand_attrs(['install_base', 'install_platbase', 'root']) File "/usr/lib64/python3.7/distutils/command/install.py", line 480, in _expand_attrs val = subst_vars(val, self.config_vars) File "/usr/lib64/python3.7/distutils/util.py", line 189, in subst_vars raise ValueError("invalid variable '$%s'" % var) ValueError: invalid variable '$'test'' So the venv actually gets created, but it's ensurepip which chokes on the $. ---------- nosy: +wolma versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 10:33:53 2018 From: report at bugs.python.org (Javier Dehesa) Date: Tue, 03 Apr 2018 14:33:53 +0000 Subject: [issue33214] join method for list and tuple Message-ID: <1522766033.22.0.467229070634.issue33214@psf.upfronthosting.co.za> New submission from Javier Dehesa : It is pretty trivial to concatenate a sequence of strings: ''.join([str1, str2, ...]) Concatenating a sequence of lists is for some reason significantly more convoluted. Some current options include: sum([lst1, lst2, ...], []) [x for y [lst1, lst2, ...] for x in y] list(itertools.chain(lst1, lst2, ...)) The first one being the less recomendable but more intuitive and the third one being the faster but most cumbersome (see https://stackoverflow.com/questions/49631326/why-is-itertools-chain-faster-than-a-flattening-list-comprehension ). None of these looks like "the one obvious way to do it" to me. Furthermore, I feel a dedicated concatenation method could be more efficient than any of these approaches. If we accept that ''.join(...) is an intuitive idiom, why not provide the syntax: [].join([lst1, lst2, ...]) And while we are at it: ().join([tpl1, tpl2, ...]) Like with str, these methods should only accept sequences of objects of their own class (e.g. we could do [].join(list(s) for s in seqs) if seqs contains lists, tuples and generators). The use case for non-empty joiners would probably be less frequent than for strings, but it also solves a problem that has no clean solution with the current tools. Here is what I would probably do to join a sequence of lists with [None, 'STOP', None]: lsts = [lst1, lst2, ...] joiner = [None, 'STOP', None] lsts_joined = list(itertools.chain.from_iterable(lst + joiner for lst in lsts))[:-len(joiner)] Which is awful and inefficient (I am not saying this is the best or only possible way to solve it, it is just what I, self-considered experienced Python developer, might write). ---------- components: Library (Lib) messages: 314881 nosy: Javier Dehesa priority: normal severity: normal status: open title: join method for list and tuple type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 10:40:42 2018 From: report at bugs.python.org (Christian Heimes) Date: Tue, 03 Apr 2018 14:40:42 +0000 Subject: [issue33214] join method for list and tuple In-Reply-To: <1522766033.22.0.467229070634.issue33214@psf.upfronthosting.co.za> Message-ID: <1522766442.72.0.467229070634.issue33214@psf.upfronthosting.co.za> Christian Heimes added the comment: join() is a bad choice, because new developers will confusing list.join with str.join. We could turn list.extend(iterable) into list.extend(*iterable). Or you could just use extend with a chain iterator: >>> l = [] >>> l.extend(itertools.chain([1], [2], [3])) >>> l [1, 2, 3] ---------- nosy: +christian.heimes versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 11:06:33 2018 From: report at bugs.python.org (Javier Dehesa) Date: Tue, 03 Apr 2018 15:06:33 +0000 Subject: [issue33214] join method for list and tuple In-Reply-To: <1522766033.22.0.467229070634.issue33214@psf.upfronthosting.co.za> Message-ID: <1522767993.99.0.467229070634.issue33214@psf.upfronthosting.co.za> Javier Dehesa added the comment: Thanks Christian. I thought of join precisely because it performs conceptually the same function as with str, so the parallel between ''.join(), [].join() and ().join() looked more obvious. Also there is os.path.join and PurePath.joinpath, so the verb seemed well-established. As for shared method names, index and count are present both in sequences and str - although it is true that these do return the same kind of object in any cases. I'm not saying your points aren't valid, though. Your proposed way with extend is I guess about the same as list(itertools.chain(...)), which could be considered to be enough. I just feel that is not particularly convenient, especially for newer developers, which will probably gravitate towards sum(...) more than itertools or a nested generator expression, but I may be wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 11:17:36 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 03 Apr 2018 15:17:36 +0000 Subject: [issue33213] crypt function not hashing properly on Mac (uses a specific salt) In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522768656.92.0.467229070634.issue33213@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > What's the return value of crypt.crypt("test", crypt.METHOD_SHA512) This is from my Mac (10.13.3): $ python3.6 Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import crypt >>> crypt.crypt("test", crypt.METHOD_SHA512) '$6asQOJRqB1i2' >>> crypt.crypt("test", crypt.METHOD_SHA512) '$6asQOJRqB1i2' >>> crypt.crypt("test", "$5") '$5yVOkTkyRzn.' >>> crypt.crypt("test", "$6") '$6asQOJRqB1i2' >>> crypt.crypt("test", "$7") '$7tSOkvDyiL6U' >>> crypt.crypt("test") == crypt.crypt("test") False >>> crypt.crypt("test", crypt.mksalt()) == crypt.crypt("test", crypt.mksalt()) False ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 11:19:38 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Apr 2018 15:19:38 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1522768778.69.0.467229070634.issue33189@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6074 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 11:23:56 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Apr 2018 15:23:56 +0000 Subject: [issue33214] join method for list and tuple In-Reply-To: <1522766033.22.0.467229070634.issue33214@psf.upfronthosting.co.za> Message-ID: <1522769036.56.0.467229070634.issue33214@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: String concatenation: f'{a}{b}{c}' List concatenation: [*a, *b, *c] Tuple concatenation: (*a, *b, *c) Set union: {*a, *b, *c} Dict merging: {**a, **b, **c} ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 11:34:06 2018 From: report at bugs.python.org (Steven Downum) Date: Tue, 03 Apr 2018 15:34:06 +0000 Subject: [issue31201] make test: module test that failed doesn't exist In-Reply-To: <1502707428.17.0.905101363291.issue31201@psf.upfronthosting.co.za> Message-ID: <1522769646.72.0.467229070634.issue31201@psf.upfronthosting.co.za> Change by Steven Downum : ---------- nosy: +steven.downum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 12:11:15 2018 From: report at bugs.python.org (Marius Gedminas) Date: Tue, 03 Apr 2018 16:11:15 +0000 Subject: [issue33215] PyPI API wiki pages could link to Warehous docs please Message-ID: <1522771875.25.0.467229070634.issue33215@psf.upfronthosting.co.za> New submission from Marius Gedminas : Now that Warehouse is preparing to replace the old PyPI codebase I think it would be a good idea if the old PyPI API documentation pages on the Python wiki would link to the new Warehouse API documentation. Specifically, - https://wiki.python.org/moin/PyPISimple ought to link to https://warehouse.readthedocs.io/api-reference/legacy/ - https://wiki.python.org/moin/PyPIJSON ought to link to https://warehouse.readthedocs.io/api-reference/json/ - https://wiki.python.org/moin/PyPIXmlRpc ought to link to https://warehouse.readthedocs.io/api-reference/xml-rpc/ The wiki pages are immutable so I cannot do this myself. (I'm not sure if this is the right bug tracker. Apologies if I got it wrong!) ---------- assignee: docs at python components: Documentation messages: 314886 nosy: docs at python, mgedmin priority: normal severity: normal status: open title: PyPI API wiki pages could link to Warehous docs please type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 12:28:49 2018 From: report at bugs.python.org (Sumana Harihareswara) Date: Tue, 03 Apr 2018 16:28:49 +0000 Subject: [issue33215] PyPI API wiki pages could link to Warehous docs please In-Reply-To: <1522771875.25.0.467229070634.issue33215@psf.upfronthosting.co.za> Message-ID: <1522772929.78.0.467229070634.issue33215@psf.upfronthosting.co.za> Change by Sumana Harihareswara : ---------- nosy: +sumanah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 12:56:19 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 03 Apr 2018 16:56:19 +0000 Subject: [issue30891] importlib: _find_and_load() race condition on sys.modules[name] check In-Reply-To: <1499679864.46.0.419806460775.issue30891@psf.upfronthosting.co.za> Message-ID: <1522774579.58.0.467229070634.issue30891@psf.upfronthosting.co.za> Brett Cannon added the comment: The other problem is zipimport is written in C and no one wants to deal with that headache if possible. ;) We actually tweaked the importlib.resources API specifically to avoid having to muck with zipimport's C code as it would have required major surgery otherwise. Thomas has also been saying he was planning to upstream the improvements he has made to zipimport internally at Google which also demotivates touching the code knowing that changes are planned. As for Steve's comment, the tricky bit is zipfile has a bunch of dependencies, so it's not so simple to just freeze that one module and wrap it with importlib to be able to load the stdlib from a zip file (which zipimport supports). Basically zip-reading code needs to be written that can be bootstrapped (C or Python), and then use that in importlib to be able to import the stdlib from a zip file. I have also been toying with the idea of a zippath module that would take pathlib's API and apply it to zip files acting like a self-contained file system, but I have never bothered as zipfile's API is messy. The "all the time in the world" project would be making all of this come together in a release of Python by building off of each other: new code to read zip files written in freezable Python, use importlib to replace zipimport, and provide a pathlib API to work with zip files (which would probably be partially built for use by importlib). If I drop my idea of putting a package on PyPI to do lazy importing I could look at tackling this for 3.8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 15:38:13 2018 From: report at bugs.python.org (Manuel Vazquez Acosta) Date: Tue, 03 Apr 2018 19:38:13 +0000 Subject: [issue33216] CALL_FUNCTION_VAR Message-ID: <1522784293.5.0.467229070634.issue33216@psf.upfronthosting.co.za> Change by Manuel Vazquez Acosta : ---------- nosy: mvaled priority: normal severity: normal status: open title: CALL_FUNCTION_VAR _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 15:42:23 2018 From: report at bugs.python.org (Manuel Vazquez Acosta) Date: Tue, 03 Apr 2018 19:42:23 +0000 Subject: [issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW Message-ID: <1522784543.83.0.467229070634.issue33216@psf.upfronthosting.co.za> New submission from Manuel Vazquez Acosta : The documentation of the dis module says that: CALL_FUNCTION_VAR (argc) Calls a function. *argc* is interpreted as in CALL_FUNCTION. The top elements on the stack are the keyword arguments, followed by the variable argument list, and then the positional arguments. However, inspecting the how ``f(b=1, *args)`` is actually compiled shows a different order: >>> import dis >>> dis.dis(compile('f(b=1, *args)', '<>', 'eval')) 1 0 LOAD_NAME 0 (f) 3 LOAD_NAME 1 (args) 6 LOAD_CONST 0 ('b') 9 LOAD_CONST 1 (1) 12 CALL_FUNCTION_VAR 256 (0 positional, 1 keyword pair) 15 RETURN_VALUE Notice that the top of the stack contains the explicit keyword arguments. The documentation of CALL_FUNCTION_VAR_KW is also incorrect. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python title: CALL_FUNCTION_VAR -> Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW versions: +Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 15:49:47 2018 From: report at bugs.python.org (Manuel Vazquez Acosta) Date: Tue, 03 Apr 2018 19:49:47 +0000 Subject: [issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW In-Reply-To: <1522784543.83.0.467229070634.issue33216@psf.upfronthosting.co.za> Message-ID: <1522784987.78.0.467229070634.issue33216@psf.upfronthosting.co.za> Change by Manuel Vazquez Acosta : ---------- keywords: +patch pull_requests: +6075 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 16:14:18 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 03 Apr 2018 20:14:18 +0000 Subject: [issue30891] importlib: _find_and_load() race condition on sys.modules[name] check In-Reply-To: <1499679864.46.0.419806460775.issue30891@psf.upfronthosting.co.za> Message-ID: <1522786458.13.0.467229070634.issue30891@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Take a look at https://bugs.python.org/issue25711 which wants to rewrite zipimport from scratch. I took Serhiy's C->Python patch and turned it into a PR, but it would need a lot of love to get it into shape. (Let's not even talk about https://bugs.python.org/issue32866 which caused me some pain during importlib.resources work.) Pretty sure Thomas's rumored rewrite is still in C, and it solves problems like support for zip64 and comments, which we've run into also. zipimport is crucial for single-file executable solutions like pex and our own soon-to-be-open-sourced tool, so it really can't go away. Both of those still unpack wheels/eggs/sdists to a file system cache, not so much for speed but because shared libraries generally can't be imported from anything but a physical path (thanks to dlopen()). I think Google has a patch for glibc that would solve that but there's some hesitation from the glibc maintainers to merge it (and then what about other platforms?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 16:16:12 2018 From: report at bugs.python.org (Dutcho) Date: Tue, 03 Apr 2018 20:16:12 +0000 Subject: [issue33217] x in enum.Flag() is True when x is no Flag Message-ID: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> New submission from Dutcho : While `Flag() in Flag()` and `Flag() | Flag()` result in the expected outcomes, e.g. `str() in Flag()` unexpectedly returns `True`, whereas `Flag() | str()` as expected raises a TypeError. >>> import enum >>> ABC = enum.Flag('ABC', 'a, b, c') >>> ac = ABC.a | ABC.c >>> def test(): ... for x in (*ABC, 'test'): ... print(x, end=' ') ... try: ... print(x in ac, end=' ') ... except TypeError as e: ... print(e, end=' ') ... try: ... print(x | ac) ... except TypeError as e: ... print(e) >>> test() ABC.a True ABC.c|a ABC.b False ABC.c|b|a ABC.c True ABC.c|a test True unsupported operand type(s) for |: 'str' and 'ABC' Likely cause is modelling of Flag.__contains__ after Flag.__and__ etc., which is incorrect as __contains__ doesn't have a reflected version like __and__ etc. have. The returned `NotImplemented` is therefore not handled by the interpreter, although it is converted to bool to satisfy __contains__ return type. This can be fixed by redefinition of Flag.__contains__ to raise TypeError: >>> def __contains__(self, other): ... if not isinstance(other, self.__class__): ... raise TypeError(f"unsupported operand type(s) for 'in': " ... f"{type(other).__qualname__!r} and {type(self).__qualname__!r}") ... return other & self == other >>> enum.Flag.__contains__ = __contains__ >>> test() ABC.a True ABC.c|a ABC.b False ABC.c|b|a ABC.c True ABC.c|a test unsupported operand type(s) for 'in': 'str' and 'ABC' unsupported operand type(s) for |: 'str' and 'ABC' ---------- components: Library (Lib) messages: 314890 nosy: Dutcho priority: normal severity: normal status: open title: x in enum.Flag() is True when x is no Flag type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 16:18:34 2018 From: report at bugs.python.org (Manuel Vazquez Acosta) Date: Tue, 03 Apr 2018 20:18:34 +0000 Subject: [issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW In-Reply-To: <1522784543.83.0.467229070634.issue33216@psf.upfronthosting.co.za> Message-ID: <1522786714.95.0.467229070634.issue33216@psf.upfronthosting.co.za> Manuel Vazquez Acosta added the comment: Correction, the documentation for CALL_FUNCTION_VAR said: Calls a function. *argc* is interpreted as in :opcode:`CALL_FUNCTION`. The top element on the stack contains the variable argument list, followed by keyword and positional arguments. In a previous comment I pasted the version I'm putting in the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 16:26:04 2018 From: report at bugs.python.org (arjun v) Date: Tue, 03 Apr 2018 20:26:04 +0000 Subject: [issue33218] Fix instances in documentation where dictionaries are referenced as unordered Message-ID: <1522787164.53.0.467229070634.issue33218@psf.upfronthosting.co.za> New submission from arjun v : In python 3.6 (and above hopefully), dictionary keys are going to be ordered, while their documentation still reference them as being unordered. https://docs.python.org/3/tutorial/datastructures.html#dictionaries 1: `It is best to think of a dictionary as an unordered set of key: value pairs,...` 2: `Performing list(d.keys()) on a dictionary returns a list of all the keys used in the dictionary, in arbitrary order..` The examples should also be changed to reflect the same: ``` >>> tel = {'jack': 4098, 'sape': 4139} >>> tel['guido'] = 4127 >>> tel {'sape': 4139, 'guido': 4127, 'jack': 4098} >>> tel['jack'] 4098 >>> del tel['sape'] >>> tel['irv'] = 4127 >>> tel {'guido': 4127, 'irv': 4127, 'jack': 4098} >>> list(tel.keys()) ['irv', 'guido', 'jack'] >>> sorted(tel.keys()) ['guido', 'irv', 'jack'] >>> 'guido' in tel True >>> 'jack' not in tel False ``` ``` >>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)]) {'sape': 4139, 'guido': 4127, 'jack': 4098} ``` ``` >>> dict(sape=4139, guido=4127, jack=4098) {'sape': 4139, 'guido': 4127, 'jack': 4098} ``` ---------- assignee: docs at python components: Documentation messages: 314892 nosy: arjunv, docs at python priority: normal severity: normal status: open title: Fix instances in documentation where dictionaries are referenced as unordered versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 16:38:20 2018 From: report at bugs.python.org (Dutcho) Date: Tue, 03 Apr 2018 20:38:20 +0000 Subject: [issue33219] x in IntFlag() should test int x's inclusion in IntFlag Message-ID: <1522787900.11.0.467229070634.issue33219@psf.upfronthosting.co.za> New submission from Dutcho : While `enum.IntFlag.__and__` accepts an int arg `other` and converts it to `IntFlag` before masking, `enum.IntFlag.__contains__` handles an int arg `other` no different from a different type arg `other` (i.e. returns `True` in Python 3.6 due to issue 33217, but would raise `TypeError` after that's fixed): >>> import enum >>> ABC = enum.Flag('ABC', 'a, b, c') >>> ac = ABC.a | ABC.c >>> ABC.b in ac # works False >>> 2 in ac # should be the same; no exception due to issue 33217 True >>> ac & 3 # works, equivalent to ac & ABC(3) This is caused by a lack of specialized `IntFlag.__contains__`, so `Flag.__contains__` does the work. Can be fixed by adding a specialization, which (like in `IntFlag.__and__`) tests for `isinstance(other, (IntFlag, int))`. >>> def __contains__(self, other): ... if not isinstance(other, (self.__class__, int)): ... return TypeError ... return other & self == other # conversion of int to IntFlag implicitly handled by IntFlag.__and__ >>> IntFlag.__contains__ = __contains__ ---------- components: Library (Lib) messages: 314893 nosy: Dutcho priority: normal severity: normal status: open title: x in IntFlag() should test int x's inclusion in IntFlag type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 16:45:44 2018 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 03 Apr 2018 20:45:44 +0000 Subject: [issue30891] importlib: _find_and_load() race condition on sys.modules[name] check In-Reply-To: <1522786458.13.0.467229070634.issue30891@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: OK, this sounds much better: zipimport has problems and we should fix them, presumably by getting Thomas's fixes (sans Google-isms, which may require some effort). I don't believe ?ukasz's recommendation "don't use it" is the right attitude (though what he puts in Facebook's internal style guide is his problem :-), and I don't believe that we're better off deprecating it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 16:47:09 2018 From: report at bugs.python.org (Ethan Furman) Date: Tue, 03 Apr 2018 20:47:09 +0000 Subject: [issue33217] x in enum.Flag() is True when x is no Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1522788429.56.0.467229070634.issue33217@psf.upfronthosting.co.za> Change by Ethan Furman : ---------- assignee: -> ethan.furman nosy: +barry, eli.bendersky, ethan.furman versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 16:49:59 2018 From: report at bugs.python.org (Ethan Furman) Date: Tue, 03 Apr 2018 20:49:59 +0000 Subject: [issue33219] x in IntFlag() should test int x's inclusion in IntFlag In-Reply-To: <1522787900.11.0.467229070634.issue33219@psf.upfronthosting.co.za> Message-ID: <1522788599.71.0.467229070634.issue33219@psf.upfronthosting.co.za> Change by Ethan Furman : ---------- assignee: -> ethan.furman nosy: +barry, eli.bendersky, ethan.furman versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:05:17 2018 From: report at bugs.python.org (Ethan Furman) Date: Tue, 03 Apr 2018 21:05:17 +0000 Subject: [issue33217] x in enum.Flag() is True when x is no Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1522789517.95.0.467229070634.issue33217@psf.upfronthosting.co.za> Ethan Furman added the comment: Thanks for finding this! However, TypeError, an exception, is not the correct type of answer -- the correct type of answer for a yes/no question is either True or False. So the code should be changed from returning NotImplemented to returning False. ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:06:24 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Apr 2018 21:06:24 +0000 Subject: [issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW In-Reply-To: <1522784543.83.0.467229070634.issue33216@psf.upfronthosting.co.za> Message-ID: <1522789584.61.0.467229070634.issue33216@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +larry, ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:10:50 2018 From: report at bugs.python.org (Lukasz) Date: Tue, 03 Apr 2018 21:10:50 +0000 Subject: [issue24960] Can't use lib2to3 with embeddable zip file. In-Reply-To: <1440869782.83.0.207113001402.issue24960@psf.upfronthosting.co.za> Message-ID: <1522789850.29.0.467229070634.issue24960@psf.upfronthosting.co.za> Lukasz added the comment: I have simmilar problem but im using python 2.7 on android. So I think I cant use this solution My problem: https://bugs.python.org/issue33208 ---------- nosy: +Lukasz00500 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:10:50 2018 From: report at bugs.python.org (Ethan Furman) Date: Tue, 03 Apr 2018 21:10:50 +0000 Subject: [issue33219] x in IntFlag() should test int x's inclusion in IntFlag In-Reply-To: <1522787900.11.0.467229070634.issue33219@psf.upfronthosting.co.za> Message-ID: <1522789850.54.0.467229070634.issue33219@psf.upfronthosting.co.za> Ethan Furman added the comment: issue33217 will not be "fixed" with a TypeError, but incorrect Falses are also bad. Rather than add __contains__ to IntFlag (and every other Flag mixin), I think the best answer is to adjust Flag.__contains__ a little bit more to check if `other` is of the same type as the mixin class, and if so see if it's one of the values. Thank you for being thorough and finding this problem as well. ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:11:31 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Apr 2018 21:11:31 +0000 Subject: [issue33209] Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle In-Reply-To: <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za> Message-ID: <1522789891.95.0.467229070634.issue33209@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset c869529ea9fbed574d34cf7ac139ca3f81b62ef0 by ?ukasz Langa (Serhiy Storchaka) in branch 'master': bpo-33209: End framing at the end of C implementation of pickle.Pickler.dump(). (GH-6363) https://github.com/python/cpython/commit/c869529ea9fbed574d34cf7ac139ca3f81b62ef0 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:11:42 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 21:11:42 +0000 Subject: [issue33209] Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle In-Reply-To: <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za> Message-ID: <1522789902.47.0.467229070634.issue33209@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6077 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:12:36 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 21:12:36 +0000 Subject: [issue33209] Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle In-Reply-To: <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za> Message-ID: <1522789956.43.0.467229070634.issue33209@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6078 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:35:13 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Apr 2018 21:35:13 +0000 Subject: [issue33209] Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle In-Reply-To: <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za> Message-ID: <1522791313.84.0.467229070634.issue33209@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset 74735e2a404949b2a0c17ac13a2de0e0cac6fc41 by ?ukasz Langa (Miss Islington (bot)) in branch '3.7': bpo-33209: End framing at the end of C implementation of pickle.Pickler.dump(). (GH-6366) https://github.com/python/cpython/commit/74735e2a404949b2a0c17ac13a2de0e0cac6fc41 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:36:22 2018 From: report at bugs.python.org (Dutcho) Date: Tue, 03 Apr 2018 21:36:22 +0000 Subject: [issue33217] x in enum.Flag() is True when x is no Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1522791382.36.0.467229070634.issue33217@psf.upfronthosting.co.za> Dutcho added the comment: Fully agree that Flag.__contains__ must RETURN False or True; that's why I suggested it RAISES TypeError The exception was to be consistent with e.g. Flag.__and__, which by returning NotImplemented transfers to type(other).__rand__, and assuming __rand__ cannot handle Flag and also returns NotImplemented, falls back to the interpreter raising TypeError. Also e.g. 1 in 'hello' raises TypeError. For Flag, I wouldn't strongly oppose to False for other being a different type. However, classes derived from Flag could face issues, e.g. `class MyIntFlag (Flag, int): pass`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:39:30 2018 From: report at bugs.python.org (Dutcho) Date: Tue, 03 Apr 2018 21:39:30 +0000 Subject: [issue33217] x in enum.Flag() is True when x is no Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1522791570.54.0.467229070634.issue33217@psf.upfronthosting.co.za> Dutcho added the comment: Ah, the mixin logic mentioned in 33219 solves most of my objections to returning False; agree that would make sense Only remaining inconsistency would be with 1 in 'hello' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 17:49:11 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 03 Apr 2018 21:49:11 +0000 Subject: [issue15088] PyGen_NeedsFinalizing is public, but undocumented In-Reply-To: <1339906861.99.0.42415214654.issue15088@psf.upfronthosting.co.za> Message-ID: <1522792151.72.0.467229070634.issue15088@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Thanks again, Antoine. I'll see what I can come up with. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 18:05:20 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Apr 2018 22:05:20 +0000 Subject: [issue33209] Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle In-Reply-To: <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za> Message-ID: <1522793120.0.0.467229070634.issue33209@psf.upfronthosting.co.za> miss-islington added the comment: New changeset a5c8830637cde632ab3bcf5475698dcf0fb0546d by Miss Islington (bot) in branch '3.6': bpo-33209: End framing at the end of C implementation of pickle.Pickler.dump(). (GH-6363) https://github.com/python/cpython/commit/a5c8830637cde632ab3bcf5475698dcf0fb0546d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 18:24:02 2018 From: report at bugs.python.org (Brett Rasmussen) Date: Tue, 03 Apr 2018 22:24:02 +0000 Subject: [issue33220] Antivirus hits on python-2.7.14.amd64.msi file Message-ID: <1522794242.81.0.467229070634.issue33220@psf.upfronthosting.co.za> New submission from Brett Rasmussen : The antivirus program 'AVG Business Edition' reported that the file python-2.7.14.amd64.msi contained "Trojan horse SCGeneric_c6.HJQ". The virustotal.com web site reported a match on MD5 370014d73c3059f610c27365def62058 for file python-2.7.14.amd64.msi (i.e. Baidu Win32.Trojan.WisdomEyes.16070401...) Hopefully these are just 'false positives' ? Thanks, BR ---------- messages: 314904 nosy: brett.rasmussen at inl.gov priority: normal severity: normal status: open title: Antivirus hits on python-2.7.14.amd64.msi file type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 18:33:22 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 03 Apr 2018 22:33:22 +0000 Subject: [issue33221] Add stats for asyncio task usage. Message-ID: <1522794802.06.0.467229070634.issue33221@psf.upfronthosting.co.za> New submission from Andrew Svetlov : I suggest adding a `Task.stats()` method. The method should return a dict with the task usage statistics. Dict keys: - total_time: a time between task creation and a moment of the call (or task finishing timestamp if the task has finished). The value includes a time for `await func()` waiting. - real_time: a cumulative time for `Task._step()` executions - switch_count: a count of `Task._step()` calls. It can help with tasks activity analyzing. Yuri, what do you think about? ---------- components: asyncio messages: 314905 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Add stats for asyncio task usage. versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 18:35:18 2018 From: report at bugs.python.org (Ethan Smith) Date: Tue, 03 Apr 2018 22:35:18 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1522794918.15.0.467229070634.issue33211@psf.upfronthosting.co.za> Ethan Smith added the comment: There is also a relevant mypy bug report https://github.com/python/mypy/issues/3871. This seems like a common problem for tools working on the AST. The relevant code seems to be https://github.com/python/cpython/blob/master/Python/ast.c#L1695. Would a possible solution be adding a decorated_lineno attribute to decorated ast nodes? ---------- nosy: +Ethan Smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 18:39:34 2018 From: report at bugs.python.org (Alexander Mohr) Date: Tue, 03 Apr 2018 22:39:34 +0000 Subject: [issue33221] Add stats for asyncio task usage. In-Reply-To: <1522794802.06.0.467229070634.issue33221@psf.upfronthosting.co.za> Message-ID: <1522795174.73.0.467229070634.issue33221@psf.upfronthosting.co.za> Alexander Mohr added the comment: another idea would be neat to somehow plug into the stats so people can trace (ex: via datadog tracing) "slow" tasks, similarly to things that are outputted via PYTHONASYNCIODEBUG, however in this case be able to trace slow steps and also slow accumulated steps. In this scenario you don't know which task will be slow and don't want to track every task. ---------- nosy: +thehesiod _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 19:01:08 2018 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 03 Apr 2018 23:01:08 +0000 Subject: [issue33221] Add stats for asyncio task usage. In-Reply-To: <1522794802.06.0.467229070634.issue33221@psf.upfronthosting.co.za> Message-ID: <1522796468.36.0.467229070634.issue33221@psf.upfronthosting.co.za> Nathaniel Smith added the comment: FYI, here's how trio handles such things ? I'm sure it's not perfect, but might be useful for inspiration: https://trio.readthedocs.io/en/latest/reference-hazmat.html#instrument-api ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 19:06:39 2018 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 03 Apr 2018 23:06:39 +0000 Subject: [issue33221] Add stats for asyncio task usage. In-Reply-To: <1522794802.06.0.467229070634.issue33221@psf.upfronthosting.co.za> Message-ID: <1522796799.96.0.467229070634.issue33221@psf.upfronthosting.co.za> Yury Selivanov added the comment: > Yuri, what do you think about? I plan to use contextvars module to introduce a full-blown tracing API to asyncio to selectively log events like tacks creations, event loop switching, IO done by transports etc. The plan is to prototype it in uvloop first. I'll update this issue with a link to a discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 19:10:32 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 03 Apr 2018 23:10:32 +0000 Subject: [issue33221] Add stats for asyncio task usage. In-Reply-To: <1522794802.06.0.467229070634.issue33221@psf.upfronthosting.co.za> Message-ID: <1522797032.65.0.467229070634.issue33221@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Well, event based solution is more powerful than just statistic collection. Please keep me in the loop. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 20:29:55 2018 From: report at bugs.python.org (Ethan Furman) Date: Wed, 04 Apr 2018 00:29:55 +0000 Subject: [issue33217] x in enum.Flag() is True when x is no Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1522801795.67.0.467229070634.issue33217@psf.upfronthosting.co.za> Ethan Furman added the comment: Strings are actually the odd-man out -- dicts, sets, lists, tuples, etc., all return False instead of raising TypeError. The reason str raises an error is because `in`, for str, is a substring check, not a membership check. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 21:12:24 2018 From: report at bugs.python.org (Joongi Kim) Date: Wed, 04 Apr 2018 01:12:24 +0000 Subject: [issue33221] Add stats for asyncio task usage. In-Reply-To: <1522794802.06.0.467229070634.issue33221@psf.upfronthosting.co.za> Message-ID: <1522804344.0.0.467229070634.issue33221@psf.upfronthosting.co.za> Change by Joongi Kim : ---------- nosy: +achimnol _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 22:37:00 2018 From: report at bugs.python.org (Nitish) Date: Wed, 04 Apr 2018 02:37:00 +0000 Subject: [issue33219] x in IntFlag() should test int x's inclusion in IntFlag In-Reply-To: <1522787900.11.0.467229070634.issue33219@psf.upfronthosting.co.za> Message-ID: <1522809420.19.0.467229070634.issue33219@psf.upfronthosting.co.za> Nitish added the comment: @Ethan Furman how can Flag do that? IntFlag can deal with int values too. Would it be possible to deal with int values in this case in Flag.__contains__? ---------- nosy: +nitishch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 3 22:43:26 2018 From: report at bugs.python.org (Joongi Kim) Date: Wed, 04 Apr 2018 02:43:26 +0000 Subject: [issue33221] Add stats for asyncio task usage. In-Reply-To: <1522794802.06.0.467229070634.issue33221@psf.upfronthosting.co.za> Message-ID: <1522809806.3.0.467229070634.issue33221@psf.upfronthosting.co.za> Joongi Kim added the comment: I like trio-style instrumentation API because it could be used for more generic purposes, not only for statistics. This stats or instrumentation API will greatly help me to utilize external monitoring services such as Datadog in my production deployments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 00:22:51 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 04 Apr 2018 04:22:51 +0000 Subject: [issue33218] Fix instances in documentation where dictionaries are referenced as unordered In-Reply-To: <1522787164.53.0.467229070634.issue33218@psf.upfronthosting.co.za> Message-ID: <1522815771.48.0.467229070634.issue33218@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Would you like to make a pull request or do you prefer for me to assign it to someone else? ---------- nosy: +rhettinger versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 00:24:27 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 04 Apr 2018 04:24:27 +0000 Subject: [issue33218] Fix instances in documentation where dictionaries are referenced as unordered In-Reply-To: <1522787164.53.0.467229070634.issue33218@psf.upfronthosting.co.za> Message-ID: <1522815867.85.0.467229070634.issue33218@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Also check the 3.7 docs to see if this work has already been done. It's unlikely that the 3.6 docs will change because it is considered a non-guaranteed implementation detail for 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 00:24:58 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 04 Apr 2018 04:24:58 +0000 Subject: [issue33218] Fix instances in documentation where dictionaries are referenced as unordered In-Reply-To: <1522787164.53.0.467229070634.issue33218@psf.upfronthosting.co.za> Message-ID: <1522815898.58.0.467229070634.issue33218@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Dict order is now guaranteed, so add tests and doc for it _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 00:41:29 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 04 Apr 2018 04:41:29 +0000 Subject: [issue32337] Dict order is now guaranteed, so add tests and doc for it In-Reply-To: <1514287514.34.0.213398074469.issue32337@psf.upfronthosting.co.za> Message-ID: <1522816889.23.0.467229070634.issue32337@psf.upfronthosting.co.za> Steven D'Aprano added the comment: I started to add this comment to #33218 but Raymond closed that ticket while I was editing it. In 3.6, dicts preserving insertion order remains an implementation detail that cannot be relied on. It only becomes a guarantee in 3.7. Even in 3.7, I think that it remains best to think of dicts as fundamentally unordered. Dicts might preserve insertion order, but there's no interface for extracting the n-th item, or re-ordering the keys into some alternative order, and for the purposes of equality comparisons, the order is ignored. I propose changing the description from "It is best to think of a dictionary as an unordered set of key: value pairs" to something like: Dicts are an otherwise unordered set of key:value pairs that remember the order keys were inserted. and references to "arbitrary order" should be replaced by "insertion order". But by no means should we suggest that dicts are fundamentally orderable (sortable). ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 00:45:08 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 04 Apr 2018 04:45:08 +0000 Subject: [issue32337] Dict order is now guaranteed, so add tests and doc for it In-Reply-To: <1514287514.34.0.213398074469.issue32337@psf.upfronthosting.co.za> Message-ID: <1522817108.16.0.467229070634.issue32337@psf.upfronthosting.co.za> INADA Naoki added the comment: > I started to add this comment to #33218 but Raymond closed that ticket while I was editing it. Sorry, I closed it, not Raymond. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 00:55:08 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 04 Apr 2018 04:55:08 +0000 Subject: [issue32337] Dict order is now guaranteed, so add tests and doc for it In-Reply-To: <1514287514.34.0.213398074469.issue32337@psf.upfronthosting.co.za> Message-ID: <1522817708.84.0.467229070634.issue32337@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset dfbbbf16f9aab82330c634913441b5ac73267d9c by INADA Naoki (hui shang) in branch 'master': bpo-32337: Update documentats about dict order (GH-4973) https://github.com/python/cpython/commit/dfbbbf16f9aab82330c634913441b5ac73267d9c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 00:56:18 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 04:56:18 +0000 Subject: [issue32337] Dict order is now guaranteed, so add tests and doc for it In-Reply-To: <1514287514.34.0.213398074469.issue32337@psf.upfronthosting.co.za> Message-ID: <1522817778.49.0.467229070634.issue32337@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6079 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 00:59:10 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 04 Apr 2018 04:59:10 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. In-Reply-To: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> Message-ID: <1522817950.79.0.467229070634.issue33195@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 42ec190761a2e8503aaa06f0bfaaabe98749179b by INADA Naoki in branch 'master': bpo-33195: Doc: Deprecate Py_UNICODE in c-api/arg (GH-6329) https://github.com/python/cpython/commit/42ec190761a2e8503aaa06f0bfaaabe98749179b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 01:00:19 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 05:00:19 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. In-Reply-To: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> Message-ID: <1522818019.62.0.467229070634.issue33195@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6080 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 01:01:48 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 05:01:48 +0000 Subject: [issue32337] Dict order is now guaranteed, so add tests and doc for it In-Reply-To: <1514287514.34.0.213398074469.issue32337@psf.upfronthosting.co.za> Message-ID: <1522818108.45.0.467229070634.issue32337@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 9216dffbc8a2aa62789f81f51f64bc1ec7bf6883 by Miss Islington (bot) in branch '3.7': bpo-32337: Update documentats about dict order (GH-4973) https://github.com/python/cpython/commit/9216dffbc8a2aa62789f81f51f64bc1ec7bf6883 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 01:08:08 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 04 Apr 2018 05:08:08 +0000 Subject: [issue33209] Repeated Pickler.dump() doesn't reset the state in the C implementation of pickle In-Reply-To: <1522717703.98.0.467229070634.issue33209@psf.upfronthosting.co.za> Message-ID: <1522818488.7.0.467229070634.issue33209@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 01:09:21 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Apr 2018 05:09:21 +0000 Subject: [issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW In-Reply-To: <1522784543.83.0.467229070634.issue33216@psf.upfronthosting.co.za> Message-ID: <1522818561.14.0.467229070634.issue33216@psf.upfronthosting.co.za> Change by Ned Deily : ---------- assignee: docs at python -> larry nosy: -ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 01:13:40 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 05:13:40 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. In-Reply-To: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> Message-ID: <1522818820.37.0.467229070634.issue33195@psf.upfronthosting.co.za> miss-islington added the comment: New changeset b8fc2d658094941250116a48577f54d1f6300362 by Miss Islington (bot) in branch '3.7': bpo-33195: Doc: Deprecate Py_UNICODE in c-api/arg (GH-6329) https://github.com/python/cpython/commit/b8fc2d658094941250116a48577f54d1f6300362 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 01:15:07 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Apr 2018 05:15:07 +0000 Subject: [issue33220] Antivirus hits on python-2.7.14.amd64.msi file In-Reply-To: <1522794242.81.0.467229070634.issue33220@psf.upfronthosting.co.za> Message-ID: <1522818907.88.0.467229070634.issue33220@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 01:15:59 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 04 Apr 2018 05:15:59 +0000 Subject: [issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW In-Reply-To: <1522784543.83.0.467229070634.issue33216@psf.upfronthosting.co.za> Message-ID: <1522818959.69.0.467229070634.issue33216@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I confirm that this issue is 3.5-only. Before 3.5 the order matched the documentation. After 3.5 these opcodes were completely rewritten and they use now other way of passing arguments. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 01:26:02 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Apr 2018 05:26:02 +0000 Subject: [issue33215] PyPI API wiki pages could link to Warehous docs please In-Reply-To: <1522771875.25.0.467229070634.issue33215@psf.upfronthosting.co.za> Message-ID: <1522819562.26.0.467229070634.issue33215@psf.upfronthosting.co.za> Ned Deily added the comment: You should probably bring this up on the packaging mailing list: https://mail.python.org/mailman/listinfo/distutils-sig or on the Warehouse issue tracker: https://github.com/pypa/warehouse/issues ---------- nosy: +ned.deily resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 01:34:06 2018 From: report at bugs.python.org (Sumana Harihareswara) Date: Wed, 04 Apr 2018 05:34:06 +0000 Subject: [issue33215] PyPI API wiki pages should be mutable In-Reply-To: <1522771875.25.0.467229070634.issue33215@psf.upfronthosting.co.za> Message-ID: <1522820046.09.0.467229070634.issue33215@psf.upfronthosting.co.za> Sumana Harihareswara added the comment: The problem mgedmin is experiencing is that these particular wiki.python.org pages are immutable, which is not a problem Warehouse maintainers (like me) can solve, and I believe it's also not a problem people on distutils-sig can solve. Perhaps this is an infrastructure question that should go into https://github.com/python/psf-infra-meta/issues ? ---------- title: PyPI API wiki pages could link to Warehous docs please -> PyPI API wiki pages should be mutable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 01:37:00 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Apr 2018 05:37:00 +0000 Subject: [issue33215] PyPI API wiki pages should be mutable In-Reply-To: <1522771875.25.0.467229070634.issue33215@psf.upfronthosting.co.za> Message-ID: <1522820220.07.0.467229070634.issue33215@psf.upfronthosting.co.za> Ned Deily added the comment: wiki.python.org pages aren't immutable. Anyone can ask for Wiki editing permission. See https://wiki.python.org/moin/: If you want to edit a page and have just signed up, or you find that you can no longer edit a page that you could edit before, please write to the pydotorg-www mailing list, stating your account name and your intended edits and we'll add you to the EditorsGroup. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 02:00:46 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Apr 2018 06:00:46 +0000 Subject: [issue33213] crypt function not hashing properly on Mac (uses a specific salt) In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522821646.91.0.467229070634.issue33213@psf.upfronthosting.co.za> Ned Deily added the comment: $ ./bin/python3 Python 3.8.0a0 (heads/master:55966f3a0d, Apr 2 2018, 18:16:13) [Clang 9.1.0 (clang-902.0.39.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import crypt >>> crypt.methods [] ---------- nosy: +ned.deily versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 02:06:56 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Apr 2018 06:06:56 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1522822016.89.0.467229070634.issue23403@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset c51d8c9ba6211d77db639487501f89aa9b4bcbb1 by ?ukasz Langa in branch 'master': bpo-23403: Bump pickle.DEFAULT_PROTOCOL to 4 (#6355) https://github.com/python/cpython/commit/c51d8c9ba6211d77db639487501f89aa9b4bcbb1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 02:12:04 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Apr 2018 06:12:04 +0000 Subject: [issue33210] pkgutil.walk_packages gives incomplete results In-Reply-To: <1522722338.23.0.467229070634.issue33210@psf.upfronthosting.co.za> Message-ID: <1522822324.23.0.467229070634.issue33210@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +brett.cannon, eric.snow, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 03:13:29 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 04 Apr 2018 07:13:29 +0000 Subject: [issue31814] subprocess_fork_exec more stable with vfork In-Reply-To: <1508343864.17.0.213398074469.issue31814@psf.upfronthosting.co.za> Message-ID: <1522826009.16.0.467229070634.issue31814@psf.upfronthosting.co.za> Gregory P. Smith added the comment: A raw os.posix_spawn() API has been added to 3.7. vfork() would likely all sorts of other problems. It is extremely complicated and implementations have bugs. CERT says never to use it. https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152373 When forking or threading is involved, you are already always at the mercy of all other code running in your process. This is not new. That some C/C++ libraries misuse pthread_atfork() is not a surprise. But the bug is theirs. We should not try to paper over others C and system call mistakes. Their code needs fixing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 03:13:55 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 04 Apr 2018 07:13:55 +0000 Subject: [issue31814] subprocess_fork_exec more stable with vfork In-Reply-To: <1508343864.17.0.213398074469.issue31814@psf.upfronthosting.co.za> Message-ID: <1522826035.23.0.467229070634.issue31814@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 04:42:48 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 04 Apr 2018 08:42:48 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. In-Reply-To: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> Message-ID: <1522831368.4.0.467229070634.issue33195@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 04:43:07 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 04 Apr 2018 08:43:07 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. In-Reply-To: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> Message-ID: <1522831387.21.0.467229070634.issue33195@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 09:55:15 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 04 Apr 2018 13:55:15 +0000 Subject: [issue30071] Duck-typing inspect.isfunction() In-Reply-To: <1492169694.13.0.728047753298.issue30071@psf.upfronthosting.co.za> Message-ID: <1522850115.73.0.682650639539.issue30071@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: Superseded by https://www.python.org/dev/peps/pep-0575/ ---------- stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 09:55:21 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 04 Apr 2018 13:55:21 +0000 Subject: [issue32337] Dict order is now guaranteed, so add tests and doc for it In-Reply-To: <1514287514.34.0.213398074469.issue32337@psf.upfronthosting.co.za> Message-ID: <1522850121.54.0.682650639539.issue32337@psf.upfronthosting.co.za> INADA Naoki added the comment: Any other known issue? May I close this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 10:00:04 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 04 Apr 2018 14:00:04 +0000 Subject: [issue33222] Various test failures if PYTHONUSERBASE is not canonicalized Message-ID: <1522850404.57.0.682650639539.issue33222@psf.upfronthosting.co.za> New submission from Jeroen Demeyer : Setting PYTHONUSERBASE=/tmp/x/.. causes the Python test suite to fail: ====================================================================== FAIL: test_user_similar (test.test_sysconfig.TestSysConfig) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/src/sage-config/local/src/cpython/Lib/test/test_sysconfig.py", line 276, in test_user_similar self.assertEqual(user_path, global_path.replace(base, user, 1)) AssertionError: '/tmp/lib/python3.8' != '/tmp/x/../lib/python3.8' - /tmp/lib/python3.8 + /tmp/x/../lib/python3.8 ? +++++ ====================================================================== FAIL: test_get_path (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/src/sage-config/local/src/cpython/Lib/test/test_site.py", line 192, in test_get_path sysconfig.get_path('purelib', scheme)) AssertionError: '/tmp/x/../lib/python3.8/site-packages' != '/tmp/lib/python3.8/site-packages' - /tmp/x/../lib/python3.8/site-packages ? ----- + /tmp/lib/python3.8/site-packages ====================================================================== FAIL: test_s_option (test.test_site.HelperFunctionsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/src/sage-config/local/src/cpython/Lib/test/test_site.py", line 199, in test_s_option self.assertIn(usersite, sys.path) AssertionError: '/tmp/x/../lib/python3.8/site-packages' not found in ['/usr/local/src/sage-config/local/src/cpython', '/usr/local/src/sage-config/local/lib/python38.zip', '/usr/local/src/sage-config/local/src/cpython/Lib', '/usr/local/src/sage-config/local/src/cpython/build/lib.linux-x86_64-3.8', '/usr/local/src/sage-config/local/lib/python3.8/site-packages'] ---------- components: Tests messages: 314931 nosy: jdemeyer priority: normal severity: normal status: open title: Various test failures if PYTHONUSERBASE is not canonicalized type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 10:08:30 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 04 Apr 2018 14:08:30 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522850910.27.0.682650639539.issue29922@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6081 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 10:09:06 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 14:09:06 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522850946.31.0.682650639539.issue29922@psf.upfronthosting.co.za> miss-islington added the comment: New changeset fcd4e03e08a2d4ec1cde17beb66e2b22a052500f by Miss Islington (bot) in branch '3.7': bpo-29922: Improve error messages in 'async with' (GH-6352) https://github.com/python/cpython/commit/fcd4e03e08a2d4ec1cde17beb66e2b22a052500f ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 10:09:17 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 14:09:17 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522850957.22.0.682650639539.issue29922@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 4fd6c27dc8ba7ca97aa70e1ab98729f2207bbe19 by Miss Islington (bot) in branch '3.6': bpo-29922: Improve error messages in 'async with' (GH-6352) https://github.com/python/cpython/commit/4fd6c27dc8ba7ca97aa70e1ab98729f2207bbe19 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 10:13:39 2018 From: report at bugs.python.org (Ioannis Valasakis) Date: Wed, 04 Apr 2018 14:13:39 +0000 Subject: [issue33223] test_posix fails ERRNO 0 Message-ID: <1522851219.93.0.682650639539.issue33223@psf.upfronthosting.co.za> New submission from Ioannis Valasakis : I am on mac OSX high Sierra 10.13.4. I am using the Apple LLVM version 9.1.0 (clang-902.0.37.1) from the XCode toolchain. My tests fail on posix and if run the interpreter I get --- pylog --- ./python.exe Python 3.8.0a0 (heads/master:da58533ac6, Apr 3 2018, 16:54:53) [Clang 9.1.0 (clang-902.0.37.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.getgrouplist('wizofe', 20) Traceback (most recent call last): File "", line 1, in OSError: [Errno 0] Error --- pylog --- My system is defined as case-sensitive in the setup. ---------- components: Tests, ctypes, macOS messages: 314934 nosy: ned.deily, ronaldoussoren, wizofe priority: normal severity: normal status: open title: test_posix fails ERRNO 0 versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 10:31:22 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 04 Apr 2018 14:31:22 +0000 Subject: [issue29673] Some gdb macros are broken in 3.6 In-Reply-To: <1488240167.08.0.156874874183.issue29673@psf.upfronthosting.co.za> Message-ID: <1522852282.11.0.682650639539.issue29673@psf.upfronthosting.co.za> Change by Charalampos Stratakis : ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 10:32:17 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 04 Apr 2018 14:32:17 +0000 Subject: [issue29673] Some gdb macros are broken in 3.6 In-Reply-To: <1488240167.08.0.156874874183.issue29673@psf.upfronthosting.co.za> Message-ID: <1522852337.26.0.682650639539.issue29673@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: A PR has been filed, could someone take a look? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 11:18:24 2018 From: report at bugs.python.org (Jeff Kaufman) Date: Wed, 04 Apr 2018 15:18:24 +0000 Subject: [issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff Message-ID: <1522855104.15.0.682650639539.issue33224@psf.upfronthosting.co.za> New submission from Jeff Kaufman : With python built at HEAD (c51d8c9b) and at 3.7b3 (fcd4e03e08) the code: import difflib for fromdata, todata, flag in difflib._mdiff( ["2"], ["3"], 1): pass produces: Traceback (most recent call last): File "/home/jefftk/cpython/Lib/difflib.py", line 1638, in _mdiff from_line, to_line, found_diff = next(line_pair_iterator) StopIteration The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/jefftk/icdiff/repro.py", line 3, in ["2"], ["3"], 1): RuntimeError: generator raised StopIteration In python 3.5 and 3.6 I don't get an error. This is probably due to https://bugs.python.org/issue32670 which implements PEP 479, but I this this isn't supposed to happen in library code? ---------- components: Library (Lib) messages: 314936 nosy: Jeff.Kaufman priority: normal severity: normal status: open title: "RuntimeError: generator raised StopIteration" in difflib.mdiff type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 11:24:16 2018 From: report at bugs.python.org (Ioannis Valasakis) Date: Wed, 04 Apr 2018 15:24:16 +0000 Subject: [issue33223] test_posix fails ERRNO 0 In-Reply-To: <1522851219.93.0.682650639539.issue33223@psf.upfronthosting.co.za> Message-ID: <1522855456.87.0.682650639539.issue33223@psf.upfronthosting.co.za> Ioannis Valasakis added the comment: Note: I get the same error with the version of python installed via homebrew: (Python 3.6.4 (default, Jan 6 2018, 11:51:59) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin Here is also the output of the id command, if that is helpful: (box3) ? /Volumes/pythontesting/cpython/ master id uid=501(wizofe) gid=20(staff) groups=20(staff),1(daemon),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),204(_developer),450(_xcs),701(1),33(_appstore),100(_lpoperator),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh) I am also attaching a dtrace log of the two liner that causes the bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 11:33:35 2018 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 04 Apr 2018 15:33:35 +0000 Subject: [issue33213] crypt function not hashing properly on Mac (uses a specific salt) In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1522856015.59.0.682650639539.issue33213@psf.upfronthosting.co.za> Ronald Oussoren added the comment: As far as I know macOS does not support different salt types at all. The manpage does mention an "extended crypt", but according to the documentation that just controls the number of DES rounds used. In particular: The salt is a 9-character array consisting of an underscore, followed by 4 bytes of iteration count and 4 bytes of salt. These are encoded as printable characters, 6 bits per character, least significant character first. The values 0 to 63 are encoded as ``./0-9A-Za-z''. This allows 24 bits for both count and salt. If anything needs to change it would have to be a macOS specific patch to the _crypt extension that rejects any attempt of using algorithm selection (but that's technically a backward incompatible change as) ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 11:45:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 04 Apr 2018 15:45:20 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522856720.08.0.682650639539.issue29922@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 2eeac269dd1e04a2a179384576986c3e47895ee0 by Serhiy Storchaka in branch 'master': bpo-29922: Add more tests for error messages in 'async with'. (GH-6370) https://github.com/python/cpython/commit/2eeac269dd1e04a2a179384576986c3e47895ee0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 11:46:30 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 15:46:30 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522856790.2.0.682650639539.issue29922@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6082 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 12:04:48 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 16:04:48 +0000 Subject: [issue33207] typing.Generic does not correctly call super().__init_subclass__ In-Reply-To: <1522706515.12.0.467229070634.issue33207@psf.upfronthosting.co.za> Message-ID: <1522857888.71.0.682650639539.issue33207@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6083 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 12:28:51 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 16:28:51 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522859331.94.0.682650639539.issue29922@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 785f36c876721c12f653371e9893527a25140624 by Miss Islington (bot) in branch '3.7': bpo-29922: Add more tests for error messages in 'async with'. (GH-6370) https://github.com/python/cpython/commit/785f36c876721c12f653371e9893527a25140624 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 12:30:17 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 16:30:17 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522859417.83.0.682650639539.issue29922@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6084 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 12:55:29 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 04 Apr 2018 16:55:29 +0000 Subject: [issue33207] typing.Generic does not correctly call super().__init_subclass__ In-Reply-To: <1522706515.12.0.467229070634.issue33207@psf.upfronthosting.co.za> Message-ID: <1522860929.98.0.682650639539.issue33207@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 13:18:59 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Apr 2018 17:18:59 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522862339.22.0.682650639539.issue29922@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 1487cd14bb1e04de5b98fffc5ec41c6cf6b5d5f1 by Miss Islington (bot) in branch '3.6': bpo-29922: Add more tests for error messages in 'async with'. (GH-6370) https://github.com/python/cpython/commit/1487cd14bb1e04de5b98fffc5ec41c6cf6b5d5f1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 13:19:47 2018 From: report at bugs.python.org (Bob Vincent) Date: Wed, 04 Apr 2018 17:19:47 +0000 Subject: [issue1294959] Problems with /usr/lib64 builds. Message-ID: <1522862387.83.0.682650639539.issue1294959@psf.upfronthosting.co.za> Change by Bob Vincent : ---------- nosy: +pillarsdotnet _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 13:29:17 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 04 Apr 2018 17:29:17 +0000 Subject: [issue33208] Lib2to3 grammar.txt error In-Reply-To: <1522707641.37.0.467229070634.issue33208@psf.upfronthosting.co.za> Message-ID: <1522862957.89.0.682650639539.issue33208@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Why do you believe this is any different than #24960? ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 13:36:05 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Apr 2018 17:36:05 +0000 Subject: [issue32337] Dict order is now guaranteed, so add tests and doc for it In-Reply-To: <1514287514.34.0.213398074469.issue32337@psf.upfronthosting.co.za> Message-ID: <1522863365.92.0.682650639539.issue32337@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for doing this! Let's close it. If comments arise prior to its release in 370b4, we can reopen, otherwise please open a new issue. ---------- priority: deferred blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 13:39:22 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 04 Apr 2018 17:39:22 +0000 Subject: [issue29922] error message when __aexit__ is not async In-Reply-To: <1490635462.94.0.877144122619.issue29922@psf.upfronthosting.co.za> Message-ID: <1522863562.77.0.682650639539.issue29922@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Since BEFORE_ASYNC_WITH always is followed by GET_AWAITABLE, in future they can be merged into a single instruction (like GET_ANEXT or GET_YIELD_FROM_ITER). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 13:40:42 2018 From: report at bugs.python.org (Yang Yu) Date: Wed, 04 Apr 2018 17:40:42 +0000 Subject: [issue33225] imaplib module IMAP4.append() unexpected response BAD Command Error Message-ID: <1522863642.75.0.682650639539.issue33225@psf.upfronthosting.co.za> New submission from Yang Yu : part of bytestring in message in .append() includes 'text-align: center;\r\n} 1 pickle.loads(pickle.dumps(typing.FrozenSet)) PicklingError: Can't pickle typing.Frozenset: attribute lookup Frozenset on typing failed The cause is in _GenericAlias.__init__ name = orig_name[0].title() + orig_name[1:] Maybe just pass the name explicitly? For context I originally hit this trying to explicitly getattr(typing, alias_name) not by pickling but I'm pleased to see that's at least apparently intended to be valid use (I need to get the underlying special's parameter variance which is lost when you give it args). ---------- nosy: +wrmsr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 17:56:12 2018 From: report at bugs.python.org (Alexander Mohr) Date: Wed, 04 Apr 2018 21:56:12 +0000 Subject: [issue31033] Add argument to .cancel() of Task and Future In-Reply-To: <1500988900.8.0.188595649246.issue31033@psf.upfronthosting.co.za> Message-ID: <1522878972.89.0.682650639539.issue31033@psf.upfronthosting.co.za> Alexander Mohr added the comment: I was about to open a new bug, but I think my idea overlaps with this one. From what I understand there are two ways to cancel tasks: 1) calling task.cancel() 2) explicitly raising a CancelledError with #2 you can get a traceback by catching the exception which yields why the task was cancelled (per callstack, and you create the CancelledError with a custom message). #1 I think is what this is talking about. The most useful information IMHO is the callstack, and via #1 this callstack is completely lost. I like the idea of having an argument to construct the CancelledError with, but I like even more the ability to tell the exception that will be raised to have the traceback of the point where the task was originally cancelled. Right now I have to use forbidden fruit to override the Task.cancel method and store the callstack in a custom attribute. I was talking with asvetlov and and he thought perhaps there could be an environment variable to enable this by default and then when the cancellation error is raised it can have the caller's callstack...I think ideally this would be the default if it could be done cheaply (given if a regular exception throw contains the callstack, then a cancellation exception should always as well. Ideally I think when a task is cancelled it instantiates the exception with the callstack at that point, and then does something like a "with e" to raise the exception from the future so you get it when it's raised. ---------- nosy: +thehesiod _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 18:04:42 2018 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 04 Apr 2018 22:04:42 +0000 Subject: [issue31033] Add argument to .cancel() of Task and Future In-Reply-To: <1500988900.8.0.188595649246.issue31033@psf.upfronthosting.co.za> Message-ID: <1522879482.73.0.682650639539.issue31033@psf.upfronthosting.co.za> Yury Selivanov added the comment: > I like the idea of having an argument to construct the CancelledError with, but I like even more the ability to tell the exception that will be raised to have the traceback of the point where the task was originally cancelled. Why don't we make CancelledErrors having proper traceback a default behaviour? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 18:06:30 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 04 Apr 2018 22:06:30 +0000 Subject: [issue32873] Pickling of typing types In-Reply-To: <1519037205.03.0.467229070634.issue32873@psf.upfronthosting.co.za> Message-ID: <1522879590.51.0.682650639539.issue32873@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: Apparently there is another type with a similar problem -- DefaultDict. Will fix this now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 18:30:49 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Wed, 04 Apr 2018 22:30:49 +0000 Subject: [issue32873] Pickling of typing types In-Reply-To: <1519037205.03.0.467229070634.issue32873@psf.upfronthosting.co.za> Message-ID: <1522881049.25.0.682650639539.issue32873@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- pull_requests: +6088 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 18:49:16 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 04 Apr 2018 22:49:16 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522882156.24.0.682650639539.issue33203@psf.upfronthosting.co.za> Raymond Hettinger added the comment: I think this can go forward as-is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 18:49:30 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 04 Apr 2018 22:49:30 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522882170.64.0.682650639539.issue33203@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- Removed message: https://bugs.python.org/msg314956 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 18:50:02 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 04 Apr 2018 22:50:02 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522882202.12.0.682650639539.issue33203@psf.upfronthosting.co.za> Raymond Hettinger added the comment: The patch looks fine. Once a news blurb is added, it can go forward. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 19:08:03 2018 From: report at bugs.python.org (Ethan Furman) Date: Wed, 04 Apr 2018 23:08:03 +0000 Subject: [issue33217] x in enum.Flag member is True when x is not a Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1522883283.31.0.682650639539.issue33217@psf.upfronthosting.co.za> Ethan Furman added the comment: Stepping back slightly, it is more general to say that str, and in certain other cases dict and set (and possibly others) will raise instead of return False when it is impossible for the target type to ever hold the checked-for type. A couple examples of what will raise: 1 in 'hello' # integers will never be in a string list() in dict() # dict keys must be hashable (and lists are not) So, yes, at least for pure Enums and Flags, raising TypeError when a non-Enum/Flag is checked for would be appropriate. Since there may be code currently relying on always getting True/False, though, a deprecation period is called for. I'll see if I can get that into 3.7. ---------- title: x in enum.Flag() is True when x is no Flag -> x in enum.Flag member is True when x is not a Flag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 19:14:49 2018 From: report at bugs.python.org (Ethan Furman) Date: Wed, 04 Apr 2018 23:14:49 +0000 Subject: [issue33219] x in IntFlag() should test int x's inclusion in IntFlag In-Reply-To: <1522787900.11.0.467229070634.issue33219@psf.upfronthosting.co.za> Message-ID: <1522883689.86.0.682650639539.issue33219@psf.upfronthosting.co.za> Ethan Furman added the comment: Nitish, Flag can check if the current Flag class has a mixin, and if so if the object being checked for is of that same type. Dutcho, my apologies. Looks like I did not fully understand how __contains__ is supposed to work and a TypeError is completely appropriate. Looking into deprecation cycles now to get the change scheduled. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 19:16:05 2018 From: report at bugs.python.org (Cyker Way) Date: Wed, 04 Apr 2018 23:16:05 +0000 Subject: [issue33210] pkgutil.walk_packages gives incomplete results In-Reply-To: <1522722338.23.0.467229070634.issue33210@psf.upfronthosting.co.za> Message-ID: <1522883765.88.0.682650639539.issue33210@psf.upfronthosting.co.za> Change by Cyker Way : Removed file: https://bugs.python.org/file47516/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 19:19:18 2018 From: report at bugs.python.org (Cyker Way) Date: Wed, 04 Apr 2018 23:19:18 +0000 Subject: [issue33210] pkgutil.walk_packages gives incomplete results In-Reply-To: <1522722338.23.0.467229070634.issue33210@psf.upfronthosting.co.za> Message-ID: <1522883958.4.0.682650639539.issue33210@psf.upfronthosting.co.za> Cyker Way added the comment: Update test program. ---------- Added file: https://bugs.python.org/file47519/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 19:31:07 2018 From: report at bugs.python.org (Seyeong Kim) Date: Wed, 04 Apr 2018 23:31:07 +0000 Subject: [issue33226] In some envrionment using unicode, formatwarning shows ascii error Message-ID: <1522884667.65.0.682650639539.issue33226@psf.upfronthosting.co.za> New submission from Seyeong Kim : In some circumstances using unicode, formatwarning show me ascii error so I should prefix on below line to remove this crash s = "%s: %s: %s\n" % (lineno, category.__name__, message) to s = u"%s: %s: %s\n" % (lineno, category.__name__, message) below are logs Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__ Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault return resp(environ, start_response) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__ Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault resp = self.call_func(req, *args, **self.kwargs) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault return self.func(req, *args, **kwargs) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/cinder/api/openstack/wsgi.py", line 1061, in __call__ Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault content_type, body, accept) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/cinder/api/openstack/wsgi.py", line 1123, in _process_stack Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault action_result = self.dispatch(meth, request, action_args) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/cinder/api/openstack/wsgi.py", line 1221, in dispatch Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault return method(req=request, **action_args) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/cinder/api/v2/volumes.py", line 405, in create Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault **kwargs) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/cinder/volume/api.py", line 327, in create Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault flow_engine.run() Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 230, in run Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault for _state in self.run_iter(timeout=timeout): Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 308, in run_iter Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault failure.Failure.reraise_if_any(fails) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/taskflow/types/failure.py", line 336, in reraise_if_any Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault failures[0].reraise() Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/taskflow/types/failure.py", line 343, in reraise Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault six.reraise(*self._exc_info) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/executor.py", line 82, in _execute_task Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault result = task.execute(**arguments) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/api/create_volume.py", line 527, in execute Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault volume = objects.Volume(context=context, **volume_properties) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/cinder/objects/volume.py", line 180, in __init__ Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault super(Volume, self).__init__(*args, **kwargs) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 304, in __init__ Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault setattr(self, key, kwargs[key]) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 72, in setter Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault field_value = field.coerce(self, name, value) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 192, in coerce Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault return self._type.coerce(obj, attr, value) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 325, in coerce Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault u"for further details" % value, FutureWarning) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/logging/__init__.py", line 1724, in _showwarning Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault s = warnings.formatwarning(message, category, filename, lineno, line) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault File "/usr/lib/python2.7/warnings.py", line 50, in formatwarning Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault s = "%s: %s: %s\n" % (lineno, category.__name__, message) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in position 1: ordinal not in range(128) Apr 4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault ---------- components: Library (Lib) messages: 314961 nosy: xtrusia priority: normal severity: normal status: open title: In some envrionment using unicode, formatwarning shows ascii error type: crash versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 19:38:18 2018 From: report at bugs.python.org (Roundup Robot) Date: Wed, 04 Apr 2018 23:38:18 +0000 Subject: [issue33226] In some envrionment using unicode, formatwarning shows ascii error In-Reply-To: <1522884667.65.0.682650639539.issue33226@psf.upfronthosting.co.za> Message-ID: <1522885098.42.0.682650639539.issue33226@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +6089 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 19:46:16 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Apr 2018 23:46:16 +0000 Subject: [issue33226] In some envrionment using unicode, formatwarning shows ascii error In-Reply-To: <1522884667.65.0.682650639539.issue33226@psf.upfronthosting.co.za> Message-ID: <1522885576.01.0.682650639539.issue33226@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +serhiy.storchaka type: crash -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 20:13:46 2018 From: report at bugs.python.org (Martin Panter) Date: Thu, 05 Apr 2018 00:13:46 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1522887226.58.0.682650639539.issue33012@psf.upfronthosting.co.za> Martin Panter added the comment: Sorry, I realize there is a problem remaining with the pointer types for "Noddy_name" (Noddy vs PyObject pointers), so you can't remove the cast there. But my suggestion should still apply to other places, for instance the "error_out" method in Doc/howto/cporting.rst. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 20:25:17 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 05 Apr 2018 00:25:17 +0000 Subject: [issue32873] Pickling of typing types In-Reply-To: <1519037205.03.0.467229070634.issue32873@psf.upfronthosting.co.za> Message-ID: <1522887917.93.0.682650639539.issue32873@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: New changeset 2a363d2930e29ec6d8a774973ed5a4965f881f5f by Ivan Levkivskyi in branch 'master': bpo-32873: Remove a name hack for generic aliases in typing module (GH-6376) https://github.com/python/cpython/commit/2a363d2930e29ec6d8a774973ed5a4965f881f5f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 20:25:39 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Apr 2018 00:25:39 +0000 Subject: [issue32873] Pickling of typing types In-Reply-To: <1519037205.03.0.467229070634.issue32873@psf.upfronthosting.co.za> Message-ID: <1522887939.78.0.682650639539.issue32873@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6090 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 20:46:42 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Apr 2018 00:46:42 +0000 Subject: [issue32873] Pickling of typing types In-Reply-To: <1519037205.03.0.467229070634.issue32873@psf.upfronthosting.co.za> Message-ID: <1522889202.97.0.682650639539.issue32873@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 04eac02088f60192c7e54c7364bcaa892d7c05cf by Miss Islington (bot) in branch '3.7': bpo-32873: Remove a name hack for generic aliases in typing module (GH-6376) https://github.com/python/cpython/commit/04eac02088f60192c7e54c7364bcaa892d7c05cf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 21:30:59 2018 From: report at bugs.python.org (Seyeong Kim) Date: Thu, 05 Apr 2018 01:30:59 +0000 Subject: [issue33226] In some envrionment using unicode, formatwarning shows ascii error In-Reply-To: <1522884667.65.0.682650639539.issue33226@psf.upfronthosting.co.za> Message-ID: <1522891859.06.0.682650639539.issue33226@psf.upfronthosting.co.za> Change by Seyeong Kim : ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 23:04:54 2018 From: report at bugs.python.org (Lisa Roach) Date: Thu, 05 Apr 2018 03:04:54 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1522897494.45.0.682650639539.issue33184@psf.upfronthosting.co.za> Lisa Roach added the comment: I'd like to help out with this, I see Christian is already providing a lot of compatibility for the latest versions of OpenSSL. What needs to be done for the update? ---------- nosy: +lisroach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 4 23:08:06 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 05 Apr 2018 03:08:06 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1522897686.38.0.682650639539.issue33184@psf.upfronthosting.co.za> Ned Deily added the comment: Lisa, thanks for the offer but there's nothing much to be done. It's just a reminder to Steve Dower for the Windows installer and to me for the macOS installer to update the respective installer build automation prior to the next releases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 00:47:10 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 05 Apr 2018 04:47:10 +0000 Subject: [issue33208] Lib2to3 grammar.txt error In-Reply-To: <1522707641.37.0.467229070634.issue33208@psf.upfronthosting.co.za> Message-ID: <1522903630.91.0.682650639539.issue33208@psf.upfronthosting.co.za> Benjamin Peterson added the comment: If it's the same problem, we don't need another issue open. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Can't use lib2to3 with embeddable zip file. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 01:01:18 2018 From: report at bugs.python.org (Nitish) Date: Thu, 05 Apr 2018 05:01:18 +0000 Subject: [issue33223] test_posix fails ERRNO 0 In-Reply-To: <1522851219.93.0.682650639539.issue33223@psf.upfronthosting.co.za> Message-ID: <1522904478.68.0.682650639539.issue33223@psf.upfronthosting.co.za> Change by Nitish : ---------- nosy: +nitishch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 02:25:43 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 06:25:43 +0000 Subject: [issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff In-Reply-To: <1522855104.15.0.682650639539.issue33224@psf.upfronthosting.co.za> Message-ID: <1522909543.66.0.682650639539.issue33224@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 02:26:53 2018 From: report at bugs.python.org (Oz Tiram) Date: Thu, 05 Apr 2018 06:26:53 +0000 Subject: [issue33227] Cmd do_something only accepts one argument Message-ID: <1522909613.34.0.682650639539.issue33227@psf.upfronthosting.co.za> New submission from Oz Tiram : Considering that I want to build an CLI interactive program using cmd.Cmd, which has multiple functions that accept two or more arguments, I always have to do parsing of arg inside my do_methods for example: class Calc(cmd.Cmd): do_add(self, arg): a, b = parse_ints(arg) return a+b do_mult(self, arg): a, b = parse_ints(arg) return a*b This is easy enough for a simple calculator. But for more logic I need to create more parse_type and explicitly call them at the top of each do_stuff. Considering this I have created a patch for Cmd.cmd, that keeps the old functionality, but adds the ability to pass multiple arguments without having to parse them every time. The functionality is as follows: class MyProg(cmd.Cmd): do_simple(self, arg): print(arg) do_greet(self, name="World") print("Hello %s" %s) do_add(self, a, b): print(a+b) Now in the cmd prompt: (Cmd) simple foo foo (Cmd) # keeps the old functionallity (Cmd) add 2 3 5 # add two properly add the values (Cmd) add 2 # expects two arguments, so it will print the help for add (Cmd) greet Hello World # does not complain because it has a default value (Cmd) greet Guido Hello Guido (Cmd) greet name=Raymond Hello Raymond # works too None of these example guess the type. It is simply handles as a string. but I am playing around with automatically detecting types of variables using function annotations in python 3.5 and later. Also, although, not demonstrated here, one can also define: def do_some_method_with_kwargs(self, arg1, arg2, **kwargs): ... do fancy stuff ... (Cmd) some_method_with_kwargs foo bar kwargs='{"name": "John", "age"=35}' kwargs is parsed to a dict (using json.loads) when escaped properly. This is a bit esoteric, hence not shown here (but the patch patch includes it). I was wondering if this kind of enhancement would be considered for this module? I will happily create a PR with tests and documentation explaining this enhanced functionality. ---------- files: cmd.patch keywords: patch messages: 314968 nosy: Oz.Tiram priority: normal severity: normal status: open title: Cmd do_something only accepts one argument Added file: https://bugs.python.org/file47520/cmd.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 02:59:07 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 06:59:07 +0000 Subject: [issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff In-Reply-To: <1522855104.15.0.682650639539.issue33224@psf.upfronthosting.co.za> Message-ID: <1522911547.63.0.682650639539.issue33224@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +6091 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 03:02:07 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 07:02:07 +0000 Subject: [issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff In-Reply-To: <1522855104.15.0.682650639539.issue33224@psf.upfronthosting.co.za> Message-ID: <1522911727.05.0.682650639539.issue33224@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- versions: +Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 03:03:12 2018 From: report at bugs.python.org (Oz Tiram) Date: Thu, 05 Apr 2018 07:03:12 +0000 Subject: [issue33227] Cmd do_something only accepts one argument In-Reply-To: <1522909613.34.0.682650639539.issue33227@psf.upfronthosting.co.za> Message-ID: <1522911792.14.0.682650639539.issue33227@psf.upfronthosting.co.za> Change by Oz Tiram : ---------- components: +Library (Lib) type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 03:22:29 2018 From: report at bugs.python.org (Nitish) Date: Thu, 05 Apr 2018 07:22:29 +0000 Subject: [issue33222] Various test failures if PYTHONUSERBASE is not canonicalized In-Reply-To: <1522850404.57.0.682650639539.issue33222@psf.upfronthosting.co.za> Message-ID: <1522912949.1.0.682650639539.issue33222@psf.upfronthosting.co.za> Change by Nitish : ---------- nosy: +nitishch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 03:22:57 2018 From: report at bugs.python.org (Nitish) Date: Thu, 05 Apr 2018 07:22:57 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1522912977.49.0.682650639539.issue33211@psf.upfronthosting.co.za> Change by Nitish : ---------- nosy: +nitishch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 03:49:41 2018 From: report at bugs.python.org (INADA Naoki) Date: Thu, 05 Apr 2018 07:49:41 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. In-Reply-To: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> Message-ID: <1522914581.32.0.682650639539.issue33195@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- pull_requests: +6092 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 04:50:52 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Thu, 05 Apr 2018 08:50:52 +0000 Subject: [issue33228] Use Random.choices in tempfile Message-ID: <1522918252.74.0.682650639539.issue33228@psf.upfronthosting.co.za> New submission from Wolfgang Maier : A rather trivial change: tempfile._RandomNameSequence could make use of random.Random.choices introduced in 3.6. IMO, the suggested change would give clearer and also faster code. It also updates the docstring of the class, which currently talks about a six-character string, when an eight-character string gets returned. ---------- messages: 314969 nosy: wolma priority: normal severity: normal status: open title: Use Random.choices in tempfile type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 04:53:02 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Thu, 05 Apr 2018 08:53:02 +0000 Subject: [issue33228] Use Random.choices in tempfile In-Reply-To: <1522918252.74.0.682650639539.issue33228@psf.upfronthosting.co.za> Message-ID: <1522918382.88.0.682650639539.issue33228@psf.upfronthosting.co.za> Change by Wolfgang Maier : ---------- keywords: +patch pull_requests: +6093 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 05:07:50 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 05 Apr 2018 09:07:50 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1522919270.67.0.682650639539.issue33211@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- nosy: +levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 05:08:37 2018 From: report at bugs.python.org (Mikhail Zakharov) Date: Thu, 05 Apr 2018 09:08:37 +0000 Subject: =?utf-8?q?=5Bissue33229=5D_Documentation_-__io_=E2=80=94_Core_tools_for_w?= =?utf-8?q?orking_with_streams_-_seek=28=29?= Message-ID: <1522919317.94.0.682650639539.issue33229@psf.upfronthosting.co.za> New submission from Mikhail Zakharov : Documentation for io.IOBase class and it's seek() method at https://docs.python.org/3/library/io.html mentions SEEK_* constants like: " SEEK_SET or 0 ? start of the stream (the default); offset should be zero or positive SEEK_CUR or 1 ? current stream position; offset may be negative SEEK_END or 2 ? end of the stream; offset is usually negative " It seems, they actually should be used as os.SEEK_SET, os.SEEK_CUR and os.SEEK_END. ---------- assignee: docs at python components: Documentation messages: 314970 nosy: Mikhail Zakharov, docs at python priority: normal severity: normal status: open title: Documentation - io ? Core tools for working with streams - seek() 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 Thu Apr 5 05:08:51 2018 From: report at bugs.python.org (INADA Naoki) Date: Thu, 05 Apr 2018 09:08:51 +0000 Subject: [issue33195] PyArg_Parse* should deprecate 'u' and 'z' family. In-Reply-To: <1522560373.89.0.467229070634.issue33195@psf.upfronthosting.co.za> Message-ID: <1522919331.3.0.682650639539.issue33195@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 29bc6f6347b1e05b22180fd296013bb2a104d589 by INADA Naoki in branch '3.6': bpo-33195: Doc: Deprecate Py_UNICODE in c-api/arg (GH-6329) https://github.com/python/cpython/commit/29bc6f6347b1e05b22180fd296013bb2a104d589 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 05:16:06 2018 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 05 Apr 2018 09:16:06 +0000 Subject: [issue15257] Misc/.gdbinit:pystack is too brittle In-Reply-To: <1341528030.36.0.158267038298.issue15257@psf.upfronthosting.co.za> Message-ID: <1522919766.3.0.682650639539.issue15257@psf.upfronthosting.co.za> Skip Montanaro added the comment: I would prefer if these macros remain standalone (and thus fragile). Despite Python support in gdb, not everyone (more than five years after the bug report) don't use a gdb which was built --with-python. There is better support for gdb integration elsewhere in the CPython code base: Tools/gdb/libpython.py. ---------- nosy: +skip.montanaro resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 05:35:11 2018 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 05 Apr 2018 09:35:11 +0000 Subject: [issue15817] Misc/gdbinit: Expose command documentation to gdb help In-Reply-To: <1346283185.13.0.0954859318202.issue15817@psf.upfronthosting.co.za> Message-ID: <1522920911.16.0.682650639539.issue15817@psf.upfronthosting.co.za> Change by Skip Montanaro : ---------- pull_requests: +6094 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 05:42:11 2018 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 05 Apr 2018 09:42:11 +0000 Subject: [issue15817] Misc/gdbinit: Expose command documentation to gdb help In-Reply-To: <1346283185.13.0.0954859318202.issue15817@psf.upfronthosting.co.za> Message-ID: <1522921331.53.0.682650639539.issue15817@psf.upfronthosting.co.za> Skip Montanaro added the comment: This looks good to me. I added a pull request with a couple minor tweaks. Unfortunately, I can't tell how to add a "skip news" label. This doesn't seem "big" enough to warrant it. ---------- nosy: +skip.montanaro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 05:45:13 2018 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 05 Apr 2018 09:45:13 +0000 Subject: [issue15817] Misc/gdbinit: Expose command documentation to gdb help In-Reply-To: <1346283185.13.0.0954859318202.issue15817@psf.upfronthosting.co.za> Message-ID: <1522921513.0.0.682650639539.issue15817@psf.upfronthosting.co.za> Change by Skip Montanaro : ---------- versions: +Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 06:01:15 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 05 Apr 2018 10:01:15 +0000 Subject: [issue33228] Use Random.choices in tempfile In-Reply-To: <1522918252.74.0.682650639539.issue33228@psf.upfronthosting.co.za> Message-ID: <1522922475.12.0.682650639539.issue33228@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See issue24567. It affects Random.choices(), but not Random.choice() because the latter uses getrandbits(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 06:18:33 2018 From: report at bugs.python.org (INADA Naoki) Date: Thu, 05 Apr 2018 10:18:33 +0000 Subject: [issue33228] Use Random.choices in tempfile In-Reply-To: <1522918252.74.0.682650639539.issue33228@psf.upfronthosting.co.za> Message-ID: <1522923513.77.0.682650639539.issue33228@psf.upfronthosting.co.za> INADA Naoki added the comment: @wolma Would you split your PR? One for fix docstring and one for using Random.choices. Since former is document bug, I want to backport it. (while _RandomNameSequence is private) ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 06:19:14 2018 From: report at bugs.python.org (Hubert Holin) Date: Thu, 05 Apr 2018 10:19:14 +0000 Subject: [issue33230] _decimal build failure (unsupported platform for that module) - evolution possible? Message-ID: <1522923554.41.0.682650639539.issue33230@psf.upfronthosting.co.za> New submission from Hubert Holin : _decimal fails to build on my platform due to lack of support: In file included from /Developer/Python/3.6/Python/Python-3.6.5/Modules/_decimal/_decimal.c:34: /usr/local/include/mpdecimal.h:201:4: error: "unsupported platform: need mpd_size_t == mpd_uint_t" #error "unsupported platform: need mpd_size_t == mpd_uint_t" My host system type: x86_64-apple-darwin17.5.0 My target system type: x86_64-apple-darwin17.5.0 Compiler used: clang+llvm-6.0.0-x86_64-apple-darwin Hardware: 3,7 GHz Quad-Core Intel Xeon E5 Relevant configurations: --enable-universalsdk... /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk --with-universal-archs... intel MACHDEP... darwin Could this module be upgraded? ---------- components: Extension Modules messages: 314976 nosy: Hubert Holin priority: normal severity: normal status: open title: _decimal build failure (unsupported platform for that module) - evolution possible? type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 07:11:02 2018 From: report at bugs.python.org (INADA Naoki) Date: Thu, 05 Apr 2018 11:11:02 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1522926662.03.0.682650639539.issue33205@psf.upfronthosting.co.za> INADA Naoki added the comment: @Mark.Shannon, @rhettinger How do you think this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 07:45:01 2018 From: report at bugs.python.org (Stefan Krah) Date: Thu, 05 Apr 2018 11:45:01 +0000 Subject: [issue33230] _decimal build failure (unsupported platform for that module) - evolution possible? In-Reply-To: <1522923554.41.0.682650639539.issue33230@psf.upfronthosting.co.za> Message-ID: <1522928701.91.0.682650639539.issue33230@psf.upfronthosting.co.za> Stefan Krah added the comment: I don't have OS X. However, this is the first time in 6 years that anyone has reported an OS X build failure. Perhaps Ned knows the answer. ---------- nosy: +ned.deily, skrah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 07:47:19 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Thu, 05 Apr 2018 11:47:19 +0000 Subject: [issue33228] Use Random.choices in tempfile In-Reply-To: <1522918252.74.0.682650639539.issue33228@psf.upfronthosting.co.za> Message-ID: <1522928839.48.0.682650639539.issue33228@psf.upfronthosting.co.za> Wolfgang Maier added the comment: @serhiy as I understand issue 33228, the double rounding problem potentially causing an IndexError can only affect choices() if the len of the sequence to choose from is greater than 2049, but the string in question here is only 37 characters long. Alternatively, choices may fail with certain weights (https://bugs.python.org/msg275594), but _RandomNameSequence is not using weights. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 07:48:27 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Thu, 05 Apr 2018 11:48:27 +0000 Subject: [issue33228] Use Random.choices in tempfile In-Reply-To: <1522918252.74.0.682650639539.issue33228@psf.upfronthosting.co.za> Message-ID: <1522928907.53.0.682650639539.issue33228@psf.upfronthosting.co.za> Wolfgang Maier added the comment: sorry, should have been issue 24567, of course. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 07:56:46 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Thu, 05 Apr 2018 11:56:46 +0000 Subject: [issue33228] Use Random.choices in tempfile In-Reply-To: <1522918252.74.0.682650639539.issue33228@psf.upfronthosting.co.za> Message-ID: <1522929406.54.0.682650639539.issue33228@psf.upfronthosting.co.za> Wolfgang Maier added the comment: Actually, in Python2.7 random.choice is implemented with the same susceptibility to the rounding bug as Python3's choices, still nobody ever reported a tempfile IndexError problem (I guess). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 08:34:19 2018 From: report at bugs.python.org (INADA Naoki) Date: Thu, 05 Apr 2018 12:34:19 +0000 Subject: [issue33231] Potential memory leak in normalizestring() Message-ID: <1522931659.19.0.682650639539.issue33231@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- components: Interpreter Core nosy: inada.naoki priority: normal severity: normal status: open title: Potential memory leak in normalizestring() type: resource usage versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 09:21:58 2018 From: report at bugs.python.org (INADA Naoki) Date: Thu, 05 Apr 2018 13:21:58 +0000 Subject: [issue33231] Potential memory leak in normalizestring() Message-ID: <1522934518.33.0.682650639539.issue33231@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- keywords: +patch pull_requests: +6095 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 09:41:06 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 05 Apr 2018 13:41:06 +0000 Subject: =?utf-8?q?=5Bissue33229=5D_Documentation_-__io_=E2=80=94_Core_tools_for_w?= =?utf-8?q?orking_with_streams_-_seek=28=29?= In-Reply-To: <1522919317.94.0.682650639539.issue33229@psf.upfronthosting.co.za> Message-ID: <1522935666.96.0.682650639539.issue33229@psf.upfronthosting.co.za> Josh Rosenberg added the comment: As indicated in the seek docs ( https://docs.python.org/3/library/io.html#io.IOBase.seek ), all three names were added to the io module in 3.1: > New in version 3.1: The SEEK_* constants. Since they're part of the io module too, there is no need to qualify them on the io module docs page. They're available in os as well, but you don't need to import it to use them. The OS specific addition position flags are explicitly documented to be found on the os module. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 09:53:19 2018 From: report at bugs.python.org (=?utf-8?q?Olivier_Ch=C3=A9dru?=) Date: Thu, 05 Apr 2018 13:53:19 +0000 Subject: [issue6721] Locks in the standard library should be sanitized on fork In-Reply-To: <1250550378.97.0.072881968798.issue6721@psf.upfronthosting.co.za> Message-ID: <1522936399.73.0.682650639539.issue6721@psf.upfronthosting.co.za> Olivier Ch?dru added the comment: FWIW, I encountered the same kind of issue when using the mkstemp() function: under the hood, it calls gettempdir() and this one is protected by a lock too. Current thread 0x00007ff10231f700 (most recent call first): File "/usr/lib/python3.5/tempfile.py", line 432 in gettempdir File "/usr/lib/python3.5/tempfile.py", line 269 in _sanitize_params File "/usr/lib/python3.5/tempfile.py", line 474 in mkstemp ---------- nosy: +ochedru _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 10:01:46 2018 From: report at bugs.python.org (Mikhail Zakharov) Date: Thu, 05 Apr 2018 14:01:46 +0000 Subject: =?utf-8?q?=5Bissue33229=5D_Documentation_-__io_=E2=80=94_Core_tools_for_w?= =?utf-8?q?orking_with_streams_-_seek=28=29?= In-Reply-To: <1522919317.94.0.682650639539.issue33229@psf.upfronthosting.co.za> Message-ID: <1522936906.77.0.682650639539.issue33229@psf.upfronthosting.co.za> Mikhail Zakharov added the comment: Seems in my, quite old 3.4.5 version, it doesn't work: $ python3 Python 3.4.5 (default, Jun 1 2017, 13:52:39) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> f = open('/tmp/text.txt', 'r') >>> f.seek(0, SEEK_END) Traceback (most recent call last): File "", line 1, in NameError: name 'SEEK_END' is not defined >>> f.close() >>> >>> import os >>> f = open('/tmp/text.txt', 'r') >>> f.seek(0, os.SEEK_END) 214 >>> f.close() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 10:11:54 2018 From: report at bugs.python.org (Mikhail Zakharov) Date: Thu, 05 Apr 2018 14:11:54 +0000 Subject: =?utf-8?q?=5Bissue33229=5D_Documentation_-__io_=E2=80=94_Core_tools_for_w?= =?utf-8?q?orking_with_streams_-_seek=28=29?= In-Reply-To: <1522919317.94.0.682650639539.issue33229@psf.upfronthosting.co.za> Message-ID: <1522937514.08.0.682650639539.issue33229@psf.upfronthosting.co.za> Mikhail Zakharov added the comment: OK, I got it. Sorry for disturbing you. The should be called like: io.SEEK_* ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 10:15:19 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 05 Apr 2018 14:15:19 +0000 Subject: [issue33231] Potential memory leak in normalizestring() Message-ID: <1522937719.12.0.682650639539.issue33231@psf.upfronthosting.co.za> New submission from Josh Rosenberg : Patch is good, but while we're at it, is there any reason why this multi-allocation design was even used? It PyMem_Mallocs a buffer, makes a C-style string in it, then uses PyUnicode_FromString to convert C-style string to Python str. Seems like the correct approach would be to just use PyUnicode_New to preallocate the final string buffer up front, then pull out the internal buffer with PyUnicode_1BYTE_DATA and populate that directly, saving a pointless allocation/deallocation, which also means the failure case means no cleanup needed at all, while barely changing the code (aside from removing the need to explicitly NUL terminate). Only reason I can see to avoid this would be if the codec names could contain arbitrary Unicode encoded as UTF-8 (and therefore strlen wouldn't tell you the final length in Unicode ordinals), but I'm pretty sure that's not the case (if it is, we're not normalizing properly, since we only lower case ASCII). If Unicode codec names need to be handled, there are other options, though the easy savings go away. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 10:49:04 2018 From: report at bugs.python.org (Alexander Sturm) Date: Thu, 05 Apr 2018 14:49:04 +0000 Subject: [issue33232] Segmentation fault in operator.attrgetter Message-ID: <1522939744.33.0.682650639539.issue33232@psf.upfronthosting.co.za> New submission from Alexander Sturm : This issue can be reproduced using Python 3.5.2 - 3.5.5 compiled with VS2015 (tested both the official Python builds as well as local builds using VS2015 Version 14.0.25431.01 Update 3) on 64-bit Windows. To reproduce, run the attached file (or python -c "import operator; operator.attrgetter('x'*1000000)"). The segfault itself occurs in attrgetter_new [1], while scanning for dots inside a unicode string. From my reading of the code, the code itself is actually correct - instead, it triggers a compiler bug in VS2015, which causes it to miscompile the code by applying an incorrect optimization. The optimization VS2015 applies is twofold: It uses SIMD instructions to avoid looking at every byte of the input string individually, and it tries to eliminate the condition in PyUnicode_READ [2] by executing all three branches (UCS1, UCS2 and UCS4) at once and then in a separate step discarding the results for the two branches that would not be taken. When combining these optimizations, the generated code incorrectly only checks the precondition of the UCS1 branch to decide whether it can use the optimized SIMD version. Since the UCS1 branch looks at 8 bytes of the buffer in each iteration, it checks whether the buffer contains at least 8 bytes. However, each iteration of the UCS2/UCS4 branches look at 16/32 bytes, respectively. As a result, when passing a UCS1 string to attrgetter(), we end up reading 24 bytes past the end of the buffer for every 8 bytes the string contains. In the reproduction example, we thus read about 24 MB past the buffer, almost guaranteeing a crash. The issue does not occur when compiling Python using VS2017 (i.e. PlatformToolset v141, MSVC version 14.13.26128). Presumably this means the compiler bug has been fixed upstream. [1]: https://github.com/python/cpython/blob/v3.5.5/Modules/_operator.c#L587 [2]: https://github.com/python/cpython/blob/v3.5.5/Include/unicodeobject.h#L521 ---------- components: Interpreter Core files: repro.py messages: 314987 nosy: asturm priority: normal severity: normal status: open title: Segmentation fault in operator.attrgetter versions: Python 3.5 Added file: https://bugs.python.org/file47521/repro.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 10:50:12 2018 From: report at bugs.python.org (Alexander Sturm) Date: Thu, 05 Apr 2018 14:50:12 +0000 Subject: [issue33232] Segmentation fault in operator.attrgetter In-Reply-To: <1522939744.33.0.682650639539.issue33232@psf.upfronthosting.co.za> Message-ID: <1522939812.26.0.682650639539.issue33232@psf.upfronthosting.co.za> Change by Alexander Sturm : Added file: https://bugs.python.org/file47522/annotated_dissasembly.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 11:02:24 2018 From: report at bugs.python.org (Zachary Ware) Date: Thu, 05 Apr 2018 15:02:24 +0000 Subject: [issue33232] Segmentation fault in operator.attrgetter In-Reply-To: <1522939744.33.0.682650639539.issue33232@psf.upfronthosting.co.za> Message-ID: <1522940544.09.0.682650639539.issue33232@psf.upfronthosting.co.za> Zachary Ware added the comment: Python 3.5 is in security-fix-only mode now, which means we won't be releasing any more binaries for it, and thus can't really do much about this other than possibly recommending that Windows users build with VS2017 instead of VS2015 in future 3.5 release notes. I believe Python 3.6+ are already built with VS2017, but can you reproduce this in Python 3.6.5? ---------- components: +Build, Windows nosy: +larry, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 11:10:58 2018 From: report at bugs.python.org (Alexander Sturm) Date: Thu, 05 Apr 2018 15:10:58 +0000 Subject: [issue33232] Segmentation fault in operator.attrgetter In-Reply-To: <1522939744.33.0.682650639539.issue33232@psf.upfronthosting.co.za> Message-ID: <1522941058.91.0.682650639539.issue33232@psf.upfronthosting.co.za> Alexander Sturm added the comment: As mentioned, the code is compiled correctly by VS2017 - both in 3.5.5 and 3.6.5. So I cannot reproduce the issue with Python 3.6.5. Would it be possible to switch the default platform toolset used to compile Python 3.5 in the next source release to v141? According to Microsoft, it should be ABI compatible with v140: https://blogs.msdn.microsoft.com/vcblog/2017/03/07/binary-compatibility-and-pain-free-upgrade-why-moving-to-visual-studio-2017-is-almost-too-easy/ If that's out of the question, I agree that there's probably not much that can be done here - other then maybe locally disabling optimizations for that loop. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 11:19:54 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 15:19:54 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522941594.01.0.682650639539.issue33203@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 091e95e9004b794280ab35becec2c3e30dd5e96e by Raymond Hettinger (Wolfgang Maier) in branch 'master': bpo-33203: Ensure random.choice always raises IndexError on empty sequence (GH-6338) https://github.com/python/cpython/commit/091e95e9004b794280ab35becec2c3e30dd5e96e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 11:20:19 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Apr 2018 15:20:19 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522941619.11.0.682650639539.issue33203@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6096 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 11:20:53 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Apr 2018 15:20:53 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522941653.84.0.682650639539.issue33203@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6097 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 12:02:14 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 16:02:14 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522944134.77.0.682650639539.issue33203@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset baf304e82e1b54dbeee6b78ddf168e33ed8d557a by Raymond Hettinger (Miss Islington (bot)) in branch '3.7': bpo-33203: Ensure random.choice always raises IndexError on empty sequence (GH-6338) (GH-6387) https://github.com/python/cpython/commit/baf304e82e1b54dbeee6b78ddf168e33ed8d557a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 12:24:29 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 16:24:29 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522945469.58.0.682650639539.issue33203@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset e25af930a300c01aa043745058a8c7f6c32d89ae by Raymond Hettinger (Miss Islington (bot)) in branch '3.6': bpo-33203: Ensure random.choice always raises IndexError on empty sequence (GH-6338) (GH-6388) https://github.com/python/cpython/commit/e25af930a300c01aa043745058a8c7f6c32d89ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 12:24:54 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 16:24:54 +0000 Subject: [issue33203] random.choice: raise IndexError on empty sequence even when not using getrandbits internally In-Reply-To: <1522613050.8.0.467229070634.issue33203@psf.upfronthosting.co.za> Message-ID: <1522945494.01.0.682650639539.issue33203@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 12:32:04 2018 From: report at bugs.python.org (Ethan Furman) Date: Thu, 05 Apr 2018 16:32:04 +0000 Subject: [issue33219] x in IntFlag should test raise TypeError if x is not an IntFlag In-Reply-To: <1522787900.11.0.467229070634.issue33219@psf.upfronthosting.co.za> Message-ID: <1522945924.92.0.682650639539.issue33219@psf.upfronthosting.co.za> Ethan Furman added the comment: issue33217 is tracking member-containment checks; modifying this one to track class-containment checks. Given class Color(Enum): RED = 1 class Fruit(Enum): APPLE = 1 then --> Fruit.APPLE in Color False --> Fruit.APPLE in Fruit True --> 1 in Fruit TypeError The last is currently returning False instead of raising a TypeError. ---------- stage: -> needs patch title: x in IntFlag() should test int x's inclusion in IntFlag -> x in IntFlag should test raise TypeError if x is not an IntFlag type: enhancement -> behavior versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 12:41:07 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 16:41:07 +0000 Subject: [issue33228] Use Random.choices in tempfile In-Reply-To: <1522918252.74.0.682650639539.issue33228@psf.upfronthosting.co.za> Message-ID: <1522946467.77.0.682650639539.issue33228@psf.upfronthosting.co.za> Raymond Hettinger added the comment: -0 on making anything other than the doc change. For the most part, we avoid sweeping through the standard library to substitute-in new features and instead have a preference for code stability rather than code churn. FWIW, the main rationale for introducing choices() was to support weighting. Existing code that calls choice() multiple times is still correct and clear. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 13:23:18 2018 From: report at bugs.python.org (Zachary Ware) Date: Thu, 05 Apr 2018 17:23:18 +0000 Subject: [issue32823] Regression in test -j behavior and time in 3.7.0b1 In-Reply-To: <1518391854.25.0.467229070634.issue32823@psf.upfronthosting.co.za> Message-ID: <1522948997.99.0.682650639539.issue32823@psf.upfronthosting.co.za> Zachary Ware added the comment: I can't reproduce this. Even running `python -m test -j14` on a machine with 2 vCPUs, I get my first results at 2s, and even test___all__ passes in only 6 (though on my first run, with -j0 (== -j4), test___all__ took 41s but other results came in first). Same results with Debug and Release Win32 builds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 13:34:46 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 05 Apr 2018 17:34:46 +0000 Subject: [issue15817] Misc/gdbinit: Expose command documentation to gdb help In-Reply-To: <1346283185.13.0.0954859318202.issue15817@psf.upfronthosting.co.za> Message-ID: <1522949686.79.0.682650639539.issue15817@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 7286dbd8b20bd0a26fabe1a07ff368082a9c5ed6 by Ned Deily (Skip Montanaro) in branch 'master': bpo-15817: Expose command documentation to gdb help (GH-6384) https://github.com/python/cpython/commit/7286dbd8b20bd0a26fabe1a07ff368082a9c5ed6 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 13:35:47 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 05 Apr 2018 17:35:47 +0000 Subject: [issue15817] Misc/gdbinit: Expose command documentation to gdb help In-Reply-To: <1346283185.13.0.0954859318202.issue15817@psf.upfronthosting.co.za> Message-ID: <1522949747.53.0.682650639539.issue15817@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks everyone! ---------- assignee: dmalcolm -> resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 13:55:29 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 05 Apr 2018 17:55:29 +0000 Subject: [issue33230] _decimal build failure (unsupported platform for that module) - evolution possible? In-Reply-To: <1522923554.41.0.682650639539.issue33230@psf.upfronthosting.co.za> Message-ID: <1522950929.55.0.682650639539.issue33230@psf.upfronthosting.co.za> Ned Deily added the comment: > However, this is the first time in 6 years that anyone has reported an OS X build failure. Yes, I've never seen one before, either. But I think the culprit is pointed to in the error message. It looks like you have another version of mpdecimal in /usr/local/. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 14:19:59 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 18:19:59 +0000 Subject: [issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff In-Reply-To: <1522855104.15.0.682650639539.issue33224@psf.upfronthosting.co.za> Message-ID: <1522952399.97.0.682650639539.issue33224@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 01b731fc2b04744a11e32f93aba8bfb9ddb3dd29 by Raymond Hettinger in branch 'master': bpo-33224: PEP 479 fix for difflib.mdiff() (GH-6381) https://github.com/python/cpython/commit/01b731fc2b04744a11e32f93aba8bfb9ddb3dd29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 14:21:25 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Apr 2018 18:21:25 +0000 Subject: [issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff In-Reply-To: <1522855104.15.0.682650639539.issue33224@psf.upfronthosting.co.za> Message-ID: <1522952485.54.0.682650639539.issue33224@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6098 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 14:22:10 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Apr 2018 18:22:10 +0000 Subject: [issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff In-Reply-To: <1522855104.15.0.682650639539.issue33224@psf.upfronthosting.co.za> Message-ID: <1522952530.48.0.682650639539.issue33224@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6099 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 14:30:40 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 05 Apr 2018 18:30:40 +0000 Subject: [issue33227] Cmd do_something only accepts one argument In-Reply-To: <1522909613.34.0.682650639539.issue33227@psf.upfronthosting.co.za> Message-ID: <1522953040.19.0.682650639539.issue33227@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for your suggested enhancement to the cmd module. cmd has been around a *long* time and, unfortunately, has received very little maintenance or enhancement attention for many years. In the meantime, third-party replacements for cmd have arisen. One of the most popular is cmd2, available from PyPI, which has also been around a long time and appears to be actively maintained. In particular, it looks like cmd2 already offers robust parsing of arguments. While enhancing the standard library cmd module sounds like it might be a good idea, in this particular case, you and other potential users of cmd might be better off using cmd2. In any case, unless a core developer is interested in shepherding this change, your proposed change is likely to languish. https://pypi.org/project/cmd2/ https://cmd2.readthedocs.io/en/latest/argument_processing.html ---------- nosy: +ned.deily versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 14:45:36 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 18:45:36 +0000 Subject: [issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff In-Reply-To: <1522855104.15.0.682650639539.issue33224@psf.upfronthosting.co.za> Message-ID: <1522953936.04.0.682650639539.issue33224@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 28c179094bcb7829d184fb3cfb3ef626505b9f77 by Raymond Hettinger (Miss Islington (bot)) in branch '3.7': bpo-33224: PEP 479 fix for difflib.mdiff() (GH-6381) (GH-6390) https://github.com/python/cpython/commit/28c179094bcb7829d184fb3cfb3ef626505b9f77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 14:51:29 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 05 Apr 2018 18:51:29 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd Message-ID: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> New submission from Ned Deily : The cmd module in the standard library has languished for many years. In the mean time, third-party replacements for it have arisen. Perhaps the most popular is cmd2 which seems to be actively maintained, provides upward compatibility from cmd along with many desirable new features, and is permissively licensed. I suggest we consider at a minimum adding a "See also:" note referencing cmd2 to the cmd documentation in the Standard Library document, similar to what we do for the third-party "requests" module in the "urllib.request" documentation. We could be even bolder and officially deprecate "cmd" and consider closing open enhancement issues for it on b.p.o. https://pypi.org/project/cmd2/ https://cmd2.readthedocs.io/ ---------- assignee: docs at python components: Documentation messages: 315002 nosy: Catherine.Devlin, docs at python, lukasz.langa, ned.deily priority: normal severity: normal status: open title: Suggest third-party cmd2 module as alternative to cmd versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 15:18:04 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 19:18:04 +0000 Subject: [issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff In-Reply-To: <1522855104.15.0.682650639539.issue33224@psf.upfronthosting.co.za> Message-ID: <1522955884.45.0.682650639539.issue33224@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset 8da15f09458fd4f4fe341861e41723892b25a11b by Raymond Hettinger (Miss Islington (bot)) in branch '3.6': bpo-33224: PEP 479 fix for difflib.mdiff() (GH-6381) (GH-6391) https://github.com/python/cpython/commit/8da15f09458fd4f4fe341861e41723892b25a11b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 15:23:50 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 19:23:50 +0000 Subject: [issue33224] "RuntimeError: generator raised StopIteration" in difflib.mdiff In-Reply-To: <1522855104.15.0.682650639539.issue33224@psf.upfronthosting.co.za> Message-ID: <1522956230.59.0.682650639539.issue33224@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Thanks for timely report. I appreciate you exercising the beta release to shake out bugs. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 15:40:33 2018 From: report at bugs.python.org (Skip Montanaro) Date: Thu, 05 Apr 2018 19:40:33 +0000 Subject: [issue27805] io.open('/dev/stdout', 'a') raises OSError with errno=ESPIPE In-Reply-To: <1471637472.92.0.246311076418.issue27805@psf.upfronthosting.co.za> Message-ID: <1522957233.46.0.682650639539.issue27805@psf.upfronthosting.co.za> Skip Montanaro added the comment: I was bitten by this porting a system from Python 2.7 to 3.6. "/dev/stderr" is a very nice default for logfiles. Users will frequently override the default, so you really want to open the logfile in append mode. Having to jump through hoops to avoid blasting a user's logfile is kinda dumb, and as others have pointed out, error-prone. os.open works just fine with O_WRONLY|O_APPEND as the flags. /dev/null can be opened in append mode, but not /dev/stderr or /dev/stdout. ---------- nosy: +skip.montanaro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 16:46:31 2018 From: report at bugs.python.org (Ethan Furman) Date: Thu, 05 Apr 2018 20:46:31 +0000 Subject: [issue33217] x in enum.Flag member is True when x is not a Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1522961191.82.0.682650639539.issue33217@psf.upfronthosting.co.za> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +6100 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 17:45:23 2018 From: report at bugs.python.org (Ray Donnelly) Date: Thu, 05 Apr 2018 21:45:23 +0000 Subject: [issue33232] Segmentation fault in operator.attrgetter In-Reply-To: <1522939744.33.0.682650639539.issue33232@psf.upfronthosting.co.za> Message-ID: <1522964723.41.0.682650639539.issue33232@psf.upfronthosting.co.za> Change by Ray Donnelly : ---------- nosy: +Ray Donnelly _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 17:46:53 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 21:46:53 +0000 Subject: [issue33234] Improve list() pre-sizing for inputs with known lengths Message-ID: <1522964813.15.0.682650639539.issue33234@psf.upfronthosting.co.za> New submission from Raymond Hettinger : The list() constructor isn't taking full advantage of known input lengths or length hints. Ideally, it should pre-size and not over-allocate when the input size is known or can be reasonably estimated. Python 3.8.0a0 (heads/master:091e95e900, Apr 5 2018, 09:48:33) [Clang 9.1.0 (clang-902.0.39.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from sys import getsizeof >>> getsizeof([0] * 10) 144 >>> getsizeof(list([0] * 10)) 200 >>> getsizeof(list(range(10))) 200 ---------- components: Interpreter Core messages: 315006 nosy: rhettinger priority: normal severity: normal status: open title: Improve list() pre-sizing for inputs with known lengths type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 18:30:25 2018 From: report at bugs.python.org (iunknwn) Date: Thu, 05 Apr 2018 22:30:25 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1522967425.44.0.682650639539.issue24882@psf.upfronthosting.co.za> Change by iunknwn : ---------- nosy: +iunknwn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 18:45:50 2018 From: report at bugs.python.org (iunknwn) Date: Thu, 05 Apr 2018 22:45:50 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1522968350.79.0.682650639539.issue24882@psf.upfronthosting.co.za> iunknwn added the comment: I've submitted a PR that should resolve this - it uses a simple atomic counter to ensure new threads are not created if existing threads are idle. One concern I do have - while writing the patch, I noticed the existing submit method (specifically the adjust_thread_count function) isn't thread safe. I've added more details in the PR. ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 19:08:47 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Apr 2018 23:08:47 +0000 Subject: [issue33232] Segmentation fault in operator.attrgetter In-Reply-To: <1522939744.33.0.682650639539.issue33232@psf.upfronthosting.co.za> Message-ID: <1522969726.99.0.682650639539.issue33232@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: -> larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 19:41:50 2018 From: report at bugs.python.org (Ethan Smith) Date: Thu, 05 Apr 2018 23:41:50 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1522971710.02.0.682650639539.issue33211@psf.upfronthosting.co.za> Ethan Smith added the comment: I have a branch with an implementation of my suggestion here: https://github.com/ethanhs/cpython/tree/decorlineno I was hoping to see if this was seen as a reasonable patch that might be accepted. Also, while I think it would be nice, I take it a patch for this would be unlikely to be backported, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 5 23:41:01 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 06 Apr 2018 03:41:01 +0000 Subject: [issue18875] Idle: Auto insertion of the closing parens, brackets, and braces In-Reply-To: <1377777498.6.0.468253349222.issue18875@psf.upfronthosting.co.za> Message-ID: <1522986061.95.0.682650639539.issue18875@psf.upfronthosting.co.za> Terry J. Reedy added the comment: My question about the idea is whether beginners would use this, or if it is the sort of 'expert' feature that IDLE should avoid. I may ask on python-list for more opinions. https://stackoverflow.com/questions/49677886/python-idle-symbol-completion/49684824#49684824 adds a vote in favor. It also prompted me to review the patch. Since I said, 4 years ago, that the feature should be an extension, we have converted extensions to features. So the patch needs re-writing, as I outlined. (Although there is now an extension configuration dialog, it is no longer a dependency of this issue.) I am not convinced that we need 5 configuration options, especially since I do not understand 2 of them ;-). Do symbol and quote fences need to be separately enabled? Does anyone known what other IDEs do? ---------- dependencies: -IDLE - Add an extension configuration dialog versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 02:46:10 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 06 Apr 2018 06:46:10 +0000 Subject: [issue33231] Potential memory leak in normalizestring() In-Reply-To: <1522937719.12.0.682650639539.issue33231@psf.upfronthosting.co.za> Message-ID: <1522997170.36.0.682650639539.issue33231@psf.upfronthosting.co.za> INADA Naoki added the comment: > Only reason I can see to avoid this would be if the codec names could contain arbitrary Unicode encoded as UTF-8 (and therefore strlen wouldn't tell you the final length in Unicode ordinals), but I'm pretty sure that's not the case (if it is, we're not normalizing properly, since we only lower case ASCII). If Unicode codec names need to be handled, there are other options, though the easy savings go away. Maybe, we can add "encoding name must be ascii" restriction in future version (3.8+). But for now, I want to avoid any potential backward incompatibility. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 02:51:29 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 06 Apr 2018 06:51:29 +0000 Subject: [issue33231] Potential memory leak in normalizestring() In-Reply-To: <1522937719.12.0.682650639539.issue33231@psf.upfronthosting.co.za> Message-ID: <1522997489.61.0.682650639539.issue33231@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 0c1c4563a65ac451021d927058e4f25013934eb2 by INADA Naoki in branch 'master': bpo-33231: Fix potential leak in normalizestring() (GH-6386) https://github.com/python/cpython/commit/0c1c4563a65ac451021d927058e4f25013934eb2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 02:51:48 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Apr 2018 06:51:48 +0000 Subject: [issue33231] Potential memory leak in normalizestring() In-Reply-To: <1522937719.12.0.682650639539.issue33231@psf.upfronthosting.co.za> Message-ID: <1522997508.31.0.682650639539.issue33231@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6101 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 02:52:34 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Apr 2018 06:52:34 +0000 Subject: [issue33231] Potential memory leak in normalizestring() In-Reply-To: <1522937719.12.0.682650639539.issue33231@psf.upfronthosting.co.za> Message-ID: <1522997554.06.0.682650639539.issue33231@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6102 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 03:12:40 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Apr 2018 07:12:40 +0000 Subject: [issue33231] Potential memory leak in normalizestring() In-Reply-To: <1522937719.12.0.682650639539.issue33231@psf.upfronthosting.co.za> Message-ID: <1522998760.64.0.682650639539.issue33231@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 64421d9237e33725e3c2916cdf2b6d6da1751c2a by Miss Islington (bot) in branch '3.7': bpo-33231: Fix potential leak in normalizestring() (GH-6386) https://github.com/python/cpython/commit/64421d9237e33725e3c2916cdf2b6d6da1751c2a ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 03:37:07 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Apr 2018 07:37:07 +0000 Subject: [issue33231] Potential memory leak in normalizestring() In-Reply-To: <1522937719.12.0.682650639539.issue33231@psf.upfronthosting.co.za> Message-ID: <1523000227.0.0.682650639539.issue33231@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 2350a4765265158072bf7ad9f04402406d3d1ada by Miss Islington (bot) in branch '3.6': bpo-33231: Fix potential leak in normalizestring() (GH-6386) https://github.com/python/cpython/commit/2350a4765265158072bf7ad9f04402406d3d1ada ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 03:37:29 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 06 Apr 2018 07:37:29 +0000 Subject: [issue33231] Potential memory leak in normalizestring() In-Reply-To: <1522937719.12.0.682650639539.issue33231@psf.upfronthosting.co.za> Message-ID: <1523000249.05.0.682650639539.issue33231@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 03:37:49 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 06 Apr 2018 07:37:49 +0000 Subject: [issue33231] Potential memory leak in normalizestring() In-Reply-To: <1522937719.12.0.682650639539.issue33231@psf.upfronthosting.co.za> Message-ID: <1523000269.39.0.682650639539.issue33231@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 05:38:48 2018 From: report at bugs.python.org (Alexander Harkness) Date: Fri, 06 Apr 2018 09:38:48 +0000 Subject: [issue13940] imaplib: Mailbox names are not quoted In-Reply-To: <1328357098.01.0.78801274991.issue13940@psf.upfronthosting.co.za> Message-ID: <1523007528.74.0.682650639539.issue13940@psf.upfronthosting.co.za> Change by Alexander Harkness : ---------- pull_requests: +6103 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 05:44:22 2018 From: report at bugs.python.org (Alexander Harkness) Date: Fri, 06 Apr 2018 09:44:22 +0000 Subject: [issue13940] imaplib: Mailbox names are not quoted In-Reply-To: <1328357098.01.0.78801274991.issue13940@psf.upfronthosting.co.za> Message-ID: <1523007862.84.0.682650639539.issue13940@psf.upfronthosting.co.za> Change by Alexander Harkness : ---------- nosy: +bearbin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 05:44:45 2018 From: report at bugs.python.org (Alexander Harkness) Date: Fri, 06 Apr 2018 09:44:45 +0000 Subject: [issue5305] imaplib should support international mailbox names In-Reply-To: <1234935371.11.0.35650041724.issue5305@psf.upfronthosting.co.za> Message-ID: <1523007885.19.0.682650639539.issue5305@psf.upfronthosting.co.za> Alexander Harkness added the comment: ssu ---------- nosy: +bearbin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 06:13:47 2018 From: report at bugs.python.org (Paddy McCarthy) Date: Fri, 06 Apr 2018 10:13:47 +0000 Subject: [issue33235] Better help text for dict.setdefault Message-ID: <1523009627.66.0.682650639539.issue33235@psf.upfronthosting.co.za> New submission from Paddy McCarthy : Hi, I was answering some question and used dict.setdefault as part of the solution and posted the help() on it as part of my answer. The help was this: In [15]: help(mapper.setdefault) Help on built-in function setdefault: setdefault(...) method of builtins.dict instance D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D This seems the wrong way around. Is it not better expressed as D.setdefault(k[,d]) -> set D[k]=d if k not in D and then D.get(k,d) ---------- assignee: docs at python components: Documentation messages: 315015 nosy: Paddy McCarthy, docs at python priority: normal severity: normal status: open title: Better help text for dict.setdefault type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 07:50:07 2018 From: report at bugs.python.org (Robert) Date: Fri, 06 Apr 2018 11:50:07 +0000 Subject: [issue33236] MagicMock().__iter__.return_value is different from MagicMock().__iter__() Message-ID: <1523015407.46.0.682650639539.issue33236@psf.upfronthosting.co.za> New submission from Robert : According to the documentation .return_value should be identical to the object returned when calling the mock ("assert m() is m.return_value") This is the case except on objects returned by __iter__ on MagicMocks. The following script demonstrates the problem: ---- from unittest.mock import MagicMock m = MagicMock() assert x.__iter__() is x.__iter__.return_value # <- fails ---- In fact __iter__() returns the object "iter([])" (which matches the documentation) while __iter__.return_value return a MagicMock object (which does not match the documentation). When replacing "__iter__" with any other special function MagicMock works as expected. ---------- components: Library (Lib) messages: 315016 nosy: mrh1997 priority: normal severity: normal status: open title: MagicMock().__iter__.return_value is different from MagicMock().__iter__() versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 10:22:24 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 06 Apr 2018 14:22:24 +0000 Subject: [issue33210] pkgutil.walk_packages gives incomplete results In-Reply-To: <1522722338.23.0.467229070634.issue33210@psf.upfronthosting.co.za> Message-ID: <1523024544.08.0.682650639539.issue33210@psf.upfronthosting.co.za> Nick Coghlan added the comment: I think this is actually two distinct problems, one documentation one (which should be addressed in the online docs for all currently maintained versions), and one actual functional issue. The documentation issue is the one you've reported: in order for the recursive descent to work in walk_packages given the current algorithm, then the combination of the given prefix, and the current global import configuration must allow that package to actually be imported. While there is a note about that limitation, it's currently thoroughly unclear. The functional issue is two-fold: 1. pkgutil.iter_modules() doesn't identify PEP 420 namespace packages correctly (it ignores them as not being potential packages) 2. The recursive import to check pkg.__path__ uses a name based global __import__ rather than the more state independent https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly technique It's that second problem that introduces the "prefix must be set to get useful output" behaviour that you're currently seeing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 10:30:40 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 06 Apr 2018 14:30:40 +0000 Subject: [issue33210] pkgutil.walk_packages "prefix" option docs are misleading In-Reply-To: <1522722338.23.0.467229070634.issue33210@psf.upfronthosting.co.za> Message-ID: <1523025040.56.0.682650639539.issue33210@psf.upfronthosting.co.za> Nick Coghlan added the comment: https://bugs.python.org/issue29258 is an existing issue for the PEP 420 limitation (it also notes why fixing that implicitly is a potential problem) I've retitled this issue to be specifically about the misleading docs for the "prefix" option (and updated the metadata accordingly). "Recursive descent in pkgutil.walk_packages depends on sys.path" would be a reasonable title for an issue to actually fix the operation to use a better algorithm based on newer importlib APIs, but I haven't filed that myself. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python title: pkgutil.walk_packages gives incomplete results -> pkgutil.walk_packages "prefix" option docs are misleading versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 11:43:32 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Apr 2018 15:43:32 +0000 Subject: [issue33237] Improve AttributeError message for partially initialized module Message-ID: <1523029412.67.0.682650639539.issue33237@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Cyclic import usually leads to an AttributeError "module 'spam' has no attribute 'ham'" which usually is confusing because in normal case 'spam.ham' exists, and the user can have no ideas why it is disappeared. The proposed PR allows to specialize the AttributeError message for partially initialized module. Any suggestions about the error message? ---------- components: Interpreter Core messages: 315019 nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka priority: normal severity: normal status: open title: Improve AttributeError message for partially initialized module type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 11:45:24 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Apr 2018 15:45:24 +0000 Subject: [issue33237] Improve AttributeError message for partially initialized module In-Reply-To: <1523029412.67.0.682650639539.issue33237@psf.upfronthosting.co.za> Message-ID: <1523029524.29.0.682650639539.issue33237@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6104 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 11:57:44 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 06 Apr 2018 15:57:44 +0000 Subject: [issue33237] Improve AttributeError message for partially initialized module In-Reply-To: <1523029412.67.0.682650639539.issue33237@psf.upfronthosting.co.za> Message-ID: <1523030264.92.0.682650639539.issue33237@psf.upfronthosting.co.za> Nick Coghlan added the comment: While I like the idea of this change, the "partially initialized" addition is fairly subtle, and relatively easy to miss. Perhaps append "(most likely due to a circular import)" to the partially initialized case?: AttributeError: partially initialized "module 'spam' has no attribute 'ham' (most likely due to a circular import). Crucially, for folks encountering the error for the first time, that also introduces them to the main phrase they may want to search for: "circular import". The "most likely" weasel wording stems from the fact that the problem won't always be with the circular import - they may have just straight up referenced the wrong module or the wrong attribute name, so the apparently circular import is an error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 12:26:11 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 06 Apr 2018 16:26:11 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1523031971.25.0.682650639539.issue33189@psf.upfronthosting.co.za> Change by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 12:29:01 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 06 Apr 2018 16:29:01 +0000 Subject: [issue33214] join method for list and tuple In-Reply-To: <1522766033.22.0.467229070634.issue33214@psf.upfronthosting.co.za> Message-ID: <1523032141.09.0.682650639539.issue33214@psf.upfronthosting.co.za> Change by ?ric Araujo : ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 12:31:54 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 06 Apr 2018 16:31:54 +0000 Subject: [issue33235] Better help text for dict.setdefault In-Reply-To: <1523009627.66.0.682650639539.issue33235@psf.upfronthosting.co.za> Message-ID: <1523032314.25.0.682650639539.issue33235@psf.upfronthosting.co.za> ?ric Araujo added the comment: The two lines are equivalent! `d.setdefault(key, default)` does return the same thing as `d.get(key, default)`, and then sets `d[key] = default` if the get method went into the ?key was not found, let?s return default? branch. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 12:33:18 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 06 Apr 2018 16:33:18 +0000 Subject: [issue33235] Better help text for dict.setdefault In-Reply-To: <1523009627.66.0.682650639539.issue33235@psf.upfronthosting.co.za> Message-ID: <1523032398.05.0.682650639539.issue33235@psf.upfronthosting.co.za> ?ric Araujo added the comment: Note that if we switch the order like you propose, we don?t need to use dict.get: set D[k]=d if k not in D then return D[k] I suspect the current doc was written the way it is because it matches the actual implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 12:40:59 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 06 Apr 2018 16:40:59 +0000 Subject: [issue33227] Cmd do_something only accepts one argument In-Reply-To: <1522909613.34.0.682650639539.issue33227@psf.upfronthosting.co.za> Message-ID: <1523032859.29.0.682650639539.issue33227@psf.upfronthosting.co.za> ?ric Araujo added the comment: I think using shlex unconditionally to parse lines sent to cmd.Cmd may not be ideal. Cmd is very generic and there are many ways to parse lines into arguments: - no parsing (think Python shells or remote command execution) - shlex (makes sense for unix users, maybe not others) - parse_ints as in your example (lexing + conversion) - optparse (I read about a tool where the interactive command format was the same as the command-line arguments format, which makes is super easy to support all commands in a config file or ?session replay? file!) - many more. Could the shlex parsing be in a subclass? Or is it small enough to be in the docs? If it?s not small, maybe the base Cmd class needs to be reworked to make it easier to hook into line parsing? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 12:43:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Apr 2018 16:43:41 +0000 Subject: [issue33235] Better help text for dict.setdefault In-Reply-To: <1523009627.66.0.682650639539.issue33235@psf.upfronthosting.co.za> Message-ID: <1523033021.85.0.682650639539.issue33235@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Changing docstring can break existing code, therefore it should go only in future new Python version unless it contains a bug. The current docstring in 3.6 doesn't look incorrect to me. The docstring in 3.7 is different. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 12:49:56 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 06 Apr 2018 16:49:56 +0000 Subject: [issue32933] mock_open does not support iteration around text files. In-Reply-To: <1519462718.87.0.467229070634.issue32933@psf.upfronthosting.co.za> Message-ID: <1523033396.42.0.682650639539.issue32933@psf.upfronthosting.co.za> ?ric Araujo added the comment: Is this related to #33236 ? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 13:14:17 2018 From: report at bugs.python.org (Anthony Flury) Date: Fri, 06 Apr 2018 17:14:17 +0000 Subject: [issue32933] mock_open does not support iteration around text files. In-Reply-To: <1519462718.87.0.467229070634.issue32933@psf.upfronthosting.co.za> Message-ID: <1523034857.19.0.682650639539.issue32933@psf.upfronthosting.co.za> Anthony Flury added the comment: No - it isn't related. In the case of mock_open; it isn't intended to be a simple MagicMock - it is meant to be a mocked version of open, and so to be useful as a testing tool, it should emulate a file as much as possible. When a mock_open is created, you can provide an argument 'read_data' which is meant to be the data from your mocked file, so it is key that the dunder iter method actually returns an iterator. The mock_open implementation already provides special versions of read, readline and readlines methods which use the 'read_data' initial value as the content. Currently though the dunder iter method isn't set at all - so the returned value would currently be an empty iterator (which makes mock_open unable to be used to test idiomatic python : def display(file_name): with open('a.txt', 'r') as fp: for line in fp: print(line) As a trivial example the above code when mock_open is used will be equivalent of opening an empty file, but this code : def display(file_name): with open('a.txt', 'r') as fp: while True: line = readline(fp) if line == '': break print(line) Will work correctly with the data provided to mock_open. Regardless of how and when #33236 is solved - a fix would still be needed for mock_open to make it provide an iterator for the mocked file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 13:25:34 2018 From: report at bugs.python.org (Hubert Holin) Date: Fri, 06 Apr 2018 17:25:34 +0000 Subject: [issue33230] _decimal build failure (unsupported platform for that module) - evolution possible? In-Reply-To: <1522923554.41.0.682650639539.issue33230@psf.upfronthosting.co.za> Message-ID: <1523035534.98.0.682650639539.issue33230@psf.upfronthosting.co.za> Hubert Holin added the comment: This is correct: I had an older version of mpdecimal in /usr/local. However, when removed mpdecimal is (manually) removed from /usr/local (the libs and the header), making a "make clean", a config and make, the _decimal build still fails, but this time for a different reason: /Developer/Python/3.6/Python/Python-3.6.5/Modules/_decimal/_decimal.c:34:10: fatal error: 'mpdecimal.h' file not found #include "mpdecimal.h" Still, we are getting closer: should I install a newer version of mpdecimal and try again? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 13:50:33 2018 From: report at bugs.python.org (Stefan Krah) Date: Fri, 06 Apr 2018 17:50:33 +0000 Subject: [issue33230] _decimal build failure (unsupported platform for that module) - evolution possible? In-Reply-To: <1522923554.41.0.682650639539.issue33230@psf.upfronthosting.co.za> Message-ID: <1523037033.65.0.682650639539.issue33230@psf.upfronthosting.co.za> Stefan Krah added the comment: It looks to me as if you are compiling --with-system-libmpdec. You don't need that, libmpdec is included in the Python tarball. -with-system-libmpdec was added mainly for Linux distros. If there's a widespread interest to support it on OS X, I'd need a patch. A hack that should work is "export PYTHON_DECIMAL_WITH_MACHINE=universal" during the Python build, then the external libmpdec *might* work. This flag was mainly added for testing. Note that "universal" does not always build fat binaries -- it uses whatever Python is configured with. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 13:57:55 2018 From: report at bugs.python.org (Stefan Krah) Date: Fri, 06 Apr 2018 17:57:55 +0000 Subject: [issue33230] _decimal build failure (unsupported platform for that module) - evolution possible? In-Reply-To: <1522923554.41.0.682650639539.issue33230@psf.upfronthosting.co.za> Message-ID: <1523037475.27.0.682650639539.issue33230@psf.upfronthosting.co.za> Stefan Krah added the comment: Another source of error is of course if the external libmpdec was not compiled as "universal" but Python is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 14:02:45 2018 From: report at bugs.python.org (Jason Haydaman) Date: Fri, 06 Apr 2018 18:02:45 +0000 Subject: [issue33238] AssertionError on await of Future returned by asyncio.wrap_future Message-ID: <1523037765.71.0.682650639539.issue33238@psf.upfronthosting.co.za> New submission from Jason Haydaman : When the concurrent Future wrapped by asyncio.wrap_future has set_result or set_exception called multiple times, I get the following traceback: Traceback (most recent call last): File "/usr/local/lib/python3.6/asyncio/events.py", line 145, in _run self._callback(*self._args) File "/usr/local/lib/python3.6/asyncio/futures.py", line 399, in _set_state _copy_future_state(other, future) File "/usr/local/lib/python3.6/asyncio/futures.py", line 369, in _copy_future_state assert not dest.done() AssertionError Minimal reproducible example: import asyncio import concurrent.futures f = concurrent.futures.Future() async_f = asyncio.wrap_future(f) f.set_result(1) f.set_result(1) loop = asyncio.get_event_loop() loop.run_until_complete(async_f) The documentation says that set_result and set_exception are only meant for Executors, so, arguably using them outside of that context would fall into undocumented behavior rather than a bug. But it still seems like it should be the second set_result that raises something like InvalidStateError. Alternatively, this can be avoided if _copy_future_state checks for done in addition to cancellation. What should happen here? ---------- components: Library (Lib), asyncio messages: 315030 nosy: Jason Haydaman, asvetlov, yselivanov priority: normal severity: normal status: open title: AssertionError on await of Future returned by asyncio.wrap_future versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 14:15:52 2018 From: report at bugs.python.org (Jason Haydaman) Date: Fri, 06 Apr 2018 18:15:52 +0000 Subject: [issue33238] AssertionError on await of Future returned by asyncio.wrap_future In-Reply-To: <1523037765.71.0.682650639539.issue33238@psf.upfronthosting.co.za> Message-ID: <1523038552.58.0.682650639539.issue33238@psf.upfronthosting.co.za> Jason Haydaman added the comment: May also be worth pointing out that even in the case of only calling set_result once, _done_callbacks still has _chain_future in it: import asyncio import concurrent.futures f = concurrent.futures.Future() async_f = asyncio.wrap_future(f) f.set_result(1) loop = asyncio.get_event_loop() print(loop.run_until_complete(async_f)) print(f._done_callbacks) >>> 1 >>> [._call_set_state at 0x7f1687f3c620>] Should that be cleared by that point? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 17:09:12 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 21:09:12 +0000 Subject: [issue33227] Cmd do_something only accepts one argument In-Reply-To: <1522909613.34.0.682650639539.issue33227@psf.upfronthosting.co.za> Message-ID: <1523048952.32.0.682650639539.issue33227@psf.upfronthosting.co.za> Ned Deily added the comment: The more I think about it, the more I feel it would be a disservice to our users to add piecemeal enhancements like this to the standard library cmd module at this point, when cmd is essentially unmaintained and there is already a superior alternative. I have opened Issue33233 suggesting we at least add a See Also doc link to cmd2 and to consider potentially deprecating cmd in the standard library. Again, thanks for the suggestion, Oz, but I would like to close this issue. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 17:22:13 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 21:22:13 +0000 Subject: [issue29673] Some gdb macros are broken in 3.6 In-Reply-To: <1488240167.08.0.156874874183.issue29673@psf.upfronthosting.co.za> Message-ID: <1523049733.7.0.682650639539.issue29673@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 3a9ccee0e5dbf7d67f5ab79f6095755969db117c by Ned Deily (Marcel Plch) in branch 'master': bpo-29673: fix gdb scripts pystack and pystackv (GH-6126) https://github.com/python/cpython/commit/3a9ccee0e5dbf7d67f5ab79f6095755969db117c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 17:22:44 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Apr 2018 21:22:44 +0000 Subject: [issue29673] Some gdb macros are broken in 3.6 In-Reply-To: <1488240167.08.0.156874874183.issue29673@psf.upfronthosting.co.za> Message-ID: <1523049764.96.0.682650639539.issue29673@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6105 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 17:23:16 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Apr 2018 21:23:16 +0000 Subject: [issue29673] Some gdb macros are broken in 3.6 In-Reply-To: <1488240167.08.0.156874874183.issue29673@psf.upfronthosting.co.za> Message-ID: <1523049796.37.0.682650639539.issue29673@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6106 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 17:29:28 2018 From: report at bugs.python.org (Oz Tiram) Date: Fri, 06 Apr 2018 21:29:28 +0000 Subject: [issue33227] Cmd do_something only accepts one argument In-Reply-To: <1522909613.34.0.682650639539.issue33227@psf.upfronthosting.co.za> Message-ID: <1523050168.54.0.682650639539.issue33227@psf.upfronthosting.co.za> Oz Tiram added the comment: I am disappointed you want to deprecate CMD. I knew about cmd2 and some other alternatives, but I think their execive use of decorators isn't so comfortable. That is why I wrote my own module. I'm also willing to adopt the module and add even more features. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 17:29:36 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 21:29:36 +0000 Subject: [issue33187] Document ElementInclude (XInclude) support in ElementTree In-Reply-To: <1522427694.7.0.467229070634.issue33187@psf.upfronthosting.co.za> Message-ID: <1523050176.57.0.682650639539.issue33187@psf.upfronthosting.co.za> Change by Ned Deily : ---------- keywords: +easy stage: -> needs patch versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 17:31:36 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Fri, 06 Apr 2018 21:31:36 +0000 Subject: [issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError In-Reply-To: <1522433023.64.0.467229070634.issue33188@psf.upfronthosting.co.za> Message-ID: <1523050296.91.0.682650639539.issue33188@psf.upfronthosting.co.za> Change by Ivan Levkivskyi : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 18:02:25 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Apr 2018 22:02:25 +0000 Subject: [issue33169] importlib.invalidate_caches() doesn't clear all caches In-Reply-To: <1522247418.61.0.467229070634.issue33169@psf.upfronthosting.co.za> Message-ID: <1523052145.22.0.682650639539.issue33169@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- keywords: +patch pull_requests: +6107 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 18:04:03 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 22:04:03 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523052243.65.0.682650639539.issue33233@psf.upfronthosting.co.za> Ned Deily added the comment: I've asked on python-dev for comments: https://mail.python.org/pipermail/python-dev/2018-April/152653.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 18:11:02 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 22:11:02 +0000 Subject: [issue33227] Cmd do_something only accepts one argument In-Reply-To: <1522909613.34.0.682650639539.issue33227@psf.upfronthosting.co.za> Message-ID: <1523052662.56.0.682650639539.issue33227@psf.upfronthosting.co.za> Ned Deily added the comment: Oz, I don't particularly like the idea of deprecating cmd but, realistically, Python development is almost entirely an unpaid, volunteer activity and we do not have enough resources to do everything we'd like to do. So sometimes we need to make a tradeoff and this seems like it might be a good opportunity to make one that will benefit most people. It's not my decision to make in isolation so I've sent a mail to the python-dev list asking other core developers and interested parties to comment on Issue33233. So, let's keep this open until we resolve that issue and feel free to comment there. Thanks again for your interest! https://mail.python.org/pipermail/python-dev/2018-April/152653.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 18:14:31 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 22:14:31 +0000 Subject: [issue29673] Some gdb macros are broken in 3.6 In-Reply-To: <1488240167.08.0.156874874183.issue29673@psf.upfronthosting.co.za> Message-ID: <1523052871.81.0.682650639539.issue29673@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 3c193cf8afce525b1283986f113de0e16f23e115 by Ned Deily (Miss Islington (bot)) in branch '3.7': [3.7] bpo-29673: fix gdb scripts pystack and pystackv (GH-6126) (GH-6399) https://github.com/python/cpython/commit/3c193cf8afce525b1283986f113de0e16f23e115 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 18:15:37 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 22:15:37 +0000 Subject: [issue29673] Some gdb macros are broken in 3.6 In-Reply-To: <1488240167.08.0.156874874183.issue29673@psf.upfronthosting.co.za> Message-ID: <1523052937.12.0.682650639539.issue29673@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 3468a05f6a7d730a656d254730a3f5b6b7e85983 by Ned Deily (Miss Islington (bot)) in branch '3.6': [3.6] bpo-29673: fix gdb scripts pystack and pystackv (GH-6126) (GH-6400) https://github.com/python/cpython/commit/3468a05f6a7d730a656d254730a3f5b6b7e85983 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 18:17:40 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 22:17:40 +0000 Subject: [issue29673] Some gdb macros are broken in 3.6 In-Reply-To: <1488240167.08.0.156874874183.issue29673@psf.upfronthosting.co.za> Message-ID: <1523053060.08.0.682650639539.issue29673@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks, Marcel, for the fix and thanks, Skip, for the review. Merged for release in 3.6.6 and 3.7.0. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 18:36:41 2018 From: report at bugs.python.org (Mark Lawrence) Date: Fri, 06 Apr 2018 22:36:41 +0000 Subject: [issue13940] imaplib: Mailbox names are not quoted In-Reply-To: <1328357098.01.0.78801274991.issue13940@psf.upfronthosting.co.za> Message-ID: <1523054201.42.0.682650639539.issue13940@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 18:51:42 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Fri, 06 Apr 2018 22:51:42 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523055102.93.0.682650639539.issue33233@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: @ned.deily - are you proposing to officially deprecate it for 3.7? If we're going to do it, let's do it now so we can remove it for 3.9. It seems like a reasonable strategy to push folks toward cmd2 and clean up our stdlib. ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 18:56:39 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 22:56:39 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523055399.14.0.682650639539.issue33233@psf.upfronthosting.co.za> Ned Deily added the comment: @barry, I was thinking more of 3.8 but, sure, if there seems to be a consensus prior to 3.7.0b4 that deprecation is the right thing, we could do it in 3.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 19:10:22 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Apr 2018 23:10:22 +0000 Subject: [issue33169] importlib.invalidate_caches() doesn't clear all caches In-Reply-To: <1522247418.61.0.467229070634.issue33169@psf.upfronthosting.co.za> Message-ID: <1523056222.67.0.682650639539.issue33169@psf.upfronthosting.co.za> Brett Cannon added the comment: New changeset 9e2be60634914f23db2ae5624e4acc9335bf5fea by Brett Cannon in branch 'master': bpo-33169: Remove values of `None` from sys.path_importer_cache when invalidating caches (GH-6402) https://github.com/python/cpython/commit/9e2be60634914f23db2ae5624e4acc9335bf5fea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 19:23:13 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 06 Apr 2018 23:23:13 +0000 Subject: [issue33169] importlib.invalidate_caches() doesn't clear all caches In-Reply-To: <1522247418.61.0.467229070634.issue33169@psf.upfronthosting.co.za> Message-ID: <1523056993.18.0.682650639539.issue33169@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- pull_requests: +6108 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 19:34:35 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 23:34:35 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523057675.74.0.682650639539.issue33185@psf.upfronthosting.co.za> Change by Ned Deily : ---------- priority: critical -> release blocker stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 19:36:42 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 23:36:42 +0000 Subject: [issue33053] Avoid adding an empty directory to sys.path when running a module with `-m` In-Reply-To: <1520855835.03.0.467229070634.issue33053@psf.upfronthosting.co.za> Message-ID: <1523057802.45.0.682650639539.issue33053@psf.upfronthosting.co.za> Ned Deily added the comment: (See Issue33185 for regression.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 19:51:26 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Apr 2018 23:51:26 +0000 Subject: [issue17861] put opcode information in one place In-Reply-To: <1367162089.6.0.986391601417.issue17861@psf.upfronthosting.co.za> Message-ID: <1523058686.59.0.682650639539.issue17861@psf.upfronthosting.co.za> Change by Ned Deily : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 20:02:20 2018 From: report at bugs.python.org (Brett Cannon) Date: Sat, 07 Apr 2018 00:02:20 +0000 Subject: [issue33169] importlib.invalidate_caches() doesn't clear all caches In-Reply-To: <1522247418.61.0.467229070634.issue33169@psf.upfronthosting.co.za> Message-ID: <1523059340.83.0.682650639539.issue33169@psf.upfronthosting.co.za> Brett Cannon added the comment: New changeset a09bb87c1eebb07b01b8105cf536704893aec565 by Brett Cannon in branch '3.7': [3.7] bpo-33169: Remove values of `None` from sys.path_importer_cache when invalidating caches (GH-6402) (GH-6403) https://github.com/python/cpython/commit/a09bb87c1eebb07b01b8105cf536704893aec565 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 20:02:53 2018 From: report at bugs.python.org (Brett Cannon) Date: Sat, 07 Apr 2018 00:02:53 +0000 Subject: [issue33169] importlib.invalidate_caches() doesn't clear all caches In-Reply-To: <1522247418.61.0.467229070634.issue33169@psf.upfronthosting.co.za> Message-ID: <1523059373.81.0.682650639539.issue33169@psf.upfronthosting.co.za> Brett Cannon added the comment: All done in 3.7 and master. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 20:18:20 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 07 Apr 2018 00:18:20 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1523060300.16.0.682650639539.issue33211@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: > I was hoping to see if this was seen as a reasonable patch that might be accepted. I didn't look carefully but superficially it looks reasonable, so it is worth trying. > Also, while I think it would be nice, I take it a patch for this would be unlikely to be backported, right? I think this is unlikely because it affects some public APIs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 20:30:59 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 07 Apr 2018 00:30:59 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523061059.07.0.682650639539.issue33233@psf.upfronthosting.co.za> Steven D'Aprano added the comment: (Previously posted on Python-Dev.) I think the documentation note is a good idea. But I disagree with deprecating "cmd" unless it is actively falling apart and no longer working, not just languishing with no feature improvements. Just in the last week, I've been reminded twice that many people using Python do so where they cannot just arbitrarily pip install , and if a library isn't in the std lib, they can't use it without a lot of pain: https://mail.python.org/pipermail/tutor/2018-April/112817.html https://mail.python.org/pipermail/tutor/2018-April/112818.html ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 21:26:10 2018 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 07 Apr 2018 01:26:10 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523064370.46.0.682650639539.issue33233@psf.upfronthosting.co.za> Guido van Rossum added the comment: But cmd is used by pdb. Do you recommend we deprecate that too? (There are countless 3rd party alternatives, but I sure prefer to have it in the stdlib, so I can start debugging without first having to install a dependency.) ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 21:27:12 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 01:27:12 +0000 Subject: [issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR' In-Reply-To: <1352121880.55.0.191535515397.issue8243@psf.upfronthosting.co.za> Message-ID: <1523064432.06.0.682650639539.issue8243@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset ef5ce884a41c8553a7eff66ebace908c1dcc1f89 by Ned Deily (Jay Crotts) in branch 'master': bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) https://github.com/python/cpython/commit/ef5ce884a41c8553a7eff66ebace908c1dcc1f89 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 21:28:24 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Apr 2018 01:28:24 +0000 Subject: [issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR' In-Reply-To: <1352121880.55.0.191535515397.issue8243@psf.upfronthosting.co.za> Message-ID: <1523064504.39.0.682650639539.issue8243@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6109 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 21:29:19 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Apr 2018 01:29:19 +0000 Subject: [issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR' In-Reply-To: <1352121880.55.0.191535515397.issue8243@psf.upfronthosting.co.za> Message-ID: <1523064559.04.0.682650639539.issue8243@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6110 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 21:30:18 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Apr 2018 01:30:18 +0000 Subject: [issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR' In-Reply-To: <1352121880.55.0.191535515397.issue8243@psf.upfronthosting.co.za> Message-ID: <1523064618.51.0.682650639539.issue8243@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6111 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 21:35:14 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 01:35:14 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523064914.41.0.682650639539.issue33233@psf.upfronthosting.co.za> Ned Deily added the comment: > cmd is used by pdb Well, that's a pretty good reason for not removing cmd! I really wasn't advocating its removal, just gently pushing users to use cmd2. So perhaps we should only add a "See Also" like we do for urllib.request and close any new feature request issues? > See also: The Requests package is recommended for a higher-level > HTTP client interface. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 21:38:30 2018 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 07 Apr 2018 01:38:30 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1523064914.41.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: I'm fine with linking to cmd2, we do that for some other modules too. (Though I think it's somewhat arbitrary. E.g. do we link to requests anywhere? Or to all the "better pdb" modules?) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 21:40:34 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 07 Apr 2018 01:40:34 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523065234.96.0.682650639539.issue33233@psf.upfronthosting.co.za> Raymond Hettinger added the comment: FWIW, I've been teaching cmd to my clients for years and it has worked fine for them. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 21:43:19 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 01:43:19 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523065399.69.0.682650639539.issue33233@psf.upfronthosting.co.za> Ned Deily added the comment: > (Though I think it's somewhat arbitrary. Yes, it is. > E.g. do we link to requests anywhere? Yes: https://docs.python.org/3/library/urllib.request.html > Or to all the "better pdb" modules?) Not that I'm aware of. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 21:56:20 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 01:56:20 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523066180.1.0.682650639539.issue33233@psf.upfronthosting.co.za> Ned Deily added the comment: > FWIW, I've been teaching cmd to my clients for years and it has worked fine for them. I'm not saying that cmd is bad; it's just that there have been suggested improvements over the years and many of those are already implemented in cmd2, which is supposed to be generally upward compatible from cmd. (I don't know how accurate that is in practice.) The main reason for bringing this up is that it seems to me that, rather than trying to duplicate effort by re-implementing new features for cmd that are already in cmd2, we should point at cmd2 for new users who want those features. So, as Guido pointed out, with a customer of cmd in the std library (e.g. pdb), we shouldn't remove it. But we can still set expectations that there aren't going to be new features in cmd. Does that sound reasonable to everyone? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 22:00:09 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 02:00:09 +0000 Subject: [issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR' In-Reply-To: <1352121880.55.0.191535515397.issue8243@psf.upfronthosting.co.za> Message-ID: <1523066409.23.0.682650639539.issue8243@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 98e8ac8d82202aae32961f10b1014641ae1fffbf by Ned Deily (Miss Islington (bot)) in branch '3.7': [3.7] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) (GH-6404) https://github.com/python/cpython/commit/98e8ac8d82202aae32961f10b1014641ae1fffbf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 22:01:05 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 02:01:05 +0000 Subject: [issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR' In-Reply-To: <1352121880.55.0.191535515397.issue8243@psf.upfronthosting.co.za> Message-ID: <1523066465.62.0.682650639539.issue8243@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 70c44465475c41ab3aa832858b250ede6f170aac by Ned Deily (Miss Islington (bot)) in branch '3.6': [3.6] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) (GH-6406) https://github.com/python/cpython/commit/70c44465475c41ab3aa832858b250ede6f170aac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 22:01:37 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 02:01:37 +0000 Subject: [issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR' In-Reply-To: <1352121880.55.0.191535515397.issue8243@psf.upfronthosting.co.za> Message-ID: <1523066497.68.0.682650639539.issue8243@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 77f0a41d72886513f5e9277e5587455745c29ac1 by Ned Deily (Miss Islington (bot)) in branch '2.7': [2.7] bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) (GH-6405) https://github.com/python/cpython/commit/77f0a41d72886513f5e9277e5587455745c29ac1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 22:03:45 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 02:03:45 +0000 Subject: [issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR' In-Reply-To: <1352121880.55.0.191535515397.issue8243@psf.upfronthosting.co.za> Message-ID: <1523066625.9.0.682650639539.issue8243@psf.upfronthosting.co.za> Ned Deily added the comment: Thank you for producing the PR, Jay! ---------- components: -Extension Modules resolution: -> fixed stage: patch review -> resolved status: open -> closed type: enhancement -> versions: +Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 22:17:58 2018 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 07 Apr 2018 02:17:58 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523067478.01.0.682650639539.issue33233@psf.upfronthosting.co.za> Guido van Rossum added the comment: Well, is cmd2 stabilizing, or is it still changing at a rate too fast for inclusion in the stdlib? Does it perhaps have a mix of desirable and wacky features? Or could we just copy much of it into the stdlib as 'cmd'? I'm a bit concerned about the idea that we should not upgrade stdlib modules because a better 3rd party alternative exists -- and I'm kind of assuming that those 3rd party module authors are also somewhat disappointed that their modules are not used to improve the stdlib. (PyPI not withstanding.) Often (like in this case) there's just no chance of getting rid of the stdlib module, so we're just stuck with a duplication of functionality. Note that every case is a bit different. But I'm not ready to give up on the idea that Python comes with batteries included. We should not let those batteries corrode and leak. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 22:31:49 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 02:31:49 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523068309.8.0.682650639539.issue33233@psf.upfronthosting.co.za> Ned Deily added the comment: > But I'm not ready to give up on the idea that Python comes with batteries included. We should not let those batteries corrode and leak. I totally agree with you. And it would be great if cmd2 could be incorporated into the std lib as an updated cmd. cmd seems to be largely abandoned in the std lib: looking at the commit history for it shows few changes in the past decade or so and I'm not aware that any current core developer feels ownership of it: I might be wrong. But it certainly is true that cmd2 has seen much more activity recently than cmd has. So I would think that the ideal solution would be for the cmd2 project to take ownership of cmd in the std library. OTOH, it seems like we haven't always had good long-term results in the past when trying to bring existing third-party packages into the std lib. But it could be worth trying again, if someone were willing to shepherd it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 23:04:06 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 07 Apr 2018 03:04:06 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523070246.69.0.682650639539.issue33233@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > cmd seems to be largely abandoned in the std lib: I'm not sure why the absence of bugs indicates abandonment. We almost never touch defaultdict, in part because the code is straight-forward, tested, and not buggy. If a bug were reported for cmd, I would be happy to work on it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 6 23:58:32 2018 From: report at bugs.python.org (Catherine Devlin) Date: Sat, 07 Apr 2018 03:58:32 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523073512.07.0.682650639539.issue33233@psf.upfronthosting.co.za> Catherine Devlin added the comment: Hi, everybody! I really appreciate the kind words about cmd2. For several years now, Todd Leonhardt has been cmd2's primary maintainer, so I may be speaking out of turn. But, before I wanted to let it get within screaming distance of the standard library, I would want to refactor it like mad; maybe even remove some features that were created more in a spirit of gee-whiz-I-can-do-this than real need. Todd and I have worked a little on such a refactor, but even once we make time to actually complete it, that would make cmd2 by definition too unstable until the refactored version itself had earned some grey hair. Also, cmd2 depends on pyparsing, which is itself unlikely to be in the standard library. I think a "see also" list attached to standard library module docs would be great, and if this helps nucleate a decision about whether/how to do that for a bunch of modules, that would be great. ---------- nosy: +catherinedevlin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 01:16:30 2018 From: report at bugs.python.org (Todd Leonhardt) Date: Sat, 07 Apr 2018 05:16:30 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523078190.27.0.682650639539.issue33233@psf.upfronthosting.co.za> Todd Leonhardt added the comment: The cmd2 project is in the process of rapidly stabilizing, but it isn't quite there yet. The other cmd2 core maintainers and I do have a bunch of refactoring planned over the next 6 to 8 months or so. Right now @kotfu (Jared Crapo) is working on replacing pyparsing with shlex. Since shlex is built into Python, that removes one 3rd party dependency. In early September we plan on abandoning support for Python 2.7 for future releases which will enable us to remove dependencies on most of the other 3rd party libraries we currently depend upon and to dramatically clean the code up in numerous other ways. The one third party dependency which will be left is pyperclip, but honestly that isn't very well maintained and I've been thinking about removing the functionality we use it for (clipboard copy/paste). Another core cmd2 maintainer, @kmvanbrunt (Kevin Van Brunt) has been toying with the idea of forking it and creating a lighter and simpler version with a reduced feature set. If it is something the core developers view as desirable, I think it would perhaps be a viable path forward to have the cmd2 maintainers take over maintenance of cmd and to move towards that becoming the lightweight reduced feature set version and cmd2 living on as the heavier weight more full featured extension of cmd (but many of the current features of cmd2 could be merged into cmd). ---------- nosy: +tleonhardt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 02:19:16 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 06:19:16 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523081956.06.0.682650639539.issue33184@psf.upfronthosting.co.za> Change by Ned Deily : ---------- keywords: +patch pull_requests: +6112 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 02:33:48 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 06:33:48 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523082828.57.0.682650639539.issue33184@psf.upfronthosting.co.za> Change by Ned Deily : ---------- pull_requests: +6113 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 02:36:05 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 06:36:05 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523082965.46.0.682650639539.issue33184@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset b405752dab95fa5dc65a19d94e798844d0378c61 by Ned Deily in branch 'master': bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h. (GH-6407) https://github.com/python/cpython/commit/b405752dab95fa5dc65a19d94e798844d0378c61 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 02:37:21 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Apr 2018 06:37:21 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523083041.54.0.682650639539.issue33184@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6114 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 03:02:43 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 07:02:43 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523084563.01.0.682650639539.issue33184@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 12d1dcd1f8ec0a2f3d8c325aa8e3f2f05b75b188 by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h. (GH-6407) (GH-6409) https://github.com/python/cpython/commit/12d1dcd1f8ec0a2f3d8c325aa8e3f2f05b75b188 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 03:04:06 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 07 Apr 2018 07:04:06 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523084646.1.0.682650639539.issue33184@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 76215a4481191b648de522a4e2120f60822f6b9c by Ned Deily in branch '3.6': bpo-33184: Update macOS installer build to use OpenSSL 1.0.2o. (GH-6408) https://github.com/python/cpython/commit/76215a4481191b648de522a4e2120f60822f6b9c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 06:01:02 2018 From: report at bugs.python.org (Xavier de Gaye) Date: Sat, 07 Apr 2018 10:01:02 +0000 Subject: [issue23649] tarfile not re-entrant for multi-threading In-Reply-To: <1426178401.83.0.913984210908.issue23649@psf.upfronthosting.co.za> Message-ID: <1523095262.2.0.682650639539.issue23649@psf.upfronthosting.co.za> Xavier de Gaye added the comment: extract_from_pkgs() in the attached extract_from_packages.py script extracts /etc files from the tar files in PKG_DIR into WORK_DIR using a ThreadPoolExecutor (a ThreadPoolExecutor, when used to extract all the /etc files from the packages that build a whole ArchLinux system, divides the elapsed time by 2). Running this script that tests this function fails randomly with the same error as reported by Srdjan in msg237961. Replacing ThreadPoolExecutor with ProcessPoolExecutor also fails randomly. Using the safe_makedirs() context manager to enclose the statements than run ThreadPoolExecutor fixes the problem. Obviously this in not a problem related to thread-safety (it occurs also with ProcessPoolExecutor) but a problem about the robustness of the tarfile module in a concurrent access context. The problem is insidious in that it may never occur in an application test suite. ---------- nosy: +xdegaye Added file: https://bugs.python.org/file47523/extract_from_packages.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 08:18:10 2018 From: report at bugs.python.org (Ethan Smith) Date: Sat, 07 Apr 2018 12:18:10 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1523103490.18.0.682650639539.issue33211@psf.upfronthosting.co.za> Change by Ethan Smith : ---------- keywords: +patch pull_requests: +6115 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 09:33:00 2018 From: report at bugs.python.org (Ron Reiter) Date: Sat, 07 Apr 2018 13:33:00 +0000 Subject: [issue33213] crypt function not hashing properly on Mac (uses a specific salt) In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1523107980.66.0.682650639539.issue33213@psf.upfronthosting.co.za> Change by Ron Reiter : ---------- type: -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 12:14:11 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 07 Apr 2018 16:14:11 +0000 Subject: [issue33201] Modernize "Extension types" documentation In-Reply-To: <1522609383.56.0.467229070634.issue33201@psf.upfronthosting.co.za> Message-ID: <1523117651.26.0.682650639539.issue33201@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 1d80a561734b9932961c546b0897405a3bfbf3e6 by Antoine Pitrou in branch 'master': bpo-33201: Modernize "Extension types" doc (GH-6337) https://github.com/python/cpython/commit/1d80a561734b9932961c546b0897405a3bfbf3e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 12:15:24 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Apr 2018 16:15:24 +0000 Subject: [issue33201] Modernize "Extension types" documentation In-Reply-To: <1522609383.56.0.467229070634.issue33201@psf.upfronthosting.co.za> Message-ID: <1523117724.9.0.682650639539.issue33201@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6116 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 12:21:30 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 07 Apr 2018 16:21:30 +0000 Subject: [issue33201] Modernize "Extension types" documentation In-Reply-To: <1522609383.56.0.467229070634.issue33201@psf.upfronthosting.co.za> Message-ID: <1523118090.28.0.682650639539.issue33201@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- pull_requests: +6117 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 12:27:07 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 07 Apr 2018 16:27:07 +0000 Subject: [issue33201] Modernize "Extension types" documentation In-Reply-To: <1522609383.56.0.467229070634.issue33201@psf.upfronthosting.co.za> Message-ID: <1523118427.64.0.682650639539.issue33201@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 31f1b52f1f6c2d84eacf3c6db3f6b9adf04b675e by Antoine Pitrou (Miss Islington (bot)) in branch '3.7': bpo-33201: Modernize "Extension types" doc (GH-6337) (GH-6411) https://github.com/python/cpython/commit/31f1b52f1f6c2d84eacf3c6db3f6b9adf04b675e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 12:35:37 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 07 Apr 2018 16:35:37 +0000 Subject: [issue33201] Modernize "Extension types" documentation In-Reply-To: <1522609383.56.0.467229070634.issue33201@psf.upfronthosting.co.za> Message-ID: <1523118937.55.0.682650639539.issue33201@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset b603609e9dd19268b61b52e701cc0ee8e86784c5 by Antoine Pitrou in branch '3.6': [3.6] bpo-33201: Modernize "Extension types" doc (GH-6337) (GH-6412) https://github.com/python/cpython/commit/b603609e9dd19268b61b52e701cc0ee8e86784c5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 12:36:00 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 07 Apr 2018 16:36:00 +0000 Subject: [issue33201] Modernize "Extension types" documentation In-Reply-To: <1522609383.56.0.467229070634.issue33201@psf.upfronthosting.co.za> Message-ID: <1523118960.56.0.682650639539.issue33201@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 13:50:59 2018 From: report at bugs.python.org (Alex Gaynor) Date: Sat, 07 Apr 2018 17:50:59 +0000 Subject: [issue29613] Support for SameSite Cookies In-Reply-To: <1487674471.93.0.248753692479.issue29613@psf.upfronthosting.co.za> Message-ID: <1523123459.16.0.682650639539.issue29613@psf.upfronthosting.co.za> Change by Alex Gaynor : ---------- keywords: +patch pull_requests: +6118 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 15:01:14 2018 From: report at bugs.python.org (Brett Cannon) Date: Sat, 07 Apr 2018 19:01:14 +0000 Subject: [issue33237] Improve AttributeError message for partially initialized module In-Reply-To: <1523029412.67.0.682650639539.issue33237@psf.upfronthosting.co.za> Message-ID: <1523127674.5.0.682650639539.issue33237@psf.upfronthosting.co.za> Brett Cannon added the comment: +1 from me for Nick's suggestion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 15:22:42 2018 From: report at bugs.python.org (Martin Falatic) Date: Sat, 07 Apr 2018 19:22:42 +0000 Subject: [issue33239] tempfile module: functions with the 'buffering' option are incorrectly documented Message-ID: <1523128962.9.0.682650639539.issue33239@psf.upfronthosting.co.za> New submission from Martin Falatic : The documentation for the tempfile module in Python 3.x for the `buffering` option is incorrect: https://docs.python.org/3/library/tempfile.html TemporaryFile, NamedTemporaryFile, and SpooledTemporaryFile all take the `buffering` option, which in turn appears to correlate to the Python 2.7 option `bufsize`, which was and continues to be an integer (per the source). In the 3.x documentation the default signature for TemporaryFile, NamedTemporaryFile, and SpooledTemporaryFile includes `buffering=None`. Actually specifying None as a default for this will cause an exception (`TypeError: an integer is required (got type NoneType)`). There is a cross-reference in the 3.x tempfile docs to `open` (https://docs.python.org/3/library/functions.html#open) which in turn shows the correct signature to use for `buffering`. Additionally, the source code is clearly documented (https://github.com/python/cpython/blob/master/Lib/tempfile.py) A good correction would be to ensure `buffering=-1` is documented as the default for the three functions in tempfile, with an additional note explicitly stating that -1 == no buffering, and the existing `open` cross-reference retained. ---------- assignee: docs at python components: Documentation messages: 315072 nosy: MartyMacGyver, docs at python priority: normal severity: normal status: open title: tempfile module: functions with the 'buffering' option are incorrectly documented 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 Apr 7 16:09:49 2018 From: report at bugs.python.org (Alex Gaynor) Date: Sat, 07 Apr 2018 20:09:49 +0000 Subject: [issue29613] Support for SameSite Cookies In-Reply-To: <1487674471.93.0.248753692479.issue29613@psf.upfronthosting.co.za> Message-ID: <1523131789.85.0.682650639539.issue29613@psf.upfronthosting.co.za> Alex Gaynor added the comment: New changeset c87eb09d2e3783b0b5dc0d7cb304050cbcc86ad3 by Alex Gaynor in branch 'master': bpo-29613: Added support for SameSite cookies (GH-6413) https://github.com/python/cpython/commit/c87eb09d2e3783b0b5dc0d7cb304050cbcc86ad3 ---------- nosy: +alex _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 16:12:44 2018 From: report at bugs.python.org (Alex Gaynor) Date: Sat, 07 Apr 2018 20:12:44 +0000 Subject: [issue29613] Support for SameSite Cookies In-Reply-To: <1487674471.93.0.248753692479.issue29613@psf.upfronthosting.co.za> Message-ID: <1523131964.55.0.682650639539.issue29613@psf.upfronthosting.co.za> Change by Alex Gaynor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 17:29:28 2018 From: report at bugs.python.org (Ethan Smith) Date: Sat, 07 Apr 2018 21:29:28 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1523136568.39.0.682650639539.issue33211@psf.upfronthosting.co.za> Ethan Smith added the comment: In my PR, I added `def_lineno` and `class_lineno` as fields in the ASDL, instead of attributes (since constructors cannot have attributes, only types can). This means they show up in `ast.dump` which is probably not the desired behavior, as it makes the dumped ast whitespace/line offset sensitive. Therefore I propose we change the line number of the nodes to be the one of the def/class statement. It seems based on [this commit](https://github.com/python/cpython/commit/09aaa88328a5083469b2682230c7f3c62942afab) that the change was done to fix inspect.getsource (so that it started on the first decorator), but I think it is much more logical for inspect to handle decorated items instead of having the ast lie. One other option could be for a modified ast to have a decorated node, which holds the decorator list, and the class/function. This has the possible downside of being a not-insignificant change to the ast. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 18:17:30 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 07 Apr 2018 22:17:30 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1523139450.35.0.682650639539.issue23403@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Is there something left to be done here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 21:29:57 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 08 Apr 2018 01:29:57 +0000 Subject: [issue33237] Improve AttributeError message for partially initialized module In-Reply-To: <1523029412.67.0.682650639539.issue33237@psf.upfronthosting.co.za> Message-ID: <1523150997.52.0.682650639539.issue33237@psf.upfronthosting.co.za> Nick Coghlan added the comment: Oops, just realised my suggested text had an extraneous double quote in it due to a copy-and-paste error. Fixed version: AttributeError: partially initialized module 'spam' has no attribute 'ham' (most likely due to a circular import). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 7 22:51:56 2018 From: report at bugs.python.org (Yu Liu) Date: Sun, 08 Apr 2018 02:51:56 +0000 Subject: [issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows Message-ID: <1523155916.86.0.682650639539.issue33240@psf.upfronthosting.co.za> New submission from Yu Liu : Given the following directory structure on a Windows machine: - foo - bar a call to `shutil.rmtree("foo")` will fail when the inner folder `bar` is opened in an Explorer. The error message indicates the `foo` directory is not empty, while after the execution, although it failed, the `foo` directory is empty. So the inner folder `bar` was removed successfully, but `foo` was not. And the error message is misleading. It will not fail when `foo` is opened in an Explorer, neither on Linux system. ---------- components: Library (Lib), Windows messages: 315077 nosy: giampaolo.rodola, paul.moore, philius, steve.dower, tarek, tim.golden, zach.ware priority: normal severity: normal status: open title: shutil.rmtree fails when the inner floder is opened in Explorer on Windows type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 00:35:51 2018 From: report at bugs.python.org (Eryk Sun) Date: Sun, 08 Apr 2018 04:35:51 +0000 Subject: [issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows In-Reply-To: <1523155916.86.0.682650639539.issue33240@psf.upfronthosting.co.za> Message-ID: <1523162151.8.0.682650639539.issue33240@psf.upfronthosting.co.za> Eryk Sun added the comment: This is not an uncommon problem. If there's one or more existing references to a file or empty directory that were opened with shared delete access, then a delete operation will succeed, but the file or directory will not be unlinked from the parent directory. The filesystem only unlinks a file or directory if its "delete disposition" is set when the last reference is closed. Removing the parent directory thus requires a loop that retries the delete until it succeeds, i.e. until existing references are closed and the directory finally becomes empty and thus deletable. If the problem is caused by an anti-malware program, it should typically be resolved within a short time. Exactly how long to wait in a retry loop before failing the operation should be configurable. Maybe you can conduct a simple experiment to measure the wait time required in your case. Run the following with "bar" opened in Explorer. Substitute the real path of "foo" in PARENT_PATH. import os import time ERROR_DIR_NOT_EMPTY = 145 PARENT_PATH = 'foo' CHILD_PATH = os.path.join(PARENT_PATH, 'bar') os.rmdir(CHILD_PATH) t0 = time.perf_counter() while True: try: os.rmdir(PARENT_PATH) wait_time = time.perf_counter() - t0 break except OSError as e: if e.winerror != ERROR_DIR_NOT_EMPTY: raise print(wait_time) ---------- components: +IO nosy: +eryksun stage: -> test needed versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 00:48:45 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 08 Apr 2018 04:48:45 +0000 Subject: [issue33053] Avoid adding an empty directory to sys.path when running a module with `-m` In-Reply-To: <1520855835.03.0.467229070634.issue33053@psf.upfronthosting.co.za> Message-ID: <1523162925.09.0.682650639539.issue33053@psf.upfronthosting.co.za> Nick Coghlan added the comment: Some notes from my investigation of bpo-33185 that seem more appropriate here, rather than on that issue: * several of the developer-centric utilities in the standard library have a shared need to be friendly to imports from the current working directory. * timeit uses os.curdir, but could be switched to os.getcwd() * pydoc uses a literal '.', but could be switched to os.getcwd() * trace, profile, cProfile, pdb, doctest, and IDLE's pyshell all add the directory containing the file under test Aside from switching pydoc from a literal '.' to os.curdir, I'm not going to change any of those (hence why I'm putting these notes here), but I wanted to capture this info in case does decide to follow through on a "less isolated than isolated mode, but still omits the current directory from sys.path" execution mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 02:04:09 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Apr 2018 06:04:09 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1523167449.36.0.682650639539.issue23403@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Shelve still uses protocol 3 by default. Should it be bumped too? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 03:57:48 2018 From: report at bugs.python.org (Aaron Ang) Date: Sun, 08 Apr 2018 07:57:48 +0000 Subject: [issue31201] make test: module test that failed doesn't exist In-Reply-To: <1502707428.17.0.905101363291.issue31201@psf.upfronthosting.co.za> Message-ID: <1523174268.23.0.682650639539.issue31201@psf.upfronthosting.co.za> Change by Aaron Ang : ---------- keywords: +patch pull_requests: +6119 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 04:11:43 2018 From: report at bugs.python.org (Mikhail Zakharov) Date: Sun, 08 Apr 2018 08:11:43 +0000 Subject: =?utf-8?q?=5Bissue33229=5D_Documentation_-__io_=E2=80=94_Core_tools_for_w?= =?utf-8?q?orking_with_streams_-_seek=28=29?= In-Reply-To: <1522919317.94.0.682650639539.issue33229@psf.upfronthosting.co.za> Message-ID: <1523175103.15.0.682650639539.issue33229@psf.upfronthosting.co.za> Change by Mikhail Zakharov : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 07:06:49 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 08 Apr 2018 11:06:49 +0000 Subject: [issue15727] PyType_FromSpecWithBases tp_new bugfix In-Reply-To: <1345391866.4.0.54341725267.issue15727@psf.upfronthosting.co.za> Message-ID: <1523185609.61.0.682650639539.issue15727@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- nosy: +encukou, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 07:20:03 2018 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 08 Apr 2018 11:20:03 +0000 Subject: [issue29613] Support for SameSite Cookies In-Reply-To: <1487674471.93.0.248753692479.issue29613@psf.upfronthosting.co.za> Message-ID: <1523186403.64.0.682650639539.issue29613@psf.upfronthosting.co.za> Andrew Svetlov added the comment: Alex, the PR has landed into 3.8 (master). Should the issue's "versions" field be updated? Now it is 3.7 ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 07:22:25 2018 From: report at bugs.python.org (Akshay Sharma) Date: Sun, 08 Apr 2018 11:22:25 +0000 Subject: [issue33239] tempfile module: functions with the 'buffering' option are incorrectly documented In-Reply-To: <1523128962.9.0.682650639539.issue33239@psf.upfronthosting.co.za> Message-ID: <1523186545.42.0.682650639539.issue33239@psf.upfronthosting.co.za> Akshay Sharma added the comment: Hi, will it be good to link the cross-reference for `open`(https://docs.python.org/3/library/functions.html#open) in the documentation? I think specifically mentioning the usage of the `buffering` is a better way. ---------- nosy: +Akshay Sharma _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 08:08:51 2018 From: report at bugs.python.org (Akshay Sharma) Date: Sun, 08 Apr 2018 12:08:51 +0000 Subject: [issue33239] tempfile module: functions with the 'buffering' option are incorrectly documented In-Reply-To: <1523128962.9.0.682650639539.issue33239@psf.upfronthosting.co.za> Message-ID: <1523189331.65.0.682650639539.issue33239@psf.upfronthosting.co.za> Change by Akshay Sharma : ---------- keywords: +patch pull_requests: +6120 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 08:56:26 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 08 Apr 2018 12:56:26 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523192186.23.0.682650639539.issue33185@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- keywords: +patch pull_requests: +6122 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 09:02:04 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 08 Apr 2018 13:02:04 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523192524.2.0.682650639539.issue33185@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 09:19:13 2018 From: report at bugs.python.org (Alexander Harkness) Date: Sun, 08 Apr 2018 13:19:13 +0000 Subject: [issue13940] imaplib: Mailbox names are not quoted In-Reply-To: <1328357098.01.0.78801274991.issue13940@psf.upfronthosting.co.za> Message-ID: <1523193553.72.0.682650639539.issue13940@psf.upfronthosting.co.za> Alexander Harkness added the comment: Pull Request opened on GH to fix this issue: https://github.com/python/cpython/pull/6395 ---------- versions: +Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 09:42:47 2018 From: report at bugs.python.org (Akshay Sharma) Date: Sun, 08 Apr 2018 13:42:47 +0000 Subject: [issue25735] math.factorial doc should mention integer return type In-Reply-To: <1448480671.49.0.139605050425.issue25735@psf.upfronthosting.co.za> Message-ID: <1523194967.05.0.682650639539.issue25735@psf.upfronthosting.co.za> Change by Akshay Sharma : ---------- pull_requests: +6123 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 09:44:47 2018 From: report at bugs.python.org (Alex Gaynor) Date: Sun, 08 Apr 2018 13:44:47 +0000 Subject: [issue29613] Support for SameSite Cookies In-Reply-To: <1487674471.93.0.248753692479.issue29613@psf.upfronthosting.co.za> Message-ID: <1523195087.65.0.682650639539.issue29613@psf.upfronthosting.co.za> Alex Gaynor added the comment: Good catch. ---------- versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 12:08:37 2018 From: report at bugs.python.org (Matej Cepl) Date: Sun, 08 Apr 2018 16:08:37 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523203717.77.0.682650639539.issue33233@psf.upfronthosting.co.za> Change by Matej Cepl : ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 12:14:05 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 08 Apr 2018 16:14:05 +0000 Subject: [issue33198] Build on Linux with --enable-optimizations fails In-Reply-To: <1522571938.21.0.467229070634.issue33198@psf.upfronthosting.co.za> Message-ID: <1523204045.26.0.682650639539.issue33198@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I wasn't able to reproduce the test_httplib with gcc 5.4.1 on Ubuntu 16.04. It would be nice if you could get more information about the crash by printing the gdb backtrace. It seems there is some help here doing that: https://github.com/springmeyer/travis-coredump ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 12:14:17 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 08 Apr 2018 16:14:17 +0000 Subject: [issue33198] Build on Linux with --enable-optimizations fails In-Reply-To: <1522571938.21.0.467229070634.issue33198@psf.upfronthosting.co.za> Message-ID: <1523204057.4.0.682650639539.issue33198@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 12:52:58 2018 From: report at bugs.python.org (Igor) Date: Sun, 08 Apr 2018 16:52:58 +0000 Subject: [issue28053] parameterize what serialization is used in multiprocessing In-Reply-To: <1473454734.41.0.810069156927.issue28053@psf.upfronthosting.co.za> Message-ID: <1523206378.26.0.682650639539.issue28053@psf.upfronthosting.co.za> Change by Igor : ---------- nosy: +i3v _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 12:53:05 2018 From: report at bugs.python.org (Igor) Date: Sun, 08 Apr 2018 16:53:05 +0000 Subject: [issue25370] Add support of pickling very large bytes and str objects with protocol < 4 In-Reply-To: <1444507390.05.0.862514167793.issue25370@psf.upfronthosting.co.za> Message-ID: <1523206385.86.0.682650639539.issue25370@psf.upfronthosting.co.za> Change by Igor : ---------- nosy: +i3v _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 12:53:10 2018 From: report at bugs.python.org (Matthias Kievernagel) Date: Sun, 08 Apr 2018 16:53:10 +0000 Subject: [issue25451] tkinter: PhotoImage transparency methods In-Reply-To: <1445417795.5.0.279905447074.issue25451@psf.upfronthosting.co.za> Message-ID: <1523206390.18.0.682650639539.issue25451@psf.upfronthosting.co.za> Change by Matthias Kievernagel : ---------- nosy: +mkiever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 12:55:06 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 08 Apr 2018 16:55:06 +0000 Subject: [issue25370] Add support of pickling very large bytes and str objects with protocol < 4 In-Reply-To: <1444507390.05.0.862514167793.issue25370@psf.upfronthosting.co.za> Message-ID: <1523206506.64.0.682650639539.issue25370@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Serhiy, now that protocol 4 is the default, this isn't needed anymore, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 14:16:23 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 08 Apr 2018 18:16:23 +0000 Subject: [issue33222] Various test failures if PYTHONUSERBASE is not canonicalized In-Reply-To: <1522850404.57.0.682650639539.issue33222@psf.upfronthosting.co.za> Message-ID: <1523211383.38.0.682650639539.issue33222@psf.upfronthosting.co.za> Ned Deily added the comment: Would you care to provide a PR fix with a test? ---------- keywords: +easy nosy: +ned.deily stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 14:19:34 2018 From: report at bugs.python.org (Louis Martin) Date: Sun, 08 Apr 2018 18:19:34 +0000 Subject: [issue33241] Tooltip not display with macOS 64-bit installer 3.6.5 but work with macOS 64-bit/32-bit installer Message-ID: <1523211574.88.0.682650639539.issue33241@psf.upfronthosting.co.za> Change by Louis Martin : ---------- components: Tkinter nosy: louis-martin priority: normal severity: normal status: open title: Tooltip not display with macOS 64-bit installer 3.6.5 but work with macOS 64-bit/32-bit installer versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 14:21:30 2018 From: report at bugs.python.org (Louis Martin) Date: Sun, 08 Apr 2018 18:21:30 +0000 Subject: [issue33241] Tooltip not display with macOS 64-bit installer 3.6.5 but work with macOS 64-bit/32-bit installer Message-ID: <1523211690.52.0.682650639539.issue33241@psf.upfronthosting.co.za> New submission from Louis Martin : Tested with : from appJar import gui with gui() as app: app.label('hello world', tip="help me") app.addLabel("l1", "text") app.setLabelTooltip("l1", "more help") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 14:25:06 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 08 Apr 2018 18:25:06 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1523211906.78.0.682650639539.issue24882@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +bquinlan, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 14:27:41 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 08 Apr 2018 18:27:41 +0000 Subject: [issue33236] MagicMock().__iter__.return_value is different from MagicMock().__iter__() In-Reply-To: <1523015407.46.0.682650639539.issue33236@psf.upfronthosting.co.za> Message-ID: <1523212061.75.0.682650639539.issue33236@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +michael.foord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 14:32:20 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 08 Apr 2018 18:32:20 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1523212340.14.0.682650639539.issue24882@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I'm not fond of this proposal. The existing behaviour is harmless; especially for a thread pool, since threads are cheap resources. Improving the logic a bit might seem nice, but it also complicates the executor implementation a bit more. Besides, once the N threads are spawned, they remain alive until the executor is shut down. So all it takes is a spike in incoming requests and you don't save resources anymore. ---------- nosy: +tomMoral versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 14:33:07 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 08 Apr 2018 18:33:07 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1523212387.19.0.682650639539.issue24882@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > If each worker thread ties up other resources in an application, such as handles to server connections, conserving threads could have a significant impact. You may want to implement a pooling mechanism for those connections, independent of the thread pool. It is also probably more flexible (you can implement whichever caching and lifetime logic benefits your application). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 14:42:56 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 08 Apr 2018 18:42:56 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1523212976.59.0.682650639539.issue24882@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Side note: > One concern I do have - while writing the patch, I noticed the existing submit method (specifically the adjust_thread_count function) isn't thread safe. True. The executor is obviously thread-safe internally (as it handles multiple worker threads). But the user should not /call/ it from multiple threads. (most primitives exposed by the Python stdlib are not thread-safe, except for the simplest ones such as lists, dicts etc.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 15:09:11 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 08 Apr 2018 19:09:11 +0000 Subject: [issue33241] Tooltip not display with macOS 64-bit installer 3.6.5 but work with macOS 64-bit/32-bit installer In-Reply-To: <1523211690.52.0.682650639539.issue33241@psf.upfronthosting.co.za> Message-ID: <1523214551.96.0.682650639539.issue33241@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 16:00:31 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 08 Apr 2018 20:00:31 +0000 Subject: [issue33241] Tooltip not display with macOS 64-bit installer 3.6.5 but work with macOS 64-bit/32-bit installer In-Reply-To: <1523211690.52.0.682650639539.issue33241@psf.upfronthosting.co.za> Message-ID: <1523217631.13.0.682650639539.issue33241@psf.upfronthosting.co.za> Ned Deily added the comment: I don't know anything about appJar (looks interesting!) but any issue like this is almost certainly a Tk issue, since Python's tkinter provides a fairly lightweight wrapper around calls to Tk. As far as I can tell from a quick test, it appears that the difference here is due to some change in the macOS Cocoa Tk behavior in more recent versions. As documented, the python.org 3.6.5 macOS 64-bit-only Python uses its own Tcl/Tk 8.6.8 while the 64-bit/32-bit installer continues to link with an external Tcl/Tk 8.5.x version. For that variant, the system looks first in /Library/Frameworks for third-party Tcl and Tk 8.5.x frameworks, such as the recommended ActiveTcl version (https://www.python.org/download/mac/tcltk/) and, if none found there, falls back to the Apple-supplied Tcl/Tk 8.5 frameworks in /System/Library/Frameworks. With the recommended ActiveState 8.5.18 Tcl/Tk version installed, the tooltips also do not appear just like with the 64-bit-only 8.6.8 version. Falling back to the old, buggy Apple-supplied 8.5.9 versions, the tooltips do appear, which I assume is what is happening on your system. I was also able to test with an X11 Tk 8.6.8 on macOS and there the tooltips *do* work. So, it appears that somewhere between Tk 8.5.9 and 8.5.18, the behavior of tooltips in Tk's macOS Aqua Cocoa implementation has changed. Suggest you pursue this on the Tcl/Tk project's Tk issue tracker (https://core.tcl.tk/tk/ticket) and/or its tcl-mac mailing list (https://sourceforge.net/p/tcl/mailman/tcl-mac/). It might help to have a pure Tcl test case. Good luck! (Nosying: Kevin Walzer from the Tk project as a heads up.) ---------- nosy: +wordtech resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 16:02:24 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Sun, 08 Apr 2018 20:02:24 +0000 Subject: [issue25177] OverflowError in statistics.mean when summing large floats In-Reply-To: <1442662840.23.0.781753910755.issue25177@psf.upfronthosting.co.za> Message-ID: <1523217744.83.0.682650639539.issue25177@psf.upfronthosting.co.za> Wolfgang Maier added the comment: Steven's commit here also fixed issue 24068. ---------- nosy: +wolma _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 16:03:14 2018 From: report at bugs.python.org (Wolfgang Maier) Date: Sun, 08 Apr 2018 20:03:14 +0000 Subject: [issue24068] statistics module - incorrect results with boolean input In-Reply-To: <1430211206.61.0.689765465928.issue24068@psf.upfronthosting.co.za> Message-ID: <1523217794.39.0.682650639539.issue24068@psf.upfronthosting.co.za> Wolfgang Maier added the comment: Fixed as part of resolving issue 25177. ---------- resolution: -> fixed stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 17:19:25 2018 From: report at bugs.python.org (Matthias Urlichs) Date: Sun, 08 Apr 2018 21:19:25 +0000 Subject: [issue33242] Support binary symbol names Message-ID: <1523222365.46.0.682650639539.issue33242@psf.upfronthosting.co.za> New submission from Matthias Urlichs : ctypes should support binary symbols. Rationale: There's no requirement that the symbol name in question is encoded as ASCII or UTF-8. >>> import ctypes >>> t = type('iface', (ctypes.Structure,), {'_fields_': [(b'c_string_symbol', ctypes.CFUNCTYPE(ctypes.c_uint32))]}) Traceback (most recent call last): File "", line 1, in TypeError: '_fields_' must be a sequence of (name, C type) pairs ---------- components: ctypes messages: 315096 nosy: smurfix priority: normal severity: normal status: open title: Support binary symbol names type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 17:32:53 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 08 Apr 2018 21:32:53 +0000 Subject: [issue33242] Support binary symbol names In-Reply-To: <1523222365.46.0.682650639539.issue33242@psf.upfronthosting.co.za> Message-ID: <1523223173.0.0.682650639539.issue33242@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 17:51:45 2018 From: report at bugs.python.org (Eryk Sun) Date: Sun, 08 Apr 2018 21:51:45 +0000 Subject: [issue33242] Support binary symbol names In-Reply-To: <1523222365.46.0.682650639539.issue33242@psf.upfronthosting.co.za> Message-ID: <1523224305.52.0.682650639539.issue33242@psf.upfronthosting.co.za> Eryk Sun added the comment: Field names define CField descriptor attributes on the class. Attribute names should be strings, not bytes. There's no syntactically clean way to use a bytes name. Consider the example of a generic property on a class: >>> T = type('T', (), {b'p': property(lambda s: 0)}) >>> t = T() >>> t.p Traceback (most recent call last): File "", line 1, in AttributeError: 'T' object has no attribute 'p' >>> getattr(t, b'p') Traceback (most recent call last): File "", line 1, in TypeError: getattr(): attribute name must be string We'd have to dig into the class dict and manually bind the property: >>> vars(T)[b'p'].__get__(t) 0 ---------- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 17:54:15 2018 From: report at bugs.python.org (Eryk Sun) Date: Sun, 08 Apr 2018 21:54:15 +0000 Subject: [issue33242] Support binary symbol names In-Reply-To: <1523222365.46.0.682650639539.issue33242@psf.upfronthosting.co.za> Message-ID: <1523224455.01.0.682650639539.issue33242@psf.upfronthosting.co.za> Change by Eryk Sun : ---------- resolution: not a bug -> rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 18:27:31 2018 From: report at bugs.python.org (Matthias Urlichs) Date: Sun, 08 Apr 2018 22:27:31 +0000 Subject: [issue33242] Support binary symbol names In-Reply-To: <1523222365.46.0.682650639539.issue33242@psf.upfronthosting.co.za> Message-ID: <1523226451.61.0.682650639539.issue33242@psf.upfronthosting.co.za> Matthias Urlichs added the comment: Well, the original problem remains: symbol names aren't constrained to UTF-8 ? so if I happen to stumble onto one of those (maybe generated by a code obfuscator), the answer is "don't use Python3 then"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 19:15:38 2018 From: report at bugs.python.org (Eryk Sun) Date: Sun, 08 Apr 2018 23:15:38 +0000 Subject: [issue33242] Support binary symbol names In-Reply-To: <1523222365.46.0.682650639539.issue33242@psf.upfronthosting.co.za> Message-ID: <1523229338.47.0.682650639539.issue33242@psf.upfronthosting.co.za> Eryk Sun added the comment: If you're automatically wrapping a C source file and don't know the source encoding, you could naively decode it as Latin-1. You're still faced with the problem of characters that Python doesn't allow in identifiers. For example, gcc allows "$" in C identifiers (e.g. a field named "egg$"), but Python doesn't allow this character. At least you can use getattr() to access such names. For example: >>> s = bytes(range(256)).decode('latin-1') >>> T = type('T', (), {s: 0}) >>> t = T() >>> getattr(t, s) 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 19:41:40 2018 From: report at bugs.python.org (Martin Falatic) Date: Sun, 08 Apr 2018 23:41:40 +0000 Subject: [issue33239] tempfile module: functions with the 'buffering' option are incorrectly documented In-Reply-To: <1523128962.9.0.682650639539.issue33239@psf.upfronthosting.co.za> Message-ID: <1523230900.92.0.682650639539.issue33239@psf.upfronthosting.co.za> Martin Falatic added the comment: The correction of `buffering=None` --> `buffering=-1` for the defaults definitely needs to happen. A reference to `open()` is already present in the 3.x documentation: "buffering, encoding and newline are interpreted as for open()." Given that the `open()` reference already suffices for `encoding` and `newline`, it ought to suffice for `buffering` as well. No extra text beyond that should be necessary (I originally thought that might be good to add, but looking at this now it's clear if you add more to describe `buffering` you'll need to add it for the other two options, and it's all duplicative. Fixing the defaults should suffice.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 20:42:49 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 09 Apr 2018 00:42:49 +0000 Subject: [issue12015] possible characters in temporary file name is too few In-Reply-To: <1304661107.62.0.977226402655.issue12015@psf.upfronthosting.co.za> Message-ID: <1523234569.77.0.682650639539.issue12015@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 9c463ec88ba21764f6fff8e01d6045a932a89438 by INADA Naoki (Wolfgang Maier) in branch 'master': Update docstring of tempfile._RandomNameSequence (GH-6414) https://github.com/python/cpython/commit/9c463ec88ba21764f6fff8e01d6045a932a89438 ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 20:43:50 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Apr 2018 00:43:50 +0000 Subject: [issue12015] possible characters in temporary file name is too few In-Reply-To: <1304661107.62.0.977226402655.issue12015@psf.upfronthosting.co.za> Message-ID: <1523234630.98.0.682650639539.issue12015@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6124 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 20:44:49 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Apr 2018 00:44:49 +0000 Subject: [issue12015] possible characters in temporary file name is too few In-Reply-To: <1304661107.62.0.977226402655.issue12015@psf.upfronthosting.co.za> Message-ID: <1523234689.22.0.682650639539.issue12015@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 21:01:56 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Apr 2018 01:01:56 +0000 Subject: [issue12015] possible characters in temporary file name is too few In-Reply-To: <1304661107.62.0.977226402655.issue12015@psf.upfronthosting.co.za> Message-ID: <1523235716.75.0.682650639539.issue12015@psf.upfronthosting.co.za> miss-islington added the comment: New changeset d964f51f813282171d4da831e8de0fe003253e9e by Miss Islington (bot) in branch '3.7': Update docstring of tempfile._RandomNameSequence (GH-6414) https://github.com/python/cpython/commit/d964f51f813282171d4da831e8de0fe003253e9e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 21:13:14 2018 From: report at bugs.python.org (Yu Liu) Date: Mon, 09 Apr 2018 01:13:14 +0000 Subject: [issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows In-Reply-To: <1523155916.86.0.682650639539.issue33240@psf.upfronthosting.co.za> Message-ID: <1523236394.22.0.682650639539.issue33240@psf.upfronthosting.co.za> Yu Liu added the comment: The result is 0.00026412295632975946 on my computer. Does this mean it is caused by an anti-malware program? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 21:26:59 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Apr 2018 01:26:59 +0000 Subject: [issue12015] possible characters in temporary file name is too few In-Reply-To: <1304661107.62.0.977226402655.issue12015@psf.upfronthosting.co.za> Message-ID: <1523237219.15.0.682650639539.issue12015@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 335efd7c252799eeeb8cbf51d178b1b897a91ae2 by Miss Islington (bot) in branch '3.6': Update docstring of tempfile._RandomNameSequence (GH-6414) https://github.com/python/cpython/commit/335efd7c252799eeeb8cbf51d178b1b897a91ae2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 22:41:52 2018 From: report at bugs.python.org (Eryk Sun) Date: Mon, 09 Apr 2018 02:41:52 +0000 Subject: [issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows In-Reply-To: <1523155916.86.0.682650639539.issue33240@psf.upfronthosting.co.za> Message-ID: <1523241712.26.0.682650639539.issue33240@psf.upfronthosting.co.za> Eryk Sun added the comment: A sub-millisecond wait is fairly quick, but it depends on the machine speed. I should have included a counter. Try the following. It's not reproducing the problem if num_retries doesn't get incremented. import os import time ERROR_DIR_NOT_EMPTY = 145 PARENT_PATH = 'foo' CHILD_PATH = os.path.join(PARENT_PATH, 'bar') os.rmdir(CHILD_PATH) num_retries = 0 t0 = time.perf_counter() while True: try: os.rmdir(PARENT_PATH) break except OSError as e: if e.winerror != ERROR_DIR_NOT_EMPTY: raise num_retries += 1 wait_time = time.perf_counter() - t0 print('num_retries:', num_retries) print('wait_time:', wait_time) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 23:07:30 2018 From: report at bugs.python.org (Ali Abbas) Date: Mon, 09 Apr 2018 03:07:30 +0000 Subject: [issue33243] nltk is not working properly Message-ID: <1523243250.91.0.682650639539.issue33243@psf.upfronthosting.co.za> New submission from Ali Abbas : nltk is not working properly, showing this error Traceback (most recent call last): File "token.py", line 1, in from nltk.tokenize import word_tokenize, sent_tokenize File "D:\PYTHON36\lib\site-packages\nltk\__init__.py", line 89, in from nltk.internals import config_java File "D:\PYTHON36\lib\site-packages\nltk\internals.py", line 11, in import subprocess File "D:\PYTHON36\lib\subprocess.py", line 126, in import threading File "D:\PYTHON36\lib\threading.py", line 7, in from traceback import format_exc as _format_exc File "D:\PYTHON36\lib\traceback.py", line 5, in import linecache File "D:\PYTHON36\lib\linecache.py", line 11, in import tokenize File "D:\PYTHON36\lib\tokenize.py", line 35, in from token import * File "C:\Users\Ali Abbas\Desktop\token\token.py", line 1, in from nltk.tokenize import word_tokenize, sent_tokenize File "D:\PYTHON36\lib\site-packages\nltk\tokenize\__init__.py", line 67, in from nltk.tokenize.mwe import MWETokenizer File "D:\PYTHON36\lib\site-packages\nltk\tokenize\mwe.py", line 31, in from nltk.util import Trie File "D:\PYTHON36\lib\site-packages\nltk\util.py", line 15, in import pydoc File "D:\PYTHON36\lib\pydoc.py", line 72, in from traceback import format_exception_only ImportError: cannot import name 'format_exception_only' ---------- components: Library (Lib) files: error.txt messages: 315106 nosy: Ali Abbas priority: normal severity: normal status: open title: nltk is not working properly type: compile error versions: Python 3.6 Added file: https://bugs.python.org/file47524/error.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 23:08:17 2018 From: report at bugs.python.org (Vignesh) Date: Mon, 09 Apr 2018 03:08:17 +0000 Subject: [issue33244] Overflow error Message-ID: <1523243297.05.0.682650639539.issue33244@psf.upfronthosting.co.za> New submission from Vignesh : Help me to recover this....... ---------- assignee: terry.reedy components: IDLE files: New Doc 2018-04-09.pdf messages: 315107 nosy: Vignesh, terry.reedy priority: normal severity: normal status: open title: Overflow error type: behavior versions: Python 2.7, Python 3.4 Added file: https://bugs.python.org/file47525/New Doc 2018-04-09.pdf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 23:47:30 2018 From: report at bugs.python.org (Ofek Lev) Date: Mon, 09 Apr 2018 03:47:30 +0000 Subject: [issue33245] Unable to send CTRL_BREAK_EVENT Message-ID: <1523245650.34.0.682650639539.issue33245@psf.upfronthosting.co.za> New submission from Ofek Lev : Vault (https://github.com/hashicorp/vault) requires the use of signals to trigger certain output https://www.vaultproject.io/docs/internals/telemetry.html. The required signal isn't sent on py2.7: >>> import os >>> import signal >>> import psutil >>> p = psutil.Process([p.info for p in psutil.process_iter(attrs=['pid', 'name']) if 'vault' in p.info['name']][0]['pid']) >>> p.exe() 'C:\\Users\\Ofek\\Desktop\\vault.exe' >>> p.pid 15536 >>> os.kill(p.pid, signal.CTRL_BREAK_EVENT) Traceback (most recent call last): File "", line 1, in WindowsError: [Error 87] The parameter is incorrect Interestingly, on py3.6 that code works but instead produces this: OSError: [WinError 87] The parameter is incorrect The above exception was the direct cause of the following exception: Traceback (most recent call last): File "", line 1, in SystemError: returned a result with an error set ---------- components: Windows messages: 315108 nosy: Ofekmeister, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Unable to send CTRL_BREAK_EVENT type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 8 23:58:07 2018 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 09 Apr 2018 03:58:07 +0000 Subject: [issue1230540] sys.excepthook doesn't work in threads Message-ID: <1523246287.14.0.682650639539.issue1230540@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 02:17:38 2018 From: report at bugs.python.org (Eryk Sun) Date: Mon, 09 Apr 2018 06:17:38 +0000 Subject: [issue33245] Unable to send CTRL_BREAK_EVENT In-Reply-To: <1523245650.34.0.682650639539.issue33245@psf.upfronthosting.co.za> Message-ID: <1523254658.46.0.682650639539.issue33245@psf.upfronthosting.co.za> Eryk Sun added the comment: Unless you're willing to step through hoops using ctypes or PyWin32, sending Ctrl+Break requires already being attached to the same console as the target. Note that the target isn't necessarily a single process that's attached to the console. Sending a control event is implemented by calling WinAPI GenerateConsoleCtrlEvent, which targets process group identifiers (i.e. like Unix killpg), not process identifiers (i.e. not like Unix kill). FYI, to generate the event, the console host (conhost.exe) uses an LPC port to relay the request to the session Windows server (csrss.exe), which is privileged to inject a thread in each target process. This control thread starts executing at a known entry point named "CtrlRoutine" in kernelbase.dll. (Prior to Windows 7 the console is actually hosted in csrss.exe, so there's no need to relay the request, and "CtrlRoutine" is implemented in kernel32.dll instead.) If you don't know the group ID, then the only option is to broadcast Ctrl+Break to group 0, which includes every process that's attached to the console. First ignore SIGBREAK (the C signal for CTRL_BREAK_EVENT) via signal.signal(signal.SIGBREAK, signal.SIG_IGN). Otherwise the default handler will run, which exits the current process. Then send Ctrl+Break via os.kill(0, signal.CTRL_BREAK_EVENT). On the other hand, if you started the process as a new group, then its ID is also the group ID. For example, p = subprocess.Popen('vault.exe', creationflags=subprocess.CREATE_NEW_PROCESS_GROUP). In this case you can send Ctrl+Break via os.kill(p.pid, signal.CTRL_BREAK_EVENT). Windows will generate the event only in the subset of processes that are both in the target process group and currently attached to the console that originated the request. The current implementation of os.kill() is behaving as designed and documented in Python 2.7. There is no bug in this case. However, the docs should clarify that the target when sending a console control event is a process group, not a process. They should also refer to the subprocess docs to explain how to create a new group via the CREATE_NEW_PROCESS_GROUP creation flag. Also, the line about accepting process handles should be stricken. A process handle is an integer that's indistinguishable from a process/group identifier, so the statement makes no sense, and thankfully the code doesn't try to implement anything that crazy. In Python 3, someone decided that if GenerateConsoleCtrlEvent fails, os.kill() should also try TerminateProcess, to allow terminating the process explicitly with exit codes 0 (CTRL_C_EVENT) and 1 (CTRL_BREAK_EVENT). Of course, killing a process using a console control event is nothing at all like terminating it abruptly, so to me this looks quite strange; it's coding with a sledgehammer. Anyway, if TerminateProcess succeeds it should, but currently does not, clear the error from the failed GenerateConsoleCtrlEvent call. That's a bug. I suggest resolving the bug by partially backing out of the change. It should only call GenerateConsoleCtrlEvent for the enum values signal.CTRL_C_EVENT and signal.CTRL_BREAK_EVENT, which I think was suggested by Steve Dower at one point. TerminateProcess can be called otherwise for 0 and 1 values. In this case, os.kill() would no longer magically switch between fundamentally different functions in a single call. An exception should always be raised if GenerateConsoleCtrlEvent fails. Possibly in 3.8, os.killpg() could be added on Windows for sending console control events to process groups, while deprecating or discouraging using os.kill() for this. ---------- nosy: +eryksun versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 03:02:02 2018 From: report at bugs.python.org (Yu Liu) Date: Mon, 09 Apr 2018 07:02:02 +0000 Subject: [issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows In-Reply-To: <1523155916.86.0.682650639539.issue33240@psf.upfronthosting.co.za> Message-ID: <1523257322.62.0.682650639539.issue33240@psf.upfronthosting.co.za> Yu Liu added the comment: This time I run it a couple of consecutive times manually. The result shows that the first time it retried 12 times and the wait time was 0.0004259171330071893. Then it seems to be steady, and the num_retried is 3 or 4, and the wait_time is about 0.00025. I also run it without `bar` opened in Explorer. The num_retried is 0 and the wait_time is 4.46745114706336e-05. Because of some reasons, I can't post the exact results here. I will run it on another computer later and post the results if you need all of the exact results. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 03:14:29 2018 From: report at bugs.python.org (=?utf-8?q?Markus_J=C3=A4rvisalo?=) Date: Mon, 09 Apr 2018 07:14:29 +0000 Subject: =?utf-8?q?=5Bissue33246=5D_Note_in_18=2E2=2E_json_=E2=80=94_JSON_encoder_?= =?utf-8?q?and_decoder_is_incorrect?= Message-ID: <1523258069.7.0.682650639539.issue33246@psf.upfronthosting.co.za> New submission from Markus J?rvisalo : The note in https://docs.python.org/2/library/json.html section "18.2. json ? JSON encoder and decoder". The note says incorrectly that JSON is a subset of YAML 1.2 but if you follow the text written in YAML 1.2 specification it states that: "The primary objective of this revision is to bring YAML into compliance with JSON as an official subset." So it should be that YAML is a subset of JSON and not the other way around. ---------- assignee: docs at python components: Documentation messages: 315111 nosy: Markus J?rvisalo, docs at python priority: normal severity: normal status: open title: Note in 18.2. json ? JSON encoder and decoder is incorrect type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 03:48:23 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 09 Apr 2018 07:48:23 +0000 Subject: =?utf-8?q?=5Bissue33246=5D_Note_in_18=2E2=2E_json_=E2=80=94_JSON_encoder_?= =?utf-8?q?and_decoder_is_incorrect?= In-Reply-To: <1523258069.7.0.682650639539.issue33246@psf.upfronthosting.co.za> Message-ID: <1523260103.83.0.682650639539.issue33246@psf.upfronthosting.co.za> INADA Naoki added the comment: > "The primary objective of this revision is to bring YAML into compliance with JSON as an official subset." > > So it should be that YAML is a subset of JSON and not the other way around. This sentence can be read as "JSON is subset of YAML" and "YAML is subset of JSON". As reading the spec, it means former. For example, http://yaml.org/spec/1.2/spec.html#id2759572 says: > YAML can therefore be viewed as a natural superset of JSON, offering improved human readability and a more complete information model. This is also the case in practice; every JSON file is also a valid YAML file. This makes it easy to migrate from JSON to YAML if/when the additional features are required. ---------- nosy: +inada.naoki resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 03:48:52 2018 From: report at bugs.python.org (=?utf-8?q?S=C5=82awomir_Nizio?=) Date: Mon, 09 Apr 2018 07:48:52 +0000 Subject: [issue33247] File "" is opened and read unconditionally Message-ID: <1523260132.01.0.682650639539.issue33247@psf.upfronthosting.co.za> New submission from S?awomir Nizio : This may lead to e.g. DoS or data leak. When an exception occurs, the Python interpreter displays the stack trace: $ python3 a.py Traceback (most recent call last): File "a.py", line 2, in print(1/0) ZeroDivisionError: division by zero and does so also when there is no source file: $ python3 -c 'print(1/0)' Traceback (most recent call last): File "", line 1, in ZeroDivisionError: division by zero It opens the file in question to read the needed bits, and an the latter case it tries to open file named literally . There is a possibility of a denial of service (a), data leak (b) and other types of problems (c). a) If "" is a symbolic link for example to /dev/stdin or an "empty" fifo, the script hangs. $ ln -s /dev/stdin '' $ python3 -c 'print(1/0)' Traceback (most recent call last): File "", line 1, in # hangs here b) If is a symbolic link, its content will be read as well. This can be a file with some kind of secret data, readable by the user executing the script, but which should not be normally displayed to screen (or for example sent back with HTTP to display the error message). User who can run a certain script (for example using sudo) that calls python -c as root or other user may be able to see parts of otherwise inaccessible files. c) Other attacks (or misbehaviour) is possible, for example file could be a symbolic link to a device file which upon reading triggers some system wide action. An interesting possiblity (if not necessarity a security issue by itself) is a way to trick a user about the cause of the exception, like in the example. $ echo 'print(0/1)' > '' $ python3 -c 'print(1/0)' Traceback (most recent call last): File "", line 1, in print(0/1) ZeroDivisionError: division by zero As it turns out, the file doesn't need to be in the current directory but anywhere in sys.path. I was able to confirm the behaviour on all versions I tried: 2.7.14, 3.5.4 and 3.6.5. This is in a way similar to the problem with Python modules loaded from current working directory: https://bugs.python.org/issue16202 (sys.path[0] security issues) but the essential differences are that: - upon validation system (e.g. a server) may reject Python files but leave out "," - system can sanitize sys.path which helps with the sys.path[0] bug but not the one being described. ---------- components: Interpreter Core messages: 315113 nosy: snizio priority: normal severity: normal status: open title: File "" is opened and read unconditionally type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 04:10:25 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 08:10:25 +0000 Subject: [issue33247] File "" is opened and read unconditionally In-Reply-To: <1523260132.01.0.682650639539.issue33247@psf.upfronthosting.co.za> Message-ID: <1523261425.95.0.682650639539.issue33247@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This is a duplicate of issue16974. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> when "python -c command" does a traceback, it open the file "" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 04:15:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 08:15:16 +0000 Subject: [issue33243] nltk is not working properly In-Reply-To: <1523243250.91.0.682650639539.issue33243@psf.upfronthosting.co.za> Message-ID: <1523261716.46.0.682650639539.issue33243@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: nltk is not a part of the stdlib, it a third-party library. But in this case seems the problem is in your code or configuration. Your "C:\Users\Ali Abbas\Desktop\token\token.py" file hides the standard token module. ---------- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 04:34:06 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 08:34:06 +0000 Subject: [issue33244] Overflow error In-Reply-To: <1523243297.05.0.682650639539.issue33244@psf.upfronthosting.co.za> Message-ID: <1523262846.09.0.682650639539.issue33244@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Please provide your code and the description of your problem as plain text. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 04:54:43 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 09 Apr 2018 08:54:43 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1523264083.77.0.682650639539.issue23403@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Shelve still uses protocol 3 by default. Should it be bumped too? That sounds reasonable. Perhaps open a separate issue for it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 06:04:53 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 09 Apr 2018 10:04:53 +0000 Subject: [issue33099] test_poplib hangs with the changes done in PR In-Reply-To: <1521411483.84.0.467229070634.issue33099@psf.upfronthosting.co.za> Message-ID: <1523268293.97.0.682650639539.issue33099@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- keywords: +patch pull_requests: +6126 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 06:09:06 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 09 Apr 2018 10:09:06 +0000 Subject: [issue33099] test_poplib hangs with the changes done in PR In-Reply-To: <1521411483.84.0.467229070634.issue33099@psf.upfronthosting.co.za> Message-ID: <1523268546.69.0.682650639539.issue33099@psf.upfronthosting.co.za> INADA Naoki added the comment: There are some resource leaks: * When error occurred in setUp() function, server thread is not stopped. It leaked threads and sockets for the server. * When error occurred in server thread's run() method, asyncore.close_all() is not called. These leaks makes dangling threads. It caused hang in test_poplib shutdown process. Additionally, the error is not printed in these cases. It makes harder to fix real problem. ---------- nosy: +inada.naoki stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 06:10:20 2018 From: report at bugs.python.org (Jonas Obrist) Date: Mon, 09 Apr 2018 10:10:20 +0000 Subject: [issue33248] Different behavior on macos and linux (docker) with __await__ Message-ID: <1523268620.33.0.682650639539.issue33248@psf.upfronthosting.co.za> New submission from Jonas Obrist : The attached code runs fine on MacOS using 3.6.5 from homebrew. However on Windows (I tested on 3.6.4 with the 32bit installer from the website) and Linux (using the python:3.6.5 docker image) it errors with "TypeError: cannot 'yield from' a coroutine object in a non-coroutine generator". On MacOS I tried both _UnixSelectorEventLoop with Kqueue and Select selectors, on Linux _UnixSelectorEventLoop with Epoll and Select. Which behavior is the expected one? As an aside, what I'm trying to achieve is to have an awaitable object that which if unawaited evaluates to False if used in if statements. ---------- components: asyncio files: nta.py messages: 315119 nosy: Jonas Obrist, asvetlov, yselivanov priority: normal severity: normal status: open title: Different behavior on macos and linux (docker) with __await__ type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47526/nta.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 06:11:51 2018 From: report at bugs.python.org (Christian Heimes) Date: Mon, 09 Apr 2018 10:11:51 +0000 Subject: [issue33099] test_poplib hangs with the changes done in PR In-Reply-To: <1521411483.84.0.467229070634.issue33099@psf.upfronthosting.co.za> Message-ID: <1523268711.27.0.682650639539.issue33099@psf.upfronthosting.co.za> Christian Heimes added the comment: This is likely a duplicate of BPO #32706 and #32753 ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 06:19:10 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 09 Apr 2018 10:19:10 +0000 Subject: [issue33099] test_poplib hangs with the changes done in PR In-Reply-To: <1521411483.84.0.467229070634.issue33099@psf.upfronthosting.co.za> Message-ID: <1523269150.22.0.682650639539.issue33099@psf.upfronthosting.co.za> INADA Naoki added the comment: @Christian Precisely, my PR doesn't fix #32706 and #32753. It fixes only hang caused by them and print stack trace for them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 06:23:23 2018 From: report at bugs.python.org (Jonas Obrist) Date: Mon, 09 Apr 2018 10:23:23 +0000 Subject: [issue33248] __await__ behaves different with or without PYTHONASYNCIODEBUG In-Reply-To: <1523268620.33.0.682650639539.issue33248@psf.upfronthosting.co.za> Message-ID: <1523269403.44.0.682650639539.issue33248@psf.upfronthosting.co.za> Jonas Obrist added the comment: I've just realized the difference between the environments wasn't the operating system, but PYTHONASYNCIODEBUG. If it is set, the code works, however if it is unset the code does not work. See the updated (attached) code for reference. ---------- title: Different behavior on macos and linux (docker) with __await__ -> __await__ behaves different with or without PYTHONASYNCIODEBUG Added file: https://bugs.python.org/file47527/nta.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 06:41:33 2018 From: report at bugs.python.org (Siddhesh Poyarekar) Date: Mon, 09 Apr 2018 10:41:33 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1523270493.89.0.682650639539.issue33012@psf.upfronthosting.co.za> Siddhesh Poyarekar added the comment: Fair enough, I'll reduce my scope of changes for this patchset, especially since I'm unable to find enough time to work on the remaining changes I had thought of in the coming weeks. I'll post an updated patch soonish. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 06:48:33 2018 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 09 Apr 2018 10:48:33 +0000 Subject: [issue26979] The danger of PyType_FromSpec() In-Reply-To: <1462731878.82.0.9073654009.issue26979@psf.upfronthosting.co.za> Message-ID: <1523270913.18.0.682650639539.issue26979@psf.upfronthosting.co.za> Change by Petr Viktorin : ---------- nosy: +Dormouse759, encukou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 06:48:45 2018 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 09 Apr 2018 10:48:45 +0000 Subject: [issue15727] PyType_FromSpecWithBases tp_new bugfix In-Reply-To: <1345391866.4.0.54341725267.issue15727@psf.upfronthosting.co.za> Message-ID: <1523270925.33.0.682650639539.issue15727@psf.upfronthosting.co.za> Change by Petr Viktorin : ---------- nosy: +Dormouse759 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 06:53:28 2018 From: report at bugs.python.org (Jonas Obrist) Date: Mon, 09 Apr 2018 10:53:28 +0000 Subject: [issue33248] __await__ behaves different with or without PYTHONASYNCIODEBUG In-Reply-To: <1523268620.33.0.682650639539.issue33248@psf.upfronthosting.co.za> Message-ID: <1523271208.27.0.682650639539.issue33248@psf.upfronthosting.co.za> Jonas Obrist added the comment: On 9c463ec88ba21764f6fff8e01d6045a932a89438 (master/3.7) both cases fail to execute. I would argue that this code should be allowed... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 07:49:31 2018 From: report at bugs.python.org (INADA Naoki) Date: Mon, 09 Apr 2018 11:49:31 +0000 Subject: [issue32753] ssl.SSLError exceptions in test_poplib In-Reply-To: <1517612876.52.0.467229070634.issue32753@psf.upfronthosting.co.za> Message-ID: <1523274571.22.0.682650639539.issue32753@psf.upfronthosting.co.za> INADA Naoki added the comment: On Ubuntu 17.10 (OpenSSL 1.0.2g), this patch fixes test_poplib error. But I don't know this patch is right. $ git diff diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py index 6abdc93879..d7a8857b05 100644 --- a/Lib/test/test_poplib.py +++ b/Lib/test/test_poplib.py @@ -180,7 +180,8 @@ class DummyPOP3Handler(asynchat.async_chat): elif err.args[0] == ssl.SSL_ERROR_EOF: return self.handle_close() # TODO: SSLError does not expose alert information - elif "SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1]: + elif ("SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1] + or "SSLV3_ALERT_CERTIFICATE_UNKNOWN" in err.args[1]): return self.handle_close() raise except OSError as err: ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 07:53:18 2018 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 09 Apr 2018 11:53:18 +0000 Subject: [issue26979] The danger of PyType_FromSpec() In-Reply-To: <1462731878.82.0.9073654009.issue26979@psf.upfronthosting.co.za> Message-ID: <1523274798.09.0.682650639539.issue26979@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 08:02:08 2018 From: report at bugs.python.org (Yu Liu) Date: Mon, 09 Apr 2018 12:02:08 +0000 Subject: [issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows In-Reply-To: <1523155916.86.0.682650639539.issue33240@psf.upfronthosting.co.za> Message-ID: <1523275328.43.0.682650639539.issue33240@psf.upfronthosting.co.za> Yu Liu added the comment: These are results on another slower machine. Note these results are attained on Windows 10, while the above on Windows 7. Just in case it has some influence. $ python test.py num_retries: 6 wait_time: 0.0008691726957804373 $ python test.py num_retries: 3 wait_time: 0.0007175661796639806 $ python test.py num_retries: 6 wait_time: 0.0007962191842657514 $ python test.py num_retries: 3 wait_time: 0.0006970480045504753 $ python test.py num_retries: 4 wait_time: 0.0009637842810260455 $ python test.py num_retries: 4 wait_time: 0.001005390580561765 $ python test.py num_retries: 3 wait_time: 0.000654301806397339 $ python test.py num_retries: 6 wait_time: 0.0008857012257329832 $ python test.py num_retries: 4 wait_time: 0.0009227479307990348 $ python test.py num_retries: 4 wait_time: 0.0008976701612158615 And this is result without `bar` opened in Explorer. $ python test.py num_retries: 0 wait_time: 0.00019834235943055225 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 08:37:25 2018 From: report at bugs.python.org (Alexander Neumann) Date: Mon, 09 Apr 2018 12:37:25 +0000 Subject: [issue33249] Pickling objects with recursive references and partials fail Message-ID: <1523277445.09.0.682650639539.issue33249@psf.upfronthosting.co.za> New submission from Alexander Neumann : The code below causes a AttributeError: 'Event' object has no attribute 'name' It seems like the entries of `Machine.events` are not available during `__setstate__`. However, the behaviour depends on the Python version. For Python 3.6.4 it's always the 'first' (as in it's always 'to_A' which has been added first) element in `Machine.events` that is incomplete. For Python 3.4.8 and 3.5.5 it looks like a racing condition since sometimes there is no error, sometimes its the first or the second element which is incomplete. Letting `Machine` serve as its own model and pickling that does work for all three versions. Tested on MacOS High Sierra. ``` import pickle from functools import partial class Event: def __init__(self, name, machine): self.name = name self.machine = machine def trigger(self): pass class Machine: def __init__(self, model, states): self.events = {} self.model = model if model != 'self' else self for state in states: trigger = 'to_%s' % state self.events[trigger] = Event(trigger, self) trig_func = partial(self.events[trigger].trigger) setattr(self.model, trigger, trig_func) def __getstate__(self): return self.__dict__ def __setstate__(self, state): self.__dict__.update(state) print(self.events['to_B'].name) print(self.events['to_A'].name) class Model: def __init__(self): self.machine = Machine(self, states=['A', 'B']) model = Model() dump = pickle.dumps(model) model2 = pickle.loads(dump) ``` ---------- components: Interpreter Core messages: 315127 nosy: aleneum priority: normal severity: normal status: open title: Pickling objects with recursive references and partials fail type: behavior versions: Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 09:29:07 2018 From: report at bugs.python.org (handle) Date: Mon, 09 Apr 2018 13:29:07 +0000 Subject: [issue33250] Move VERSION attribute output up in pydoc (via help() builtin) Message-ID: <1523280547.57.0.682650639539.issue33250@psf.upfronthosting.co.za> New submission from handle : I'd like to suggest moving the output of a modules version, e.g. VERSION __version__ up as it can "buried" by PACKAGE CONTENTS and DATA items. https://github.com/python/cpython/blob/3.6/Lib/pydoc.py#L1181 The other attributes (date, author, credits) could be moved up, too, e.g. to https://github.com/python/cpython/blob/3.6/Lib/pydoc.py#L1117 Of course this depends on the use case (what are we looking for), but assuming these attributes are rather limited and constant in size, they would not be blocking access to the further items. ---------- components: Library (Lib) messages: 315128 nosy: handle priority: normal severity: normal status: open title: Move VERSION attribute output up in pydoc (via help() builtin) type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 11:11:35 2018 From: report at bugs.python.org (Eryk Sun) Date: Mon, 09 Apr 2018 15:11:35 +0000 Subject: [issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows In-Reply-To: <1523155916.86.0.682650639539.issue33240@psf.upfronthosting.co.za> Message-ID: <1523286695.65.0.682650639539.issue33240@psf.upfronthosting.co.za> Eryk Sun added the comment: Your case probably isn't due to a anti-malware filesystem filter. Explorer keeps handles open to directories to get updates via ReadDirectoryChangesExW. It opens watched directories with shared delete access, so deleting the child succeeds. But as discussed above, the directory isn't unlinked from the parent until Explorer closes its handle. Apparently it's not fast enough on the systems you tested. As a workaround, you can define an onerror handler for use with shutil.rmtree() that retries the rmdir() call in a loop for up to a given timeout period, such as 10 ms. For convenience, a handler that retries unlink() and rmdir() could be distributed with shutil. For ease of use, it could be enabled by default on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 11:31:56 2018 From: report at bugs.python.org (Alexander Neumann) Date: Mon, 09 Apr 2018 15:31:56 +0000 Subject: [issue33249] Unpickling objects with recursive references and partials fail due to incomplete state passed to __setstate__ In-Reply-To: <1523277445.09.0.682650639539.issue33249@psf.upfronthosting.co.za> Message-ID: <1523287916.05.0.682650639539.issue33249@psf.upfronthosting.co.za> Alexander Neumann added the comment: Changed issue title to summarise the actual problem better. ---------- title: Pickling objects with recursive references and partials fail -> Unpickling objects with recursive references and partials fail due to incomplete state passed to __setstate__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 11:37:58 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 09 Apr 2018 15:37:58 +0000 Subject: [issue32759] multiprocessing.Array do not release shared memory In-Reply-To: <1517692462.01.0.467229070634.issue32759@psf.upfronthosting.co.za> Message-ID: <1523288278.11.0.682650639539.issue32759@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset e4679cd644aa19f9d9df9beb1326625cf2b02c15 by Antoine Pitrou in branch 'master': bpo-32759: Free unused arenas in multiprocessing.heap (GH-5827) https://github.com/python/cpython/commit/e4679cd644aa19f9d9df9beb1326625cf2b02c15 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 11:42:05 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 09 Apr 2018 15:42:05 +0000 Subject: [issue32759] multiprocessing.Array do not release shared memory In-Reply-To: <1517692462.01.0.467229070634.issue32759@psf.upfronthosting.co.za> Message-ID: <1523288525.59.0.682650639539.issue32759@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I pushed a fix for this in 3.8. Since the fix is a bit delicate, I'd rather not backport it. Thank you for reporting this issue! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 12:01:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 16:01:27 +0000 Subject: [issue32759] multiprocessing.Array do not release shared memory In-Reply-To: <1517692462.01.0.467229070634.issue32759@psf.upfronthosting.co.za> Message-ID: <1523289687.41.0.682650639539.issue32759@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This change looks safe to me. I was just not sure that it is enough for practical cases. What if after allocating a large buffer the rest of the new area would be used for allocating small buffers? They can keep references to the large area after freeing the large buffer. Perhaps it is worth to block marking the remainder of a large area available. This will increase the memory consumption by small percent, but will reduce the risk of prolonging the life time of large blocks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 12:14:31 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 16:14:31 +0000 Subject: [issue33031] Questionable code in OrderedDict definition In-Reply-To: <1520534349.37.0.467229070634.issue33031@psf.upfronthosting.co.za> Message-ID: <1523290471.14.0.682650639539.issue33031@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 827d49f3cf0296f1e267eae6834a977cf312cc1e by Serhiy Storchaka in branch 'master': bpo-33031: Remove dead code in C implementation of OrderedDict. (GH-6120) https://github.com/python/cpython/commit/827d49f3cf0296f1e267eae6834a977cf312cc1e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 12:25:53 2018 From: report at bugs.python.org (Akshay Sharma) Date: Mon, 09 Apr 2018 16:25:53 +0000 Subject: [issue33222] Various test failures if PYTHONUSERBASE is not canonicalized In-Reply-To: <1522850404.57.0.682650639539.issue33222@psf.upfronthosting.co.za> Message-ID: <1523291153.94.0.682650639539.issue33222@psf.upfronthosting.co.za> Akshay Sharma added the comment: What are the possible cases we can have here ? ---------- nosy: +akshaysharma096 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 12:26:29 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 16:26:29 +0000 Subject: [issue33237] Improve AttributeError message for partially initialized module In-Reply-To: <1523029412.67.0.682650639539.issue33237@psf.upfronthosting.co.za> Message-ID: <1523291189.17.0.682650639539.issue33237@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I have applied the Nick's suggestion. Needed to find a place for new test. The code is copied from PyImport_ImportModuleLevelObject(). I'm not happy from how verbose it is. And testing mod.__spec__._initialized adds relatively large overhead for importing already imported module in PyImport_ImportModuleLevelObject(). Is it possible to invent a faster way for checking whether the module is partially imported? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 12:34:18 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 09 Apr 2018 16:34:18 +0000 Subject: [issue32759] multiprocessing.Array do not release shared memory In-Reply-To: <1517692462.01.0.467229070634.issue32759@psf.upfronthosting.co.za> Message-ID: <1523291658.06.0.682650639539.issue32759@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Yes, it's a minimal effort. More sophisticated behavior would require a more sophisticated allocator. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 12:35:29 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 16:35:29 +0000 Subject: [issue33200] Optimize the empty set "literal" In-Reply-To: <1522578566.75.0.467229070634.issue33200@psf.upfronthosting.co.za> Message-ID: <1523291729.59.0.682650639539.issue33200@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Closed due to the lack of practical applications. Can be reopened if this idiom become popular. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 12:44:19 2018 From: report at bugs.python.org (Ethan Furman) Date: Mon, 09 Apr 2018 16:44:19 +0000 Subject: [issue33233] Suggest third-party cmd2 module as alternative to cmd In-Reply-To: <1522954289.49.0.682650639539.issue33233@psf.upfronthosting.co.za> Message-ID: <1523292259.93.0.682650639539.issue33233@psf.upfronthosting.co.za> Change by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 12:57:51 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 09 Apr 2018 16:57:51 +0000 Subject: [issue33244] Overflow error In-Reply-To: <1523243297.05.0.682650639539.issue33244@psf.upfronthosting.co.za> Message-ID: <1523293071.3.0.682650639539.issue33244@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Vignesh: This issue tracker is for reporting bugs in the CPython interpreter. Requests for help with problems with your code should go elsewhere, such as pythonlist mail list or stackoverflow.com web site. In this case, your problem is described in the error message: you input an int that is too large for the array of C longs. The following is a much shortened example equivalent to your code. >>> import array >>> longs = array.array('l',[]) >>> longs.append(2222222222222222222222222222222222222222222) Traceback (most recent call last): File "", line 1, in longs.append(2222222222222222222222222222222222222222222) OverflowError: Python int too large to convert to C long When a program gets input from a user, it must be prepared to catch and deal with exceptions. If you have more questions, ask on a user help forum, such as the 2 I listed above. ---------- assignee: terry.reedy -> components: -IDLE resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 13:09:23 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 17:09:23 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1523293763.08.0.682650639539.issue31920@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset c93938b5beea4c3f592119ebee6d4029558db8de by Serhiy Storchaka in branch 'master': bpo-31920: Fixed handling directories as arguments in the ``pygettext`` script. (GH-6259) https://github.com/python/cpython/commit/c93938b5beea4c3f592119ebee6d4029558db8de ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 13:09:38 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Apr 2018 17:09:38 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1523293778.76.0.682650639539.issue31920@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6127 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 13:10:27 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Apr 2018 17:10:27 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1523293827.22.0.682650639539.issue31920@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6128 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 13:15:01 2018 From: report at bugs.python.org (Skip Montanaro) Date: Mon, 09 Apr 2018 17:15:01 +0000 Subject: [issue33099] test_poplib hangs with the changes done in PR In-Reply-To: <1521411483.84.0.467229070634.issue33099@psf.upfronthosting.co.za> Message-ID: <1523294101.81.0.682650639539.issue33099@psf.upfronthosting.co.za> Skip Montanaro added the comment: Just in case this would be useful to others, git bisect led me to this commit as the source of the problem: 61d478c71c5341cdc54e6bfb4ace4252852fd972 is the first bad commit commit 61d478c71c5341cdc54e6bfb4ace4252852fd972 Author: Christian Heimes Date: Sat Jan 27 15:51:38 2018 +0100 bpo-31399: Let OpenSSL verify hostname and IP address (#3462) bpo-31399: Let OpenSSL verify hostname and IP The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. * Remove match_hostname calls * Check for libssl with set1_host, libssl must provide X509_VERIFY_PARAM_set1_host() * Add documentation for OpenSSL 1.0.2 requirement * Don't support OpenSSL special mode with a leading dot, e.g. ".example.org" matches "www.example.org". It's not standard conform. * Add hostname_checks_common_name Signed-off-by: Christian Heimes :040000 040000 09f4c8a18941f926c1f79e2f07dfd7731edf74c2 798ae3fab880e3365c490d56935901a4c18fd3bd M Doc :040000 040000 f35a1b4e2144050dfc4c7dbb02b7d92e3de1c2d0 7af4e4a8e82eafc6e7f2f4392c951213777f12c4 M Lib :040000 040000 e287c27f4db61beae905c21b96666194bb930c13 59e6fc63d296f7fe3187ff0987a04c9999e2d1d0 M Misc :040000 040000 95250f4c1009b5f10ec392c186908698d78f9cd3 160ebeb2c63d1ca305c7e37a0b555900b5084d20 M Modules :040000 040000 8adc7f664a8eaa667f4540f537304d7f9de672d4 41ea621f5433077f6dd776f4c2c51f7a8e4cab0f M PC :100644 100644 a6f4488cc99941abaa8b6fb7c53079b7cc292f9f ba0a7624cfcd0129e73bc218510f398001514df8 M setup.py ---------- nosy: +skip.montanaro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 13:19:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 17:19:27 +0000 Subject: [issue33031] Questionable code in OrderedDict definition In-Reply-To: <1520534349.37.0.467229070634.issue33031@psf.upfronthosting.co.za> Message-ID: <1523294367.57.0.682650639539.issue33031@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6129 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 13:21:40 2018 From: report at bugs.python.org (Akshay Sharma) Date: Mon, 09 Apr 2018 17:21:40 +0000 Subject: [issue33222] Various test failures if PYTHONUSERBASE is not canonicalized In-Reply-To: <1522850404.57.0.682650639539.issue33222@psf.upfronthosting.co.za> Message-ID: <1523294500.05.0.682650639539.issue33222@psf.upfronthosting.co.za> Change by Akshay Sharma : ---------- keywords: +patch pull_requests: +6130 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 13:44:12 2018 From: report at bugs.python.org (Christian Heimes) Date: Mon, 09 Apr 2018 17:44:12 +0000 Subject: [issue33099] test_poplib hangs with the changes done in PR In-Reply-To: <1521411483.84.0.467229070634.issue33099@psf.upfronthosting.co.za> Message-ID: <1523295852.45.0.682650639539.issue33099@psf.upfronthosting.co.za> Christian Heimes added the comment: Thanks for you confirmation. I already knew which commit lead to the issue. :) The problem didn't "pop" up in my local tests or on Travis CI. I can only reproduce it locally, when I run the test in a tight loop and put extra load on the other CPU cores. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 13:57:55 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Apr 2018 17:57:55 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1523296675.13.0.682650639539.issue31920@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 9b25bd6e26b50ade8d52a85c78d957b1f6f9131c by Miss Islington (bot) in branch '3.7': bpo-31920: Fixed handling directories as arguments in the ``pygettext`` script. (GH-6259) https://github.com/python/cpython/commit/9b25bd6e26b50ade8d52a85c78d957b1f6f9131c ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 14:06:11 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Apr 2018 18:06:11 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1523297171.54.0.682650639539.issue31920@psf.upfronthosting.co.za> miss-islington added the comment: New changeset e0dbc57e116516f6ca1ef021f71e1a98773d57ed by Miss Islington (bot) in branch '3.6': bpo-31920: Fixed handling directories as arguments in the ``pygettext`` script. (GH-6259) https://github.com/python/cpython/commit/e0dbc57e116516f6ca1ef021f71e1a98773d57ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 14:07:30 2018 From: report at bugs.python.org (David K. Hess) Date: Mon, 09 Apr 2018 18:07:30 +0000 Subject: [issue4963] mimetypes.guess_extension result changes after mimetypes.init() In-Reply-To: <1232107494.83.0.0570958889295.issue4963@psf.upfronthosting.co.za> Message-ID: <1523297250.81.0.682650639539.issue4963@psf.upfronthosting.co.za> David K. Hess added the comment: Are there any committers watching this issue that are able to review the PR? https://github.com/python/cpython/pull/3062 It's close to 6 months old now with no action on it. I'm willing to help but doing so and then having the PR gather dust is pretty discouraging. Thanks in advance! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 14:46:47 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 18:46:47 +0000 Subject: [issue33031] Questionable code in OrderedDict definition In-Reply-To: <1520534349.37.0.467229070634.issue33031@psf.upfronthosting.co.za> Message-ID: <1523299607.76.0.682650639539.issue33031@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b0f387d7ca126d486fc82744b8ec90c131230311 by Serhiy Storchaka in branch '3.7': [3.7] bpo-33031: Remove dead code in C implementation of OrderedDict. (GH-6120) (GH-6433) https://github.com/python/cpython/commit/b0f387d7ca126d486fc82744b8ec90c131230311 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 14:47:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 18:47:41 +0000 Subject: [issue33031] Questionable code in OrderedDict definition In-Reply-To: <1520534349.37.0.467229070634.issue33031@psf.upfronthosting.co.za> Message-ID: <1523299661.53.0.682650639539.issue33031@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 15:02:37 2018 From: report at bugs.python.org (Fred L. Drake, Jr.) Date: Mon, 09 Apr 2018 19:02:37 +0000 Subject: [issue32706] test_check_hostname() of test_ftplib started to fail randomly In-Reply-To: <1517225256.94.0.467229070634.issue32706@psf.upfronthosting.co.za> Message-ID: <1523300557.5.0.682650639539.issue32706@psf.upfronthosting.co.za> Change by Fred L. Drake, Jr. : ---------- nosy: +fdrake _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 15:08:02 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Apr 2018 19:08:02 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1523300882.95.0.682650639539.issue31920@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6131 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 15:59:13 2018 From: report at bugs.python.org (Skip Montanaro) Date: Mon, 09 Apr 2018 19:59:13 +0000 Subject: [issue33099] test_poplib hangs with the changes done in PR In-Reply-To: <1521411483.84.0.467229070634.issue33099@psf.upfronthosting.co.za> Message-ID: <1523303953.0.0.682650639539.issue33099@psf.upfronthosting.co.za> Skip Montanaro added the comment: @christian.heimes I figured you probably didn't need it, but I did that work before I discovered this ticket. And as a nice bonus, I got to learn git bisect. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 16:04:26 2018 From: report at bugs.python.org (Tim Shaffer) Date: Mon, 09 Apr 2018 20:04:26 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars Message-ID: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> New submission from Tim Shaffer : The documentation for ConfigParser.items(section, raw=False, vars=None) says the following: > Changed in version 3.2: Items present in vars no longer appear in the result. The previous behaviour mixed actual parser options with variables provided for interpolation. https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.items However, this does not seem to be the case. The keys from vars are present in the output. Tested on 3.6.5. This example shows the issue: import configparser config = configparser.ConfigParser() config.add_section('example') config.set('example', 'name', 'timster %(suffix)s') data = config.items('example', vars={'suffix': 'user'}) print(data) Expected output: [('name', 'timster user')] Actual output: [('name', 'timster user'), ('suffix', 'user')] ---------- components: Library (Lib) messages: 315148 nosy: timster priority: normal severity: normal status: open title: ConfigParser.items returns items present in vars versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 16:10:13 2018 From: report at bugs.python.org (Tim Shaffer) Date: Mon, 09 Apr 2018 20:10:13 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1523304613.66.0.682650639539.issue33251@psf.upfronthosting.co.za> Change by Tim Shaffer : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 16:27:49 2018 From: report at bugs.python.org (Pokestar Fan) Date: Mon, 09 Apr 2018 20:27:49 +0000 Subject: [issue12345] Add math.tau In-Reply-To: <1308193830.26.0.803614362003.issue12345@psf.upfronthosting.co.za> Message-ID: <1523305669.03.0.682650639539.issue12345@psf.upfronthosting.co.za> Change by Pokestar Fan : ---------- pull_requests: +6132 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 17:00:30 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 09 Apr 2018 21:00:30 +0000 Subject: [issue16974] when "python -c command" does a traceback, it open the file "" In-Reply-To: <1358286006.48.0.232332339533.issue16974@psf.upfronthosting.co.za> Message-ID: <1523307630.99.0.682650639539.issue16974@psf.upfronthosting.co.za> Change by Ned Deily : ---------- stage: -> needs patch versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 17:09:40 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 09 Apr 2018 21:09:40 +0000 Subject: [issue31201] make test: module test that failed doesn't exist In-Reply-To: <1502707428.17.0.905101363291.issue31201@psf.upfronthosting.co.za> Message-ID: <1523308180.78.0.682650639539.issue31201@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 0f914b5b5f6ba186afd7112fc851c97247076f70 by Ned Deily (Aaron Ang) in branch 'master': bpo-31201: Clarify command to re-run failing test(s) with example (GH-6417) https://github.com/python/cpython/commit/0f914b5b5f6ba186afd7112fc851c97247076f70 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 17:10:48 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Apr 2018 21:10:48 +0000 Subject: [issue31201] make test: module test that failed doesn't exist In-Reply-To: <1502707428.17.0.905101363291.issue31201@psf.upfronthosting.co.za> Message-ID: <1523308248.44.0.682650639539.issue31201@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6133 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 17:11:41 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Apr 2018 21:11:41 +0000 Subject: [issue31201] make test: module test that failed doesn't exist In-Reply-To: <1502707428.17.0.905101363291.issue31201@psf.upfronthosting.co.za> Message-ID: <1523308301.33.0.682650639539.issue31201@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6134 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 17:17:23 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 09 Apr 2018 21:17:23 +0000 Subject: [issue31201] make test: module test that failed doesn't exist In-Reply-To: <1502707428.17.0.905101363291.issue31201@psf.upfronthosting.co.za> Message-ID: <1523308643.01.0.682650639539.issue31201@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 71a3837bf39580ffa828c14247230a9277b9d5b1 by Ned Deily (Miss Islington (bot)) in branch '3.7': [3.7] bpo-31201: Clarify command to re-run failing test(s) with example (GH-6417) (GH-6437) https://github.com/python/cpython/commit/71a3837bf39580ffa828c14247230a9277b9d5b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 17:19:34 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 09 Apr 2018 21:19:34 +0000 Subject: [issue31201] make test: module test that failed doesn't exist In-Reply-To: <1502707428.17.0.905101363291.issue31201@psf.upfronthosting.co.za> Message-ID: <1523308774.69.0.682650639539.issue31201@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 83bb39907ec3828aec6d99bb9338283bd6b30ac2 by Ned Deily (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31201: Clarify command to re-run failing test(s) with example (GH-6417) (GH-6438) https://github.com/python/cpython/commit/83bb39907ec3828aec6d99bb9338283bd6b30ac2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 17:21:01 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 09 Apr 2018 21:21:01 +0000 Subject: [issue31201] make test: module test that failed doesn't exist In-Reply-To: <1502707428.17.0.905101363291.issue31201@psf.upfronthosting.co.za> Message-ID: <1523308861.73.0.682650639539.issue31201@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the PR, Aaron! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: enhancement -> versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 18:13:44 2018 From: report at bugs.python.org (Ed Morley) Date: Mon, 09 Apr 2018 22:13:44 +0000 Subject: [issue33252] Clarify ResourceWarning documentation Message-ID: <1523312024.12.0.682650639539.issue33252@psf.upfronthosting.co.za> New submission from Ed Morley : The `ResourceWarning` warning has always been ignored by default, since it was added in Python 3.2 in: https://github.com/python/cpython/commit/08be72d0aa0112118b79d271479598c218adfd23#diff-db4e2b9efea108a38c53e06fa99cdd77R391 However there are several places in the docs where the "ignored by default" aspect is not mentioned even though it is for `DeprecationWarning` and similar - which caused me quite a bit of confusion today. The docs were partly improved in Python 3.7 onwards by: https://github.com/python/cpython/commit/9b99747386b690007027c3be2a5d7cfe3d3634f5 ...however: (a) there is still at least one place that still needs updating on master (https://docs.python.org/3.8/library/warnings.html#warning-categories) (b) it would be good to backport the docs fixes to 3.4/3.5/3.6 (I was looking at the 3.6 docs today) I'm happy to open PRs to fix this; but filing this issue so I have something to reference. ---------- assignee: docs at python components: Documentation messages: 315153 nosy: docs at python, edmorley priority: normal severity: normal status: open title: Clarify ResourceWarning documentation type: enhancement versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 18:46:08 2018 From: report at bugs.python.org (Gorialis) Date: Mon, 09 Apr 2018 22:46:08 +0000 Subject: [issue33253] xxsubtype.bench does not function correctly on CPython 3+ Message-ID: <1523313968.82.0.682650639539.issue33253@psf.upfronthosting.co.za> New submission from Gorialis : Due to the `OS|i` signature of `xxsubtype.bench`, it accepts `bytes` as its second argument in CPython 3+, however, it does a call `PyObject_GetAttr` which only accepts `PyString`. This means that if you give the function `bytes`, it fails on the getattr call, but if you give it anything else, it rejects it as it doesn't match the signature. While the module itself does not contribute to CPython's functionality (and is infact optional), since it serves as an example, it should actually function, as it does in CPython 2. ---------- components: Extension Modules messages: 315154 nosy: Gorialis priority: normal severity: normal status: open title: xxsubtype.bench does not function correctly on CPython 3+ 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 Mon Apr 9 19:16:49 2018 From: report at bugs.python.org (Gorialis) Date: Mon, 09 Apr 2018 23:16:49 +0000 Subject: [issue33253] xxsubtype.bench does not function correctly on CPython 3+ In-Reply-To: <1523313968.82.0.682650639539.issue33253@psf.upfronthosting.co.za> Message-ID: <1523315809.31.0.682650639539.issue33253@psf.upfronthosting.co.za> Change by Gorialis : ---------- keywords: +patch pull_requests: +6135 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 20:27:02 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 10 Apr 2018 00:27:02 +0000 Subject: [issue33254] importlib.resources.contents() incorrectly yields an empty list Message-ID: <1523320022.42.0.682650639539.issue33254@psf.upfronthosting.co.za> New submission from Brett Cannon : If you look at https://github.com/python/cpython/blob/0f914b5b5f6ba186afd7112fc851c97247076f70/Lib/importlib/resources.py#L247 you will notice that the generator for importlib.resources.contents() return an empty list. While the intent was to have no values be returned by contents(), by virtue of being a generator that empty list is actually being returned as a value. ---------- assignee: brett.cannon components: Library (Lib) messages: 315155 nosy: barry, brett.cannon priority: normal severity: normal stage: test needed status: open title: importlib.resources.contents() incorrectly yields an empty list type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 20:29:47 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 10 Apr 2018 00:29:47 +0000 Subject: [issue33254] importlib.resources.contents() incorrectly yields an empty list In-Reply-To: <1523320022.42.0.682650639539.issue33254@psf.upfronthosting.co.za> Message-ID: <1523320187.81.0.682650639539.issue33254@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Note that this is in the case where a user is asking for the contents of a namespace package (which by definition, can't have resources). +1 on fixing this API wart. Will you @brett.cannon will submit a PR? I'll do a quick review and then backport the change to the standalone library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 22:04:12 2018 From: report at bugs.python.org (Jonas Obrist) Date: Tue, 10 Apr 2018 02:04:12 +0000 Subject: [issue33248] __await__ behaves different with or without PYTHONASYNCIODEBUG In-Reply-To: <1523268620.33.0.682650639539.issue33248@psf.upfronthosting.co.za> Message-ID: <1523325852.6.0.682650639539.issue33248@psf.upfronthosting.co.za> Jonas Obrist added the comment: I realized I have to call __await__ of the inner coroutine object in NonTrueAwaitable.__await__. This is not a bug, but my mistake. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 9 22:44:20 2018 From: report at bugs.python.org (Zachary Ware) Date: Tue, 10 Apr 2018 02:44:20 +0000 Subject: [issue32823] Regression in test -j behavior and time in 3.7.0b1 In-Reply-To: <1518391854.25.0.467229070634.issue32823@psf.upfronthosting.co.za> Message-ID: <1523328260.84.0.682650639539.issue32823@psf.upfronthosting.co.za> Zachary Ware added the comment: Ok, interesting. The above results are from running on my Windows 8.1 buildbot, running on Azure. Running on a local fully-updated (I think) Windows 10 VM, I get results similar to what Terry reports: results come in batches of X for -jX. Does anyone know of any changes we've made that would cause Windows 10 to behave differently here, or has something changed in Windows itself to cause the issue? Steve or Eryk, do you get the same? ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 01:21:21 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 10 Apr 2018 05:21:21 +0000 Subject: [issue33253] xxsubtype.bench does not function correctly on CPython 3+ In-Reply-To: <1523313968.82.0.682650639539.issue33253@psf.upfronthosting.co.za> Message-ID: <1523337681.38.0.682650639539.issue33253@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset f178028f37c9dafb72608b719eb03e5a70af4ff5 by Serhiy Storchaka (Devon R) in branch 'master': bpo-33253: Fix xxsubtype.bench() to accept correct str signature. (GH-6439) https://github.com/python/cpython/commit/f178028f37c9dafb72608b719eb03e5a70af4ff5 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 01:22:02 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Apr 2018 05:22:02 +0000 Subject: [issue33253] xxsubtype.bench does not function correctly on CPython 3+ In-Reply-To: <1523313968.82.0.682650639539.issue33253@psf.upfronthosting.co.za> Message-ID: <1523337722.14.0.682650639539.issue33253@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6136 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 01:22:30 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Apr 2018 05:22:30 +0000 Subject: [issue33253] xxsubtype.bench does not function correctly on CPython 3+ In-Reply-To: <1523313968.82.0.682650639539.issue33253@psf.upfronthosting.co.za> Message-ID: <1523337750.2.0.682650639539.issue33253@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6137 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 01:47:15 2018 From: report at bugs.python.org (devurandom) Date: Tue, 10 Apr 2018 05:47:15 +0000 Subject: [issue32576] concurrent.futures.thread deadlock due to Queue in weakref callback In-Reply-To: <1516151048.85.0.467229070634.issue32576@psf.upfronthosting.co.za> Message-ID: <1523339235.29.0.682650639539.issue32576@psf.upfronthosting.co.za> Change by devurandom : ---------- nosy: +devurandom _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 01:47:26 2018 From: report at bugs.python.org (devurandom) Date: Tue, 10 Apr 2018 05:47:26 +0000 Subject: [issue21009] Potential deadlock in concurrent futures when garbage collection occurs during Queue.get In-Reply-To: <1395416846.85.0.759574712799.issue21009@psf.upfronthosting.co.za> Message-ID: <1523339246.69.0.682650639539.issue21009@psf.upfronthosting.co.za> Change by devurandom : ---------- nosy: +devurandom _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 02:00:59 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Apr 2018 06:00:59 +0000 Subject: [issue33253] xxsubtype.bench does not function correctly on CPython 3+ In-Reply-To: <1523313968.82.0.682650639539.issue33253@psf.upfronthosting.co.za> Message-ID: <1523340059.59.0.682650639539.issue33253@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 9bb8cebdce99db7e7a94f15141a8e0514b51aa72 by Miss Islington (bot) in branch '3.7': bpo-33253: Fix xxsubtype.bench() to accept correct str signature. (GH-6439) https://github.com/python/cpython/commit/9bb8cebdce99db7e7a94f15141a8e0514b51aa72 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 02:03:29 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 10 Apr 2018 06:03:29 +0000 Subject: [issue12345] Add math.tau In-Reply-To: <1308193830.26.0.803614362003.issue12345@psf.upfronthosting.co.za> Message-ID: <1523340209.9.0.682650639539.issue12345@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: -6132 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 02:07:16 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Apr 2018 06:07:16 +0000 Subject: [issue33253] xxsubtype.bench does not function correctly on CPython 3+ In-Reply-To: <1523313968.82.0.682650639539.issue33253@psf.upfronthosting.co.za> Message-ID: <1523340436.75.0.682650639539.issue33253@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 910d71b839755baa31258bcc083be9191563819e by Miss Islington (bot) in branch '3.6': bpo-33253: Fix xxsubtype.bench() to accept correct str signature. (GH-6439) https://github.com/python/cpython/commit/910d71b839755baa31258bcc083be9191563819e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 02:16:00 2018 From: report at bugs.python.org (Simon Baird) Date: Tue, 10 Apr 2018 06:16:00 +0000 Subject: [issue12345] Add math.tau In-Reply-To: <1308193830.26.0.803614362003.issue12345@psf.upfronthosting.co.za> Message-ID: <1523340960.55.0.682650639539.issue12345@psf.upfronthosting.co.za> Change by Simon Baird : ---------- nosy: -sbaird _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 04:04:01 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 10 Apr 2018 08:04:01 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1523347441.03.0.682650639539.issue31920@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset a61f5da54772b0ea6a7eccf21df08e61585ef712 by Serhiy Storchaka in branch '2.7': [2.7] bpo-31920: Fixed handling directories as arguments in the ``pygettext`` script. (GH-6259) (GH-6436) https://github.com/python/cpython/commit/a61f5da54772b0ea6a7eccf21df08e61585ef712 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 04:04:26 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 10 Apr 2018 08:04:26 +0000 Subject: [issue31920] pygettext ignores directories as inputfile argument In-Reply-To: <1509611840.93.0.213398074469.issue31920@psf.upfronthosting.co.za> Message-ID: <1523347466.77.0.682650639539.issue31920@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 04:07:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 10 Apr 2018 08:07:41 +0000 Subject: [issue33253] xxsubtype.bench does not function correctly on CPython 3+ In-Reply-To: <1523313968.82.0.682650639539.issue33253@psf.upfronthosting.co.za> Message-ID: <1523347661.38.0.682650639539.issue33253@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: 3.4 and 3.5 are at security bug fixes only stage. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 05:21:14 2018 From: report at bugs.python.org (=?utf-8?q?Nicol=C3=A1s_Hatcher?=) Date: Tue, 10 Apr 2018 09:21:14 +0000 Subject: [issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8' Message-ID: <1523352074.24.0.682650639539.issue33255@psf.upfronthosting.co.za> New submission from Nicol?s Hatcher : Hey I'm new here, so please let me know what incorrect things I am doing! I _think_ `json.dumps(o, ensure_ascii=False)` is doing the wrong thing when `o` has both unicode and str keys/values. For instance: ``` import json o = {u"greeting": "hi", "currency": "?"} json.dumps(o, ensure_ascii=False, encoding="utf8") json.dumps(o, ensure_ascii=False) ``` The first `dumps` will work while the second will fail. the reason is: https://github.com/python/cpython/blob/2.7/Lib/json/encoder.py#L198 This will decode any str if the encoding is not 'utf-8'. In the mixed case (unicode and str) this will blow. I workaround is to use any of the aliases for 'utf-8' like 'utf8' or 'u8'. I would be crazy happy to provide a PR if this is really an issue. Let me know if extra clarification is needed. Nicol?s ---------- components: Unicode messages: 315164 nosy: ezio.melotti, nhatcher, vstinner priority: normal severity: normal status: open title: json.dumps has different behaviour if encoding='utf-8' or encoding='utf8' type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 06:18:03 2018 From: report at bugs.python.org (Stefan Krah) Date: Tue, 10 Apr 2018 10:18:03 +0000 Subject: [issue33230] _decimal build failure (unsupported platform for that module) - evolution possible? In-Reply-To: <1522923554.41.0.682650639539.issue33230@psf.upfronthosting.co.za> Message-ID: <1523355483.92.0.682650639539.issue33230@psf.upfronthosting.co.za> Stefan Krah added the comment: I'm trying to reduce the number of open issues that I'm involved in. If something concrete comes up, feel free to reopen. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 07:28:55 2018 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 10 Apr 2018 11:28:55 +0000 Subject: [issue33237] Improve AttributeError message for partially initialized module In-Reply-To: <1523029412.67.0.682650639539.issue33237@psf.upfronthosting.co.za> Message-ID: <1523359735.78.0.682650639539.issue33237@psf.upfronthosting.co.za> Nick Coghlan added the comment: The main idea that comes to mind is to cache a reference to `_frozen_importlib._module_locks` in the interpreter state, and do a key lookup in there (since any in-progress import should have a lock allocated to it). That would be a separate performance issue though - for this issue, we're on an error handling path, so the speed with which the error gets reported isn't critical (although it does technically slow down try/except import fallback chains). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 07:59:39 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Tue, 10 Apr 2018 11:59:39 +0000 Subject: [issue33256] module is not displayed by cgitb.html Message-ID: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> New submission from St?phane Blondon : The html produced by cgitb.html() does not display because the square brackets are interpreted as a html tag (see the picture in attachement). This bug occurs if the code is called directly in the module, not inside a function or a class. ---------- components: Library (Lib) files: traceback_cgi.gif messages: 315167 nosy: sblondon priority: normal severity: normal status: open title: module is not displayed by cgitb.html Added file: https://bugs.python.org/file47528/traceback_cgi.gif _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 08:00:28 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Tue, 10 Apr 2018 12:00:28 +0000 Subject: [issue33256] module is not displayed by cgitb.html In-Reply-To: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> Message-ID: <1523361628.75.0.682650639539.issue33256@psf.upfronthosting.co.za> Change by St?phane Blondon : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 08:04:22 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Tue, 10 Apr 2018 12:04:22 +0000 Subject: [issue33256] module is not displayed by cgitb.html In-Reply-To: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> Message-ID: <1523361862.34.0.682650639539.issue33256@psf.upfronthosting.co.za> Change by St?phane Blondon : ---------- keywords: +patch pull_requests: +6138 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 09:00:06 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 10 Apr 2018 13:00:06 +0000 Subject: [issue30686] make `make install` faster In-Reply-To: <1497638336.46.0.297230638217.issue30686@psf.upfronthosting.co.za> Message-ID: <1523365206.11.0.682650639539.issue30686@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 09:02:18 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 10 Apr 2018 13:02:18 +0000 Subject: [issue31584] Documentation Language mixed up In-Reply-To: <1506402847.94.0.987670636111.issue31584@psf.upfronthosting.co.za> Message-ID: <1523365338.04.0.682650639539.issue31584@psf.upfronthosting.co.za> INADA Naoki added the comment: Maybe, this issue is fixed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 09:07:31 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 10 Apr 2018 13:07:31 +0000 Subject: [issue28832] Reduce memset in dict creation In-Reply-To: <1480424215.77.0.617126562471.issue28832@psf.upfronthosting.co.za> Message-ID: <1523365651.29.0.682650639539.issue28832@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 09:36:11 2018 From: report at bugs.python.org (Julien Palard) Date: Tue, 10 Apr 2018 13:36:11 +0000 Subject: [issue31584] Documentation Language mixed up In-Reply-To: <1506402847.94.0.987670636111.issue31584@psf.upfronthosting.co.za> Message-ID: <1523367371.56.0.682650639539.issue31584@psf.upfronthosting.co.za> Julien Palard added the comment: I think so, at least since https://github.com/python/docsbuild-scripts/pull/36 has been merged. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 10:37:05 2018 From: report at bugs.python.org (Ned Deily) Date: Tue, 10 Apr 2018 14:37:05 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1523371025.57.0.682650639539.issue33251@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 10:38:43 2018 From: report at bugs.python.org (Ned Deily) Date: Tue, 10 Apr 2018 14:38:43 +0000 Subject: [issue33252] Clarify ResourceWarning documentation In-Reply-To: <1523312024.12.0.682650639539.issue33252@psf.upfronthosting.co.za> Message-ID: <1523371123.86.0.682650639539.issue33252@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 11:05:09 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 10 Apr 2018 15:05:09 +0000 Subject: [issue33254] importlib.resources.contents() incorrectly yields an empty list In-Reply-To: <1523320022.42.0.682650639539.issue33254@psf.upfronthosting.co.za> Message-ID: <1523372709.6.0.682650639539.issue33254@psf.upfronthosting.co.za> Brett Cannon added the comment: I had to stare at it for a while since I knew it was for namespace packages and I'm so used to them returning a magical value to signal that fact, but then realize we don't even support namespace packages so it wasn't magical at all. ;) And yes, I'll do a PR and make you a reviewer probably this Friday. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 12:05:22 2018 From: report at bugs.python.org (Hubert Holin) Date: Tue, 10 Apr 2018 16:05:22 +0000 Subject: [issue33230] _decimal build failure (unsupported platform for that module) - evolution possible? In-Reply-To: <1522923554.41.0.682650639539.issue33230@psf.upfronthosting.co.za> Message-ID: <1523376322.31.0.682650639539.issue33230@psf.upfronthosting.co.za> Hubert Holin added the comment: Yes, the error turned out to be that I had indeed forgotten to remove the --with-system-libmpdec along with the library and header. Now _decimal compiles fine. I will see if I can get Python to run with my system's mpdecimal (once I have updated it), but as far as this issue is concerned I believe it is indeed closed. Thanks for the help! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 12:41:09 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Tue, 10 Apr 2018 16:41:09 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl Message-ID: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> New submission from Ivan Pozdeev : (Marked only 2.7 as affected but this would affect any branch if built with nonthreaded Tcl.) When running the attached TkinterCrash2-2.py repeatedly with 2.7.14 and 2.7 head, win7 x64, two kinds of errors pop up randomly: 1. Crashes and freezes. 2. Exceptions on the console like: Exception in thread Thread-14: Traceback (most recent call last): File "C:\Users\Sasha\Documents\cpython\lib\threading.py", line 801, in __boots trap_inner self.run() File "../tkt/TkinterCrash2-2.py", line 50, in run self.deliverToqueue((self.target, z, y)) File "../tkt/TkinterCrash2-2.py", line 133, in arrival_122 new_yz[1]) File "C:\Users\Sasha\Documents\cpython\lib\lib-tk\Tkinter.py", line 2328, in create_line return self._create('line', args, kw) File "C:\Users\Sasha\Documents\cpython\lib\lib-tk\Tkinter.py", line 2310, in _create *(args + self._options(cnf, kw)))) ValueError: invalid literal for int() with base 10: 'None' Running the same code with the minimal required changes (attached as TkinterCrash3-2-2.py) under 3.6 (same platform) goes without any errors. Diagnostics showed: 1. Under debug Python, a crash became an MSVC double-free assertion error. The stacktrace is: Tkapp_Call->Tkapp_CallDeallocArgs->Tcl_DecrRefCount->TclFreeObj->free 2. The exceptions are caused by a ` create line` Tk call randomly returning "None" (a string) instead of an integer -- which it should never do according to its doc. Since it happens inconsistently, this also suggests a race condition. 3. In Tkapp_Call and SetVar, Tcl lock isn't held when creating/destroying Tcl objects for the call. The underlying fns modify the global state (free objects list, reference counters), so it should be held. These two are the only such places in the code. I've fixed this, will file the PR shortly. Holding the lock when calling Tkapp_CallDeallocArgs in Tkapp_Call eliminated the crashes and freezes, locking objects' creation in the same fn decreased the number of exceptions greatly, and locking creation in SetVar, too, eliminated them completely. I did not check if objects created with AsObj in SetVar need to be disposed of like in Tkapp_Call. Also have no idea how to autotest the fix. If someone does, I'm all ears. ---------- components: Tkinter files: TkinterCrash2-2.py messages: 315172 nosy: Ivan.Pozdeev priority: normal severity: normal status: open title: Race conditions in Tkinter with non-threaded Tcl type: crash versions: Python 2.7 Added file: https://bugs.python.org/file47529/TkinterCrash2-2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 12:41:34 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Tue, 10 Apr 2018 16:41:34 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1523378494.3.0.682650639539.issue33257@psf.upfronthosting.co.za> Change by Ivan Pozdeev : Added file: https://bugs.python.org/file47530/TkinterCrash3-2-2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 13:05:03 2018 From: report at bugs.python.org (Carl) Date: Tue, 10 Apr 2018 17:05:03 +0000 Subject: [issue33258] Unable to install 3.6.5 on Windows Server 2008 Message-ID: <1523379903.12.0.682650639539.issue33258@psf.upfronthosting.co.za> New submission from Carl : Hello, I am trying to install python version 3.6.5 on a windows 2008 2008 rc2 SP1 server. I have tired both the installer for python-3.6.5.exe and python-3.6.5-amd64.exe installers. Both will not run on the server either from the gui or the command line prompt with admin privileges. It appears to run but nothing happens, no response or no error is provided. Any there any other methods to install this version? ---------- components: Windows messages: 315173 nosy: hpo0016, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Unable to install 3.6.5 on Windows Server 2008 versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 13:18:42 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Tue, 10 Apr 2018 17:18:42 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1523380722.73.0.682650639539.issue33257@psf.upfronthosting.co.za> Change by Ivan Pozdeev : ---------- keywords: +patch pull_requests: +6139 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 13:23:16 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 10 Apr 2018 17:23:16 +0000 Subject: [issue33097] concurrent futures Executors accept tasks after interpreter shutdown In-Reply-To: <1521391273.18.0.467229070634.issue33097@psf.upfronthosting.co.za> Message-ID: <1523380996.33.0.682650639539.issue33097@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset c4b695f85e141f57d22d8edf7bc2c756da136918 by Antoine Pitrou (Mark Nemec) in branch 'master': bpo-33097: Fix submit accepting callable after executor shutdown by interpreter exit (GH-6144) https://github.com/python/cpython/commit/c4b695f85e141f57d22d8edf7bc2c756da136918 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 13:24:31 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Apr 2018 17:24:31 +0000 Subject: [issue33097] concurrent futures Executors accept tasks after interpreter shutdown In-Reply-To: <1521391273.18.0.467229070634.issue33097@psf.upfronthosting.co.za> Message-ID: <1523381071.81.0.682650639539.issue33097@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6140 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 14:35:11 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 10 Apr 2018 18:35:11 +0000 Subject: [issue33097] concurrent futures Executors accept tasks after interpreter shutdown In-Reply-To: <1521391273.18.0.467229070634.issue33097@psf.upfronthosting.co.za> Message-ID: <1523385311.12.0.682650639539.issue33097@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset b26265900a18a184997c3c3a1fa6a5bf29703ec9 by Antoine Pitrou (Miss Islington (bot)) in branch '3.7': bpo-33097: Fix submit accepting callable after executor shutdown by interpreter exit (GH-6144) (GH-6445) https://github.com/python/cpython/commit/b26265900a18a184997c3c3a1fa6a5bf29703ec9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 14:38:59 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 10 Apr 2018 18:38:59 +0000 Subject: [issue33097] concurrent futures Executors accept tasks after interpreter shutdown In-Reply-To: <1521391273.18.0.467229070634.issue33097@psf.upfronthosting.co.za> Message-ID: <1523385539.61.0.682650639539.issue33097@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thanks your contribution Mark! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 15:18:54 2018 From: report at bugs.python.org (Chris Bradbury) Date: Tue, 10 Apr 2018 19:18:54 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1523387934.93.0.682650639539.issue33251@psf.upfronthosting.co.za> Change by Chris Bradbury : ---------- keywords: +patch pull_requests: +6141 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 15:40:51 2018 From: report at bugs.python.org (Steve Dower) Date: Tue, 10 Apr 2018 19:40:51 +0000 Subject: [issue33258] Unable to install 3.6.5 on Windows Server 2008 In-Reply-To: <1523379903.12.0.682650639539.issue33258@psf.upfronthosting.co.za> Message-ID: <1523389251.47.0.682650639539.issue33258@psf.upfronthosting.co.za> Steve Dower added the comment: I believe these are both out of support, but the installer should be showing an error still. If you look at recently created files in %TEMP% you may see some logs that will provide more information. The best resolution however is likely to require upgrading Windows Server or using an older version of Python ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 16:13:32 2018 From: report at bugs.python.org (Carl) Date: Tue, 10 Apr 2018 20:13:32 +0000 Subject: [issue33258] Unable to install 3.6.5 on Windows Server 2008 In-Reply-To: <1523379903.12.0.682650639539.issue33258@psf.upfronthosting.co.za> Message-ID: <1523391212.41.0.682650639539.issue33258@psf.upfronthosting.co.za> Carl added the comment: Steve, there was no information or no log files created in %TEMP%, but you would think some kind of message dialog or log would be displayed or created. And I am aware of the end of life for 2008 r2 enterprise server, but this organization is still running this version for some of their servers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 17:03:12 2018 From: report at bugs.python.org (Stanislav P) Date: Tue, 10 Apr 2018 21:03:12 +0000 Subject: [issue11122] bdist_rpm should use rpmbuild, not rpm In-Reply-To: <1296854362.61.0.538085175842.issue11122@psf.upfronthosting.co.za> Message-ID: <1523394192.5.0.682650639539.issue11122@psf.upfronthosting.co.za> Stanislav P added the comment: can this patch be sped up? i am running into this issue with the latest python version the patch was submitted 7 years ago i don't see any workaround. ---------- nosy: +stanp versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 17:34:20 2018 From: report at bugs.python.org (=?utf-8?q?G=C3=A9ry_Ogam?=) Date: Tue, 10 Apr 2018 21:34:20 +0000 Subject: [issue33259] Encoding issue in the name of the local DST timezone Message-ID: <1523396060.7.0.682650639539.issue33259@psf.upfronthosting.co.za> New submission from G?ry Ogam : There seems to be an encoding bug in Python 3.6.5 on Windows with the [timezone constant](https://docs.python.org/3/library/time.html#timezone-constants) `time.tzname`: >>> import time >>> time.tzname ('Paris, Madrid', 'Paris, Madrid (heure d\x92?t?)') In the second string (the name of the local *DST* timezone), the escape sequence `\x92` is (since it is in a *character* string, not in a byte string) the Unicode code point [U+0092 PRIVATE USE 2 (PU2)](https://en.wikipedia.org/wiki/List_of_Unicode_characters), instead of the Unicode code point [U+2019 RIGHT SINGLE QUOTATION MARK](https://en.wikipedia.org/wiki/List_of_Unicode_characters) as expected, which would have been displayed as `?` or `\u2019`, so `'Paris, Madrid (heure d??t?)'`. This `\x92` obviously comes from the 0x92 byte of the [CP-1252 encoding](https://en.wikipedia.org/wiki/Windows-1252) for the `?` character, but the byte has been badly handled in `time.tzname` somehow. Indeed, quoting the [?Lexical analysis?](https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals) chapter from the *Language Reference*: > In a bytes literal, hexadecimal and octal escapes denote the byte with > the given value. In a string literal, these escapes denote a Unicode > character with the given value. ---------- components: Library (Lib) messages: 315181 nosy: maggyero priority: normal severity: normal status: open title: Encoding issue in the name of the local DST timezone type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 10 17:36:03 2018 From: report at bugs.python.org (Mark Nemec) Date: Tue, 10 Apr 2018 21:36:03 +0000 Subject: [issue33097] concurrent futures Executors accept tasks after interpreter shutdown In-Reply-To: <1521391273.18.0.467229070634.issue33097@psf.upfronthosting.co.za> Message-ID: <1523396163.69.0.682650639539.issue33097@psf.upfronthosting.co.za> Mark Nemec added the comment: Happy to contribute! Thanks for the review :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 00:49:00 2018 From: report at bugs.python.org (Steve Dower) Date: Wed, 11 Apr 2018 04:49:00 +0000 Subject: [issue33258] Unable to install 3.6.5 on Windows Server 2008 In-Reply-To: <1523379903.12.0.682650639539.issue33258@psf.upfronthosting.co.za> Message-ID: <1523422140.77.0.682650639539.issue33258@psf.upfronthosting.co.za> Steve Dower added the comment: I more meant that because of the EOL for that version of Windows, we don't have support at all in that version of Python. So while we try to have helpful failure messages, ultimately we aren't obliged to do anything useful at all, and it sounds like that's what is happening. You'll need to use an earlier version of Python, probably 3.4. Will that work for you? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 03:17:24 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Apr 2018 07:17:24 +0000 Subject: [issue33260] Update token.py etc for ASYNC and AWAIT Message-ID: <1523431044.29.0.682650639539.issue33260@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : After making 'async' and 'await' proper keywords (issue30406), token.py was not regenerated. The proposed patch updates token.py, tokenize.py and the documentation. ---------- components: Library (Lib) messages: 315184 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Update token.py etc for ASYNC and AWAIT type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 03:19:04 2018 From: report at bugs.python.org (Giampaolo Rodola') Date: Wed, 11 Apr 2018 07:19:04 +0000 Subject: [issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows In-Reply-To: <1523155916.86.0.682650639539.issue33240@psf.upfronthosting.co.za> Message-ID: <1523431144.46.0.682650639539.issue33240@psf.upfronthosting.co.za> Giampaolo Rodola' added the comment: > For convenience, a handler that retries unlink() and rmdir() could be distributed with shutil. For ease of use, it could be enabled by default on Windows. +1 on that. I bumped into this many times over the years as occasional and hardly reproducible test failures when cleaning up test files/dirs. The tricky part is how to distinguish a legitimate "directory is not empty" error though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 03:23:10 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Apr 2018 07:23:10 +0000 Subject: [issue33260] Update token.py etc for ASYNC and AWAIT In-Reply-To: <1523431044.29.0.682650639539.issue33260@psf.upfronthosting.co.za> Message-ID: <1523431390.94.0.682650639539.issue33260@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6143 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 03:24:37 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Apr 2018 07:24:37 +0000 Subject: [issue33260] Update token.py etc for ASYNC and AWAIT In-Reply-To: <1523431044.29.0.682650639539.issue33260@psf.upfronthosting.co.za> Message-ID: <1523431477.87.0.682650639539.issue33260@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: ASYNC and AWAIT are kept in the lib2to3 grammar. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 03:26:50 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Apr 2018 07:26:50 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1523431610.37.0.682650639539.issue33257@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka versions: +Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 04:59:53 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 11 Apr 2018 08:59:53 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods Message-ID: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> New submission from Jeroen Demeyer : The inspect functions isgeneratorfunction, iscoroutinefunction, isasyncgenfunction can fail on methods that do not have a __code__ attribute: >>> from types import MethodType >>> class Callable: ... def __call__(self, *args): ... return args >>> m = MethodType(Callable(), 42) >>> m() (42,) >>> import inspect >>> inspect.iscoroutinefunction(m) Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.6/inspect.py", line 186, in iscoroutinefunction object.__code__.co_flags & CO_COROUTINE) AttributeError: 'Callable' object has no attribute '__code__' This was discovered while working on PEP 575, but it is really an independent issue that should be fixed anyway. ---------- components: Library (Lib) messages: 315187 nosy: jdemeyer priority: normal severity: normal status: open title: inspect.isgeneratorfunction fails on hand-created methods type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 05:35:40 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 11 Apr 2018 09:35:40 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1523439340.02.0.682650639539.issue33261@psf.upfronthosting.co.za> Change by Jeroen Demeyer : ---------- keywords: +patch pull_requests: +6144 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 05:55:08 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 11 Apr 2018 09:55:08 +0000 Subject: [issue11122] bdist_rpm should use rpmbuild, not rpm In-Reply-To: <1296854362.61.0.538085175842.issue11122@psf.upfronthosting.co.za> Message-ID: <1523440508.49.0.682650639539.issue11122@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: I could make a PR out of the patch but I wonder if anyone is actually using this functionality. Wearing my Fedora's python maintainer hat, we have a lot of tooling around rpm that handles those things, so I don't think there is a valid usecase for Fedora at least. Is it useful somehow for other rpm based distros or is the resulting rpm's functional enough for some testing at least? ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 06:28:49 2018 From: report at bugs.python.org (Christian Heimes) Date: Wed, 11 Apr 2018 10:28:49 +0000 Subject: [issue33262] Deprecate shlex.split(None) to read from stdin. Message-ID: <1523442529.49.0.682650639539.issue33262@psf.upfronthosting.co.za> New submission from Christian Heimes : The shlex module implements simple tokenize for a shell-like mini language. The shlex.split() function splits a string into subcomponents just like a typical Unix shell. However function has a surprising feature. When None is passed into shlex.split(). Note: Since the split() function instantiates a shlex instance, passing None for s will read the string to split from standard input. https://docs.python.org/3/library/shlex.html#shlex.split This is both surprising, unnecessary and potentially dangerous. Reading from sys.stdin is a blocking operation. In case an application doesn't account for None, shlex.split(value) could lead to a blocked server application. I suggest to deprecate and eventually remove this mis-feature. Credits: David R. MacIver reported the bug on Twitter: https://twitter.com/DRMacIver/status/984001867985367040 ---------- messages: 315189 nosy: christian.heimes priority: normal severity: normal stage: needs patch status: open title: Deprecate shlex.split(None) to read from stdin. type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 07:05:20 2018 From: report at bugs.python.org (=?utf-8?b?UGF3ZcWC?=) Date: Wed, 11 Apr 2018 11:05:20 +0000 Subject: [issue20784] 'collections.abc' is no longer defined when collections is imported In-Reply-To: <1393439138.94.0.309642790057.issue20784@psf.upfronthosting.co.za> Message-ID: <1523444720.16.0.682650639539.issue20784@psf.upfronthosting.co.za> Pawe? added the comment: I had similar issue and it helped when as a workaround I use 'pip install .' as opposed to 'python setup.py develop' in my project. I hope this will give you a hint. ---------- components: +Library (Lib) nosy: +pawciobiel versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 09:51:58 2018 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 11 Apr 2018 13:51:58 +0000 Subject: [issue33252] Clarify ResourceWarning documentation In-Reply-To: <1523312024.12.0.682650639539.issue33252@psf.upfronthosting.co.za> Message-ID: <1523454718.86.0.682650639539.issue33252@psf.upfronthosting.co.za> Nick Coghlan added the comment: +1 from me for further ResourceWarning docs improvements - my focus when working on PEP 565 was the actual change in how DeprecationWarning was being handled, and the other warnings doc improvements were just a necessary prerequisite for being able to convey that clearly. The backport to 3.6 may or may not be worthwhile, depending on how much work it proves to be in practice (while those will still be the default online docs for the next couple of months, the 3.7 branch will take their place once 3.7.0 is officially released). We wouldn't backport docs changes to 3.4 or 3.5, as both of those branches are already in security-fix-only mode. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 10:31:32 2018 From: report at bugs.python.org (Adam) Date: Wed, 11 Apr 2018 14:31:32 +0000 Subject: [issue31087] asyncio.create_subprocess_* do not honor `encoding` In-Reply-To: <1501477317.46.0.791551033282.issue31087@psf.upfronthosting.co.za> Message-ID: <1523457092.93.0.682650639539.issue31087@psf.upfronthosting.co.za> Adam added the comment: It occurs both on Python 3.6 and 3.7 RC, so maybe it should be fixed in the 3.7 release. ---------- nosy: +adampl type: -> behavior versions: +Python 3.7 Added file: https://bugs.python.org/file47531/asyncio_encoding_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 10:49:18 2018 From: report at bugs.python.org (Oliver Urs Lenz) Date: Wed, 11 Apr 2018 14:49:18 +0000 Subject: [issue25433] whitespace in strip()/lstrip()/rstrip() In-Reply-To: <1445170536.34.0.94220475409.issue25433@psf.upfronthosting.co.za> Message-ID: <1523458158.22.0.682650639539.issue25433@psf.upfronthosting.co.za> Oliver Urs Lenz added the comment: Slightly tangential, but it would be great if the documentation of lstrip() and rstrip() could include an equivalent definition in terms of re.sub(), e.g.: lstrip(foo) == re.sub(r'(?u)\A\s*', '', foo) rstrip(foo) == re.sub(r'(?u)\s*\Z', '', foo) (Or whatever else is correct.) ---------- nosy: +oulenz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 12:16:04 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Apr 2018 16:16:04 +0000 Subject: [issue33260] Update token.py etc for ASYNC and AWAIT In-Reply-To: <1523431044.29.0.682650639539.issue33260@psf.upfronthosting.co.za> Message-ID: <1523463364.98.0.682650639539.issue33260@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset d08972fdb92cad6b813d22205752c97ea18df060 by Serhiy Storchaka in branch 'master': bpo-33260: Regenerate token.py after removing ASYNC and AWAIT. (GH-6447) https://github.com/python/cpython/commit/d08972fdb92cad6b813d22205752c97ea18df060 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 12:16:41 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Apr 2018 16:16:41 +0000 Subject: [issue33260] Update token.py etc for ASYNC and AWAIT In-Reply-To: <1523431044.29.0.682650639539.issue33260@psf.upfronthosting.co.za> Message-ID: <1523463401.75.0.682650639539.issue33260@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6145 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 13:07:28 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Apr 2018 17:07:28 +0000 Subject: [issue33260] Update token.py etc for ASYNC and AWAIT In-Reply-To: <1523431044.29.0.682650639539.issue33260@psf.upfronthosting.co.za> Message-ID: <1523466448.79.0.682650639539.issue33260@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 4dc3c8ff14572032e63d9938a12813392bcbe982 by Miss Islington (bot) in branch '3.7': bpo-33260: Regenerate token.py after removing ASYNC and AWAIT. (GH-6447) https://github.com/python/cpython/commit/4dc3c8ff14572032e63d9938a12813392bcbe982 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 13:13:48 2018 From: report at bugs.python.org (Vlad Starostin) Date: Wed, 11 Apr 2018 17:13:48 +0000 Subject: [issue33263] Asyncio server enters an invalid state after a request with SO_LINGER Message-ID: <1523466828.6.0.682650639539.issue33263@psf.upfronthosting.co.za> New submission from Vlad Starostin : Long story short, if you have a TCP asyncio-server (implementing asyncio.Protocol) that sends something to socket in connection_made callback, it will leak fds and won't be able to handle some consequent requests, if you will send to it RST right after TCP-handshake. In my case, these requests are sent by keepalived demon (it makes TCP-checks that way), but they can be easily hand-crafted. Example server: import asyncio class EchoServerClientProtocol(asyncio.Protocol): def connection_made(self, transport): self.transport = transport self.transport.write(b'Say something') def data_received(self, data): self.transport.write(data) self.transport.close() loop = asyncio.get_event_loop() coro = loop.create_server(EchoServerClientProtocol, '127.0.0.1', 8888) server = loop.run_until_complete(coro) loop.run_forever() Example client: import socket import struct import time # first request sock = socket.socket() l_onoff = 1 l_linger = 0 sock.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', l_onoff, l_linger)) sock.connect(('127.0.0.1', 8022)) sock.close() time.sleep(1) # second request sock = socket.socket() sock.connect(('127.0.0.1', 8888)) print('Got', sock.recv(1024)) sock.sendall(b'Hi there') print('Got', sock.recv(1024)) # <-- Will hang here sock.close() Why is this happening? 1. First request 1.1. _SelectorSocketTransport.__init__ schedules connection_made and loop.add_reader. 1.2. connection_made tries to send data to the socket, it fails, _SelectorTransport._fatal_error is called, then _SelectorTransport._force_close is called. 1.3. _SelectorTransport._force_close removes the reader from the loop (there is none, it's ok), and schedules closing the socket in _SelectorTransport._call_connection_lost. 1.4. loop.add_reader is called (scheduled on step 1), it calls epoll_ctl, no error is returned because the socket isn't closed yet. 1.5. the socket is closed by _SelectorTransport._call_connection_lost (scheduled on step 3). The corresponding entry in _SelectorMapping remains and isn't cleaned up. 2. Second request 2.1. FD from the first request is reused by the OS 2.2. BaseSelectorEventLoop._add_reader sees that the FD is already in BaseSelectorEventLoop._selector, so it calls _selector.modify 2.3 _BaseSelectorImpl.modify sees that the events mask is the same, so it uses a shortcut, changing only the callback, but without calling epoll_ctl. The socket won't be polled. I think the source of the error is in step 1.4, we shouldn't add the reader if we are already closing the transport. I've made a simple PR fixing this, but maybe there are other options here. ---------- components: asyncio messages: 315196 nosy: asvetlov, drtyrsa, giampaolo.rodola, yselivanov priority: normal severity: normal status: open title: Asyncio server enters an invalid state after a request with SO_LINGER type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 13:17:40 2018 From: report at bugs.python.org (Vlad Starostin) Date: Wed, 11 Apr 2018 17:17:40 +0000 Subject: [issue33263] Asyncio server enters an invalid state after a request with SO_LINGER In-Reply-To: <1523466828.6.0.682650639539.issue33263@psf.upfronthosting.co.za> Message-ID: <1523467060.35.0.682650639539.issue33263@psf.upfronthosting.co.za> Change by Vlad Starostin : ---------- keywords: +patch pull_requests: +6146 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 13:22:18 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Apr 2018 17:22:18 +0000 Subject: [issue33260] Update token.py etc for ASYNC and AWAIT In-Reply-To: <1523431044.29.0.682650639539.issue33260@psf.upfronthosting.co.za> Message-ID: <1523467338.72.0.682650639539.issue33260@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 13:30:10 2018 From: report at bugs.python.org (Stanislav P) Date: Wed, 11 Apr 2018 17:30:10 +0000 Subject: [issue11122] bdist_rpm should use rpmbuild, not rpm In-Reply-To: <1296854362.61.0.538085175842.issue11122@psf.upfronthosting.co.za> Message-ID: <1523467810.52.0.682650639539.issue11122@psf.upfronthosting.co.za> Stanislav P added the comment: i am using this on redhat enterprise and mac. both running python 3.5 both running latest rpm. if you can make a pr it would great. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 13:34:56 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 11 Apr 2018 17:34:56 +0000 Subject: [issue11122] bdist_rpm should use rpmbuild, not rpm In-Reply-To: <1296854362.61.0.538085175842.issue11122@psf.upfronthosting.co.za> Message-ID: <1523468096.95.0.682650639539.issue11122@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: The bug exists indeed but I would like to know what is the actual use case here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 14:51:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Apr 2018 18:51:41 +0000 Subject: [issue1634034] Show "expected" token on syntax error Message-ID: <1523472701.74.0.682650639539.issue1634034@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Similar enhancement has been implemented in PyPy just now. https://morepypy.blogspot.de/2018/04/improving-syntaxerror-in-pypy.html ---------- versions: +Python 3.8 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 14:59:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 11 Apr 2018 18:59:19 +0000 Subject: [issue1634034] Show "expected" token on syntax error Message-ID: <1523473159.8.0.682650639539.issue1634034@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6147 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 16:20:01 2018 From: report at bugs.python.org (Stanislav P) Date: Wed, 11 Apr 2018 20:20:01 +0000 Subject: [issue11122] bdist_rpm should use rpmbuild, not rpm In-Reply-To: <1296854362.61.0.538085175842.issue11122@psf.upfronthosting.co.za> Message-ID: <1523478001.11.0.682650639539.issue11122@psf.upfronthosting.co.za> Stanislav P added the comment: the use case is being able to publish python package as rpm using setup.py on mac. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 16:33:52 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 11 Apr 2018 20:33:52 +0000 Subject: [issue13585] Add contextlib.ExitStack In-Reply-To: <1323654590.86.0.53041507768.issue13585@psf.upfronthosting.co.za> Message-ID: <1523478832.98.0.682650639539.issue13585@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: Why this? _exit_wrapper.__self__ = cm It seems that you are trying to create something which is exactly like a method except that it's not a method. Is there any reason to not use an actual method? It would actually simplify the code. I ask because assigning __self__ might break after PEP 575. ---------- nosy: +jdemeyer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 18:06:45 2018 From: report at bugs.python.org (Alexey Izbyshev) Date: Wed, 11 Apr 2018 22:06:45 +0000 Subject: [issue32270] subprocess closes redirected fds even if they are in pass_fds In-Reply-To: <1512926046.73.0.213398074469.issue32270@psf.upfronthosting.co.za> Message-ID: <1523484405.33.0.682650639539.issue32270@psf.upfronthosting.co.za> Alexey Izbyshev added the comment: An alternative fix is here: https://github.com/izbyshev/cpython/commit/b89b52f28490b69142d5c061604b3a3989cec66c Feel free to use the test if you don't like the approach :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 18:50:54 2018 From: report at bugs.python.org (om364@) Date: Wed, 11 Apr 2018 22:50:54 +0000 Subject: [issue33065] IDLE debugger: problem importing user created module In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1523487054.01.0.682650639539.issue33065@psf.upfronthosting.co.za> om364@ added the comment: Traceback (most recent call last): File "...\PositionalList.py", line 1, in from _DoublyLinkedBase import _DoublyLinkedBase File "", line 968, in _find_and_load File "", line 148, in __enter__ File "", line 174, in _get_module_lock File "", line 59, in __init__ File "", line 59, in __init__ File "...\Python\Python36\lib\bdb.py", line 48, in trace_dispatch return self.dispatch_line(frame) File "...\Python\Python36\lib\bdb.py", line 66, in dispatch_line self.user_line(frame) File "...\Python\Python36\lib\idlelib\debugger.py", line 24, in user_line self.gui.interaction(message, frame) AttributeError: '_ModuleLock' object has no attribute 'name' The file works correctly in PowerShell, but in IDLE debbuger there is a error. ---------- nosy: +om364@ type: behavior -> crash Added file: https://bugs.python.org/file47532/PositionalList.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 18:57:04 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Wed, 11 Apr 2018 22:57:04 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO Message-ID: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Documentation says urllib.request.urlretrieve "might become deprecated at some point in the future". IMHO, it's better to provide examples that do not make users rely on API that has this label. I propose the example in the pull request to accomplish exactly the same task while not relying on urllib.request.urlretrieve. ---------- assignee: docs at python components: Documentation messages: 315204 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 18:59:29 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Wed, 11 Apr 2018 22:59:29 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1523487569.04.0.682650639539.issue33264@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- keywords: +patch pull_requests: +6148 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 19:01:21 2018 From: report at bugs.python.org (Nathaniel Smith) Date: Wed, 11 Apr 2018 23:01:21 +0000 Subject: [issue31087] asyncio.create_subprocess_* do not honor `encoding` In-Reply-To: <1501477317.46.0.791551033282.issue31087@psf.upfronthosting.co.za> Message-ID: <1523487681.89.0.682650639539.issue31087@psf.upfronthosting.co.za> Nathaniel Smith added the comment: @adampl: The first step is for someone (possibly you :-)) to write a patch and submit it as a PR against the Python master branch. Then once the actual change is figured out, we can have the discussion about which releases to backport it to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 19:31:37 2018 From: report at bugs.python.org (Ned Deily) Date: Wed, 11 Apr 2018 23:31:37 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1523489497.16.0.682650639539.issue33264@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 19:44:05 2018 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 11 Apr 2018 23:44:05 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1523490245.02.0.682650639539.issue33264@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Andr?s, your pull request looks good to me. Please go ahead and sign the CLA and I can merge this to cpython HEAD. Thank you for your contribution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 19:48:09 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Wed, 11 Apr 2018 23:48:09 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1523490489.35.0.682650639539.issue33264@psf.upfronthosting.co.za> Andr?s Delfino added the comment: Hi Senthil! I signed the CLA several days ago. Got the "Python Contributor Agreement Form between Python Software Foundation and Andr?s Delfino is Signed and Filed!" mail on April 1st (perhaps I chose a bad date to fill the request ;) ) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 19:56:10 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 11 Apr 2018 23:56:10 +0000 Subject: [issue33065] IDLE debugger: problem importing user created module In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1523490970.08.0.682650639539.issue33065@psf.upfronthosting.co.za> Terry J. Reedy added the comment: We use 'crash' for, on Window, a process stopping either with no explanation or a 'Your process has stopped box' from Windows. In any case, PositionalList.py will not run without _DoublyLinkedBase.py, which you did not upload. The traceback has File "...\Python\Python36\lib\bdb.py", line 48, in trace_dispatch return self.dispatch_line(frame) Since sometime last summer, that code line is line 51, indicating that you are using an old release of 3.6, probably 3.6.2 or earlier. The current bugfix release is 3.6.5. If possible, upgrade to 3.6.5 and retest. The traceback does not make much sense to me either. Neither of the IDLE methods userline and interaction obviously access a .name attribute of anything. The '_ModuleLock' object is created by importlib._bootstrap. Searching all issues for '_ModuleLock' got 11 hits. None are obviously about import and tracing. To determine whether the problem has anything to do with IDLE, single-step debugging should be repeated with pdb, which is Python's text debugger, and also based on bdb. Brett, can you tell anything from the multiple importlib._bootstrap lines in the traceback? ---------- nosy: +brett.cannon type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 20:01:13 2018 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 12 Apr 2018 00:01:13 +0000 Subject: [issue33262] Deprecate shlex.split(None) to read from stdin. In-Reply-To: <1523442529.49.0.682650639539.issue33262@psf.upfronthosting.co.za> Message-ID: <1523491273.87.0.682650639539.issue33262@psf.upfronthosting.co.za> Eric V. Smith added the comment: I agree that it should be deprecated. That's crazy behavior. I'd also recommend that shlex.shlex with instream=None be deprecated, but maybe that's too radical. It seems way too easy to accidentally pass in None. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 20:40:33 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Thu, 12 Apr 2018 00:40:33 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1523493633.9.0.682650639539.issue33264@psf.upfronthosting.co.za> Andr?s Delfino added the comment: The agreement can be found at: https://secure.na1.echosign.com/public/viewAgreement?tsid=CBFCIBAA3AAABLblqZhC0bOfZxqQ_bUGhwUqnYiqqxAj3N7_dOts1qHsH9YdsbakL5qJ6FbSU9NHkecXglBLZ29gXbHeNdUErGzW7QkUs& ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 21:05:48 2018 From: report at bugs.python.org (Chad) Date: Thu, 12 Apr 2018 01:05:48 +0000 Subject: [issue33082] multiprocessing docs bury very important 'callback=' args In-Reply-To: <1521139850.07.0.467229070634.issue33082@psf.upfronthosting.co.za> Message-ID: <1523495148.41.0.682650639539.issue33082@psf.upfronthosting.co.za> Change by Chad : ---------- pull_requests: +6150 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 11 21:56:29 2018 From: report at bugs.python.org (Ethan Furman) Date: Thu, 12 Apr 2018 01:56:29 +0000 Subject: [issue33217] x in enum.Flag member is True when x is not a Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1523498189.13.0.682650639539.issue33217@psf.upfronthosting.co.za> Ethan Furman added the comment: New changeset 3715176557cf87925c8f89b98939c7daf9bf48e2 by Ethan Furman in branch '3.7': [3.7] bpo-33217: deprecate non-Enum lookups in Enums (GH-6392) https://github.com/python/cpython/commit/3715176557cf87925c8f89b98939c7daf9bf48e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 01:24:51 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 12 Apr 2018 05:24:51 +0000 Subject: [issue33265] contextlib.ExitStack abuses __self__ Message-ID: <1523510691.14.0.682650639539.issue33265@psf.upfronthosting.co.za> New submission from Jeroen Demeyer : In contextlib, there is code which roughly looks like def _exit_wrapper(exc_type, exc, tb): return cm_exit(cm, exc_type, exc, tb) _exit_wrapper.__self__ = cm This creates a new function _exit_wrapper from a given function cm_exit by prepending the __self__ attribute to *args. Now this is exactly what a method does too. It would be better to use an actual method for this: it's cleaner, faster and it doesn't abuse a double-underscore attribute. The latter will actually break with PEP 575, as __self__ will become a special name instead of an arbitrary attribute. ---------- components: Library (Lib) messages: 315212 nosy: jdemeyer priority: normal severity: normal status: open title: contextlib.ExitStack abuses __self__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 01:25:34 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 12 Apr 2018 05:25:34 +0000 Subject: [issue13585] Add contextlib.ExitStack In-Reply-To: <1323654590.86.0.53041507768.issue13585@psf.upfronthosting.co.za> Message-ID: <1523510734.54.0.682650639539.issue13585@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: Follow-up: https://bugs.python.org/issue33265 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 01:28:43 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Thu, 12 Apr 2018 05:28:43 +0000 Subject: [issue33265] contextlib.ExitStack abuses __self__ In-Reply-To: <1523510691.14.0.682650639539.issue33265@psf.upfronthosting.co.za> Message-ID: <1523510923.05.0.682650639539.issue33265@psf.upfronthosting.co.za> Change by Jeroen Demeyer : ---------- keywords: +patch pull_requests: +6151 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 02:40:24 2018 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 12 Apr 2018 06:40:24 +0000 Subject: [issue33265] contextlib.ExitStack abuses __self__ In-Reply-To: <1523510691.14.0.682650639539.issue33265@psf.upfronthosting.co.za> Message-ID: <1523515224.42.0.682650639539.issue33265@psf.upfronthosting.co.za> Change by Eric V. Smith : ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 04:18:58 2018 From: report at bugs.python.org (Wonsup Yoon) Date: Thu, 12 Apr 2018 08:18:58 +0000 Subject: [issue29456] bugs in unicodedata.normalize: u1176, u11a7 and u11c3 In-Reply-To: <1486355272.29.0.0894514518656.issue29456@psf.upfronthosting.co.za> Message-ID: <1523521138.18.0.682650639539.issue29456@psf.upfronthosting.co.za> Wonsup Yoon added the comment: Hello! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 04:24:59 2018 From: report at bugs.python.org (Zsolt Dollenstein) Date: Thu, 12 Apr 2018 08:24:59 +0000 Subject: [issue33266] 2to3 doesn't parse all valid string literals Message-ID: <1523521499.6.0.682650639539.issue33266@psf.upfronthosting.co.za> New submission from Zsolt Dollenstein : For example `rf"blah"` is not tokenized properly. ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 315215 nosy: Zsolt Dollenstein priority: normal severity: normal status: open title: 2to3 doesn't parse all valid string literals type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 04:26:21 2018 From: report at bugs.python.org (Roundup Robot) Date: Thu, 12 Apr 2018 08:26:21 +0000 Subject: [issue33266] 2to3 doesn't parse all valid string literals In-Reply-To: <1523521499.6.0.682650639539.issue33266@psf.upfronthosting.co.za> Message-ID: <1523521581.04.0.682650639539.issue33266@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +6152 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 04:45:09 2018 From: report at bugs.python.org (Eric Wieser) Date: Thu, 12 Apr 2018 08:45:09 +0000 Subject: [issue33267] ctypes array types create reference cycles Message-ID: <1523522709.53.0.682650639539.issue33267@psf.upfronthosting.co.za> New submission from Eric Wieser : Discovered in https://github.com/numpy/numpy/pull/10882/files#r180813166 A reproduction: ``` In [1]: import ctypes In [2]: def make_array_ctype(shape): ...: import ctypes ...: ct = ctypes.c_uint8 ...: for i in shape: ...: ct = i * ct ...: return ct ...: # all on one line to keep ipython out of this In [3]: gc.collect(); x = make_array_ctype((1,)); del x; gc.collect() ``` Using the proposed function in https://github.com/numpy/numpy/pull/10891, we get a few more details: ``` In [4]: from numpy.testing import assert_no_gc_cycles In [5]: assert_no_gc_cycles(make_array_ctype, (1,)) AssertionError: Reference cycles were found when calling make_array_ctype: 7 objects were collected, of which 6 are shown below: tuple object with id=2822255556536: (,) PyCArrayType object with id=2822226500408: getset_descriptor object with id=2822252062256: getset_descriptor object with id=2822252062184: tuple object with id=2822243712440: (, , , ) StgDict object with id=2822226211928: {'__dict__': , '__doc__': None, '__module__': '__main__', '__weakref__': , '_length_': 1, '_type_': } ``` I suppose this isn't really a bug, but it's not clear to me why a cycle needs to be created here. ---------- components: ctypes messages: 315216 nosy: Eric.Wieser priority: normal severity: normal status: open title: ctypes array types create reference cycles versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 04:47:39 2018 From: report at bugs.python.org (Eric Wieser) Date: Thu, 12 Apr 2018 08:47:39 +0000 Subject: [issue33267] ctypes array types create reference cycles In-Reply-To: <1523522709.53.0.682650639539.issue33267@psf.upfronthosting.co.za> Message-ID: <1523522859.76.0.682650639539.issue33267@psf.upfronthosting.co.za> Eric Wieser added the comment: Apologies, I missed the important part of that snippet: ``` In [3]: gc.collect(); x = make_array_ctype((1,)); del x; gc.collect() Out[3]: 7 ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 05:55:09 2018 From: report at bugs.python.org (tkhyn) Date: Thu, 12 Apr 2018 09:55:09 +0000 Subject: [issue33268] iteration over attrs in metaclass' __new__ affects class' __name__ Message-ID: <1523526909.26.0.682650639539.issue33268@psf.upfronthosting.co.za> New submission from tkhyn : The following script, run with python 3.6.5, highlights an issue with the class' __name__ attribute being set incorrectly just because of a loop in the metaclass' __new__ method: class MC(type): def __new__(mcs, name, bases, attrs): for name, attr in attrs.items(): pass return super(MC, mcs).__new__(mcs, name, bases, attrs) class C(metaclass=MC): a = None print(C.__name__) Expected output: "C" Actual output: "a" Comment the for loop and you get the expected output! On Python 2.7.13, the amended code exposes the same bug: class MC(type): def __new__(mcs, name, bases, attrs): for name, attr in attrs.items(): pass return super(MC, mcs).__new__(mcs, name, bases, attrs) class C(object): __metaclass__ = MC a = None print C.__name__ output is "__metaclass__" and should be "C" ---------- components: Interpreter Core messages: 315218 nosy: tkhyn priority: normal severity: normal status: open title: iteration over attrs in metaclass' __new__ affects class' __name__ versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 06:45:23 2018 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 12 Apr 2018 10:45:23 +0000 Subject: [issue33268] iteration over attrs in metaclass' __new__ affects class' __name__ In-Reply-To: <1523526909.26.0.682650639539.issue33268@psf.upfronthosting.co.za> Message-ID: <1523529923.18.0.682650639539.issue33268@psf.upfronthosting.co.za> Eric V. Smith added the comment: In the loop, you're reassigning the value of name, then using it in the super call. If you change the name of the loop variable, your code works. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 06:47:54 2018 From: report at bugs.python.org (tkhyn) Date: Thu, 12 Apr 2018 10:47:54 +0000 Subject: [issue33268] iteration over attrs in metaclass' __new__ affects class' __name__ In-Reply-To: <1523526909.26.0.682650639539.issue33268@psf.upfronthosting.co.za> Message-ID: <1523530074.18.0.682650639539.issue33268@psf.upfronthosting.co.za> tkhyn added the comment: oops, indeed. Sometimes the obvious things are not so obvious .. Sorry for the noise! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 08:25:27 2018 From: report at bugs.python.org (Nick Coghlan) Date: Thu, 12 Apr 2018 12:25:27 +0000 Subject: [issue33265] contextlib.ExitStack abuses __self__ In-Reply-To: <1523510691.14.0.682650639539.issue33265@psf.upfronthosting.co.za> Message-ID: <1523535927.07.0.682650639539.issue33265@psf.upfronthosting.co.za> Nick Coghlan added the comment: Yury, could you double check the async exit stack change in the PR? I think it's fine since the bound method just passes back the underlying coroutine and the tests all still pass, but a second opinion would be good :) ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 09:32:09 2018 From: report at bugs.python.org (Jan Vlcinsky) Date: Thu, 12 Apr 2018 13:32:09 +0000 Subject: [issue14573] json iterencode can not handle general iterators In-Reply-To: <1334355033.57.0.314676653112.issue14573@psf.upfronthosting.co.za> Message-ID: <1523539929.56.0.682650639539.issue14573@psf.upfronthosting.co.za> Jan Vlcinsky added the comment: I found proposed change very handy (came here researching why it is not behaving that way). Taking into account: - Python shines in handling lists, using generators and iterators - Largest group of python developers develop web apps, and there it is typical pattern to iterate across many records and return them as long list of dictionaries I think proposed feature could become very popular. ---------- nosy: +vlcinsky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 10:25:13 2018 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 12 Apr 2018 14:25:13 +0000 Subject: [issue33266] 2to3 doesn't parse all valid string literals In-Reply-To: <1523521499.6.0.682650639539.issue33266@psf.upfronthosting.co.za> Message-ID: <1523543113.83.0.682650639539.issue33266@psf.upfronthosting.co.za> Eric V. Smith added the comment: Is 2to3 supposed to be able to parse non-python2 files? I don't recall. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 10:55:59 2018 From: report at bugs.python.org (Kadir Haldenbilen) Date: Thu, 12 Apr 2018 14:55:59 +0000 Subject: [issue33269] InteractiveConsole behaves differently when used on terminal and used within script Message-ID: <1523544959.58.0.682650639539.issue33269@psf.upfronthosting.co.za> New submission from Kadir Haldenbilen : on terminal push and runcode accepts indentation where required (like for loop etc), within script gives error message on terminal import works properly and objects can be found as normal, within script you may need to add module name upfront simple example import code ii = code.InteractiveConsole() ii.push("for ii in range(3):") ii.push(" print('i', i)") you will get normal expected output on terminal, but indentation error within script ii.push("from time import sleep") ii.push("sleep(1)") will sleep 1 sec on terminal, but will give name error ---------- messages: 315224 nosy: Kadir Haldenbilen priority: normal severity: normal status: open title: InteractiveConsole behaves differently when used on terminal and used within script type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 11:07:01 2018 From: report at bugs.python.org (Kirill Matsaberydze) Date: Thu, 12 Apr 2018 15:07:01 +0000 Subject: [issue32696] Fix pickling exceptions with multiple arguments In-Reply-To: <1517156155.35.0.467229070634.issue32696@psf.upfronthosting.co.za> Message-ID: <1523545621.29.0.682650639539.issue32696@psf.upfronthosting.co.za> Kirill Matsaberydze added the comment: Hi, I encounter similar behavior in python 3.6.5 with following code: import pickle class CustomException(Exception): def __init__(self, arg1, arg2): msg = "Custom message {} {}".format(arg1, arg2) super().__init__(msg) obj_dump = pickle.dumps(CustomException("arg1", "arg2")) obj = pickle.loads(obj_dump) Traceback (most recent call last): File "", line 1, in TypeError: __init__() missing 1 required positional argument: 'arg2' So it looks like it not only python 2.7 problem ---------- nosy: +Kirill Matsaberydze _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 11:46:55 2018 From: report at bugs.python.org (Kadir Haldenbilen) Date: Thu, 12 Apr 2018 15:46:55 +0000 Subject: [issue33269] InteractiveConsole behaves differently when used on terminal and used within script In-Reply-To: <1523544959.58.0.682650639539.issue33269@psf.upfronthosting.co.za> Message-ID: <1523548015.27.0.682650639539.issue33269@psf.upfronthosting.co.za> Kadir Haldenbilen added the comment: Attached is a non working example I could not attach a second file, which works OK within script I will attach separately ---------- Added file: https://bugs.python.org/file47533/iitests.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 11:47:37 2018 From: report at bugs.python.org (Kadir Haldenbilen) Date: Thu, 12 Apr 2018 15:47:37 +0000 Subject: [issue33269] InteractiveConsole behaves differently when used on terminal and used within script In-Reply-To: <1523544959.58.0.682650639539.issue33269@psf.upfronthosting.co.za> Message-ID: <1523548057.63.0.682650639539.issue33269@psf.upfronthosting.co.za> Kadir Haldenbilen added the comment: This script works OK. Compare with iitests.py uploaded before ---------- Added file: https://bugs.python.org/file47534/iiteswok.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 12:27:31 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 12 Apr 2018 16:27:31 +0000 Subject: [issue33267] ctypes array types create reference cycles In-Reply-To: <1523522709.53.0.682650639539.issue33267@psf.upfronthosting.co.za> Message-ID: <1523550451.49.0.682650639539.issue33267@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 12:36:04 2018 From: report at bugs.python.org (Brett Cannon) Date: Thu, 12 Apr 2018 16:36:04 +0000 Subject: [issue33065] IDLE debugger: problem importing user created module In-Reply-To: <1520917336.65.0.467229070634.issue33065@psf.upfronthosting.co.za> Message-ID: <1523550964.27.0.682650639539.issue33065@psf.upfronthosting.co.za> Brett Cannon added the comment: Without knowing the exact Python version it's hard to tell as line 59 changed between Python 3.5 and where Python 3.6 is now (FYI, the line as it currently sits in Python 3.6 is https://github.com/python/cpython/blob/e98e3385f2acfc6d98f70f8e66c96b752d003b8f/Lib/importlib/_bootstrap.py#L59). But the double-reporting of the same line is a bit odd. The best I can think of is that IDLE is requesting the __repr__() of `self` while still executing `__init__()` but before `self.name` is set, triggering an AttributeError (although those lines don't exactly line up with that). Otherwise looking at the code for _ModuleLock suggests this really shouldn't happen as `self.name` is set in `__init__()` and there's no use of `del` or `delattr()` that would cause this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 12:41:50 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 12 Apr 2018 16:41:50 +0000 Subject: [issue14573] json iterencode can not handle general iterators In-Reply-To: <1334355033.57.0.314676653112.issue14573@psf.upfronthosting.co.za> Message-ID: <1523551310.83.0.682650639539.issue14573@psf.upfronthosting.co.za> Ned Deily added the comment: If there is still interest in this, perhaps @Zectbumo could rebase the patch as a PR against the master branch of the current python/cpython repo now that we've moved to git and GitHub (https://devguide.python.org/pullrequest/). There's no guarantee that it will ultimately be accepted but it will make it much easier to review. ---------- nosy: +ned.deily versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 12:42:31 2018 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 12 Apr 2018 16:42:31 +0000 Subject: [issue32696] Fix pickling exceptions with multiple arguments In-Reply-To: <1517156155.35.0.467229070634.issue32696@psf.upfronthosting.co.za> Message-ID: <1523551351.95.0.682650639539.issue32696@psf.upfronthosting.co.za> Jason R. Coombs added the comment: Kirill, see https://bugs.python.org/issue1692335#msg310951 in the related issue for one possible way to work around the issue on Python 3. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 12:43:17 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 12 Apr 2018 16:43:17 +0000 Subject: [issue33266] 2to3 doesn't parse all valid string literals In-Reply-To: <1523521499.6.0.682650639539.issue33266@psf.upfronthosting.co.za> Message-ID: <1523551397.62.0.682650639539.issue33266@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 12:53:15 2018 From: report at bugs.python.org (Alex Garel) Date: Thu, 12 Apr 2018 16:53:15 +0000 Subject: [issue19993] Pool.imap doesn't work as advertised In-Reply-To: <1387182676.04.0.471976296284.issue19993@psf.upfronthosting.co.za> Message-ID: <1523551995.58.0.682650639539.issue19993@psf.upfronthosting.co.za> Alex Garel added the comment: Hello, I think this is a really important feature, it hits me hard those days. It would also solve https://bugs.python.org/issue19173 in a nice way. ---------- nosy: +alex-garel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 15:34:32 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 12 Apr 2018 19:34:32 +0000 Subject: [issue19993] Pool.imap doesn't work as advertised In-Reply-To: <1387182676.04.0.471976296284.issue19993@psf.upfronthosting.co.za> Message-ID: <1523561672.11.0.682650639539.issue19993@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 15:35:34 2018 From: report at bugs.python.org (Ned Deily) Date: Thu, 12 Apr 2018 19:35:34 +0000 Subject: [issue19173] Expose Queue maxsize parameter to multiprocessing.Pool class In-Reply-To: <1380994241.79.0.709476745668.issue19173@psf.upfronthosting.co.za> Message-ID: <1523561734.57.0.682650639539.issue19173@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +davin, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 16:32:14 2018 From: report at bugs.python.org (Daniel Moisset) Date: Thu, 12 Apr 2018 20:32:14 +0000 Subject: [issue33270] tags for anonymous code objects should be interned Message-ID: <1523565134.3.0.682650639539.issue33270@psf.upfronthosting.co.za> New submission from Daniel Moisset : In compile.c, some strings are created to be used as name of anonymous code objects: "", "", "", "", "" and "". Only the first two of those are interned (created with PyUnicode_InternFromString ), the rest are created with "PyUnicode_FromString". Even if they use a static variable to avoid creating multiple instances, not interning results in multiple copies when code objects are marshaled into pyc files and reloaded (one copy per module). Always using PyUnicode_InternFromString should be more consistent, and slightly more efficient ---------- components: Interpreter Core messages: 315232 nosy: Daniel Moisset priority: normal severity: normal status: open title: tags for anonymous code objects should be interned _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 17:34:06 2018 From: report at bugs.python.org (Ethan Furman) Date: Thu, 12 Apr 2018 21:34:06 +0000 Subject: [issue33219] x in IntFlag should test raise TypeError if x is not an IntFlag In-Reply-To: <1522787900.11.0.467229070634.issue33219@psf.upfronthosting.co.za> Message-ID: <1523568846.6.0.682650639539.issue33219@psf.upfronthosting.co.za> Ethan Furman added the comment: This and issue33217 are similar enough I'm going to track it in issue33217. ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> x in enum.Flag member is True when x is not a Flag _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 17:36:00 2018 From: report at bugs.python.org (Ethan Furman) Date: Thu, 12 Apr 2018 21:36:00 +0000 Subject: [issue33217] x in enum.Flag member is True when x is not a Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1523568960.08.0.682650639539.issue33217@psf.upfronthosting.co.za> Ethan Furman added the comment: DeprecationWarning is in 3.7, now need to raise TypeError in 3.8. ---------- stage: patch review -> needs patch versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 18:19:37 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 12 Apr 2018 22:19:37 +0000 Subject: [issue19993] Pool.imap doesn't work as advertised In-Reply-To: <1387182676.04.0.471976296284.issue19993@psf.upfronthosting.co.za> Message-ID: <1523571577.21.0.682650639539.issue19993@psf.upfronthosting.co.za> Josh Rosenberg added the comment: Related: issue29842 "Make Executor.map work with infinite/large inputs correctly" for a similar problem in concurrent.futures (but worse, since it doesn't even allow you to begin consuming results until all inputs are dispatched). A similar approach to my Executor.map patch could probably be used with imap/imap_unordered. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 18:23:40 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 12 Apr 2018 22:23:40 +0000 Subject: [issue33267] ctypes array types create reference cycles In-Reply-To: <1523522709.53.0.682650639539.issue33267@psf.upfronthosting.co.za> Message-ID: <1523571820.25.0.682650639539.issue33267@psf.upfronthosting.co.za> Josh Rosenberg added the comment: Pretty sure this is a problem with classes in general; classes are self-referencing, and using multiplication to create new ctypes array types is creating new classes. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 18:33:05 2018 From: report at bugs.python.org (Ethan Smith) Date: Thu, 12 Apr 2018 22:33:05 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1523572385.08.0.682650639539.issue33211@psf.upfronthosting.co.za> Change by Ethan Smith : ---------- pull_requests: +6154 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 19:00:55 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Thu, 12 Apr 2018 23:00:55 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1523574055.02.0.682650639539.issue33264@psf.upfronthosting.co.za> Andr?s Delfino added the comment: My contributor form shows as received now :) Don't know how to update the "CLA not signed" label on the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 20:40:49 2018 From: report at bugs.python.org (Francis Herne) Date: Fri, 13 Apr 2018 00:40:49 +0000 Subject: [issue32911] Doc strings no longer stored in body of AST In-Reply-To: <1519302007.93.0.467229070634.issue32911@psf.upfronthosting.co.za> Message-ID: <1523580049.08.0.682650639539.issue32911@psf.upfronthosting.co.za> Francis Herne added the comment: Note: Because this also applies to module-level docstrings, a rather strange effect that, for example, `ast.parse("'foo'")` is now an empty module. While the root node is always an instance of `ast.Module`, in practice `ast.parse()` is often used with smaller fragments of source code that don't directly correspond to a complete module, and this behaviour makes no sense in such cases. The resulting bug in kdev-python took a while to track down (because I had no immediate reason to suspect this change), and will be somewhat awkward to workaround. I would prefer that this be reverted; it's likely to break a variety of users in strange ways. ---------- nosy: +flherne _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 12 23:29:00 2018 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 13 Apr 2018 03:29:00 +0000 Subject: [issue33265] contextlib.ExitStack abuses __self__ In-Reply-To: <1523510691.14.0.682650639539.issue33265@psf.upfronthosting.co.za> Message-ID: <1523590140.88.0.682650639539.issue33265@psf.upfronthosting.co.za> Yury Selivanov added the comment: Yep, I think this is a good fix! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 00:58:10 2018 From: report at bugs.python.org (INADA Naoki) Date: Fri, 13 Apr 2018 04:58:10 +0000 Subject: [issue32911] Doc strings no longer stored in body of AST In-Reply-To: <1519302007.93.0.467229070634.issue32911@psf.upfronthosting.co.za> Message-ID: <1523595490.92.0.682650639539.issue32911@psf.upfronthosting.co.za> INADA Naoki added the comment: > in practice `ast.parse()` is often used with smaller fragments of source code that don't directly correspond to a complete module, and this behaviour makes no sense in such cases. > > The resulting bug in kdev-python took a while to track down (because I had no immediate reason to suspect this change), and will be somewhat awkward to workaround. Would you elaborate it more, please? Without concrete example, we cannot to decide how it's important problem. > I would prefer that this be reverted; it's likely to break a variety of users in strange ways. I don't want to revert, see discussions in this issue and PR-5927. And would you give us real world example of "variety of users"? How many applications use ast.parse for such way? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 03:39:34 2018 From: report at bugs.python.org (Michael McCoy) Date: Fri, 13 Apr 2018 07:39:34 +0000 Subject: [issue33271] Exception handling matches subtypes, not subclasses Message-ID: <1523605174.57.0.682650639539.issue33271@psf.upfronthosting.co.za> New submission from Michael McCoy : Exception handling matches subtypes, not subclasses # Example from abc import ABC class MyException(Exception, ABC): pass class OtherException(Exception): pass MyException.register(OtherException) try: raise OtherException except MyException: print("Correct: Caught MyException") except Exception: print("Wrong: Caught something else") # "Wrong: Caught something else" # Background and evidence of bug-ness Issue 2534 [1] (10 years ago!) introduced the behavior, but only in the Python 3 patch [2]. During code review, the correct function call was used [3], but the function's name got switched in the final python3 patch without any comment. The current Python 2 code uses `PyObject_IsSubclass`, and produces the correct behavior in the example above (using `__metaclass__ = ABCMeta`, of course). This leads me to strongly suspect that this is a bug, not a feature. The note below regarding unittest for further evidence that this code has eight legs. Given the ancient nature of this bug, it affects all versions of python3. [1] https://bugs.python.org/issue2534 [2] https://bugs.python.org/file11257/isinstance3k-2.patch [3] https://codereview.appspot.com/483/diff/1/21#newcode114 [4] https://github.com/python/cpython/blob/2.7/Python/errors.c#L119 # Solution Coming very soon in a PR on Github, but in short, we do the following: 1. Switch `PyType_IsSubtype` to `PyObject_IsSubclass`. 2. Revert the changes made to remove ?dead code? in https://bugs.python.org/issue31091. The code was dead because the wrong function was used?the PR left only the bug. 3. Add tests. Note that `unittest`?s `self.assertRaises` function uses `issubclass` and does not alert to this bug. (Different symptom, same cause.) # Note This bug has nothing to do with the `abc` package, beyond being a simple way to generate the error. -Mike Gitub: mbmccoy ---------- components: Interpreter Core messages: 315241 nosy: Michael McCoy priority: normal severity: normal status: open title: Exception handling matches subtypes, not subclasses versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 03:44:52 2018 From: report at bugs.python.org (Roundup Robot) Date: Fri, 13 Apr 2018 07:44:52 +0000 Subject: [issue33271] Exception handling matches subtypes, not subclasses In-Reply-To: <1523605174.57.0.682650639539.issue33271@psf.upfronthosting.co.za> Message-ID: <1523605492.86.0.682650639539.issue33271@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +6155 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 07:12:03 2018 From: report at bugs.python.org (Mikhail) Date: Fri, 13 Apr 2018 11:12:03 +0000 Subject: [issue33272] Which are reasonable reason for recursion limit in function _vformat of class Formatter lib string? Message-ID: <1523617923.76.0.682650639539.issue33272@psf.upfronthosting.co.za> New submission from Mikhail : The presence of the restriction of recursion prevent making nested conditions for the superformatter: https://github.com/ebrehault/superformatter for example: import string class SuperFormatter(string.Formatter): """World's simplest Template engine.""" def format_field(self, value, spec): if spec.startswith('repeat'): template = spec.partition(':')[-1] if type(value) is dict: value = value.items() return ''.join([template.format(item=item) for item in value]) elif spec == 'call': return value() elif spec.startswith('if'): return (value and spec.partition(':')[-1]) or '' else: return super(SuperFormatter, self).format_field(value, spec) data = { 'a1':1, 'a2':2, 'a3':3 } tmpl = ''' {a1:if: {a2:if: {a2} } {a1} } ''' sf = SuperFormatter() out = sf.format(tmpl, **data) print(out) Causes error: $ python3.6 my_progs/test.py Traceback (most recent call last): File "my_progs/test.py", line 37, in out = sf.format(tmpl, **data) File "/usr/lib64/python3.6/string.py", line 190, in format return self.vformat(format_string, args, kwargs) File "/usr/lib64/python3.6/string.py", line 194, in vformat result, _ = self._vformat(format_string, args, kwargs, used_args, 2) File "/usr/lib64/python3.6/string.py", line 244, in _vformat auto_arg_index=auto_arg_index) File "/usr/lib64/python3.6/string.py", line 244, in _vformat auto_arg_index=auto_arg_index) File "/usr/lib64/python3.6/string.py", line 244, in _vformat auto_arg_index=auto_arg_index) File "/usr/lib64/python3.6/string.py", line 201, in _vformat raise ValueError('Max string recursion exceeded') ValueError: Max string recursion exceeded If there was not this restriction, then the example code is worked. ---------- components: Library (Lib) messages: 315242 nosy: mv.gavrilov priority: normal severity: normal status: open title: Which are reasonable reason for recursion limit in function _vformat of class Formatter lib string? type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 07:41:47 2018 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 13 Apr 2018 11:41:47 +0000 Subject: [issue33272] Which are reasonable reason for recursion limit in function _vformat of class Formatter lib string? In-Reply-To: <1523617923.76.0.682650639539.issue33272@psf.upfronthosting.co.za> Message-ID: <1523619707.91.0.682650639539.issue33272@psf.upfronthosting.co.za> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 08:22:50 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 13 Apr 2018 12:22:50 +0000 Subject: [issue33265] contextlib.ExitStack abuses __self__ In-Reply-To: <1523510691.14.0.682650639539.issue33265@psf.upfronthosting.co.za> Message-ID: <1523622170.26.0.682650639539.issue33265@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 23ab5ee667a9b29014f6f7f01797c611f63ff743 by Nick Coghlan (jdemeyer) in branch 'master': bpo-33265: use an actual method instead of a method-like function in ExitStack (GH-6456) https://github.com/python/cpython/commit/23ab5ee667a9b29014f6f7f01797c611f63ff743 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 08:25:09 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 13 Apr 2018 12:25:09 +0000 Subject: [issue33265] contextlib.ExitStack abuses __self__ In-Reply-To: <1523510691.14.0.682650639539.issue33265@psf.upfronthosting.co.za> Message-ID: <1523622309.81.0.682650639539.issue33265@psf.upfronthosting.co.za> Nick Coghlan added the comment: Classifying this as a minor performance enhancement, since methods are much simpler objects than full Python level closures. Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> performance versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 09:03:58 2018 From: report at bugs.python.org (Vidar Fauske) Date: Fri, 13 Apr 2018 13:03:58 +0000 Subject: [issue31226] shutil.rmtree fails when target has an internal directory junction (Windows) In-Reply-To: <1502978298.87.0.60982184572.issue31226@psf.upfronthosting.co.za> Message-ID: <1523624638.13.0.682650639539.issue31226@psf.upfronthosting.co.za> Vidar Fauske added the comment: A PR that fixes the issue according to the feedback from Eryk Sun is available. It does seem to have stranded a bit on the review side. That being said, would a bugfix for shutil.rmtree be appropriate? It is very annoying when junction points made by other tools break pip source install of packages (since pip calls shutil.rmtree on its temporary directory after a build). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 10:15:39 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 13 Apr 2018 14:15:39 +0000 Subject: [issue19173] Expose Queue maxsize parameter to multiprocessing.Pool class In-Reply-To: <1380994241.79.0.709476745668.issue19173@psf.upfronthosting.co.za> Message-ID: <1523628939.07.0.682650639539.issue19173@psf.upfronthosting.co.za> Antoine Pitrou added the comment: A similar issue for concurrent.futures is bpo-29595. ---------- versions: +Python 3.8 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 10:33:23 2018 From: report at bugs.python.org (Julian DeMille) Date: Fri, 13 Apr 2018 14:33:23 +0000 Subject: [issue33273] Allow multiple imports from one module while preserving its namespace Message-ID: <1523630003.29.0.682650639539.issue33273@psf.upfronthosting.co.za> New submission from Julian DeMille : An example of this would be to have something like `import .{ , , ... }` ---------- components: Interpreter Core messages: 315247 nosy: jdemilledt priority: normal severity: normal status: open title: Allow multiple imports from one module while preserving its namespace type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 10:52:26 2018 From: report at bugs.python.org (Zachary Ware) Date: Fri, 13 Apr 2018 14:52:26 +0000 Subject: [issue33273] Allow multiple imports from one module while preserving its namespace In-Reply-To: <1523630003.29.0.682650639539.issue33273@psf.upfronthosting.co.za> Message-ID: <1523631146.59.0.682650639539.issue33273@psf.upfronthosting.co.za> Zachary Ware added the comment: Do you mean like `from lib import mod1, mod2, mod3`? If that doesn't cover what you're looking for, try sending your idea (fleshed out a bit more :)) to the python-ideas at python.org mailing list, where you can get feedback on your idea. For now, I'm closing this issue; if your discussions on python-ideas prove fruitful and you can come back with a clearer plan for a change, you can reopen it. ---------- nosy: +zach.ware resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 12:36:10 2018 From: report at bugs.python.org (Alfred Morgan) Date: Fri, 13 Apr 2018 16:36:10 +0000 Subject: [issue14573] json iterencode can not handle general iterators In-Reply-To: <1334355033.57.0.314676653112.issue14573@psf.upfronthosting.co.za> Message-ID: <1523637370.79.0.682650639539.issue14573@psf.upfronthosting.co.za> Alfred Morgan added the comment: I would love to but it is a bit late for me now. The json encoding has been optimized in c which falls outside my expertise. https://github.com/python/cpython/blob/master/Modules/_json.c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 12:39:57 2018 From: report at bugs.python.org (Tom Hines) Date: Fri, 13 Apr 2018 16:39:57 +0000 Subject: [issue10685] trace does not ignore --ignore-module In-Reply-To: <1292157270.73.0.200325030661.issue10685@psf.upfronthosting.co.za> Message-ID: <1523637597.67.0.682650639539.issue10685@psf.upfronthosting.co.za> Tom Hines added the comment: bump ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 12:41:53 2018 From: report at bugs.python.org (Matej Cepl) Date: Fri, 13 Apr 2018 16:41:53 +0000 Subject: [issue12735] request full Unicode collation support in std python library In-Reply-To: <1313093897.54.0.111250936422.issue12735@psf.upfronthosting.co.za> Message-ID: <1523637713.32.0.682650639539.issue12735@psf.upfronthosting.co.za> Change by Matej Cepl : ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 12:57:27 2018 From: report at bugs.python.org (Matej Cepl) Date: Fri, 13 Apr 2018 16:57:27 +0000 Subject: [issue32771] merge the underlying data stores of unicodedata and the str type In-Reply-To: <1517797199.65.0.467229070634.issue32771@psf.upfronthosting.co.za> Message-ID: <1523638647.53.0.682650639539.issue32771@psf.upfronthosting.co.za> Change by Matej Cepl : ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 14:07:05 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 13 Apr 2018 18:07:05 +0000 Subject: [issue14573] json iterencode can not handle general iterators In-Reply-To: <1334355033.57.0.314676653112.issue14573@psf.upfronthosting.co.za> Message-ID: <1523642825.69.0.682650639539.issue14573@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Things are more complicated. bytes object is an iterable. I think serialize an bytes object (which can be unexpectedly leaked in a code ported from 2.7) as a list of integers is not expected behavior in most cases. It is safer to fail by default and provide an explicit handling for bytes if it is needed. There are other iterables that are better not to serialize by default: mappings, which are not dict subclasses, exhaustible iterators. I'm working on large patch for the json module (maybe even a PEP). It will not allow serializing all iterables by default, but will make easy to switch on serialization for particular types, including iterables. ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 14:16:25 2018 From: report at bugs.python.org (Michael McCoy) Date: Fri, 13 Apr 2018 18:16:25 +0000 Subject: [issue33271] Exception handling matches subclasses, not subtypes In-Reply-To: <1523605174.57.0.682650639539.issue33271@psf.upfronthosting.co.za> Message-ID: <1523643385.45.0.682650639539.issue33271@psf.upfronthosting.co.za> Change by Michael McCoy : ---------- title: Exception handling matches subtypes, not subclasses -> Exception handling matches subclasses, not subtypes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 14:18:24 2018 From: report at bugs.python.org (Michael McCoy) Date: Fri, 13 Apr 2018 18:18:24 +0000 Subject: [issue33271] Exception handling should match subclasses, not subtypes In-Reply-To: <1523605174.57.0.682650639539.issue33271@psf.upfronthosting.co.za> Message-ID: <1523643504.09.0.682650639539.issue33271@psf.upfronthosting.co.za> Change by Michael McCoy : ---------- title: Exception handling matches subclasses, not subtypes -> Exception handling should match subclasses, not subtypes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 14:32:15 2018 From: report at bugs.python.org (Michael McCoy) Date: Fri, 13 Apr 2018 18:32:15 +0000 Subject: [issue33271] Exception handling should match subclasses, not subtypes In-Reply-To: <1523605174.57.0.682650639539.issue33271@psf.upfronthosting.co.za> Message-ID: <1523644335.73.0.682650639539.issue33271@psf.upfronthosting.co.za> Michael McCoy added the comment: Adding Serhiy because this relates to issue31091, and specifically claims that there _was_ a bug in the old code (msg299585). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 14:36:43 2018 From: report at bugs.python.org (Ari Krupnik) Date: Fri, 13 Apr 2018 18:36:43 +0000 Subject: [issue33274] minidom removeAttributeNode returns None Message-ID: <1523644603.75.0.682650639539.issue33274@psf.upfronthosting.co.za> New submission from Ari Krupnik : W3C DOM Level 1[1] requires removeAttributeNode() to return the removed node: removeAttributeNode: Removes the specified attribute. Return Value: The Attr node that was removed. Minidom implementation returns None. [1]https://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeAttributeNode ---------- components: Library (Lib), XML messages: 315253 nosy: iter priority: normal pull_requests: 6157 severity: normal status: open title: minidom removeAttributeNode returns None versions: Python 2.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 14:37:34 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 13 Apr 2018 18:37:34 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523644654.03.0.682650639539.issue33184@psf.upfronthosting.co.za> Change by Steve Dower : ---------- pull_requests: +6158 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 14:37:43 2018 From: report at bugs.python.org (Ari Krupnik) Date: Fri, 13 Apr 2018 18:37:43 +0000 Subject: [issue33274] minidom removeAttributeNode returns None In-Reply-To: <1523644603.75.0.682650639539.issue33274@psf.upfronthosting.co.za> Message-ID: <1523644663.99.0.682650639539.issue33274@psf.upfronthosting.co.za> Change by Ari Krupnik : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 14:38:46 2018 From: report at bugs.python.org (Ben FrantzDale) Date: Fri, 13 Apr 2018 18:38:46 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted Message-ID: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> New submission from Ben FrantzDale : The sortedness of glob.glob's output is platform-dependent. While the docs do not mention sorting, and so are strictly correct, if you are on a platform where its output is sorted, it's easy to believe that the output is always sorted. I propose we a Note maybe next to "Note: Using the ?**? pattern in large directory trees may consume an inordinate amount of time." that says "Note: While the output of glob.glob may be sorted on some architectures, ordering is not guaranteed. Use `sort(glob.glob(...))` if ordering is important." This wrong assumption burned us when scripts inexplicably stopped working on OSX High Sierra. ---------- components: Library (Lib) messages: 315254 nosy: Ben FrantzDale priority: normal severity: normal status: open title: glob.glob should explicitly note that results aren't sorted 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 Apr 13 14:41:48 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 13 Apr 2018 18:41:48 +0000 Subject: [issue33270] tags for anonymous code objects should be interned In-Reply-To: <1523565134.3.0.682650639539.issue33270@psf.upfronthosting.co.za> Message-ID: <1523644908.37.0.682650639539.issue33270@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- stage: -> needs patch type: -> enhancement versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 14:48:52 2018 From: report at bugs.python.org (Steve Dower) Date: Fri, 13 Apr 2018 18:48:52 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523645332.18.0.682650639539.issue33184@psf.upfronthosting.co.za> Change by Steve Dower : ---------- pull_requests: +6159 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 14:55:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 13 Apr 2018 18:55:19 +0000 Subject: [issue33271] Exception handling should match subclasses, not subtypes In-Reply-To: <1523605174.57.0.682650639539.issue33271@psf.upfronthosting.co.za> Message-ID: <1523645719.16.0.682650639539.issue33271@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Isn't this a duplicate of issue12029? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 15:08:16 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 13 Apr 2018 19:08:16 +0000 Subject: [issue33276] Clarify that __path__ can't be set to just anything Message-ID: <1523646496.5.0.682650639539.issue33276@psf.upfronthosting.co.za> New submission from Brett Cannon : https://docs.python.org/3/reference/import.html#module-path says that "regardless of its value", __path__'s mere existence is key. But then later the docs say "__path__ must be an iterable of strings, but it may be empty". Technically the latter is more accurate, so the docs should get touched up to match itself better. ---------- assignee: brett.cannon components: Documentation keywords: easy messages: 315256 nosy: brett.cannon priority: normal severity: normal stage: needs patch status: open title: Clarify that __path__ can't be set to just anything versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 15:09:29 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 13 Apr 2018 19:09:29 +0000 Subject: [issue12029] Allow catching virtual subclasses in except clauses In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1523646569.05.0.682650639539.issue12029@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Silencing exceptions like MemoryError, RecursionError or KeyboardInterrupt and returning a lying result doesn't look like a good idea to me. These exceptions can be raised in virtually any code for causes not related to executed code. MemoryError -- if other parts of the program allocated too much memory, RecursionError -- if the exception check is performed too deep in the execution stack, KeyboardInterrupt -- for obvious reasons. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 15:20:20 2018 From: report at bugs.python.org (Michael McCoy) Date: Fri, 13 Apr 2018 19:20:20 +0000 Subject: [issue33271] Exception handling should match subclasses, not subtypes In-Reply-To: <1523605174.57.0.682650639539.issue33271@psf.upfronthosting.co.za> Message-ID: <1523647220.32.0.682650639539.issue33271@psf.upfronthosting.co.za> Michael McCoy added the comment: Serhiy, it sure is. I'll note that the issue is open. Moreover, reading through the history, Guido says it's a bug (msg160418), and there was agreement that it should be fixed. It's unclear why it was dropped. Can you help me get this in? I'm not sure the correct protocol, since this is my first contrib. Note that if this is not a bug, then there are probably bugs anywhere issubclass(...) is used to emulate exception handling. For example, unittest's self.assertRaises is inconsistent with the current behavior: from abc import ABC import unittest class TestExceptionABC(unittest.TestCase): def test_exception(self): class A(Exception, ABC): pass class B(Exception): pass A.register(B) with self.assertRaises(A, msg="Wrong exception raised"): raise B Test passes in python3, but not in python2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 15:34:47 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 13 Apr 2018 19:34:47 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: <1523648087.6.0.682650639539.issue33275@psf.upfronthosting.co.za> Raymond Hettinger added the comment: This seems reasonable. I would like like it to be part of the regular text rather rather than appearing as a big ..note entry which can be visually distracting from the core functionality. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) keywords: +easy nosy: +docs at python, rhettinger stage: -> needs patch versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 15:35:33 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 13 Apr 2018 19:35:33 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: <1523648133.79.0.682650639539.issue33275@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- nosy: +csabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 15:36:55 2018 From: report at bugs.python.org (iunknwn) Date: Fri, 13 Apr 2018 19:36:55 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1523648215.07.0.682650639539.issue24882@psf.upfronthosting.co.za> iunknwn added the comment: The existing behavior seems strange (and isn't well documented). The code had a TODO comment from bquinlan to implement idle thread recycling, so that was why I made the change. That said, if threads are cheap, why not just create all the work threads on initialization, and then remove all the logic entirely? Also, regarding the executor and thread-safety, there's an example in the current docs showing a job being added to the executor from a worker thread (it's part of the example on deadlocks, but it focuses on max worker count, not on the executor's thread-safety). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 15:48:13 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Apr 2018 19:48:13 +0000 Subject: [issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer In-Reply-To: <1523155916.86.0.682650639539.issue33240@psf.upfronthosting.co.za> Message-ID: <1523648893.02.0.682650639539.issue33240@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- title: shutil.rmtree fails when the inner floder is opened in Explorer on Windows -> shutil.rmtree fails if inner folder is open in Windows Explorer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 15:50:39 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Apr 2018 19:50:39 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1523649039.89.0.682650639539.issue33251@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 16:04:38 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 13 Apr 2018 20:04:38 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1523649878.49.0.682650639539.issue24882@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > That said, if threads are cheap, why not just create all the work threads on initialization, and then remove all the logic entirely? That would sound reasonable to me. bquinlan has been absent for a long time, so I wouldn't expect an answer from him on this issue. > Also, regarding the executor and thread-safety, there's an example in the current docs showing a job being added to the executor from a worker thread Actually, looking at the code again, submit() is protected by the shutdown_lock, so it seems it should be thread-safe. That's on git master btw. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 16:12:26 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 13 Apr 2018 20:12:26 +0000 Subject: [issue33271] Exception handling should match subclasses, not subtypes In-Reply-To: <1523605174.57.0.682650639539.issue33271@psf.upfronthosting.co.za> Message-ID: <1523650346.86.0.682650639539.issue33271@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Let to keep the discussion in a single place -- in issue12029. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Allow catching virtual subclasses in except clauses _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 16:13:00 2018 From: report at bugs.python.org (Michael McCoy) Date: Fri, 13 Apr 2018 20:13:00 +0000 Subject: [issue12029] Allow catching virtual subclasses in except clauses In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1523650380.41.0.682650639539.issue12029@psf.upfronthosting.co.za> Change by Michael McCoy : ---------- pull_requests: +6160 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 16:13:59 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 13 Apr 2018 20:13:59 +0000 Subject: [issue33270] tags for anonymous code objects should be interned In-Reply-To: <1523565134.3.0.682650639539.issue33270@psf.upfronthosting.co.za> Message-ID: <1523650439.86.0.682650639539.issue33270@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 16:18:34 2018 From: report at bugs.python.org (iunknwn) Date: Fri, 13 Apr 2018 20:18:34 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1523650714.01.0.682650639539.issue24882@psf.upfronthosting.co.za> iunknwn added the comment: Alright - I'll put together another patch that removes the logic, and spins up all threads during initialization. Do you want me to create a completely new PR, or just update my existing one? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 16:23:48 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 13 Apr 2018 20:23:48 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1523651028.12.0.682650639539.issue24882@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Creating a new PR would be cleaner IMHO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 16:31:58 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 13 Apr 2018 20:31:58 +0000 Subject: [issue33176] Allow memoryview.cast(readonly=...) In-Reply-To: <1522311712.08.0.467229070634.issue33176@psf.upfronthosting.co.za> Message-ID: <1523651518.25.0.682650639539.issue33176@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- pull_requests: +6161 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 16:47:21 2018 From: report at bugs.python.org (Antony Lee) Date: Fri, 13 Apr 2018 20:47:21 +0000 Subject: [issue12029] Allow catching virtual subclasses in except clauses In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1523652441.8.0.682650639539.issue12029@psf.upfronthosting.co.za> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 17:08:16 2018 From: report at bugs.python.org (Kirill Balunov) Date: Fri, 13 Apr 2018 21:08:16 +0000 Subject: [issue27129] Wordcode, part 2 In-Reply-To: <1464268387.83.0.862540030058.issue27129@psf.upfronthosting.co.za> Message-ID: <1523653696.21.0.682650639539.issue27129@psf.upfronthosting.co.za> Kirill Balunov added the comment: Hello, what is the future of this patch? Such a feeling that the transition to wordcode is still in some half-way state. ---------- nosy: +godaygo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 17:12:21 2018 From: report at bugs.python.org (Michael McCoy) Date: Fri, 13 Apr 2018 21:12:21 +0000 Subject: [issue12029] Allow catching virtual subclasses in except clauses In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1523653941.73.0.682650639539.issue12029@psf.upfronthosting.co.za> Michael McCoy added the comment: Amalgamating the patch history here, I've updated the tests on Github (PR6160) to include tests for both the recursive case and ensure the correct error is propagated up if an exception occurs during the subclass check. I've also added a check to ensure that unittest's assertRaises behaves as expected. (The test currently passes on master, which is a bug if this doesn't get merged.) Finally, the PR updates the documentation for try/except. ---------- nosy: +Michael McCoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 17:37:41 2018 From: report at bugs.python.org (Michael McCoy) Date: Fri, 13 Apr 2018 21:37:41 +0000 Subject: [issue12029] Allow catching virtual subclasses in except clauses In-Reply-To: <1304844823.89.0.48444500115.issue12029@psf.upfronthosting.co.za> Message-ID: <1523655461.54.0.682650639539.issue12029@psf.upfronthosting.co.za> Michael McCoy added the comment: Sorry, my last message referred to Github PR6460 / pull_request6160. ---------- versions: +Python 3.4, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 17:48:22 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 13 Apr 2018 21:48:22 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules Message-ID: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> New submission from Brett Cannon : If you look at https://docs.python.org/3/reference/import.html#import-related-module-attributes you will notice there are a lot of attributes on modules. But since the introduction of module specs (https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec), all of those attributes became redundant. Now some attributes can never be taken away based on common idioms in the Python community. __name__ can't go due to `if __name__ == '__main__'`. __path__ can't go due to people manipulating it with e.g. pkg_resources or pkgutil. The rest, though, don't have such strong idioms tied to them (and in the case of __package__, has actually been made officially redundant by the import system since Python 3.6). That means setting them is unnecessary and any time someone wants to read or potentially manipulate them they have to choose between those attributes or the spec (or update both). Either way it can lead to bugs (I know I have nearly forgotten to set both the spec and the attribute before). I don't know if we can easily deprecate these attributes using __getattr__ on modules as added in Python 3.7, or if this is more of a documentation thing and need a long period of clearly messaging that these redundant attributes will no longer be set at some point. ---------- components: Library (Lib) messages: 315269 nosy: brett.cannon, eric.snow priority: normal severity: normal stage: test needed status: open title: Deprecate __loader__, __package__, __file__, and __cached__ on modules versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 17:48:26 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 13 Apr 2018 21:48:26 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1523656106.99.0.682650639539.issue33277@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 18:13:29 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 13 Apr 2018 22:13:29 +0000 Subject: [issue33254] importlib.resources.contents() incorrectly yields an empty list In-Reply-To: <1523320022.42.0.682650639539.issue33254@psf.upfronthosting.co.za> Message-ID: <1523657609.68.0.682650639539.issue33254@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- keywords: +patch pull_requests: +6162 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 18:20:39 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Fri, 13 Apr 2018 22:20:39 +0000 Subject: [issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8' In-Reply-To: <1523352074.24.0.682650639539.issue33255@psf.upfronthosting.co.za> Message-ID: <1523658039.02.0.682650639539.issue33255@psf.upfronthosting.co.za> Ivan Pozdeev added the comment: Treating 'utf-8' and its aliases differently (when they specifically mean the Python's, rather than something else's, encoding) is definitely as issue. You shouldn't hardcode a list of aliases though; rather use existing facilities to resolve them. From quick googling, e.g. `codecs.lookup().name` can get the canonical name. Make sure to follow https://devguide.python.org/pullrequest when doing the PR; a test case will likely be needed, too. ---------- nosy: +Ivan.Pozdeev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 18:46:30 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Fri, 13 Apr 2018 22:46:30 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1523659590.91.0.682650639539.issue33257@psf.upfronthosting.co.za> Ivan Pozdeev added the comment: My best idea for a test as of now is to run the example ~20 times in a loop (or continuously for a comparable amount of time & threads) and catch and register any exceptions in all threads as per https://stackoverflow.com/questions/18349614/check-if-a-python-thread-threw-an-exception . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 18:46:48 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Apr 2018 22:46:48 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1523659608.19.0.682650639539.issue33261@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Nick and Raymond, I added both of you as nosy because, among other reasons, you commented on the latest version of PEP575. I agree that there is a bug in current CPython, in that the is* functions should return, not raise, but I am not sure where is it, and hence if the PR is the right fix. I am wondering if, instead, the bug is in m, the object returned by MethodType, or in attribute lookup thereupon. MethodType is the type of bound user-defined (Python-coded) functions and ismethod is true for instances thereof. Consider 4 other bound methods, two 'normal'(callable is method of instance class) and two, like Jeroen's, 'odd' (callable not related to int). >>> cm = Callable().__call__ >>> cm.__code__ ", line 2> >>> cm.__name__ '__call__' >>> cm2 = MethodType(Callable.__call__, Callable()) >>> cm2.__code__ ", line 2> >>> cm2.__name__ '__call__' >>> m2 = MethodType(Callable.__call__, 42) >>> m2.__code__ ", line 2> >>> m2.__name__ '__call__' >>> m2() () >>> m3 = MethodType(Callable().__call__, 42) >>> m3.__code__ ", line 2> >>> m3.__name__ '__call__' >>> m3() (42,) >>> m = MethodType(Callable(), 42) >>> m.__code__ ... AttributeError: 'Callable' object has no attribute '__code__' >>> m.__name__ ... AttributeError: 'Callable' object has no attribute '__name__' >>> m() (42,) They all have the same attributes exposed by dir(), which omits both'__name__', promised in the docstring for ismethod*, and '__code__', assumed by the is--- functions under discussion. >>> dir(cm) == dir(cm2) == dir(m) == dir(m2) == dir(m3) True >>> ('__code__' in dir(cm)) or ('__name__' in dir(cm)) False However, accessing those names anyway, as (hidden) attributes, works for all but m. Should doing so also work for m? (If not, the ismethod docstring should not 'guarantee' .__name__.) * " Instance method objects provide these attributes: __doc__ documentation string __name__ name with which this method was defined ..." ---------- nosy: +ncoghlan, rhettinger, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 19:55:52 2018 From: report at bugs.python.org (Eryk Sun) Date: Fri, 13 Apr 2018 23:55:52 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: <1523663752.91.0.682650639539.issue33275@psf.upfronthosting.co.za> Eryk Sun added the comment: > The sortedness of glob.glob's output is platform-dependent. It's typically file-system dependent (e.g. NTFS, FAT, ISO9660, UDF) -- at least on Windows. NTFS and ISO9660 store directories in sorted order based on the filename (Unicode or ASCII ordinal sort). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 19:58:03 2018 From: report at bugs.python.org (Julian Mehnle) Date: Fri, 13 Apr 2018 23:58:03 +0000 Subject: [issue13041] argparse: terminal width is not detected properly In-Reply-To: <1316902039.33.0.744560309521.issue13041@psf.upfronthosting.co.za> Message-ID: <1523663883.22.0.682650639539.issue13041@psf.upfronthosting.co.za> Julian Mehnle added the comment: What's holding up the merging of this patch? ---------- nosy: +jmehnle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 20:09:49 2018 From: report at bugs.python.org (Ben FrantzDale) Date: Sat, 14 Apr 2018 00:09:49 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: <1523664589.04.0.682650639539.issue33275@psf.upfronthosting.co.za> Ben FrantzDale added the comment: Fascinating. That seems like an even wilder gotcha: It sounds like a script assuming sorted results would work in one directory (on one filesystem) but not on another. Or even weirder, if I had a mounted scratch partition, the script could work until I (or a sys admin) mounts a larger drive with a different filesystem on the same mountpoint. Yikes! Either way, this gotcha seems worth mentioning explicitly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 20:09:54 2018 From: report at bugs.python.org (Mark Lawrence) Date: Sat, 14 Apr 2018 00:09:54 +0000 Subject: [issue13041] argparse: terminal width is not detected properly In-Reply-To: <1316902039.33.0.744560309521.issue13041@psf.upfronthosting.co.za> Message-ID: <1523664594.21.0.682650639539.issue13041@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 20:21:05 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Sat, 14 Apr 2018 00:21:05 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1523665265.38.0.682650639539.issue33277@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: I agree. It should also be pointed out that we've had inconsistencies between the module attributes and the spec attributes, and even fixing those has lead to problems. There should be a single source of truth, and the module spec should be that. +1, and I agree about not being able to __name__ and __path__. ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 20:22:29 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Apr 2018 00:22:29 +0000 Subject: [issue33269] InteractiveConsole behaves differently on terminal, within script In-Reply-To: <1523544959.58.0.682650639539.issue33269@psf.upfronthosting.co.za> Message-ID: <1523665349.6.0.682650639539.issue33269@psf.upfronthosting.co.za> Terry J. Reedy added the comment: [For future reference, if I were not closing this, I would ask the following: Does 'on terminal mean that you started Python in interactive mode and then entered lines in response to the '>>> prompt'? If so, did you start Python from an actual (non-Python) terminal or console? or from an icon or start menu? What OS? When you ran a script, did you run it from the system console or from the file itself? However, I now consider this a moot point.] The test for the code module is test.test_code_module, as test_code tests code objects. It created a code.InteractiveConsole and calls .interact. There are no direct unittests of any of the other methods, but most, if not all, including .push, are called directly or indirecty within .interact. This is all within a script, which you say has problmes. Input is fed to the interact loop with lines such as self.infunc.side_effect = ["try: ham\nexcept: eggs\n", EOFError('Finished')] I cannot see that you have identified a real problem. Your iitests.py fails because it is buggy. It creates a new interactive console for each line. When " print('i', i)" is pushed to a new console, in response to >>>, there *should* be an indentation error. Similarly, 'sleep(1)' in a new console *should* fail with a NameError. In iiteswok.py, which you say works, only one console is created. After adding 'ii.push("")', to tell the console that the statement is complete, and removing unneeded code, the following works for me when run as a script import code ii = code.InteractiveConsole() ii.push("for i in range(3):") ii.push(" print ('i', i)") ii.push("") # prints i 0 i 1 i 2 Adding ii.push("from time import sleep") ii.push("print('start')") ii.push("sleep(1)") ii.push("print('stop')") prints 'start' and 'stop' with a one second delay. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed title: InteractiveConsole behaves differently when used on terminal and used within script -> InteractiveConsole behaves differently on terminal, within script _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 20:30:38 2018 From: report at bugs.python.org (Steve Dower) Date: Sat, 14 Apr 2018 00:30:38 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523665838.79.0.682650639539.issue33184@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset b1dc07509f78b354e83f5f4a902f1ff80c7bb05d by Steve Dower in branch 'master': bpo-33184: Update Windows installer to OpenSSL 1.1.0h (GH-6463) https://github.com/python/cpython/commit/b1dc07509f78b354e83f5f4a902f1ff80c7bb05d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 20:31:06 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Apr 2018 00:31:06 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523665866.39.0.682650639539.issue33184@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6163 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 20:31:18 2018 From: report at bugs.python.org (Steve Dower) Date: Sat, 14 Apr 2018 00:31:18 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523665878.59.0.682650639539.issue33184@psf.upfronthosting.co.za> Steve Dower added the comment: New changeset 1672c2fbae6128ee4717e08c4e65a0ab99a02a02 by Steve Dower in branch '3.6': bpo-33184: Update Windows installer to OpenSSL 1.0.2o (GH-6464) https://github.com/python/cpython/commit/1672c2fbae6128ee4717e08c4e65a0ab99a02a02 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 20:32:20 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Apr 2018 00:32:20 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1523665940.91.0.682650639539.issue33264@psf.upfronthosting.co.za> Terry J. Reedy added the comment: The label has been changed. Senthil, go ahead and merge this. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 20:52:04 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Apr 2018 00:52:04 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523667124.93.0.682650639539.issue33184@psf.upfronthosting.co.za> miss-islington added the comment: New changeset df958ff28af9c5c4563fd1b050f04f0e9745ab80 by Miss Islington (bot) in branch '3.7': bpo-33184: Update Windows installer to OpenSSL 1.1.0h (GH-6463) https://github.com/python/cpython/commit/df958ff28af9c5c4563fd1b050f04f0e9745ab80 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 21:11:21 2018 From: report at bugs.python.org (Steve Dower) Date: Sat, 14 Apr 2018 01:11:21 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523668281.12.0.682650639539.issue33184@psf.upfronthosting.co.za> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 21:15:08 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 01:15:08 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523668508.16.0.682650639539.issue33184@psf.upfronthosting.co.za> Ned Deily added the comment: Steve, what about 2.7 for 2.7.15rc1? (I'm working on that for the Mac installer now.) ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 13 23:08:24 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Apr 2018 03:08:24 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1523675304.25.0.682650639539.issue33257@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I believe I have seen this exact error message within the last few months, and I found one example on SO. https://stackoverflow.com/questions/21209124/weird-error-that-comes-up-during-python-program-run ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 01:04:54 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 14 Apr 2018 05:04:54 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1523682294.21.0.682650639539.issue33261@psf.upfronthosting.co.za> Nick Coghlan added the comment: The inspect functions throwing an exception when handed a method wrapping a non-function callable instead of returning False is a definite bug. The behaviour of MethodType when handed a non-function callable is cryptic, but not actually a bug: the problem is that it expects to be able to delegate accesses to __name__ and __code__ to the underlying callable. A docs bug to clarify exactly which accesses are going to get delegated would make sense (and perhaps make MethodType.__dir__ a bit smarter about that delegation), but it's a separate issue from the one Jeroen has reported here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 04:56:26 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Sat, 14 Apr 2018 08:56:26 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1523696186.2.0.682650639539.issue33257@psf.upfronthosting.co.za> Ivan Pozdeev added the comment: @terry.reedy Apparently, this bug has gone unnoticed for years (to be precise, since https://github.com/python/cpython/commit/b5bfb9f38c786c3330b2d52d93b664588c42283d in 2002), and there are all kinds of weird rumors circulating about whether tkinter is thread-safe or not, and what can be run where ( see e.g. https://stackoverflow.com/search?q=tkinter+thread+safe ). Having run into it in my project, I set out to get to the bottom of this ( https://github.com/RedFantom/mtTkinter/issues/5 ) ...and looks like I did. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 05:00:12 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Sat, 14 Apr 2018 09:00:12 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1523696412.95.0.682650639539.issue33257@psf.upfronthosting.co.za> Ivan Pozdeev added the comment: Wait a second... I think I noticed another similar bug. In Tkapp_CallProc. Same case, Tkapp_CallArgs and Tkapp_CallDeallocArgs are called when not holding both locks. The attached example doesn't use Python event handlers, so it didn't manifest itself in my tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 08:13:54 2018 From: report at bugs.python.org (Jeffrey McLarty) Date: Sat, 14 Apr 2018 12:13:54 +0000 Subject: [issue27544] Document the ABCs for instance/subclass checks of dict view types In-Reply-To: <1468805116.02.0.14575319212.issue27544@psf.upfronthosting.co.za> Message-ID: <1523708034.83.0.682650639539.issue27544@psf.upfronthosting.co.za> Change by Jeffrey McLarty : ---------- nosy: +Jeffrey McLarty _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 09:51:33 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Sat, 14 Apr 2018 13:51:33 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1523713893.78.0.682650639539.issue33261@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: > I am wondering if, instead, the bug is in m, the object returned by MethodType, or in attribute lookup thereupon. What would you expect m.__code__ to return then? Methods support arbitrary callables and certainly not all callables have a meaningful __code__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 09:59:05 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Sat, 14 Apr 2018 13:59:05 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1523714345.25.0.682650639539.issue33261@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: The only attributes that a method is guaranteed to have are __func__ and __self__ (which are the arguments passed to the MethodType constructor). All other attributes are looked up through __func__ by the C version of the following Python code: def __getattr__(self, attr): return getattr(self.__func__, attr) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:25:13 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:25:13 +0000 Subject: [issue32726] macOS installer and framework enhancements and changes for 3.7.0 and 3.6.5 In-Reply-To: <1517313531.59.0.467229070634.issue32726@psf.upfronthosting.co.za> Message-ID: <1523715913.49.0.682650639539.issue32726@psf.upfronthosting.co.za> Change by Ned Deily : ---------- pull_requests: +6164 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:25:13 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:25:13 +0000 Subject: [issue24414] MACOSX_DEPLOYMENT_TARGET set incorrectly by configure In-Reply-To: <1433799874.27.0.587161975864.issue24414@psf.upfronthosting.co.za> Message-ID: <1523715913.76.0.0935424498089.issue24414@psf.upfronthosting.co.za> Change by Ned Deily : ---------- keywords: +patch pull_requests: +6165 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:25:13 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:25:13 +0000 Subject: [issue19019] Investigate using Apple clang for building OS X installers In-Reply-To: <1379190673.82.0.353716409802.issue19019@psf.upfronthosting.co.za> Message-ID: <1523715913.84.0.548999895584.issue19019@psf.upfronthosting.co.za> Change by Ned Deily : ---------- keywords: +patch pull_requests: +6166 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:25:13 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:25:13 +0000 Subject: [issue11485] Default SDK value on MacOSX needs changing In-Reply-To: <1300051696.43.0.599185291628.issue11485@psf.upfronthosting.co.za> Message-ID: <1523715913.95.0.918678401297.issue11485@psf.upfronthosting.co.za> Change by Ned Deily : ---------- pull_requests: +6167 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:29:15 2018 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sat, 14 Apr 2018 14:29:15 +0000 Subject: [issue33278] libexpat uses HAVE_SYSCALL_GETRANDOM instead of HAVE_GETRANDOM_SYSCALL Message-ID: <1523716155.58.0.682650639539.issue33278@psf.upfronthosting.co.za> New submission from Marc-Andre Lemburg : See https://github.com/python/cpython/blob/3.6/Modules/expat/xmlparse.c#L87 The Python configure script tests and sets the variable HAVE_GETRANDOM_SYSCALL. The solution would be to have Python's config script define HAVE_SYSCALL_GETRANDOM as well, in case it detects the function. ---------- components: XML messages: 315289 nosy: lemburg priority: normal severity: normal status: open title: libexpat uses HAVE_SYSCALL_GETRANDOM instead of HAVE_GETRANDOM_SYSCALL versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:37:34 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:37:34 +0000 Subject: [issue11485] Default SDK value on MacOSX needs changing In-Reply-To: <1300051696.43.0.599185291628.issue11485@psf.upfronthosting.co.za> Message-ID: <1523716654.47.0.682650639539.issue11485@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset ee8e4b61d6181f5bfadf6ee3d229f0ebda8a6ae9 by Ned Deily in branch '2.7': [2.7] Backport macOS universal build and installer fixes from 3.6. (GH-6469) https://github.com/python/cpython/commit/ee8e4b61d6181f5bfadf6ee3d229f0ebda8a6ae9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:37:34 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:37:34 +0000 Subject: [issue32726] macOS installer and framework enhancements and changes for 3.7.0 and 3.6.5 In-Reply-To: <1517313531.59.0.467229070634.issue32726@psf.upfronthosting.co.za> Message-ID: <1523716654.71.0.262363346258.issue32726@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset ee8e4b61d6181f5bfadf6ee3d229f0ebda8a6ae9 by Ned Deily in branch '2.7': [2.7] Backport macOS universal build and installer fixes from 3.6. (GH-6469) https://github.com/python/cpython/commit/ee8e4b61d6181f5bfadf6ee3d229f0ebda8a6ae9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:37:34 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:37:34 +0000 Subject: [issue24414] MACOSX_DEPLOYMENT_TARGET set incorrectly by configure In-Reply-To: <1433799874.27.0.587161975864.issue24414@psf.upfronthosting.co.za> Message-ID: <1523716654.78.0.0935424498089.issue24414@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset ee8e4b61d6181f5bfadf6ee3d229f0ebda8a6ae9 by Ned Deily in branch '2.7': [2.7] Backport macOS universal build and installer fixes from 3.6. (GH-6469) https://github.com/python/cpython/commit/ee8e4b61d6181f5bfadf6ee3d229f0ebda8a6ae9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:37:34 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:37:34 +0000 Subject: [issue19019] Investigate using Apple clang for building OS X installers In-Reply-To: <1379190673.82.0.353716409802.issue19019@psf.upfronthosting.co.za> Message-ID: <1523716654.91.0.393789816046.issue19019@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset ee8e4b61d6181f5bfadf6ee3d229f0ebda8a6ae9 by Ned Deily in branch '2.7': [2.7] Backport macOS universal build and installer fixes from 3.6. (GH-6469) https://github.com/python/cpython/commit/ee8e4b61d6181f5bfadf6ee3d229f0ebda8a6ae9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:48:24 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:48:24 +0000 Subject: [issue19019] Investigate using Apple clang for building OS X installers In-Reply-To: <1379190673.82.0.353716409802.issue19019@psf.upfronthosting.co.za> Message-ID: <1523717304.37.0.682650639539.issue19019@psf.upfronthosting.co.za> Change by Ned Deily : ---------- pull_requests: +6168 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:48:24 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:48:24 +0000 Subject: [issue17128] OS X system openssl deprecated - installer should build local libssl In-Reply-To: <1360002680.77.0.851671416179.issue17128@psf.upfronthosting.co.za> Message-ID: <1523717304.62.0.0935424498089.issue17128@psf.upfronthosting.co.za> Change by Ned Deily : ---------- pull_requests: +6169 status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:56:19 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:56:19 +0000 Subject: [issue17128] OS X system openssl deprecated - installer should build local libssl In-Reply-To: <1360002680.77.0.851671416179.issue17128@psf.upfronthosting.co.za> Message-ID: <1523717779.82.0.682650639539.issue17128@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 93c91ac8f67ef0819ddacdcca12ef0ae88e5802e by Ned Deily in branch '2.7': [2.7] Fix errant NEWS item: bpo-19019 -> bpo-17128 (GH-6470) https://github.com/python/cpython/commit/93c91ac8f67ef0819ddacdcca12ef0ae88e5802e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 10:56:20 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 14:56:20 +0000 Subject: [issue19019] Investigate using Apple clang for building OS X installers In-Reply-To: <1379190673.82.0.353716409802.issue19019@psf.upfronthosting.co.za> Message-ID: <1523717780.21.0.262363346258.issue19019@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 93c91ac8f67ef0819ddacdcca12ef0ae88e5802e by Ned Deily in branch '2.7': [2.7] Fix errant NEWS item: bpo-19019 -> bpo-17128 (GH-6470) https://github.com/python/cpython/commit/93c91ac8f67ef0819ddacdcca12ef0ae88e5802e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 11:00:54 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 14 Apr 2018 15:00:54 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523718054.65.0.682650639539.issue33184@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6170 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 11:21:05 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 14 Apr 2018 15:21:05 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523719265.12.0.682650639539.issue33184@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 01a0fd4a3a4cb9928518518acc9c9f2ed6e9a382 by Ned Deily (Miss Islington (bot)) in branch '2.7': [2.7] bpo-33184: Update macOS installer build to use OpenSSL 1.0.2o. (GH-6408) (GH-6471) https://github.com/python/cpython/commit/01a0fd4a3a4cb9928518518acc9c9f2ed6e9a382 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 11:53:49 2018 From: report at bugs.python.org (Alfred Morgan) Date: Sat, 14 Apr 2018 15:53:49 +0000 Subject: [issue14573] json iterencode can not handle general iterators In-Reply-To: <1334355033.57.0.314676653112.issue14573@psf.upfronthosting.co.za> Message-ID: <1523721229.86.0.682650639539.issue14573@psf.upfronthosting.co.za> Alfred Morgan added the comment: @serhiy.storchaka while you are doing your overhaul will you please add support for raw json values. I often find myself where I have a serialized object that I want to include in an object response that I'm about to serialize anyway. The implementation should be very simple. Here is my workaround code: class RawJSON(str): pass origEnc = json.encoder.encode_basestring_ascii def rawEnc(obj): if isinstance(obj, RawJSON): return obj return origEnc(obj) json.encoder.encode_basestring_ascii = rawEnc https://stackoverflow.com/a/48985560/289240 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 12:05:14 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Apr 2018 16:05:14 +0000 Subject: [issue14573] json iterencode can not handle general iterators In-Reply-To: <1334355033.57.0.314676653112.issue14573@psf.upfronthosting.co.za> Message-ID: <1523721914.52.0.682650639539.issue14573@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It is included. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 13:17:53 2018 From: report at bugs.python.org (Zackery Spytz) Date: Sat, 14 Apr 2018 17:17:53 +0000 Subject: [issue33270] tags for anonymous code objects should be interned In-Reply-To: <1523565134.3.0.682650639539.issue33270@psf.upfronthosting.co.za> Message-ID: <1523726273.86.0.682650639539.issue33270@psf.upfronthosting.co.za> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +6171 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 13:49:23 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 14 Apr 2018 17:49:23 +0000 Subject: [issue33176] Allow memoryview.cast(readonly=...) In-Reply-To: <1522311712.08.0.467229070634.issue33176@psf.upfronthosting.co.za> Message-ID: <1523728163.34.0.682650639539.issue33176@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 480ab05d5fee2b8fa161f799af33086a4e68c7dd by Antoine Pitrou in branch 'master': bpo-33176: Add a toreadonly() method to memoryviews. (GH-6466) https://github.com/python/cpython/commit/480ab05d5fee2b8fa161f799af33086a4e68c7dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 13:49:49 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 14 Apr 2018 17:49:49 +0000 Subject: [issue33176] Allow memoryview.toreadonly() In-Reply-To: <1522311712.08.0.467229070634.issue33176@psf.upfronthosting.co.za> Message-ID: <1523728189.03.0.682650639539.issue33176@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: Allow memoryview.cast(readonly=...) -> Allow memoryview.toreadonly() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 14:32:01 2018 From: report at bugs.python.org (Dan Snider) Date: Sat, 14 Apr 2018 18:32:01 +0000 Subject: [issue33279] Py_Build value is causing crashes with the "L" and "K" format characters when upcasting sub 64-bit integer types Message-ID: <1523730721.0.0.682650639539.issue33279@psf.upfronthosting.co.za> New submission from Dan Snider : New to both C and the CPython api so I'm not sure what compiler details matter but this is with VS14 and default compile parameters on windows 10 with 32bit Python. The following function: static PyObject *spam(PyObject *module) { digit w = 9; int x = 9; long y = 9; int32_t z = 9; return Py_BuildValue("(HIK)(lll)(LLL)", w,w,w,x,y,z,x,y,z); } returns: >>> spam() ((9, 9, 38654705673), (9, 9, 9), (38654705673, 438244858264171835, 6133859984)) Above was the most I could fit in a single Py_BuildValue call without causing a crash (it instantly crashes if "O" or "N" fields are present). I believe this happens because the ints are being upcasted as pointers, which is undefined behavior. ---------- components: Interpreter Core, Windows messages: 315300 nosy: bup, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Py_Build value is causing crashes with the "L" and "K" format characters when upcasting sub 64-bit integer types type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 14:32:30 2018 From: report at bugs.python.org (Dan Snider) Date: Sat, 14 Apr 2018 18:32:30 +0000 Subject: [issue33279] Py_BuildValue is causing crashes with the "L" and "K" format characters when upcasting sub 64-bit integer types In-Reply-To: <1523730721.0.0.682650639539.issue33279@psf.upfronthosting.co.za> Message-ID: <1523730750.67.0.682650639539.issue33279@psf.upfronthosting.co.za> Change by Dan Snider : ---------- title: Py_Build value is causing crashes with the "L" and "K" format characters when upcasting sub 64-bit integer types -> Py_BuildValue is causing crashes with the "L" and "K" format characters when upcasting sub 64-bit integer types _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 14:46:04 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 14 Apr 2018 18:46:04 +0000 Subject: [issue33279] Py_BuildValue is causing crashes with the "L" and "K" format characters when upcasting sub 64-bit integer types In-Reply-To: <1523730721.0.0.682650639539.issue33279@psf.upfronthosting.co.za> Message-ID: <1523731564.7.0.682650639539.issue33279@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This isn't a bug in CPython API. You need to pass arguments of correct type to functions with a variable number of parameters. The compiler doesn't know what type is expected and can't coerce the value automatically. The same undefined behavior your can see with say printf(). ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 15:07:52 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Apr 2018 19:07:52 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1523732872.53.0.682650639539.issue33261@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I would like python_coded_callable.__code__ to be the code object executed when python_coded_callable is called, just as expected by the isxyz author(s). It has to exist somewhere. Methods m and m3 both return 42 when called, and both have the same code object. >>> m3.__code__ >>> m3.__func__.__code__ >>> m.__func__.__call__.__code__ The fact that m requires an additional level of indirection is an implementation detail that I don't think necessarily has to involve users. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 16:12:42 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 14 Apr 2018 20:12:42 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst Message-ID: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> New submission from Andr?s Delfino : There are two links to the Tcl/Tk documentation on tkinter.rst. One of them points to 8.5 man pages. ---------- assignee: docs at python components: Documentation messages: 315303 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Update link to Tcl/Tk 8.6 man pages in tkinter.rst type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 16:13:57 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 14 Apr 2018 20:13:57 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1523736837.8.0.682650639539.issue33280@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- keywords: +patch pull_requests: +6172 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 16:31:10 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Sat, 14 Apr 2018 20:31:10 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1523737870.26.0.682650639539.issue33257@psf.upfronthosting.co.za> Ivan Pozdeev added the comment: Attached reproducing example for event handlers. If launching more than one EventThread, it abort()'s immediately. ---------- Added file: https://bugs.python.org/file47535/TkinterHanders.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 16:47:00 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Sat, 14 Apr 2018 20:47:00 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1523738820.47.0.682650639539.issue33261@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: > I would like python_coded_callable.__code__ to be the code object executed when python_coded_callable is called First of all, that doesn't answer the question of what to do with non-Python coded callables where there is no __code__ object at all. Second, are you *really* sure that you want that? That would mean adding a __code__ attribute to all callable Python classes or adding a __code__ descriptor to "type". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 17:53:15 2018 From: report at bugs.python.org (Steve Dower) Date: Sat, 14 Apr 2018 21:53:15 +0000 Subject: [issue33148] RuntimeError('Event loop is closed') after cancelling getaddrinfo and closing loop In-Reply-To: <1522104643.31.0.467229070634.issue33148@psf.upfronthosting.co.za> Message-ID: <1523742795.81.0.682650639539.issue33148@psf.upfronthosting.co.za> Change by Steve Dower : ---------- keywords: +patch pull_requests: +6173 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 18:05:05 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 14 Apr 2018 22:05:05 +0000 Subject: [issue33148] RuntimeError('Event loop is closed') after cancelling getaddrinfo and closing loop In-Reply-To: <1522104643.31.0.467229070634.issue33148@psf.upfronthosting.co.za> Message-ID: <1523743505.49.0.682650639539.issue33148@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset bba2ba180de91177a73d28551dce71696d472c47 by Benjamin Peterson (Steve Dower) in branch '2.7': bpo-33148: Update Windows build to use OpenSSL 1.0.2o https://github.com/python/cpython/commit/bba2ba180de91177a73d28551dce71696d472c47 ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 18:19:00 2018 From: report at bugs.python.org (Steve Dower) Date: Sat, 14 Apr 2018 22:19:00 +0000 Subject: [issue32185] SSLContext.wrap_socket sends SNI Extension when server_hostname is IP In-Reply-To: <1512065109.64.0.213398074469.issue32185@psf.upfronthosting.co.za> Message-ID: <1523744340.62.0.682650639539.issue32185@psf.upfronthosting.co.za> Change by Steve Dower : ---------- pull_requests: +6174 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 18:38:18 2018 From: report at bugs.python.org (Steve Dower) Date: Sat, 14 Apr 2018 22:38:18 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523745498.79.0.682650639539.issue33184@psf.upfronthosting.co.za> Change by Steve Dower : ---------- pull_requests: +6175 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 14 18:44:24 2018 From: report at bugs.python.org (Steve Dower) Date: Sat, 14 Apr 2018 22:44:24 +0000 Subject: [issue33184] Update OpenSSL to 1.1.0h / 1.0.2o In-Reply-To: <1522375918.6.0.467229070634.issue33184@psf.upfronthosting.co.za> Message-ID: <1523745864.91.0.682650639539.issue33184@psf.upfronthosting.co.za> Steve Dower added the comment: The 2.7 backport was merged by Benjamin into his release branch, which is why the PR shows "closed". ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 01:11:23 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 05:11:23 +0000 Subject: [issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x In-Reply-To: <1516595654.84.0.467229070634.issue32616@psf.upfronthosting.co.za> Message-ID: <1523769083.59.0.682650639539.issue32616@psf.upfronthosting.co.za> Ned Deily added the comment: A followup - Ronald asked: > w.r.t. detection of the clang/llvm version on Apple's system compiler: Is it worthwhile to do so? Now that Xcode 9.3 (for macOS 10.13+) is officially released, I ran a quick series of test on it and on the most recent Xcode versions for the last several macOS OS families: 10.12, 10.11, and 10.9 (I didn't have a 10.10 system available at the moment). Only looking at the most recent supported Xcode/compiler version for each major release is reasonable since I think most people follow Apple's strong encouragement to keep software updated and only use the most recent releases. And I think most people follow Apple's lead in using their build tools, via Xcode or the command line utilities, rather than a third-party compiler. By that measure, it seems clear that (1) there is only one current version that exhibits the performance degradation, that is the Xcode 9.2 version labeled Apple LLVM 9.0.0 (clang-900.0.39.2) and (2) that is now only an issue for macOS 10.12 (Sierra) where Xcode 9.2 is (and will likely remain) the most recent version. For macOS 10.13 (High Sierra), the compiler in the newly released Xcode 9.3 does not exhibit the problem. And the most recent versions of Xcode for the tested earlier macOS releases do not either. BTW, the MacPorts project maintains a handy webpage listing Xcode releases and compiler versions by macOS release: https://trac.macports.org/wiki/XcodeVersionInfo Here are the results. The methodology was to download and build the just released Python 2.7.15rc1 from source using the default configure options, i.e. just ./configure, and then run the test program 3 times with it and then three times with the Apple-provided system /usr/bin/python2.7 as a baseline. ProductName: Mac OS X ProductVersion: 10.13.4 BuildVersion: 17E199 2.7.15rc1 (default, Apr 15 2018, 00:22:29) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] 1.181971 1.180467 1.173380 2.7.10 (default, Oct 6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] 1.567072 1.587779 1.570056 ProductName: Mac OS X ProductVersion: 10.12.6 BuildVersion: 16G1314 2.7.15rc1 (default, Apr 15 2018, 00:31:39) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] 6.290989 6.356802 6.295680 2.7.10 (default, Feb 7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] 1.306507 1.312231 1.302826 ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G20015 2.7.15rc1 (default, Apr 15 2018, 00:38:12) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] 1.846332 1.855483 1.896600 2.7.10 (default, Oct 23 2015, 19:19:21) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] 1.453702 1.426298 1.440348 ProductName: Mac OS X ProductVersion: 10.9.5 BuildVersion: 13F1911 2.7.15rc1 (default, Apr 15 2018, 00:42:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] 1.720303 1.712045 1.710216 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] 1.681696 1.685704 1.686414 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 01:24:20 2018 From: report at bugs.python.org (Ian Burgwin) Date: Sun, 15 Apr 2018 05:24:20 +0000 Subject: [issue33281] ctypes.util.find_library not working on macOS Message-ID: <1523769860.6.0.682650639539.issue33281@psf.upfronthosting.co.za> New submission from Ian Burgwin : On Python 3.7.0a4 and later (including 3.7.0b4), find_library currently always returns None on macOS. It works on 3.7.0a3 and earlier. Tested on macOS 10.11 and 10.13. Expected result: Tested on 3.6.5, 3.7.0a1 and 3.7.0a3: >>> from ctypes.util import find_library >>> find_library('iconv') '/usr/lib/libiconv.dylib' >>> find_library('c') '/usr/lib/libc.dylib' >>> Current output on 3.7.0a4 to 3.7.0b3: >>> from ctypes.util import find_library >>> find_library('iconv') >>> find_library('c') >>> ---------- components: ctypes messages: 315309 nosy: Ian Burgwin (ihaveahax) priority: normal severity: normal status: open title: ctypes.util.find_library not working on macOS type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 01:56:41 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 05:56:41 +0000 Subject: [issue33281] ctypes.util.find_library not working on macOS In-Reply-To: <1523769860.6.0.682650639539.issue33281@psf.upfronthosting.co.za> Message-ID: <1523771801.88.0.682650639539.issue33281@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for the report and the good detective work! I see the same results. It appears that the error was introduced by c5ae169e1b73315672770517bf51cf8464286c76 for Issue26439. It looks we need both a fix and a test for this. This really needs to be fixed for 3.7.0b4. ---------- nosy: +Michael.Felt, ned.deily, vstinner priority: normal -> release blocker stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 01:58:01 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 05:58:01 +0000 Subject: [issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX) In-Reply-To: <1456413023.18.0.874865601403.issue26439@psf.upfronthosting.co.za> Message-ID: <1523771881.93.0.682650639539.issue26439@psf.upfronthosting.co.za> Ned Deily added the comment: It looks like c5ae169e1b73315672770517bf51cf8464286c76 broke find_library on macOS; see Issue33281. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 02:05:01 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 06:05:01 +0000 Subject: [issue33281] ctypes.util.find_library not working on macOS In-Reply-To: <1523769860.6.0.682650639539.issue33281@psf.upfronthosting.co.za> Message-ID: <1523772301.83.0.682650639539.issue33281@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +amaury.forgeotdarc, belopolsky, meador.inge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 02:46:58 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 15 Apr 2018 06:46:58 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1523774818.04.0.682650639539.issue33261@psf.upfronthosting.co.za> Nick Coghlan added the comment: Terry, if you'd like to continue that discussion, please open a new enhancement request for 3.8+ against the inspect module asking for the affected introspection functions to recursively search for relevant attributes, the same way `inspect.signature` digs inside different object types to look for signature information. However, the fact the inspect module doesn't implement that search for relevant attributes today is *not* a bug - it's a past design decision that could potentially stand to be revisited. By contrast, the fact the affected functions throw AttributeError instead of returning False for a missing attribute *is* a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 03:01:12 2018 From: report at bugs.python.org (Aaron Ang) Date: Sun, 15 Apr 2018 07:01:12 +0000 Subject: [issue11594] 2to3 does not preserve line endings In-Reply-To: <1300465648.02.0.83291128633.issue11594@psf.upfronthosting.co.za> Message-ID: <1523775672.48.0.682650639539.issue11594@psf.upfronthosting.co.za> Aaron Ang added the comment: I couldn't reproduce this issue. I tried reproducing this problem by extending the TestRefactoringTool class and creating two files: one file with LF line-endings and one file with CRLF line-endings. The changes that I made can be found here: https://github.com/aaronang/cpython/commit/55e8bd317f37923e6e23780e6ae41858493e98d8. The output of the tests: Before: b'print("hi")\n\nprint("Like bad Windows newlines?")\n' After: b'print("hi")\n\nprint("Like bad Windows newlines?")\n' Before: b'print("hi")\r\n\r\nprint("Like bad Windows newlines?")\r\n' After: b'print("hi")\r\n\r\nprint("Like bad Windows newlines?")\r\n' Maybe this problem has been resolved? ---------- nosy: +Aaron Ang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 06:33:38 2018 From: report at bugs.python.org (Paul Moore) Date: Sun, 15 Apr 2018 10:33:38 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1523788418.23.0.682650639539.issue33131@psf.upfronthosting.co.za> Paul Moore added the comment: Pip 10 has now been released. I'll be getting a PR to put it into 3.7 in the next few days. One question on workflow - is the right approach to create a PR for master and request a backport to the 3.7 branch? Or is there something else I should do? Also, can I just check the timing implications should we need to do a 10.0.1 followup release? Would we need to have that released in time for b4, or would it be acceptable to update to 10.0.1 between b4 and rc1? (I'm not trying to push for any particular decision here - we may not even need a 10.0.1 - just want to be sure of the rules). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 07:05:56 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 15 Apr 2018 11:05:56 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1523790356.45.0.682650639539.issue33131@psf.upfronthosting.co.za> Nick Coghlan added the comment: Merge to master and set the "needs backport to 3.7" label for the initial PR - the backport bot will then take care of creating the 3.7 PR. For the backport, all you then need to do is leave an Approve review, and the bot will automatically merge it once the CI completes. I'll defer to Ned regarding post-b4 updates, but I'd expect them to be fine if needed - otherwise we wouldn't be able to respond to any pip bugs reported against b4. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 07:19:41 2018 From: report at bugs.python.org (Paul Moore) Date: Sun, 15 Apr 2018 11:19:41 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1523791181.42.0.682650639539.issue33131@psf.upfronthosting.co.za> Paul Moore added the comment: Thanks Nick, that's what I thought for the workflow. And agreed with your understanding of the post-b4 question, but as you say Ned's the boss on that one :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 07:25:34 2018 From: report at bugs.python.org (Jatin Goel) Date: Sun, 15 Apr 2018 11:25:34 +0000 Subject: [issue33282] Subprocess Popen communicate hung if stdin not given to Popen, even though script not expecting any input Message-ID: <1523791534.02.0.682650639539.issue33282@psf.upfronthosting.co.za> New submission from Jatin Goel : Hi needed a small help related to the subprocess module I'm executing a powershell process using the subprocess module process = subprocess.Popen( [ 'powershell.exe', script ], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True ) output, error = process.communicate() but the call to the communicate method is getting hung on some machines, and not all i tried to debug the subprocess module but couldn't find anything helpful the script is not expecting any input from the user on the machines where it failed, if I just add stdin=subprocess.PIPE argument, it works process = subprocess.Popen( [ 'powershell.exe', script ], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True ) above works ---------- components: Windows messages: 315317 nosy: JatinGoel, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Subprocess Popen communicate hung if stdin not given to Popen, even though script not expecting any input versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 07:53:27 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 15 Apr 2018 11:53:27 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523793207.11.0.682650639539.issue33185@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6176 stage: commit review -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 08:12:46 2018 From: report at bugs.python.org (Eli_B) Date: Sun, 15 Apr 2018 12:12:46 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1523794366.34.0.682650639539.issue15443@psf.upfronthosting.co.za> Change by Eli_B : ---------- nosy: +Eli_B _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 08:17:18 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 15 Apr 2018 12:17:18 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523794638.19.0.682650639539.issue33185@psf.upfronthosting.co.za> miss-islington added the comment: New changeset d7ffa5820733a528d9ab87ee567738e2d3fd7126 by Miss Islington (bot) in branch '3.7': bpo-33185: Fix regression in pydoc CLI sys.path handling (GH-6419) https://github.com/python/cpython/commit/d7ffa5820733a528d9ab87ee567738e2d3fd7126 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 08:46:35 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 15 Apr 2018 12:46:35 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523796395.88.0.682650639539.issue33185@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- pull_requests: +6177 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 09:01:47 2018 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 15 Apr 2018 13:01:47 +0000 Subject: [issue11594] 2to3 does not preserve line endings In-Reply-To: <1300465648.02.0.83291128633.issue11594@psf.upfronthosting.co.za> Message-ID: <1523797307.79.0.682650639539.issue11594@psf.upfronthosting.co.za> Jason R. Coombs added the comment: I do still see the issue on Python 3.7b3: $ python ~/Dropbox/bin/scripts/which-line-ending onefile.py Line ending is '\n' $ python ~/Dropbox/bin/scripts/which-line-ending otherfile.py Line ending is '\r\n' $ python -V Python 3.7.0b3 $ python -m lib2to3 . -w RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: Refactored ./onefile.py --- ./onefile.py (original) +++ ./onefile.py (refactored) @@ -1 +1 @@ -print 'hello world' +print('hello world') RefactoringTool: Refactored ./otherfile.py --- ./otherfile.py (original) +++ ./otherfile.py (refactored) @@ -1 +1 @@ -print 'hello world' +print('hello world') RefactoringTool: Files that were modified: RefactoringTool: ./onefile.py RefactoringTool: ./otherfile.py $ $ python ~/Dropbox/bin/scripts/which-line-ending onefile.py Line ending is '\n' $ python ~/Dropbox/bin/scripts/which-line-ending otherfile.py Line ending is '\n' ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 09:32:12 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 15 Apr 2018 13:32:12 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523799132.07.0.682650639539.issue33185@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 1a5c4bdb6ecc6a8b19ff33bde323ab188ed60977 by Nick Coghlan in branch 'master': bpo-33185: Improve wording and markup (GH-6477) https://github.com/python/cpython/commit/1a5c4bdb6ecc6a8b19ff33bde323ab188ed60977 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 09:33:24 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 15 Apr 2018 13:33:24 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523799204.5.0.682650639539.issue33185@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6178 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 09:43:06 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 13:43:06 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1523799786.5.0.682650639539.issue33131@psf.upfronthosting.co.za> Ned Deily added the comment: The ensurepip blob is a bit of a special case regarding updates, that is, I think we can be a little more flexible about them since they are getting tested and a lot of exposure external to Python releases. Accepting a bugfix update for pip between 3.7.0b4 and 3.7.0rc1 should be OK although the closer it is to the b4 date, rather than the rc1 date, the happier I would be :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 09:55:12 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 15 Apr 2018 13:55:12 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523800512.57.0.682650639539.issue33185@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 986eaa86da7ebac4c71a09db88706eea6d89664c by Miss Islington (bot) in branch '3.7': bpo-33185: Improve wording and markup (GH-6477) https://github.com/python/cpython/commit/986eaa86da7ebac4c71a09db88706eea6d89664c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 09:58:10 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 15 Apr 2018 13:58:10 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523800690.92.0.682650639539.issue33185@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 10:01:44 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 14:01:44 +0000 Subject: [issue33185] Python 3.7.0b3 fails in pydoc where b2 did not. In-Reply-To: <1522425117.82.0.467229070634.issue33185@psf.upfronthosting.co.za> Message-ID: <1523800904.73.0.682650639539.issue33185@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks, Nick! ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 10:16:23 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Sun, 15 Apr 2018 14:16:23 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1523801783.14.0.682650639539.issue33257@psf.upfronthosting.co.za> Change by Ivan Pozdeev : Added file: https://bugs.python.org/file47536/TkinterHanders.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 10:16:34 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Sun, 15 Apr 2018 14:16:34 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1523801794.36.0.682650639539.issue33257@psf.upfronthosting.co.za> Change by Ivan Pozdeev : Removed file: https://bugs.python.org/file47535/TkinterHanders.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 10:23:12 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 15 Apr 2018 14:23:12 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk Message-ID: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> New submission from Andr?s Delfino : PNG is supported since Tcl/Tk 8.6. Update the doc/source accordingly. ---------- assignee: docs at python components: Documentation messages: 315324 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Mention PNG as a supported image format by Tcl/Tk type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 10:23:55 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 15 Apr 2018 14:23:55 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523802235.94.0.682650639539.issue33283@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- keywords: +patch pull_requests: +6179 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 11:40:37 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 15 Apr 2018 15:40:37 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1523806837.58.0.682650639539.issue33280@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I suggest to just remove the version suffix "8.6". ---------- nosy: +serhiy.storchaka, terry.reedy versions: +Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 11:41:12 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 15 Apr 2018 15:41:12 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1523806872.82.0.682650639539.issue33280@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Tkinter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 11:45:29 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 15 Apr 2018 15:45:29 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523807129.54.0.682650639539.issue33283@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The minimal supported version is 8.4 in 3.x and 8.3 in 2.7, which don't support PNG. ---------- components: +Tkinter nosy: +serhiy.storchaka, terry.reedy versions: +Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 11:49:58 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 15 Apr 2018 15:49:58 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1523807398.45.0.682650639539.issue33280@psf.upfronthosting.co.za> Andr?s Delfino added the comment: IMHO, it's important to provide the link of the specific version of Tcl/Tk that Python actually uses. Otherwise, when 8.7 users might read the wrong documentation. Also, users might read the 8.5 man pages. Perhaps I didn't get your comment? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 11:52:24 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 15 Apr 2018 15:52:24 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523807544.69.0.682650639539.issue33283@psf.upfronthosting.co.za> Andr?s Delfino added the comment: This brings the question: should the documentation follow what Python provides, or the minimum supported version? Maybe a compromise is to have a "requires Tcl/Tk 8.6" note? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 11:54:21 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 15 Apr 2018 15:54:21 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1523807661.21.0.682650639539.issue33280@psf.upfronthosting.co.za> Andr?s Delfino added the comment: Replaces msg315327: IMHO, it's important to provide the link of the specific version of Tcl/Tk that Python actually uses. Otherwise, when 8.7 users might read the wrong documentation. Perhaps I didn't get your comment? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 12:29:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 15 Apr 2018 16:29:41 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523809781.22.0.682650639539.issue33283@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Yes, the minimal version of Tcl/Tk for supporting PNG should be mentioned. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 12:43:09 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 15 Apr 2018 16:43:09 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523810589.83.0.682650639539.issue33283@psf.upfronthosting.co.za> Andr?s Delfino added the comment: I have updated the PR. Hopefully, it addreses Serhiy's comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 12:45:14 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 15 Apr 2018 16:45:14 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1523810714.09.0.682650639539.issue33280@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Different builds of Python can use different versions of Tcl/Tk (as well as other external libraries). Tkinter supports features added in versions newer than minimal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 12:50:21 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 16:50:21 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523811020.99.0.682650639539.issue33283@psf.upfronthosting.co.za> Ned Deily added the comment: (As a side note to Sehiy and others, as of 2.7.15, we no longer ship any python.org macOS binary installers that link with Tcl/Tk 8.4 and we also now ship at least one installer variant for 2.7.x and 3.6.x that provides Tcl/Tk 8.6. 3.7.0 will be only 8.6 and perhaps 2.7.x and 3.6.x will drop 8.5 in a future release. Of course, there may still be other platforms that use 8.4.) ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 12:50:57 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 16:50:57 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523811057.62.0.682650639539.issue33283@psf.upfronthosting.co.za> Ned Deily added the comment: (As a side note to Serhiy and others, as of 2.7.15, we no longer ship any python.org macOS binary installers that link with Tcl/Tk 8.4 and we also now ship at least one installer variant for 2.7.x and 3.6.x that provides Tcl/Tk 8.6. 3.7.0 will be only 8.6 and perhaps 2.7.x and 3.6.x will drop 8.5 in a future release. Of course, there may still be other platforms that use 8.4.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 12:51:05 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 16:51:05 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523811065.06.0.682650639539.issue33283@psf.upfronthosting.co.za> Change by Ned Deily : ---------- Removed message: https://bugs.python.org/msg315333 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 12:55:12 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 15 Apr 2018 16:55:12 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1523811312.56.0.682650639539.issue33280@psf.upfronthosting.co.za> Andr?s Delfino added the comment: Perhaps a comment in the lines of: --- You can find the relevant Tk man pages by checking what version is installed in your system: python -c "import tkinter; print(tkinter.TkVersion)" --- at the top of the page, and then removing all version suffixes as you suggested? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 13:34:02 2018 From: report at bugs.python.org (Adam) Date: Sun, 15 Apr 2018 17:34:02 +0000 Subject: [issue31087] asyncio.create_subprocess_* should honor `encoding` In-Reply-To: <1501477317.46.0.791551033282.issue31087@psf.upfronthosting.co.za> Message-ID: <1523813642.58.0.682650639539.issue31087@psf.upfronthosting.co.za> Adam added the comment: After reading the docs more carefully, it's now plain to me that text encoding is not supported yet, so actually it's not a bug :) However the docs should be improved (and then an assertion could be added too) to prevent people from falling into this trap. Only the `universal_newlines` parameter is explicitly mentioned, while others (including `encoding` and `errors``) are passed to `subprocess.Popen`, which falsely suggests that they should work fine. Moreover, the `std*` properties of the subprocess have a `_transport._pipe.encoding` set to the encoding passed to `asyncio.create_subprocess_*`, but apparently it's not used at all. IMHO this is too messy. Alternatively this option could be implemented, which would require a new kind of StreamReader and StreamWriter. ---------- title: asyncio.create_subprocess_* do not honor `encoding` -> asyncio.create_subprocess_* should honor `encoding` type: behavior -> enhancement versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 14:14:55 2018 From: report at bugs.python.org (Barry Devlin) Date: Sun, 15 Apr 2018 18:14:55 +0000 Subject: [issue33284] Increase test coverage for numbers.py Message-ID: <1523816095.6.0.682650639539.issue33284@psf.upfronthosting.co.za> New submission from Barry Devlin : The __bool__ method in the complex class in numbers is not tested. ---------- components: Tests messages: 315337 nosy: Barry Devlin priority: normal severity: normal status: open title: Increase test coverage for numbers.py versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 14:19:57 2018 From: report at bugs.python.org (Roundup Robot) Date: Sun, 15 Apr 2018 18:19:57 +0000 Subject: [issue33284] Increase test coverage for numbers.py In-Reply-To: <1523816095.6.0.682650639539.issue33284@psf.upfronthosting.co.za> Message-ID: <1523816397.18.0.682650639539.issue33284@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +6180 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 15:07:35 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 15 Apr 2018 19:07:35 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1523819255.28.0.682650639539.issue33280@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- Removed message: https://bugs.python.org/msg315327 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 16:13:44 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 20:13:44 +0000 Subject: [issue32726] macOS installer and framework enhancements and changes for 3.7.0, 3.6.5, and 2.7.15 In-Reply-To: <1517313531.59.0.467229070634.issue32726@psf.upfronthosting.co.za> Message-ID: <1523823224.9.0.682650639539.issue32726@psf.upfronthosting.co.za> Ned Deily added the comment: I've now backported the changes for 3.6.5 to 2.7.15. along with some long overdue changes made previously in 3.x. Besides the support for a 10.9+ 64-bit-only installer variant (with built-in Tcl/Tk 8.6.x) and other changes noted above, ee8e4b61d6181f5bfadf6ee3d229f0ebda8a6ae9 also includes fixes for the following as there were cross-dependencies and it wasn't worth the effort to try to separate them out into independent commits: - bpo-24414: Default macOS deployment target is now set by configure to the build system's OS version (as is done by Python 3), not 10.4; override with, for example, ``./configure MACOSX_DEPLOYMENT_TARGET=10.4``. - bpo-19019: All 2.7 macOS installer variants now supply their own version of OpenSSL 1.0.2; the Apple-supplied SSL libraries and root certificates are no longer used. The Installer Certificate command in /Applications/Python 2.7 may be used to download and install a default set of root certificates from the third-party certifi package. I'm satisfied that 3.6.x and 2.7.x are now in sync enough and up-to-date enough with regards to macOS universal build and installer support that we can close these and related issues and move on. ---------- assignee: -> ned.deily resolution: -> fixed stage: patch review -> resolved status: open -> closed title: macOS installer and framework enhancements and changes for 3.7.0 and 3.6.5 -> macOS installer and framework enhancements and changes for 3.7.0, 3.6.5, and 2.7.15 versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 16:29:45 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 15 Apr 2018 20:29:45 +0000 Subject: [issue33270] tags for anonymous code objects should be interned In-Reply-To: <1523565134.3.0.682650639539.issue33270@psf.upfronthosting.co.za> Message-ID: <1523824185.64.0.682650639539.issue33270@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 16:30:13 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 20:30:13 +0000 Subject: [issue24414] MACOSX_DEPLOYMENT_TARGET set incorrectly by configure in Python 2.7 In-Reply-To: <1433799874.27.0.587161975864.issue24414@psf.upfronthosting.co.za> Message-ID: <1523824213.07.0.682650639539.issue24414@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks for your suggested patch and my apologies for not replying sooner. For Python 2.7.15, we have done some housecleaning of old macOS support issues and, as part of ee8e4b61d6181f5bfadf6ee3d229f0ebda8a6ae9 for Issue32726, I have backported the deployment target setting behavior from 3.x, i.e. the deployment target on current systems is now set to the build system's OS level unless overridden by MACOSX_DEPLOYMENT_TARGET= on the configure command or as an environment variable. So the previous behavior can be forced by: ./configure MACOSX_DEPLOYMENT_TARGET=10.4 As you noted, using a proper value for the deployment target allows things like using the system libedit readline support and standard library support for more recent system calls. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: MACOSX_DEPLOYMENT_TARGET set incorrectly by configure -> MACOSX_DEPLOYMENT_TARGET set incorrectly by configure in Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 16:41:24 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 20:41:24 +0000 Subject: [issue19019] Investigate using Apple clang for building OS X installers In-Reply-To: <1379190673.82.0.353716409802.issue19019@psf.upfronthosting.co.za> Message-ID: <1523824884.89.0.682650639539.issue19019@psf.upfronthosting.co.za> Ned Deily added the comment: As of 3.6.5, 2.7.15, and the upcoming 3.7.0. the macOS installers now build with a generic 'gcc' specified, rather than the somewhat confusing 'gcc-4.2' and we also provide a new 10.9+ 64-bit-only installer variant that is built with clang. So I think we can finally close this issue. Thanks all! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7, Python 3.6, Python 3.7 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 16:49:37 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 20:49:37 +0000 Subject: [issue17128] OS X system openssl deprecated - installer should build local libssl In-Reply-To: <1360002680.77.0.851671416179.issue17128@psf.upfronthosting.co.za> Message-ID: <1523825377.95.0.682650639539.issue17128@psf.upfronthosting.co.za> Ned Deily added the comment: As of 2.7.15 (finally!) all current python.org macOS installers now provide their own copies of OpenSSL: 1.0.2x for 3.6.x and 2.7.15. 1.1.0x for the upcoming 3.7.0 release. Until a better solution for root certificates is implemented, all of the installers also now provide a "Install Certificates.command', a script which will download and install the latest third-party `certifi` bundle of certificates from PyPI and configure the ssl module to use them. Declaring this issue resolved. Thanks everyone! ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 16:54:08 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 20:54:08 +0000 Subject: [issue15663] Investigate providing Tcl/Tk 8.6 with OS X installers In-Reply-To: <1345022434.53.0.691858342769.issue15663@psf.upfronthosting.co.za> Message-ID: <1523825648.29.0.682650639539.issue15663@psf.upfronthosting.co.za> Ned Deily added the comment: Update: as of 3.7.0b3, both 3.7.0 installer variants (10.9+ and 10.6+) provide a built-in Tcl/Tk 8.6.8. And 3.6.5 and 2.7.15 also provide a 10.9+ installer variant with the built-in Tcl/Tk 8.6.8. (For the moment, the 3.6.5 and 2.7.15 10.6+ 64-bit/32-bit installers still link with an external Tcl/Tk 8.5.x.) ---------- versions: +Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 17:04:25 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 15 Apr 2018 21:04:25 +0000 Subject: [issue11485] Default SDK value on MacOSX needs changing In-Reply-To: <1300051696.43.0.599185291628.issue11485@psf.upfronthosting.co.za> Message-ID: <1523826265.59.0.682650639539.issue11485@psf.upfronthosting.co.za> Ned Deily added the comment: Update: as of 3.6.5 and 2.7.15 and in the upcoming 3.7.0 release, macSO framework builds with --enable-universalsdk=/ no longer add -isysroot=/ to compiler and linker calls. They are not necessary and made it more difficult to attempt to override. Although we still do not officially support building on newer macOS systems for older systems (due to lack of "weak link" testing support and issues with setup.py and configure), it should now be possible to more easily use the Apple build tool chain features documented for xcrun, like the DEVELOPER_RUN and SDKROOT environment variables (see 'man xcrun'). This includes current python.org macOS installer builds. So I think we can finally close this. Thanks all! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6, Python 3.7 -Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 17:47:49 2018 From: report at bugs.python.org (Bram Borger-Johnson) Date: Sun, 15 Apr 2018 21:47:49 +0000 Subject: [issue33285] pip upgrade runtime crash Message-ID: <1523828869.12.0.682650639539.issue33285@psf.upfronthosting.co.za> New submission from Bram Borger-Johnson : I was using pip to install a package when I got a warning message that a new version of pip was available. I ran the prompted command and got the following back. E:\GitHub\discord_feedbot>pip install --upgrade pip Collecting pip Downloading pip-10.0.0-py2.py3-none-any.whl (1.3MB) 100% |????????????????????????????????| 1.3MB 654kB/s Installing collected packages: pip Found existing installation: pip 9.0.1 Uninstalling pip-9.0.1: Exception: Traceback (most recent call last): File "e:\programs\python36-32\lib\shutil.py", line 544, in move os.rename(src, real_dst) OSError: [WinError 17] The system cannot move the file to a different disk drive: 'e:\\programs\\python36-32\\scripts\\pip.exe' -> 'C:\\Users\\Bram\\AppData\\Local\\Temp\\pip-nahcxphl-uninstall\\programs\\python36-32\\scripts\\pip.exe' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "e:\programs\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main File "e:\programs\python36-32\lib\site-packages\pip\commands\install.py", line 342, in run File "e:\programs\python36-32\lib\site-packages\pip\req\req_set.py", line 778, in install File "e:\programs\python36-32\lib\site-packages\pip\req\req_install.py", line 754, in uninstall File "e:\programs\python36-32\lib\site-packages\pip\req\req_uninstall.py", line 115, in remove File "e:\programs\python36-32\lib\site-packages\pip\utils\__init__.py", line 267, in renames File "e:\programs\python36-32\lib\shutil.py", line 559, in move os.unlink(src) PermissionError: [WinError 5] Access is denied: 'e:\\programs\\python36-32\\scripts\\pip.exe' Now, whenever I run pip at all, it results in Traceback (most recent call last): File "e:\programs\python36-32\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "e:\programs\python36-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "E:\Programs\Python36-32\Scripts\pip.exe\__main__.py", line 5, in ModuleNotFoundError: No module named 'pip' I sent an email help at python.org who directed me to create a bug report, stating that it looks like the people behind pip "didn't expect your temp directory to be on a different drive from your library directory." ---------- components: Windows messages: 315344 nosy: Bram Borger-Johnson, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: pip upgrade runtime crash type: crash versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 18:12:32 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 15 Apr 2018 22:12:32 +0000 Subject: [issue33270] tags for anonymous code objects should be interned In-Reply-To: <1523565134.3.0.682650639539.issue33270@psf.upfronthosting.co.za> Message-ID: <1523830352.01.0.682650639539.issue33270@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset f303639e3ac96cfe6c1438f1c594226941f46216 by Serhiy Storchaka (Zackery Spytz) in branch 'master': bpo-33270: Intern names for all anonymous code objects (#6472) https://github.com/python/cpython/commit/f303639e3ac96cfe6c1438f1c594226941f46216 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 18:13:46 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 15 Apr 2018 22:13:46 +0000 Subject: [issue33270] tags for anonymous code objects should be interned In-Reply-To: <1523565134.3.0.682650639539.issue33270@psf.upfronthosting.co.za> Message-ID: <1523830426.27.0.682650639539.issue33270@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your contribution Zackery. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 21:03:09 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 16 Apr 2018 01:03:09 +0000 Subject: [issue14499] Extension module builds fail with Xcode 4.3 on OS X 10.7 due to SDK move In-Reply-To: <1333576900.91.0.0583021085072.issue14499@psf.upfronthosting.co.za> Message-ID: <1523840589.7.0.682650639539.issue14499@psf.upfronthosting.co.za> Ned Deily added the comment: Update: as of 3.6.5 and 2.7.15 and in the upcoming 3.7.0 release, macSO framework builds with --enable-universalsdk=/ no longer add -isysroot=/ to compiler and linker calls. They are not necessary and made it more difficult to attempt to override. Although we still do not officially support building on newer macOS systems for older systems (due to lack of "weak link" testing support and issues with setup.py and configure), it should now be possible to more easily use the Apple build tool chain features documented for xcrun, like the DEVELOPER_RUN and SDKROOT environment variables (see 'man xcrun'). This includes current python.org macOS installer builds. So I think we can finally close this. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 22:43:46 2018 From: report at bugs.python.org (Aaron Ang) Date: Mon, 16 Apr 2018 02:43:46 +0000 Subject: [issue11594] 2to3 does not preserve line endings In-Reply-To: <1300465648.02.0.83291128633.issue11594@psf.upfronthosting.co.za> Message-ID: <1523846626.42.0.682650639539.issue11594@psf.upfronthosting.co.za> Change by Aaron Ang : ---------- keywords: +patch pull_requests: +6181 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 22:45:47 2018 From: report at bugs.python.org (Aaron Ang) Date: Mon, 16 Apr 2018 02:45:47 +0000 Subject: [issue11594] 2to3 does not preserve line endings In-Reply-To: <1300465648.02.0.83291128633.issue11594@psf.upfronthosting.co.za> Message-ID: <1523846747.14.0.682650639539.issue11594@psf.upfronthosting.co.za> Aaron Ang added the comment: @Jason R. Coombs You are right. I managed to reproduce the problem with a test. It only occurs when a fix is applied. Also, I figured out that the refactoring reads in the file using `open(file, 'r')`, which basically transforms all line-endings to LF regardless the used line-endings. I think I fixed the problem, looking forward to receiving feedback ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 23:40:38 2018 From: report at bugs.python.org (Ethan Furman) Date: Mon, 16 Apr 2018 03:40:38 +0000 Subject: [issue31947] names=None case is not handled by EnumMeta._create_ method In-Reply-To: <1509880866.58.0.213398074469.issue31947@psf.upfronthosting.co.za> Message-ID: <1523850038.24.0.682650639539.issue31947@psf.upfronthosting.co.za> Ethan Furman added the comment: New changeset b8e21f12891382bc0aac5ccd13dcb4a990d65e0a by Ethan Furman (anentropic) in branch 'master': bpo-31947: remove None default for names param in Enum._create_ (GH-4288) https://github.com/python/cpython/commit/b8e21f12891382bc0aac5ccd13dcb4a990d65e0a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 23:41:55 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Apr 2018 03:41:55 +0000 Subject: [issue31947] names=None case is not handled by EnumMeta._create_ method In-Reply-To: <1509880866.58.0.213398074469.issue31947@psf.upfronthosting.co.za> Message-ID: <1523850115.96.0.682650639539.issue31947@psf.upfronthosting.co.za> Change by miss-islington : ---------- keywords: +patch pull_requests: +6183 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 15 23:42:45 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Apr 2018 03:42:45 +0000 Subject: [issue31947] names=None case is not handled by EnumMeta._create_ method In-Reply-To: <1509880866.58.0.213398074469.issue31947@psf.upfronthosting.co.za> Message-ID: <1523850165.58.0.682650639539.issue31947@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6184 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 02:14:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 16 Apr 2018 06:14:27 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1523859267.4.0.682650639539.issue33205@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The capacity of the dict is 2/3 of its hashtable size: dk_usable < 2/3 * dk_size. Currently the dict grows if dk_usable > 1/4 * dk_size, and preserves the size if dk_usable < 1/4 * dk_size. Note that it it can grow twice if dk_usable > 1/2 * dk_size. With the proposed change the dict will grow only if dk_usable > 1/3 * dk_size, preserve the size if 1/6 * dk_size < dk_usable < 1/3 * dk_size, and shrink if dk_usable < 1/6 * dk_size. After growing once it will no need to grow again until the number of item be increased. This LGTM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 04:01:39 2018 From: report at bugs.python.org (Paul Moore) Date: Mon, 16 Apr 2018 08:01:39 +0000 Subject: [issue33285] pip upgrade runtime crash In-Reply-To: <1523828869.12.0.682650639539.issue33285@psf.upfronthosting.co.za> Message-ID: <1523865699.15.0.682650639539.issue33285@psf.upfronthosting.co.za> Paul Moore added the comment: Issues with pip should be reported at https://github.com/pypa/pip/issues rather than here. However, in this case, the issue is that you ran the command "pip install --upgrade pip" which will use the pip executable to upgrade itself, something that Windows blocks. To upgrade pip you should run the command "python -m pip install --upgrade pip", using "python -m pip" rather than plain "pip". ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 06:21:46 2018 From: report at bugs.python.org (schwemro) Date: Mon, 16 Apr 2018 10:21:46 +0000 Subject: [issue33286] Conflict between tqdm and multiprocessing on windows Message-ID: <1523874106.93.0.682650639539.issue33286@psf.upfronthosting.co.za> New submission from schwemro : Apparently, there occurs a conflict between tqdm and multiprocessing. There is an AttributeError displayed. I provide here an minimal working example. It works on UNIX but unfortunately not on windows. ---------- components: Windows files: tqdm_multi.py messages: 315353 nosy: paul.moore, schwemro, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Conflict between tqdm and multiprocessing on windows type: compile error versions: Python 3.6 Added file: https://bugs.python.org/file47537/tqdm_multi.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 08:37:45 2018 From: report at bugs.python.org (antonio95100) Date: Mon, 16 Apr 2018 12:37:45 +0000 Subject: [issue33287] "pip iinstall packageName.py" fails Message-ID: <1523882265.62.0.682650639539.issue33287@psf.upfronthosting.co.za> New submission from antonio95100 : Hi all. I'm struggling with the installation of a pyton package under Ubuntu 16.4 and Python 7. I follow the statements of the pakage authors, but I obtaint the following errors (note that I have the same error for different packages installation attempt). Any suggestion is more than welcome. $ pip install path.py Collecting path.py Exception: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main status = self.run(options, args) File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 328, in run wb.build(autobuilding=True) File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 748, in build self.requirement_set.prepare_files(self.finder) File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 512, in _prepare_file finder, self.upgrade, require_hashes) File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 273, in populate_link self.link = finder.find_requirement(self, upgrade) File "/usr/lib/python2.7/dist-packages/pip/index.py", line 442, in find_requirement all_candidates = self.find_all_candidates(req.name) File "/usr/lib/python2.7/dist-packages/pip/index.py", line 400, in find_all_candidates for page in self._get_pages(url_locations, project_name): File "/usr/lib/python2.7/dist-packages/pip/index.py", line 545, in _get_pages page = self._get_page(location) File "/usr/lib/python2.7/dist-packages/pip/index.py", line 648, in _get_page return HTMLPage.get_page(link, session=self.session) File "/usr/lib/python2.7/dist-packages/pip/index.py", line 757, in get_page "Cache-Control": "max-age=600", File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 480, in get return self.request('GET', url, **kwargs) File "/usr/lib/python2.7/dist-packages/pip/download.py", line 378, in request return super(PipSession, self).request(method, url, *args, **kwargs) File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 468, in request resp = self.send(prep, **send_kwargs) File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 46, in send resp = super(CacheControlAdapter, self).send(request, **kw) File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/adapters.py", line 376, in send timeout=timeout File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 610, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in increment total -= 1 TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' ---------- components: Installation messages: 315354 nosy: antonio95100 priority: normal severity: normal status: open title: "pip iinstall packageName.py" fails versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 09:32:37 2018 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 16 Apr 2018 13:32:37 +0000 Subject: [issue33286] Conflict between tqdm and multiprocessing on windows In-Reply-To: <1523874106.93.0.682650639539.issue33286@psf.upfronthosting.co.za> Message-ID: <1523885557.04.0.682650639539.issue33286@psf.upfronthosting.co.za> Ronald Oussoren added the comment: What's the specific exception you are getting? BTW. This involves third-party code and this may be a bug in that code. An important difference between linux and windows is how multiprocessing launches additional processes. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 09:55:58 2018 From: report at bugs.python.org (schwemro) Date: Mon, 16 Apr 2018 13:55:58 +0000 Subject: [issue33286] Conflict between tqdm and multiprocessing on windows In-Reply-To: <1523874106.93.0.682650639539.issue33286@psf.upfronthosting.co.za> Message-ID: <1523886958.84.0.682650639539.issue33286@psf.upfronthosting.co.za> schwemro added the comment: Here is the traceback: Python 3.6.5 | packaged by conda-forge | (default, Apr 6 2018, 16:13:55) [MSC v.1900 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information. IPython 6.3.1 -- An enhanced Interactive Python. runfile('C:/Users/Downloads/temp.py', wdir='C:/Users/Downloads') Traceback (most recent call last): File "", line 1, in runfile('C:/Users/Downloads/temp.py', wdir='C:/Users/Downloads') File "C:\ProgramData\Anaconda3\lib\site- packages\spyder\utils\site\sitecustomize.py", line 705, in runfile execfile(filename, namespace) File "C:\ProgramData\Anaconda3\lib\site- packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/Downloads/temp.py", line 22, in p.map(progresser, L) File "C:\ProgramData\Anaconda3\lib\multiprocessing\pool.py", line 266, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "C:\ProgramData\Anaconda3\lib\multiprocessing\pool.py", line 644, in get raise self._value AttributeError: 'NoneType' object has no attribute 'write' Where can I find more details about differences between the two OS? By the way, I'm working on mac. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 10:02:03 2018 From: report at bugs.python.org (Berker Peksag) Date: Mon, 16 Apr 2018 14:02:03 +0000 Subject: [issue33287] "pip iinstall packageName.py" fails In-Reply-To: <1523882265.62.0.682650639539.issue33287@psf.upfronthosting.co.za> Message-ID: <1523887323.26.0.682650639539.issue33287@psf.upfronthosting.co.za> Berker Peksag added the comment: There are two different problems here: 1. There is a possible networking issue. I'd try to use a proxy or something like that. 2. You are using a pip patched by Ubuntu/Debian developers. pip is normally a self-contained package and they use their own version of requests library (urllib3 is used by requests.) Upgrading pip by running "pip install -U pip" (you might need "sudo" depending on your system) or by using your package manager might help. Please use support channels of Ubuntu to get further help. This tracker is for issues with the Python standard library and Python interpreter. ---------- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 10:06:29 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Apr 2018 14:06:29 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1523887589.35.0.682650639539.issue33264@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6185 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 10:06:45 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Apr 2018 14:06:45 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1523887604.99.0.682650639539.issue33264@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6186 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 10:11:55 2018 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 16 Apr 2018 14:11:55 +0000 Subject: [issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator In-Reply-To: <1230900364.95.0.0532833034138.issue4806@psf.upfronthosting.co.za> Message-ID: <1523887915.94.0.682650639539.issue4806@psf.upfronthosting.co.za> Jason R. Coombs added the comment: I believe I encountered this issue today on Python 2.7.14 (https://ci.appveyor.com/project/jaraco/jaraco-windows/build/31/job/lenh5l4dcmj137b9). In this case, I have an iterable (in itertools.imap) that raises a TypeError when evaluated, not a generator. The issue doesn't happen on Python 3, where 'map' is used instead of itertools.imap. Does this patch need to be extended to support any iterable? ---------- nosy: +jason.coombs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 10:13:05 2018 From: report at bugs.python.org (Senthil Kumaran) Date: Mon, 16 Apr 2018 14:13:05 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1523887985.07.0.682650639539.issue33264@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Thank you, Andr?s and Terry. This is merged in 3.8 and backported to 3.7 and 3.6 too. ---------- versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 11:27:37 2018 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 16 Apr 2018 15:27:37 +0000 Subject: [issue33286] Conflict between tqdm and multiprocessing on windows In-Reply-To: <1523874106.93.0.682650639539.issue33286@psf.upfronthosting.co.za> Message-ID: <1523892457.72.0.682650639539.issue33286@psf.upfronthosting.co.za> Ronald Oussoren added the comment: Multiprocessing by default uses the fork system call to start new processes on Linux. This system call is not available on Windows, and there multiprocessing starts a fresh interpreter (see ). I'm also on macOS, and cannot reproduce the problem there even when using the 'spawn' method there by adding some lines to the start of your script (before the other import statements): import multiprocessing if __name__ == "__main__": multiprocessing.set_start_method('spawn') But: I have a fairly old version of 3.6 on my machine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 11:33:42 2018 From: report at bugs.python.org (schwemro) Date: Mon, 16 Apr 2018 15:33:42 +0000 Subject: [issue33286] Conflict between tqdm and multiprocessing on windows In-Reply-To: <1523874106.93.0.682650639539.issue33286@psf.upfronthosting.co.za> Message-ID: <1523892822.88.0.682650639539.issue33286@psf.upfronthosting.co.za> schwemro added the comment: On macOS it works perfectly for me as well. The issue is about running it on windows 10... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 14:29:21 2018 From: report at bugs.python.org (Steven Steven) Date: Mon, 16 Apr 2018 18:29:21 +0000 Subject: [issue21475] Support the Sitemap extension in robotparser In-Reply-To: <1399858557.27.0.633505879036.issue21475@psf.upfronthosting.co.za> Message-ID: <1523903361.56.0.682650639539.issue21475@psf.upfronthosting.co.za> Steven Steven added the comment: Kindly add a test for this issue ---------- nosy: +stevensalbert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 14:37:10 2018 From: report at bugs.python.org (Steven Steven) Date: Mon, 16 Apr 2018 18:37:10 +0000 Subject: [issue33288] Diethealth Message-ID: <1523903830.84.0.682650639539.issue33288@psf.upfronthosting.co.za> New submission from Steven Steven : sue ---------- messages: 315363 nosy: stevensalbert priority: normal severity: normal status: open title: Diethealth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 14:38:09 2018 From: report at bugs.python.org (Steven Steven) Date: Mon, 16 Apr 2018 18:38:09 +0000 Subject: [issue33288] Diethealth In-Reply-To: <1523903830.84.0.682650639539.issue33288@psf.upfronthosting.co.za> Message-ID: <1523903889.3.0.682650639539.issue33288@psf.upfronthosting.co.za> Steven Steven added the comment: http://www.diethealthsupplements.com/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 14:45:44 2018 From: report at bugs.python.org (Zachary Ware) Date: Mon, 16 Apr 2018 18:45:44 +0000 Subject: [issue33288] Spam In-Reply-To: <1523903830.84.0.682650639539.issue33288@psf.upfronthosting.co.za> Message-ID: <1523904344.01.0.682650639539.issue33288@psf.upfronthosting.co.za> Change by Zachary Ware : ---------- nosy: -stevensalbert resolution: -> not a bug stage: -> resolved status: open -> closed title: Diethealth -> Spam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 14:46:06 2018 From: report at bugs.python.org (Zachary Ware) Date: Mon, 16 Apr 2018 18:46:06 +0000 Subject: [issue33288] Spam In-Reply-To: <1523903830.84.0.682650639539.issue33288@psf.upfronthosting.co.za> Message-ID: <1523904366.55.0.682650639539.issue33288@psf.upfronthosting.co.za> Change by Zachary Ware : ---------- Removed message: https://bugs.python.org/msg315364 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 14:46:16 2018 From: report at bugs.python.org (Zachary Ware) Date: Mon, 16 Apr 2018 18:46:16 +0000 Subject: [issue33288] Spam Message-ID: <1523904376.11.0.682650639539.issue33288@psf.upfronthosting.co.za> Change by Zachary Ware : ---------- Removed message: https://bugs.python.org/msg315363 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 15:40:29 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 16 Apr 2018 19:40:29 +0000 Subject: [issue31904] Python should support VxWorks RTOS In-Reply-To: <1509393393.78.0.213398074469.issue31904@psf.upfronthosting.co.za> Message-ID: <1523907629.99.0.682650639539.issue31904@psf.upfronthosting.co.za> Ned Deily added the comment: As I commented on the PR, I think this PR should not be merged until and if there is a consensus that this support belongs in the standard cpython repo and there is an agreed-upon plan how this platform would be supported on going. I think it needs an approved PEP. We've allowed ourselves in the past to do a long-term disservice to our downstream users by merging in support for platforms that we were not equipped to support. In any case, it would need to wait for 3.8. ---------- nosy: +lukasz.langa, ned.deily versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 16:49:36 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Apr 2018 20:49:36 +0000 Subject: [issue31947] names=None case is not handled by EnumMeta._create_ method In-Reply-To: <1509880866.58.0.213398074469.issue31947@psf.upfronthosting.co.za> Message-ID: <1523911776.51.0.682650639539.issue31947@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 3bcca488fe753ae8cef9178e32237f84927c938e by Miss Islington (bot) in branch '3.7': bpo-31947: remove None default for names param in Enum._create_ (GH-4288) https://github.com/python/cpython/commit/3bcca488fe753ae8cef9178e32237f84927c938e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 17:49:41 2018 From: report at bugs.python.org (Bryan Oakley) Date: Mon, 16 Apr 2018 21:49:41 +0000 Subject: [issue33289] askcolor is returning floats for r, g, b values instead of ints Message-ID: <1523915381.82.0.682650639539.issue33289@psf.upfronthosting.co.za> New submission from Bryan Oakley : Even though the underlying tcl/tk interpreter is returning ints, askcolor is converting the values to floats. My guess is this is an oversight related to the change in functionality of the / operator in python3. this: return (r/256, g/256, b/256), str(result) should probably be this: return (r//256, g//256, b//256), str(result) ---------- components: Tkinter messages: 315367 nosy: Bryan.Oakley priority: normal severity: normal status: open title: askcolor is returning floats for r,g,b values instead of ints versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 17:53:19 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Apr 2018 21:53:19 +0000 Subject: [issue33266] 2to3 doesn't parse all valid string literals In-Reply-To: <1523521499.6.0.682650639539.issue33266@psf.upfronthosting.co.za> Message-ID: <1523915599.44.0.682650639539.issue33266@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6187 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 18:59:49 2018 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 16 Apr 2018 22:59:49 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1523919589.77.0.682650639539.issue32232@psf.upfronthosting.co.za> Change by Xavier de Gaye : ---------- pull_requests: +6188 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 19:04:42 2018 From: report at bugs.python.org (Xavier de Gaye) Date: Mon, 16 Apr 2018 23:04:42 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1523919882.54.0.682650639539.issue32232@psf.upfronthosting.co.za> Xavier de Gaye added the comment: The compilation failure is a consequence of the changes made in issue 30860. Simply adding '#include "internal/pystate.h"' in Modules/_elementtree.c fixes the compilation although this is not the correct fix. The modules configured in Modules/Setup keep being built with -DPy_BUILD_CORE while the refactoring done in issue 30860 imposes new constraints on the way headers are handled for modules accessing the Py_BUILD_CORE API. Most modules configured in Modules/Setup do not use this API and none of the commented out modules in this file (normally built by setup.py [1]) does. PR 6489 fixes this by introducing yet another CFLAGS named PY_NO_CORE_CFLAGS to only use -DPy_BUILD_CORE with Setup modules that use the Py_BUILD_CORE API. [1] the _xxsubinterpreters module is the only one that sets -DPy_BUILD_CORE explicitly in setup.py ---------- nosy: +xdegaye _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 19:09:40 2018 From: report at bugs.python.org (Gilbert Wilson) Date: Mon, 16 Apr 2018 23:09:40 +0000 Subject: [issue33290] Python.org macOS pkg installs pip3 as pip Message-ID: <1523920180.91.0.682650639539.issue33290@psf.upfronthosting.co.za> New submission from Gilbert Wilson : The python-3.6.5-macosx10.6.pkg installs pip3 as pip. This means if you have both python2.7.x and 3.6.x you get unexpected and undesirable behavior. According to the release notes in 3.6.5: Python 3 and Python 2 Co-existence Python.org Python 3.6 and 2.7.x versions can both be installed on your system and will not conflict. Command names for Python 3 contain a 3 in them, python3 (or python3.6), idle3 (or idle3.6), pip3 (or pip3.6), etc. Python 2.7 command names contain a 2 or no digit: python2 (or python2.7 or python), idle2 (or idle2.7 or idle), etc. The release notes for Python2.7.14 have a similarly worded note on Python 3 and Python 2 co-existence. For both Pythons to properly coexist you must install Python2.7.x after installing Python3.6.x or manually fix the changes that the Python installers make to your ~/.profile PATH environmental variable. $ which pip3 /Library/Frameworks/Python.framework/Versions/3.6/bin/pip3 $ ls -l $(dirname $(which pip3)) [SNIP] -rwxr-xr-x 1 gilw admin 263 Apr 16 13:05 pip -rwxr-xr-x 1 gilw admin 263 Apr 16 13:05 pip3 -rwxr-xr-x 1 gilw admin 263 Apr 16 13:05 pip3.6 [SNIP] ---------- components: macOS messages: 315369 nosy: dbxgil, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Python.org macOS pkg installs pip3 as pip versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 19:13:54 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 16 Apr 2018 23:13:54 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1523920434.22.0.682650639539.issue32232@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks, Xavier, for your analysis and your PR! We definitely meed to get this resolved before 3.7.0b4. Given the complexity and potential impact on this area and that we are approaching the final beta, I think we need a few pairs of eyes to review it. @doko, does the PR work for you? @eric.snow and @ncoghlan, could you please take a look, too? Thanks! ---------- nosy: +vstinner priority: deferred blocker -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 19:25:29 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Apr 2018 23:25:29 +0000 Subject: [issue23403] Use pickle protocol 4 by default? In-Reply-To: <1423258098.35.0.366066771775.issue23403@psf.upfronthosting.co.za> Message-ID: <1523921129.34.0.682650639539.issue23403@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- pull_requests: +6189 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 19:31:25 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 16 Apr 2018 23:31:25 +0000 Subject: [issue33290] Python.org macOS pkg installs pip3 as pip In-Reply-To: <1523920180.91.0.682650639539.issue33290@psf.upfronthosting.co.za> Message-ID: <1523921485.84.0.682650639539.issue33290@psf.upfronthosting.co.za> Ned Deily added the comment: Actually, this appears to be a pip upgrade issue. If you install 3.6.5 from the python.org installers, there is no pip link there, only pip3: $ cd /Library/Frameworks/Python.framework/Versions/3.6/bin $ ls -l total 272 lrwxr-xr-x 1 root admin 8 Apr 16 19:19 2to3 -> 2to3-3.6 -rwxrwxr-x 1 root admin 140 Mar 28 06:05 2to3-3.6 -rwxrwxr-x 1 root admin 281 Apr 16 19:19 easy_install-3.6 lrwxr-xr-x 1 root admin 7 Apr 16 19:19 idle3 -> idle3.6 -rwxrwxr-x 1 root admin 138 Mar 28 06:05 idle3.6 -rwxrwxr-x 1 root admin 253 Apr 16 19:19 pip3 -rwxrwxr-x 1 root admin 253 Apr 16 19:19 pip3.6 lrwxr-xr-x 1 root admin 8 Apr 16 19:19 pydoc3 -> pydoc3.6 -rwxrwxr-x 1 root admin 123 Mar 28 06:05 pydoc3.6 lrwxr-xr-x 1 root admin 9 Apr 16 19:19 python3 -> python3.6 lrwxr-xr-x 1 root admin 12 Apr 16 19:19 python3-32 -> python3.6-32 lrwxr-xr-x 1 root admin 16 Apr 16 19:19 python3-config -> python3.6-config -rwxrwxr-x 2 root admin 25920 Mar 28 06:05 python3.6 -rwxrwxr-x 1 root admin 13568 Mar 28 06:05 python3.6-32 lrwxr-xr-x 1 root admin 17 Apr 16 19:19 python3.6-config -> python3.6m-config -rwxrwxr-x 2 root admin 25920 Mar 28 06:05 python3.6m -rwxrwxr-x 1 root admin 2081 Mar 28 06:05 python3.6m-config lrwxr-xr-x 1 root admin 10 Apr 16 19:19 pyvenv -> pyvenv-3.6 -rwxrwxr-x 1 root admin 480 Mar 28 06:05 pyvenv-3.6 But if you then upgrade to pip 10.0.0, which I'm guessing you did, you'll see: $ ls -l [...] -rwxrwxr-x 1 root admin 138 Mar 28 06:05 idle3.6 -rwxr-xr-x 1 sysadmin admin 224 Apr 16 19:22 pip -rwxr-xr-x 1 sysadmin admin 224 Apr 16 19:22 pip3 -rwxr-xr-x 1 sysadmin admin 224 Apr 16 19:22 pip3.6 lrwxr-xr-x 1 root admin 8 Apr 16 19:19 pydoc3 -> pydoc3.6 [...] So it appears the pip upgrade unconditionally installs both a pip and a pip3 link. It really shouldn't. You should check the pip issue tracker and, if not already reported, open a new issue there: https://github.com/pypa/pip/issues/ Thanks for the report! ---------- nosy: +Marcus.Smith, dstufft, ncoghlan, paul.moore resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 19:42:32 2018 From: report at bugs.python.org (Ned Deily) Date: Mon, 16 Apr 2018 23:42:32 +0000 Subject: [issue33290] Python.org macOS pkg installs pip3 as pip In-Reply-To: <1523920180.91.0.682650639539.issue33290@psf.upfronthosting.co.za> Message-ID: <1523922152.69.0.682650639539.issue33290@psf.upfronthosting.co.za> Ned Deily added the comment: P.S. Of course, you'll probably need to manually remove that spurious pip command. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 20:28:44 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Apr 2018 00:28:44 +0000 Subject: [issue33234] Improve list() pre-sizing for inputs with known lengths In-Reply-To: <1522964813.15.0.682650639539.issue33234@psf.upfronthosting.co.za> Message-ID: <1523924924.47.0.682650639539.issue33234@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +6190 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 21:21:19 2018 From: report at bugs.python.org (Adam Klinger) Date: Tue, 17 Apr 2018 01:21:19 +0000 Subject: [issue33291] Cannot Install Stegano Package - Python 3.6.5 Base Message-ID: <1523928079.77.0.682650639539.issue33291@psf.upfronthosting.co.za> New submission from Adam Klinger : There seems to be an issue in the default setup.py which comes with the Python 3.6.5 installer. Upon trying to install an additional package through pip the below is observed: C:\Users\adamj\Desktop>pip install stegano Collecting stegano Downloading https://files.pythonhosted.org/packages/77/76/07a61c042ac1a1cb3445689b4f140800b16d0e883a46049e221d7a92de66/Stegano-0.8.4.tar.gz (243kB) 100% |????????????????????????????????| 245kB 3.3MB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "C:\Users\adamj\AppData\Local\Temp\pip-install-sh3rd6wj\stegano\setup.py", line 26, in readme = f.read() File "c:\python36\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 1569: character maps to ---------- components: Unicode messages: 315373 nosy: Adam Klinger, ezio.melotti, vstinner priority: normal severity: normal status: open title: Cannot Install Stegano Package - Python 3.6.5 Base versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 21:22:25 2018 From: report at bugs.python.org (Adam Klinger) Date: Tue, 17 Apr 2018 01:22:25 +0000 Subject: [issue33291] issue in the default setup.py which comes with the Python 3.6.5 installer In-Reply-To: <1523928079.77.0.682650639539.issue33291@psf.upfronthosting.co.za> Message-ID: <1523928145.68.0.682650639539.issue33291@psf.upfronthosting.co.za> Change by Adam Klinger : ---------- title: Cannot Install Stegano Package - Python 3.6.5 Base -> issue in the default setup.py which comes with the Python 3.6.5 installer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 22:36:25 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Apr 2018 02:36:25 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1523932585.59.0.682650639539.issue33251@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Hm. The documentation change was done in issue12036 but it seems this was actually never the case, contrary to what the conversation on that other issue there states. I wouldn't change it for 3.6.6 anymore since it's pretty late in the release cycle. This looks like an interesting bug fix for 3.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 22:40:00 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Apr 2018 02:40:00 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1523932800.67.0.682650639539.issue33251@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Well, now that I think about it, this is not even a *bug* fix since it's behavior that configparser had since 1997. So that will have to go straight to 3.8. ---------- versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 22:47:13 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Apr 2018 02:47:13 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1523933233.19.0.682650639539.issue33251@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- pull_requests: +6191 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 23:04:17 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 03:04:17 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1523934257.37.0.682650639539.issue33251@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6192 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 23:04:22 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 03:04:22 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1523934262.17.0.682650639539.issue33251@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6193 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 23:09:36 2018 From: report at bugs.python.org (Vex Woo) Date: Tue, 17 Apr 2018 03:09:36 +0000 Subject: [issue33292] Fix secrets.randbelow docstring Message-ID: <1523934576.27.0.682650639539.issue33292@psf.upfronthosting.co.za> New submission from Vex Woo : - https://github.com/python/cpython/blob/master/Lib/secrets.py#L28 Please fix """Return a random int in the range [0, n).""" to """Return a random int in the range(0, n).""" ---------- components: Library (Lib) messages: 315376 nosy: Nixawk priority: normal severity: normal status: open title: Fix secrets.randbelow docstring type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 16 23:11:57 2018 From: report at bugs.python.org (Roundup Robot) Date: Tue, 17 Apr 2018 03:11:57 +0000 Subject: [issue33292] Fix secrets.randbelow docstring In-Reply-To: <1523934576.27.0.682650639539.issue33292@psf.upfronthosting.co.za> Message-ID: <1523934717.83.0.682650639539.issue33292@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +6194 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 01:20:37 2018 From: report at bugs.python.org (Han Shaowen) Date: Tue, 17 Apr 2018 05:20:37 +0000 Subject: [issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. Message-ID: <1523942437.5.0.682650639539.issue33293@psf.upfronthosting.co.za> New submission from Han Shaowen : What I am talking is like: Python 3.6.0 (default, Feb 28 2018, 15:41:04) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> from datetime import datetime >>> time.time() 1523942154.3787892 >>> datetime.now().timestamp() 1523942165.202865 >>> datetime.utcnow().timestamp() 1523913372.362377 Apparently, datetime.now().timestamp() give me right unix timestamp while utcnow().timestamp() doesn't. Fellas what do you think about this? ---------- components: Extension Modules messages: 315377 nosy: Han Shaowen priority: normal severity: normal status: open title: Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 01:29:45 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 05:29:45 +0000 Subject: [issue33292] Fix secrets.randbelow docstring In-Reply-To: <1523934576.27.0.682650639539.issue33292@psf.upfronthosting.co.za> Message-ID: <1523942985.9.0.682650639539.issue33292@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What is wrong with the current docstring? ---------- nosy: +serhiy.storchaka, steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 01:34:42 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 05:34:42 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523943282.57.0.682650639539.issue33283@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 4b685bf7192fff48c8effeeae4f4d64f9420ec0f by Serhiy Storchaka (Andr?s Delfino) in branch 'master': bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) https://github.com/python/cpython/commit/4b685bf7192fff48c8effeeae4f4d64f9420ec0f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 01:35:51 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 05:35:51 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523943351.44.0.682650639539.issue33283@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6196 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 01:37:44 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 05:37:44 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523943464.42.0.682650639539.issue33283@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6197 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 02:53:37 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 17 Apr 2018 06:53:37 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1523948017.78.0.682650639539.issue33205@psf.upfronthosting.co.za> INADA Naoki added the comment: New changeset 5fbc511f56688654a05b9eba23d140318bb9b2d5 by INADA Naoki in branch 'master': bpo-33205: dict: Change GROWTH_RATE to `used*3` (GH-6350) https://github.com/python/cpython/commit/5fbc511f56688654a05b9eba23d140318bb9b2d5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 02:54:43 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 06:54:43 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1523948083.8.0.682650639539.issue33205@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6198 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 03:02:12 2018 From: report at bugs.python.org (=?utf-8?q?Martin_Li=C5=A1ka?=) Date: Tue, 17 Apr 2018 07:02:12 +0000 Subject: [issue33294] Support complex expressions for py-print command. Message-ID: <1523948532.18.0.682650639539.issue33294@psf.upfronthosting.co.za> New submission from Martin Li?ka : The patch is based on a blog post: http://kouk.surukle.me/2014/09/25/debugging-python-objects-and-fields-with-gdb/. Adding him: @kouk Purpose of the pull request is to support more complex expressions for py-print command. Small example: (gdb) py-print self local 'self' = _______________________________________ From report at bugs.python.org Tue Apr 17 03:43:38 2018 From: report at bugs.python.org (Roundup Robot) Date: Tue, 17 Apr 2018 07:43:38 +0000 Subject: [issue33294] Support complex expressions for py-print command. In-Reply-To: <1523948532.18.0.682650639539.issue33294@psf.upfronthosting.co.za> Message-ID: <1523951018.47.0.682650639539.issue33294@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +6199 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 04:26:05 2018 From: report at bugs.python.org (Sylvain Marie) Date: Tue, 17 Apr 2018 08:26:05 +0000 Subject: [issue32886] new Boolean ABC in numbers module In-Reply-To: <1519133521.3.0.467229070634.issue32886@psf.upfronthosting.co.za> Message-ID: <1523953565.76.0.682650639539.issue32886@psf.upfronthosting.co.za> Sylvain Marie added the comment: Mark I get your point. Mine is just to have a common abstraction between python's primitive bool and numpy bool (and possibly other future alternate booleans) for consistency with `numbers` and to be used in common type hints (PEP484). If I get you correctly, then the minimal `Boolean` ABC would only need to contain the `__bool__` method, without the bitwise operations. That's perfectly fine, as long as it correctly describes the minimal boolean logic (truth value for `if`/..., and `and`/`or`/`not`) and is compliant both with python and numpy bool. A separate ABC for bitwise operations is then indeed a good idea to open in a separate thread. Finding a good name will be tough here though... `BitwiseOperable` ? `BitsContainer` ? ... :) Regards -Sylvain ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 05:09:19 2018 From: report at bugs.python.org (Vex Woo) Date: Tue, 17 Apr 2018 09:09:19 +0000 Subject: [issue33292] Fix secrets.randbelow docstring In-Reply-To: <1523934576.27.0.682650639539.issue33292@psf.upfronthosting.co.za> Message-ID: <1523956158.99.0.682650639539.issue33292@psf.upfronthosting.co.za> Vex Woo added the comment: Please use () or [] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 05:15:32 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 17 Apr 2018 09:15:32 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) Message-ID: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> New submission from INADA Naoki : https://github.com/python/cpython/blob/5fbc511f56688654a05b9eba23d140318bb9b2d5/Lib/test/test_urllib2net.py#L180-L198 This test uses http://www.imdb.com/, but it is gone. So This test start failing. Is there any good URL for this test case? May I skip this test for now? ---------- components: Tests messages: 315384 nosy: inada.naoki priority: critical severity: normal status: open title: ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 05:16:46 2018 From: report at bugs.python.org (Shlomo Anglister) Date: Tue, 17 Apr 2018 09:16:46 +0000 Subject: [issue33296] datetime.datetime.utcfromtimestamp call decimal causes precision loss Message-ID: <1523956606.05.0.682650639539.issue33296@psf.upfronthosting.co.za> New submission from Shlomo Anglister : Output for python2.7.11 2018-04-12-05:23:08.436252 2018-04-12-05:23:08.436252 Output for python3.4 and python3.6 2018-04-12-05:23:08.436252 2018-04-12-05:23:08.000000 ---------- components: Library (Lib) files: timestamp_decimal_test.py messages: 315385 nosy: anglister priority: normal severity: normal status: open title: datetime.datetime.utcfromtimestamp call decimal causes precision loss type: behavior versions: Python 3.4, Python 3.5, Python 3.6 Added file: https://bugs.python.org/file47538/timestamp_decimal_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 05:35:22 2018 From: report at bugs.python.org (Shlomo Anglister) Date: Tue, 17 Apr 2018 09:35:22 +0000 Subject: [issue15443] datetime module has no support for nanoseconds In-Reply-To: <1343158610.62.0.806232279741.issue15443@psf.upfronthosting.co.za> Message-ID: <1523957722.94.0.682650639539.issue15443@psf.upfronthosting.co.za> Change by Shlomo Anglister : ---------- nosy: +anglister _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 05:43:08 2018 From: report at bugs.python.org (Shlomo Anglister) Date: Tue, 17 Apr 2018 09:43:08 +0000 Subject: [issue33296] datetime.datetime.utcfromtimestamp call decimal causes precision loss In-Reply-To: <1523956606.05.0.682650639539.issue33296@psf.upfronthosting.co.za> Message-ID: <1523958188.43.0.682650639539.issue33296@psf.upfronthosting.co.za> Shlomo Anglister added the comment: The test code demonstrates that fromutctimestamp(1523510588.436252000) != fromutctimestamp(Decimal(1523510588.436252000)) This is related to issues: 22627 and 23607 but not a duplicate ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 06:09:21 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 10:09:21 +0000 Subject: [issue33292] Fix secrets.randbelow docstring In-Reply-To: <1523934576.27.0.682650639539.issue33292@psf.upfronthosting.co.za> Message-ID: <1523959761.42.0.682650639539.issue33292@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I don't think that intervals [0, n-1] or (-1, n) would look better than [0, n). ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 06:10:48 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 10:10:48 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1523959848.28.0.682650639539.issue33283@psf.upfronthosting.co.za> miss-islington added the comment: New changeset f44ce356a6ccd6c8e80ac5c4b29adb13db5c117a by Miss Islington (bot) in branch '3.6': bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) https://github.com/python/cpython/commit/f44ce356a6ccd6c8e80ac5c4b29adb13db5c117a ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 06:22:06 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 10:22:06 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1523960526.5.0.682650639539.issue33189@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If there are no objections I'm going to merge PR 6364 in 24 hours. ---------- assignee: -> serhiy.storchaka nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 06:29:13 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 10:29:13 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1523960953.34.0.682650639539.issue33251@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What *actually* was changed in 3.2? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 06:55:02 2018 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 17 Apr 2018 10:55:02 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1523962502.01.0.682650639539.issue32232@psf.upfronthosting.co.za> Nick Coghlan added the comment: Even when statically linked, extension modules should *NOT* be getting built with `-DPy_BUILD_CORE`. That preprocessor definition is for CPython core core only, and we moved the headers to help make that 100% crystal clear. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 06:56:52 2018 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 17 Apr 2018 10:56:52 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1523962612.18.0.682650639539.issue32232@psf.upfronthosting.co.za> Nick Coghlan added the comment: Ah, oops - I commented before fully catching up on everything else, and now I see that Xavier already made exactly that point just above. I'll go review the PR now :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 07:01:28 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 17 Apr 2018 11:01:28 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) In-Reply-To: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> Message-ID: <1523962888.32.0.682650639539.issue33295@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- keywords: +patch pull_requests: +6200 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 07:12:06 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Tue, 17 Apr 2018 11:12:06 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats Message-ID: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> New submission from Andr?s Delfino : Given that the default list of supported formats is quite limited, IMHO we should point to Pillow, or any other package that provides support for more formats. ---------- assignee: docs at python components: Documentation messages: 315393 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Mention Pillow package on tkinter.rst to work with more image formats versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 07:12:29 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Tue, 17 Apr 2018 11:12:29 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1523963549.16.0.682650639539.issue33297@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- keywords: +patch pull_requests: +6201 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 07:12:57 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Tue, 17 Apr 2018 11:12:57 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1523963577.8.0.682650639539.issue33297@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 08:10:49 2018 From: report at bugs.python.org (Mahmud Al Hasan) Date: Tue, 17 Apr 2018 12:10:49 +0000 Subject: [issue19143] Finding the Windows version getting messier (detect windows 8.1?) In-Reply-To: <1380675004.25.0.239416620624.issue19143@psf.upfronthosting.co.za> Message-ID: <1523967049.96.0.682650639539.issue19143@psf.upfronthosting.co.za> Mahmud Al Hasan added the comment: The problem still exists on python 3.4 and I need to use this version. Any solution? ---------- nosy: +rauaha versions: -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 09:04:37 2018 From: report at bugs.python.org (Mark Lawrence) Date: Tue, 17 Apr 2018 13:04:37 +0000 Subject: [issue19143] Finding the Windows version getting messier (detect windows 8.1?) In-Reply-To: <1380675004.25.0.239416620624.issue19143@psf.upfronthosting.co.za> Message-ID: <1523970277.03.0.682650639539.issue19143@psf.upfronthosting.co.za> Change by Mark Lawrence : ---------- nosy: -BreamoreBoy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 09:32:17 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 17 Apr 2018 13:32:17 +0000 Subject: [issue33292] Fix secrets.randbelow docstring In-Reply-To: <1523934576.27.0.682650639539.issue33292@psf.upfronthosting.co.za> Message-ID: <20180417133211.GP11616@ando.pearwood.info> Steven D'Aprano added the comment: Possibly you may not be familiar with interval notation? https://www.mathsisfun.com/sets/intervals.html Since this is Python and not maths, maybe we should rethink the wording. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 10:15:59 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 14:15:59 +0000 Subject: [issue19143] Finding the Windows version getting messier (detect windows 8.1?) In-Reply-To: <1380675004.25.0.239416620624.issue19143@psf.upfronthosting.co.za> Message-ID: <1523974559.91.0.682650639539.issue19143@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Does the problem still exist on Python 3.6? Python 3.4 is now in security fixes only mode. The only solution for you may be upgrading to Python 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:16:20 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 17 Apr 2018 15:16:20 +0000 Subject: [issue33144] random._randbelow optimization In-Reply-To: <1522076428.25.0.467229070634.issue33144@psf.upfronthosting.co.za> Message-ID: <1523978180.97.0.682650639539.issue33144@psf.upfronthosting.co.za> Raymond Hettinger added the comment: New changeset ba3a87aca37cec5b1ee32cf68f4a254fa0bb2bec by Raymond Hettinger (Wolfgang Maier) in branch 'master': bpo-33144: random.Random and subclasses: split _randbelow implementation (GH-6291) https://github.com/python/cpython/commit/ba3a87aca37cec5b1ee32cf68f4a254fa0bb2bec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:19:35 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 17 Apr 2018 15:19:35 +0000 Subject: [issue33144] random._randbelow optimization In-Reply-To: <1522076428.25.0.467229070634.issue33144@psf.upfronthosting.co.za> Message-ID: <1523978375.68.0.682650639539.issue33144@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Possibly, the switch from type checks to identity checks could be considered a bugfix that could be backported. I've always had a lingering worry about that part of the code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:31:32 2018 From: report at bugs.python.org (Ned Deily) Date: Tue, 17 Apr 2018 15:31:32 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) In-Reply-To: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> Message-ID: <1523979092.11.0.682650639539.issue33295@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset 36d56ea826caffbeac0fc0c6d90248b80516e33c by Ned Deily (INADA Naoki) in branch 'master': bpo-33295: Skip test using missing external site (GH-6504) https://github.com/python/cpython/commit/36d56ea826caffbeac0fc0c6d90248b80516e33c ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:32:40 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 15:32:40 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) In-Reply-To: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> Message-ID: <1523979160.19.0.682650639539.issue33295@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6202 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:33:41 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 15:33:41 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) In-Reply-To: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> Message-ID: <1523979221.12.0.682650639539.issue33295@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6203 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:33:51 2018 From: report at bugs.python.org (Ned Deily) Date: Tue, 17 Apr 2018 15:33:51 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) In-Reply-To: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> Message-ID: <1523979231.43.0.682650639539.issue33295@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset f7379ddf1c315fe18734cca943aff5b437baf849 by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-33295: Skip test using missing external site (GH-6504) (GH-6509) https://github.com/python/cpython/commit/f7379ddf1c315fe18734cca943aff5b437baf849 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:34:42 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 15:34:42 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) In-Reply-To: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> Message-ID: <1523979282.92.0.682650639539.issue33295@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6204 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:35:38 2018 From: report at bugs.python.org (Ned Deily) Date: Tue, 17 Apr 2018 15:35:38 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) In-Reply-To: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> Message-ID: <1523979338.29.0.682650639539.issue33295@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset afc768d69879d6b95c59a0a5e92ea4c6061f3841 by Ned Deily (Miss Islington (bot)) in branch '2.7': bpo-33295: Skip test using missing external site (GH-6504) (GH-6510) https://github.com/python/cpython/commit/afc768d69879d6b95c59a0a5e92ea4c6061f3841 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:36:32 2018 From: report at bugs.python.org (Ned Deily) Date: Tue, 17 Apr 2018 15:36:32 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) In-Reply-To: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> Message-ID: <1523979392.82.0.682650639539.issue33295@psf.upfronthosting.co.za> Ned Deily added the comment: New changeset f1547d110ff195291e29ba5c29617912d12ecbec by Ned Deily (Miss Islington (bot)) in branch '3.6': bpo-33295: Skip test using missing external site (GH-6504) (GH-6511) https://github.com/python/cpython/commit/f1547d110ff195291e29ba5c29617912d12ecbec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:38:46 2018 From: report at bugs.python.org (Ned Deily) Date: Tue, 17 Apr 2018 15:38:46 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) In-Reply-To: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> Message-ID: <1523979526.79.0.682650639539.issue33295@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks! I force-merged the skips of the test so that Travis CI and buildbots were not failing. I'll leave the issue open so we can decide what to do about the test long term. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 11:39:22 2018 From: report at bugs.python.org (Berker Peksag) Date: Tue, 17 Apr 2018 15:39:22 +0000 Subject: [issue33295] ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) In-Reply-To: <1523956532.44.0.682650639539.issue33295@psf.upfronthosting.co.za> Message-ID: <1523979562.84.0.682650639539.issue33295@psf.upfronthosting.co.za> Berker Peksag added the comment: I initially thought about using pythontest.net but I don't think it's possible to remove the Connection header at the nginx level: https://github.com/python/psf-salt/blob/master/salt/pythontest/config/nginx.pythontest.conf.jinja I think our only option is to create a local server for the test. I'm not sure it's an important enough use case, though. ---------- nosy: +berker.peksag, orsenthil type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 12:21:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 16:21:41 +0000 Subject: [issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler. Message-ID: <1523982101.74.0.682650639539.issue33298@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Currently every constant is wrapped with _PyCode_ConstantKey() in the compiler. This is necessary for distinguishing numbers 1, 1.0 and 1.0+0j, 0.0 and -0.0, and avoiding warnings from comparing string and bytes constants. But the change that introduced using _PyCode_ConstantKey() for constants (in issue25843) also caused to wrapping names with _PyCode_ConstantKey(). This is superfluous because all names are strings. This just consumes memory for 2-tuples for every name and spends CPU time for creating these tuples for every name. There are two ways of getting rid of this overhead. 1. Make _PyCode_ConstantKey() returning just a string itself for string argument. Strings are never equal to tuples. This requires minimal changes. 2. Use different helpers for adding constants and names, and use _PyCode_ConstantKey() only for names. This will clean up the code for names, but needs adding few special functions and macros. I'm going to apply both solution. The first one will add a benefit for string constants (and other common types), the second one will help moving the folding tuples of constants from peephole.c to compile.c and generalizing it for lists, sets and dicts of constants, constant default values, constant arguments, etc. The following PR implements the second option. ---------- assignee: serhiy.storchaka components: Interpreter Core messages: 315405 nosy: benjamin.peterson, brett.cannon, ncoghlan, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Wrap only constants with _PyCode_ConstantKey() in the compiler. type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 12:26:03 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 16:26:03 +0000 Subject: [issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler. In-Reply-To: <1523982101.74.0.682650639539.issue33298@psf.upfronthosting.co.za> Message-ID: <1523982363.23.0.682650639539.issue33298@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6205 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 12:28:23 2018 From: report at bugs.python.org (Gilbert Wilson) Date: Tue, 17 Apr 2018 16:28:23 +0000 Subject: [issue33290] Python.org macOS pkg installs pip3 as pip In-Reply-To: <1523920180.91.0.682650639539.issue33290@psf.upfronthosting.co.za> Message-ID: <1523982503.32.0.682650639539.issue33290@psf.upfronthosting.co.za> Gilbert Wilson added the comment: Well what do you know, it does indeed look like a pip3 upgrade issue! I'll wander over to the pip issue tracker and file a bug/upvote over there. Thanks! gilw-mbp:bin gilw$ ls -al pip* -rwxrwxr-x 1 root admin 253 Apr 17 09:21 pip3 -rwxrwxr-x 1 root admin 253 Apr 17 09:21 pip3.6 gilw-mbp:bin gilw$ pip3 install --upgrade pip Collecting pip Downloading https://files.pythonhosted.org/packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py2.py3-none-any.whl (1.3MB) 100% |????????????????????????????????| 1.3MB 1.0MB/s Installing collected packages: pip Found existing installation: pip 9.0.3 Uninstalling pip-9.0.3: Successfully uninstalled pip-9.0.3 Successfully installed pip-10.0.0 gilw-mbp:bin gilw$ ls -al pip* -rwxr-xr-x 1 gilw admin 263 Apr 17 09:23 pip -rwxr-xr-x 1 gilw admin 263 Apr 17 09:23 pip3 -rwxr-xr-x 1 gilw admin 263 Apr 17 09:23 pip3.6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 12:30:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 16:30:16 +0000 Subject: [issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler. In-Reply-To: <1523982101.74.0.682650639539.issue33298@psf.upfronthosting.co.za> Message-ID: <1523982616.43.0.682650639539.issue33298@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 12:54:12 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 16:54:12 +0000 Subject: [issue33299] Return an object itself for some types in _PyCode_ConstantKey() Message-ID: <1523984052.37.0.682650639539.issue33299@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : _PyCode_ConstantKey() wraps a constant into a tuple that contains other items besides the wrapped object. This makes booleans different from 0 and 1, makes numbers of different type different (1, 1.0 and 1.0+0j), makes floating point zeros with different signs different (0.0 and -0.0), and avoids a ByteWarning from comparing strings and bytes. But for some types objects are always different from objects of other types and from tuples. _PyCode_ConstantKey() can be made faster and using less memory if return the object of these types unwrapped. ---------- components: Interpreter Core messages: 315407 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Return an object itself for some types in _PyCode_ConstantKey() type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 12:54:22 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 16:54:22 +0000 Subject: [issue33299] Return an object itself for some types in _PyCode_ConstantKey() In-Reply-To: <1523984052.37.0.682650639539.issue33299@psf.upfronthosting.co.za> Message-ID: <1523984062.54.0.682650639539.issue33299@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 12:56:31 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 16:56:31 +0000 Subject: [issue33299] Return an object itself for some types in _PyCode_ConstantKey() In-Reply-To: <1523984052.37.0.682650639539.issue33299@psf.upfronthosting.co.za> Message-ID: <1523984191.8.0.682650639539.issue33299@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6206 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 12:57:34 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 16:57:34 +0000 Subject: [issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler. In-Reply-To: <1523982101.74.0.682650639539.issue33298@psf.upfronthosting.co.za> Message-ID: <1523984254.26.0.682650639539.issue33298@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: See issue33299 for the first option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 13:17:28 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 17:17:28 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1523985448.73.0.682650639539.issue33205@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 902bb62d5af21526b68892a1032c63aa86ded247 by Miss Islington (bot) in branch '3.7': bpo-33205: dict: Change GROWTH_RATE to `used*3` (GH-6350) https://github.com/python/cpython/commit/902bb62d5af21526b68892a1032c63aa86ded247 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 13:22:43 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 17 Apr 2018 17:22:43 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1523985763.14.0.682650639539.issue33205@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 13:22:53 2018 From: report at bugs.python.org (INADA Naoki) Date: Tue, 17 Apr 2018 17:22:53 +0000 Subject: [issue33205] GROWTH_RATE prevents dict shrinking In-Reply-To: <1522670151.04.0.467229070634.issue33205@psf.upfronthosting.co.za> Message-ID: <1523985773.97.0.682650639539.issue33205@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 15:35:17 2018 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 17 Apr 2018 19:35:17 +0000 Subject: [issue33262] Deprecate shlex.split(None) to read from stdin. In-Reply-To: <1523442529.49.0.682650639539.issue33262@psf.upfronthosting.co.za> Message-ID: <1523993717.09.0.682650639539.issue33262@psf.upfronthosting.co.za> Change by Zackery Spytz : ---------- keywords: +patch pull_requests: +6207 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 15:37:07 2018 From: report at bugs.python.org (Zackery Spytz) Date: Tue, 17 Apr 2018 19:37:07 +0000 Subject: [issue33262] Deprecate shlex.split(None) to read from stdin. In-Reply-To: <1523442529.49.0.682650639539.issue33262@psf.upfronthosting.co.za> Message-ID: <1523993827.02.0.682650639539.issue33262@psf.upfronthosting.co.za> Change by Zackery Spytz : ---------- components: +Library (Lib) nosy: +ZackerySpytz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 16:02:15 2018 From: report at bugs.python.org (Glen Neff) Date: Tue, 17 Apr 2018 20:02:15 +0000 Subject: [issue33300] Bad usage example in id() DocString Message-ID: <1523995335.26.0.682650639539.issue33300@psf.upfronthosting.co.za> New submission from Glen Neff : The DocString for id() in 3.5.x & 3.6.x seems to have an incorrect usage example, specifically ``id(obj, /)``. This is present in 3.5.x & 3.6.x. It does not appear to be present in 2.7.x or 3.4.x.: Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> help(id) Help on built-in function id in module builtins: id(obj, /) Return the identity of an object. This is guaranteed to be unique among simultaneously existing objects. (CPython uses the object's memory address.) >>> ---------- assignee: docs at python components: Documentation messages: 315410 nosy: docs at python, gneff priority: normal severity: normal status: open title: Bad usage example in id() DocString versions: Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 16:31:44 2018 From: report at bugs.python.org (Steve Dower) Date: Tue, 17 Apr 2018 20:31:44 +0000 Subject: [issue19143] Finding the Windows version getting messier (detect windows 8.1?) In-Reply-To: <1380675004.25.0.239416620624.issue19143@psf.upfronthosting.co.za> Message-ID: <1523997104.62.0.682650639539.issue19143@psf.upfronthosting.co.za> Steve Dower added the comment: The attached files should work on Python 3.4. Feel free to use them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 16:32:06 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Apr 2018 20:32:06 +0000 Subject: [issue33234] Improve list() pre-sizing for inputs with known lengths In-Reply-To: <1522964813.15.0.682650639539.issue33234@psf.upfronthosting.co.za> Message-ID: <1523997126.24.0.682650639539.issue33234@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Calling PyObject_LengthHint() adds an overhead. It is significant for short sequences. I work on a patch that reduces it. PR 6493 adds the second call of PyObject_LengthHint() and increases the overhead. As for this issue, in-place repeat overallocates too. >>> a = [0]; a *= 10; getsizeof(a) 200 I think it would be better to make it not preallocating. And maybe it would be worth to avoid overallocating if newsize > allocated + allocated/8 or something like. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 16:49:39 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 17 Apr 2018 20:49:39 +0000 Subject: [issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. In-Reply-To: <1523942437.5.0.682650639539.issue33293@psf.upfronthosting.co.za> Message-ID: <1523998179.11.0.682650639539.issue33293@psf.upfronthosting.co.za> Brett Cannon added the comment: Are you seeing the same issue on Python 3.6.5? ---------- nosy: +belopolsky, brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 16:50:05 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 17 Apr 2018 20:50:05 +0000 Subject: [issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. In-Reply-To: <1523942437.5.0.682650639539.issue33293@psf.upfronthosting.co.za> Message-ID: <1523998205.87.0.682650639539.issue33293@psf.upfronthosting.co.za> Brett Cannon added the comment: And we do have women on the team, so please minimize the "fellas" comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 16:50:45 2018 From: report at bugs.python.org (Ned Deily) Date: Tue, 17 Apr 2018 20:50:45 +0000 Subject: [issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. In-Reply-To: <1523942437.5.0.682650639539.issue33293@psf.upfronthosting.co.za> Message-ID: <1523998245.56.0.682650639539.issue33293@psf.upfronthosting.co.za> Ned Deily added the comment: I am not sure I understand what behavior you are expecting. But datetime.now() is documented as returning "the current local date and time" (assuming no tx= argument is provided) while datetime.utcnow() returns "the current UTC date and time". So I would expect the two to provide a similar value only if your system/process local time zone is set to UTC. I'm guessing the time zone in effect when your examples were run was 8 hours ahead of UTC: >>> (1523942165.202865 - 1523913372.362377) / (60*60) 7.998011246654722 https://docs.python.org/3/library/datetime.html ---------- nosy: +ned.deily -belopolsky, brett.cannon resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 16:52:05 2018 From: report at bugs.python.org (Martin Panter) Date: Tue, 17 Apr 2018 20:52:05 +0000 Subject: [issue33300] Bad usage example in id() DocString In-Reply-To: <1523995335.26.0.682650639539.issue33300@psf.upfronthosting.co.za> Message-ID: <1523998325.02.0.682650639539.issue33300@psf.upfronthosting.co.za> Martin Panter added the comment: It is supposed to be a function signature, similar to the syntax when you define your own function, rather than a usage example of calling the function. In this case, the slash notation is described by PEP 457. It is supposed to indicate that ?obj? is a positional-only parameter, and not a keyword parameter. If that is what you think is incorrect, perhaps you can suggest a place to explain the notation in Issue 21314. ---------- nosy: +martin.panter superseder: -> Document '/' in signatures _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 16:52:25 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 17 Apr 2018 20:52:25 +0000 Subject: [issue33291] issue in the default setup.py which comes with the Python 3.6.5 installer In-Reply-To: <1523928079.77.0.682650639539.issue33291@psf.upfronthosting.co.za> Message-ID: <1523998345.7.0.682650639539.issue33291@psf.upfronthosting.co.za> Brett Cannon added the comment: We don't having to do with the stegano project. It looks like they specified the wrong encoding in their setup.py. (This also isn't the issue tracker for pip, but I don't think they have the bug.) ---------- nosy: +brett.cannon resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 16:58:56 2018 From: report at bugs.python.org (Tim Peters) Date: Tue, 17 Apr 2018 20:58:56 +0000 Subject: [issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. In-Reply-To: <1523942437.5.0.682650639539.issue33293@psf.upfronthosting.co.za> Message-ID: <1523998736.21.0.682650639539.issue33293@psf.upfronthosting.co.za> Tim Peters added the comment: I agree this isn't a bug (and it was right to close it). I expect the OP is confused about what the `.timestamp()` method does, though. This note in the docs directly address what happens in their problematic `datetime.utcnow().timestamp()` case: """ Note There is no method to obtain the POSIX timestamp directly from a naive datetime instance representing UTC time. If your application uses this convention and your system timezone is not set to UTC, you can obtain the POSIX timestamp by supplying tzinfo=timezone.utc: timestamp = dt.replace(tzinfo=timezone.utc).timestamp() or by calculating the timestamp directly: timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1) """ ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:03:48 2018 From: report at bugs.python.org (Ned Deily) Date: Tue, 17 Apr 2018 21:03:48 +0000 Subject: [issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. In-Reply-To: <1523942437.5.0.682650639539.issue33293@psf.upfronthosting.co.za> Message-ID: <1523999028.81.0.682650639539.issue33293@psf.upfronthosting.co.za> Ned Deily added the comment: Tim, do you think the docs should be changed and, if so, which sections? If you dictate, I'll type! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:07:31 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Apr 2018 21:07:31 +0000 Subject: [issue33234] Improve list() pre-sizing for inputs with known lengths In-Reply-To: <1522964813.15.0.682650639539.issue33234@psf.upfronthosting.co.za> Message-ID: <1523999251.89.0.682650639539.issue33234@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: Microbenchmarked with @vstinner's perf module: python -m perf timeit "list([0]*10)" -o new.json checkout master and build python -m perf timeit "list([0]*10)" -o old.json python -m perf compare_to new.json old.json Mean +- std dev: [new] 241 ns +- 3 ns -> [old] 243 ns +- 18 ns: 1.01x slower (+1%) Not significant! ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:15:05 2018 From: report at bugs.python.org (Tim Peters) Date: Tue, 17 Apr 2018 21:15:05 +0000 Subject: [issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. In-Reply-To: <1523942437.5.0.682650639539.issue33293@psf.upfronthosting.co.za> Message-ID: <1523999705.59.0.682650639539.issue33293@psf.upfronthosting.co.za> Tim Peters added the comment: Ned, I think this one is more the case that the OP didn't read the docs ;-) That said, there's a level of complexity here that seemingly can't be reduced: the distinctions between the `datetime` and `time` modules' views of the world, and between `datetime`'s notions of `aware` and `naive` datetime objects. Those are general distinctions that apply all over the place, not just in a method or two's docs. Given that those are understood, the OP's results "are obvious". But it takes some work for users to get to that point, and best I can tell the current docs have been successful at helping users get there - but they do have to do the work of reading them thoughtfully. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:18:45 2018 From: report at bugs.python.org (James Lu) Date: Tue, 17 Apr 2018 21:18:45 +0000 Subject: [issue33090] race condition between send and recv in _ssl with non-zero timeout In-Reply-To: <1521229390.38.0.467229070634.issue33090@psf.upfronthosting.co.za> Message-ID: <1523999925.33.0.682650639539.issue33090@psf.upfronthosting.co.za> Change by James Lu : ---------- nosy: +tacocat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:18:48 2018 From: report at bugs.python.org (James Lu) Date: Tue, 17 Apr 2018 21:18:48 +0000 Subject: [issue32533] SSLSocket read/write thread-unsafety In-Reply-To: <1515678068.63.0.467229070634.issue32533@psf.upfronthosting.co.za> Message-ID: <1523999928.39.0.682650639539.issue32533@psf.upfronthosting.co.za> Change by James Lu : ---------- nosy: +tacocat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:23:21 2018 From: report at bugs.python.org (Alok Singh) Date: Tue, 17 Apr 2018 21:23:21 +0000 Subject: [issue33301] Add __contains__ to pathlib Message-ID: <1524000201.84.0.682650639539.issue33301@psf.upfronthosting.co.za> New submission from Alok Singh : I was thinking today that it would be natural for paths to support __contains__ since then you could write statements like `if file in dir` or `if subdir in dir` cleanly. The library plumbum appears to already have this, but I think it could be useful in the standard library: https://plumbum.readthedocs.io/en/latest/_modules/plumbum/path/base.html#Path.__contains__ ---------- components: Library (Lib) messages: 315422 nosy: Alok Singh priority: normal severity: normal status: open title: Add __contains__ to pathlib type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:34:21 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Apr 2018 21:34:21 +0000 Subject: [issue11594] 2to3 does not preserve line endings In-Reply-To: <1300465648.02.0.83291128633.issue11594@psf.upfronthosting.co.za> Message-ID: <1524000861.87.0.682650639539.issue11594@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset c127a86e1862df88ec6f9d15b79c627fc616766e by ?ukasz Langa (Aaron Ang) in branch 'master': bpo-11594: Ensure line-endings are respected when using 2to3 (GH-6483) https://github.com/python/cpython/commit/c127a86e1862df88ec6f9d15b79c627fc616766e ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:35:27 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 21:35:27 +0000 Subject: [issue11594] 2to3 does not preserve line endings In-Reply-To: <1300465648.02.0.83291128633.issue11594@psf.upfronthosting.co.za> Message-ID: <1524000927.65.0.682650639539.issue11594@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6208 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:35:32 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 17 Apr 2018 21:35:32 +0000 Subject: [issue33301] Add __contains__ to pathlib In-Reply-To: <1524000201.84.0.682650639539.issue33301@psf.upfronthosting.co.za> Message-ID: <1524000932.9.0.682650639539.issue33301@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:48:28 2018 From: report at bugs.python.org (Matthew Woodcraft) Date: Tue, 17 Apr 2018 21:48:28 +0000 Subject: [issue33302] The search for pyvenv.cfg doesn't match PEP 405 Message-ID: <1524001707.98.0.682650639539.issue33302@psf.upfronthosting.co.za> New submission from Matthew Woodcraft : PEP 405 says that the pyvenv.cfg file is found as follows: ? a pyvenv.cfg file is found either adjacent to the Python executable or one directory above it (if the executable is a symlink, it is not dereferenced), ? But in cpython if the executable is a symlink, it _is_ dereferenced before searching for pyvenv.cfg . I've checked this behaviour with Python 3.5, 3.6, and today's 3.7 tip. Looking in 3.7's getpath.c, calculate_path_impl() calls, in order: calculate_program_full_path() calculate_argv0_path() calculate_read_pyenv() It looks like the symlink resolution happens near the end of calculate_argv0_path(). I think this means that the 'home=' line in pyvenv.cfg files generated by the 'venv' module is irrelevant (and seems likely to confuse anyone who might try to construct a Python environment by imitating a built venv). ---------- components: Interpreter Core messages: 315424 nosy: mattheww priority: normal severity: normal status: open title: The search for pyvenv.cfg doesn't match PEP 405 type: behavior versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:51:07 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Apr 2018 21:51:07 +0000 Subject: [issue32108] configparser bug: section is emptied if you assign a section to itself In-Reply-To: <1511286370.98.0.213398074469.issue32108@psf.upfronthosting.co.za> Message-ID: <1524001867.42.0.682650639539.issue32108@psf.upfronthosting.co.za> ?ukasz Langa added the comment: I agree, the fix needs to be changed. What we probably want is to discover this kind of assignment and special-case *that*. ---------- versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 17:58:42 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Apr 2018 21:58:42 +0000 Subject: [issue11594] 2to3 does not preserve line endings In-Reply-To: <1300465648.02.0.83291128633.issue11594@psf.upfronthosting.co.za> Message-ID: <1524002322.56.0.682650639539.issue11594@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 3b3be1fe10f6c15e57360cac9d9dbc660666e655 by Miss Islington (bot) in branch '3.7': bpo-11594: Ensure line-endings are respected when using 2to3 (GH-6483) https://github.com/python/cpython/commit/3b3be1fe10f6c15e57360cac9d9dbc660666e655 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 18:13:48 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 17 Apr 2018 22:13:48 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1524003228.37.0.682650639539.issue33297@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- nosy: +serhiy.storchaka, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 19:39:13 2018 From: report at bugs.python.org (Andro Nuxx) Date: Tue, 17 Apr 2018 23:39:13 +0000 Subject: [issue28126] Py_MEMCPY: Use memcpy on Windows? In-Reply-To: <1473769943.75.0.0646288473229.issue28126@psf.upfronthosting.co.za> Message-ID: <1524008353.89.0.682650639539.issue28126@psf.upfronthosting.co.za> Andro Nuxx added the comment: Py_MEMCPY() has a special case for small blocks on Windows to work around an ancient performance issue in MSVC. Can we safely assume that recent MSVC properly optimize memcpy()? See #28055 /* Py_MEMCPY can be used instead of memcpy in cases where the copied blocks * are often very short. While most platforms have highly optimized code for * large transfers, the setup costs for memcpy are often quite high. MEMCPY * solves this by doing short copies "in line". */ #if defined(_MSC_VER) #define Py_MEMCPY(target, source, length) do { \ size_t i_, n_ = (length); \ char *t_ = (void*) (target); \ const char *s_ = (void*) (source); \ if (n_ >= 16) \ memcpy(t_, s_, n_); \ else \ for (i_ = 0; i_ < n_; i_++) \ t_[i_] = s_[i_]; \ } while (0) #else #define Py_MEMCPY memcpy #endif ---------- nosy: +gitinit.py at gmail.com _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 20:33:12 2018 From: report at bugs.python.org (John Burnett) Date: Wed, 18 Apr 2018 00:33:12 +0000 Subject: [issue33303] ElementTree Comment text isn't escaped Message-ID: <1524011592.66.0.682650639539.issue33303@psf.upfronthosting.co.za> New submission from John Burnett : The _serialize_xml function in ElementTree.py doesn't escape Comment.text values when writing output. This means the following code: import sys import xml.etree.ElementTree elem = xml.etree.ElementTree.Comment() elem.text = 'hi --> bye' tree = xml.etree.ElementTree.ElementTree(elem) tree.write(sys.stdout) ...will output the following invalid xml: bye--> In Python 3.7, changing the _serialize_xml function on line 903/904 from this: if tag is Comment: write("" % text) ...to this: if tag is Comment: write("" % _escape_cdata(text)) ...writes something more expected: ---------- components: XML messages: 315428 nosy: eli.bendersky, johnburnett, scoder priority: normal severity: normal status: open title: ElementTree Comment text isn't escaped 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 Tue Apr 17 21:11:07 2018 From: report at bugs.python.org (jackb) Date: Wed, 18 Apr 2018 01:11:07 +0000 Subject: [issue33304] Syntax Error on leading 0 in integer tokens Message-ID: <1524013867.24.0.682650639539.issue33304@psf.upfronthosting.co.za> New submission from jackb : Entering 007 gives a syntax error. Should return 7. 00 correctly returns 0. 007. correctly returns 7.0. ---------- components: Interpreter Core messages: 315429 nosy: jackb priority: normal severity: normal status: open title: Syntax Error on leading 0 in integer tokens type: behavior versions: Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 21:25:39 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 18 Apr 2018 01:25:39 +0000 Subject: [issue33304] Syntax Error on leading 0 in integer tokens In-Reply-To: <1524013867.24.0.682650639539.issue33304@psf.upfronthosting.co.za> Message-ID: <1524014739.39.0.682650639539.issue33304@psf.upfronthosting.co.za> Steven D'Aprano added the comment: This is not a bug, it is intentional. In Python 2, numbers with a leading zero are interpreted as octal, leading to surprising results: py> 015 13 In Python 3, we use 0o15 to get octal, and 015 becomes a syntax error. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 21:47:11 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 18 Apr 2018 01:47:11 +0000 Subject: [issue33305] Improve syntax error for numbers with leading zero Message-ID: <1524016031.89.0.682650639539.issue33305@psf.upfronthosting.co.za> New submission from Steven D'Aprano : The Python 2.x syntax for octal integers is a syntax error in 3.x, but the error message is very uninformative: SyntaxError: invalid token Can this be improved? Perhaps to something like: invalid token, use 0o prefix for octal integers (see also #33304) ---------- messages: 315431 nosy: steven.daprano priority: normal severity: normal status: open title: Improve syntax error for numbers with leading zero type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 21:47:49 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 18 Apr 2018 01:47:49 +0000 Subject: [issue33305] Improve syntax error for numbers with leading zero In-Reply-To: <1524016031.89.0.682650639539.issue33305@psf.upfronthosting.co.za> Message-ID: <1524016069.89.0.682650639539.issue33305@psf.upfronthosting.co.za> Change by Steven D'Aprano : ---------- type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 21:48:19 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 18 Apr 2018 01:48:19 +0000 Subject: [issue33304] Syntax Error on leading 0 in integer tokens In-Reply-To: <1524013867.24.0.682650639539.issue33304@psf.upfronthosting.co.za> Message-ID: <1524016099.63.0.682650639539.issue33304@psf.upfronthosting.co.za> Steven D'Aprano added the comment: I've opened an issue to improve the error message: #33305 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 23:01:35 2018 From: report at bugs.python.org (Han Shaowen) Date: Wed, 18 Apr 2018 03:01:35 +0000 Subject: [issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. In-Reply-To: <1523942437.5.0.682650639539.issue33293@psf.upfronthosting.co.za> Message-ID: <1524020495.39.0.682650639539.issue33293@psf.upfronthosting.co.za> Han Shaowen added the comment: Guys, what I said is the doc in help(datetime.timestamp) is 'Return POSIX timestamp as float.' So I assumed it is irrelevant to time zone, considering POSIX timestamp's definition. If it is then datetime.now and datetime.utcnow should return the same timestamp. But datetime.now().timestamp return a correct timestamp which I checked in the website https://www.unixtimestamp.com/ but datetime.utcnow().timestamp did not. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 23:11:33 2018 From: report at bugs.python.org (Tim Peters) Date: Wed, 18 Apr 2018 03:11:33 +0000 Subject: [issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. In-Reply-To: <1523942437.5.0.682650639539.issue33293@psf.upfronthosting.co.za> Message-ID: <1524021093.74.0.682650639539.issue33293@psf.upfronthosting.co.za> Tim Peters added the comment: docstrings give brief statements intended to jog your memory; they're not intended to be comprehensive docs. Read the actual documentation and see whether you're still confused. When you "assumed it is irrelevant to time zone", that was your _assumption_, which the actual docs would have clarified. The whole story simply can't be told here without docs that make the distinction between "naive" and "aware" datetime objects, and the connection to what your platform's C mktime() function does about your local time zone. The brief docstring is correct that a POSIX timestamp is returned (a count of seconds from the UTC epoch). But how that relates to the datetime object requires reading the docs, not blind guessing ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 17 23:27:51 2018 From: report at bugs.python.org (Han Shaowen) Date: Wed, 18 Apr 2018 03:27:51 +0000 Subject: [issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. In-Reply-To: <1523942437.5.0.682650639539.issue33293@psf.upfronthosting.co.za> Message-ID: <1524022071.52.0.682650639539.issue33293@psf.upfronthosting.co.za> Han Shaowen added the comment: Hohoho, I found the full-version doc. This issue over. Thanks Tim, Ned and Brett. And sorry about something improper I said, I respect female Pythonista. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 02:14:26 2018 From: report at bugs.python.org (Mahmud Al Hasan) Date: Wed, 18 Apr 2018 06:14:26 +0000 Subject: [issue19143] Finding the Windows version getting messier (detect windows 8.1?) In-Reply-To: <1380675004.25.0.239416620624.issue19143@psf.upfronthosting.co.za> Message-ID: <1524032066.29.0.682650639539.issue19143@psf.upfronthosting.co.za> Mahmud Al Hasan added the comment: Thanks to Steve Dower the problem is solved! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 03:11:28 2018 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 18 Apr 2018 07:11:28 +0000 Subject: [issue33305] Improve syntax error for numbers with leading zero In-Reply-To: <1524016031.89.0.682650639539.issue33305@psf.upfronthosting.co.za> Message-ID: <1524035488.59.0.682650639539.issue33305@psf.upfronthosting.co.za> Mark Dickinson added the comment: Maybe once Python 2.7 officially reaches EOL, we can remove the syntax error altogether and allow leading zeros on decimal integer literals. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 03:25:22 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Wed, 18 Apr 2018 07:25:22 +0000 Subject: [issue33261] inspect.isgeneratorfunction fails on hand-created methods In-Reply-To: <1523437193.82.0.682650639539.issue33261@psf.upfronthosting.co.za> Message-ID: <1524036322.9.0.682650639539.issue33261@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: Can we please go back to the original issue? If you think that __code__ should be an alias for __call__.__code__, that is a different issue. On https://github.com/python/cpython/pull/6448#issuecomment-381507329 I posted an alternative solution for the problem. Is either the original PR or the new variant acceptable? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 03:30:42 2018 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 18 Apr 2018 07:30:42 +0000 Subject: [issue33305] Improve syntax error for numbers with leading zero In-Reply-To: <1524016031.89.0.682650639539.issue33305@psf.upfronthosting.co.za> Message-ID: <1524036642.71.0.682650639539.issue33305@psf.upfronthosting.co.za> Mark Dickinson added the comment: For the message: > invalid token, use 0o prefix for octal integers I'd expect (without having any evidence to back this up) that the majority of people who encounter this error would be those who intended a decimal literal rather than an octal one, in which case an error message that talks about octal might be confusing. >>> import datetime >>> birthday = datetime.datetime(1912, 06, 23) File "", line 1 birthday = datetime.datetime(1912, 06, 23) ^ SyntaxError: invalid token Could we cover both cases in a single message? "leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 03:49:08 2018 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 18 Apr 2018 07:49:08 +0000 Subject: [issue33292] Fix secrets.randbelow docstring In-Reply-To: <1523934576.27.0.682650639539.issue33292@psf.upfronthosting.co.za> Message-ID: <1524037748.43.0.682650639539.issue33292@psf.upfronthosting.co.za> Mark Dickinson added the comment: """Return a random integer x satisfying 0 <= x < n""" ? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 05:22:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 09:22:20 +0000 Subject: [issue33306] Improving SyntaxError for unmatched parentheses Message-ID: <1524043340.4.0.682650639539.issue33306@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : SyntaxError messages were improved recently in PyPy. [1] [2] The part of this improvement in CPython (showing an expected token) is discussed in issue1634034. The following PR implements other part, related to unmatched parentheses. Showing the number of the line containing an unmatched opening parenthesis looks as enhancement. But I'm not sure that this change is always an enhancement (in comparison with issue1634034). Syntax error for unmatched parentheses will be raised even if the code contains other syntax errors before unmatched parenthesis. [1] https://morepypy.blogspot.de/2018/04/improving-syntaxerror-in-pypy.html [2] https://bitbucket.org/pypy/pypy/commits/e66f24650dafbcd2ac1c443af7417eddf8e8f093 ---------- components: Interpreter Core messages: 315441 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Improving SyntaxError for unmatched parentheses type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 05:26:22 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 09:26:22 +0000 Subject: [issue33306] Improving SyntaxError for unmatched parentheses In-Reply-To: <1524043340.4.0.682650639539.issue33306@psf.upfronthosting.co.za> Message-ID: <1524043582.69.0.682650639539.issue33306@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6209 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 05:35:43 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 09:35:43 +0000 Subject: [issue33305] Improve syntax error for numbers with leading zero In-Reply-To: <1524016031.89.0.682650639539.issue33305@psf.upfronthosting.co.za> Message-ID: <1524044143.75.0.682650639539.issue33305@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It still can cause when copy octal constants from other languages or from old Python 2 books and articles. Perhaps it should emit SyntaxWarning if all digits are in range 0-7 and the number is larger than 7. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 05:48:00 2018 From: report at bugs.python.org (Vex Woo) Date: Wed, 18 Apr 2018 09:48:00 +0000 Subject: [issue33292] Fix secrets.randbelow docstring In-Reply-To: <1523934576.27.0.682650639539.issue33292@psf.upfronthosting.co.za> Message-ID: <1524044879.99.0.682650639539.issue33292@psf.upfronthosting.co.za> Vex Woo added the comment: It looks simple and good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 06:52:55 2018 From: report at bugs.python.org (Kaulkwappe) Date: Wed, 18 Apr 2018 10:52:55 +0000 Subject: [issue33307] socket.send() fails to send large amount of bytes Message-ID: <1524048775.4.0.682650639539.issue33307@psf.upfronthosting.co.za> New submission from Kaulkwappe : socket.setblocking(0) socket.send(b'a' * 32 * 1024 * 1024) In the example above socket.send() fails with this error: Error in connection handler Traceback (most recent call last): File "/usr/lib/python3/dist-packages/websockets/server.py", line 81, in handler yield from self.ws_handler(self, path) File "/var/www/vhosts/.../app/sockets/core/Daemon.py", line 286, in websocketClientHandler self.api.connection.send(data) File "/usr/lib/python3.5/ssl.py", line 869, in send return self._sslobj.write(data) File "/usr/lib/python3.5/ssl.py", line 594, in write return self._sslobj.write(data) ssl.SSLWantWriteError: The operation did not complete (write) (_ssl.c:1949) ---------- assignee: christian.heimes components: SSL messages: 315444 nosy: Kaulkwappe, christian.heimes priority: normal severity: normal status: open title: socket.send() fails to send large amount of bytes type: crash versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 07:19:48 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 11:19:48 +0000 Subject: [issue33305] Improve syntax error for numbers with leading zero In-Reply-To: <1524016031.89.0.682650639539.issue33305@psf.upfronthosting.co.za> Message-ID: <1524050388.43.0.682650639539.issue33305@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6210 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 07:27:43 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 11:27:43 +0000 Subject: [issue33305] Improve syntax error for numbers with leading zero In-Reply-To: <1524016031.89.0.682650639539.issue33305@psf.upfronthosting.co.za> Message-ID: <1524050863.06.0.682650639539.issue33305@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 6517 improves syntax error messages for invalid numerical literals. >>> 012 File "", line 1 SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers >>> 0o129 File "", line 1 SyntaxError: invalid digit '9' in octal literal >>> 0o File "", line 1 SyntaxError: invalid octal literal >>> 1_2_ File "", line 1 SyntaxError: invalid decimal literal >>> 0.1_2_ File "", line 1 SyntaxError: invalid decimal literal >>> 12e+ File "", line 1 SyntaxError: invalid decimal literal >>> 12e+1_ File "", line 1 SyntaxError: invalid decimal literal "SyntaxError: invalid token" was emitted before. No tests yet. Suggestions about error messages are welcome. ---------- components: +Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 08:44:24 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 18 Apr 2018 12:44:24 +0000 Subject: [issue33307] socket.send() fails to send large amount of bytes In-Reply-To: <1524048775.4.0.682650639539.issue33307@psf.upfronthosting.co.za> Message-ID: <1524055464.29.0.682650639539.issue33307@psf.upfronthosting.co.za> INADA Naoki added the comment: Isn't it an expected behavior of SSL with nonblocking socket? What's wrong? ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 08:53:55 2018 From: report at bugs.python.org (INADA Naoki) Date: Wed, 18 Apr 2018 12:53:55 +0000 Subject: [issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler. In-Reply-To: <1523982101.74.0.682650639539.issue33298@psf.upfronthosting.co.za> Message-ID: <1524056035.63.0.682650639539.issue33298@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 08:57:22 2018 From: report at bugs.python.org (Kaulkwappe) Date: Wed, 18 Apr 2018 12:57:22 +0000 Subject: [issue33307] socket.send() fails to send large amount of bytes In-Reply-To: <1524048775.4.0.682650639539.issue33307@psf.upfronthosting.co.za> Message-ID: <1524056242.68.0.682650639539.issue33307@psf.upfronthosting.co.za> Kaulkwappe added the comment: Sorry for the misunderstanding, here is the complete example: socket.setblocking(0) try: buffer = socket.recv() if not buffer: break except OSError: bytes_sent = socket.send(b'a' * 32 * 1024 * 1024) In this case the socket is ready for sending data and should return the bytes that were actually sent. But when sending a large amount of bytes it every time fails with SSLWantWriteError exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 08:58:47 2018 From: report at bugs.python.org (Christian Heimes) Date: Wed, 18 Apr 2018 12:58:47 +0000 Subject: [issue33307] socket.send() fails to send large amount of bytes In-Reply-To: <1524048775.4.0.682650639539.issue33307@psf.upfronthosting.co.za> Message-ID: <1524056327.09.0.682650639539.issue33307@psf.upfronthosting.co.za> Christian Heimes added the comment: Inada is correct. This is the expected and documented behavior for non-blocking SSLSockets, see https://docs.python.org/3/library/ssl.html#ssl-nonblocking . ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 09:12:16 2018 From: report at bugs.python.org (Kaulkwappe) Date: Wed, 18 Apr 2018 13:12:16 +0000 Subject: [issue33307] socket.send() fails to send large amount of bytes In-Reply-To: <1524048775.4.0.682650639539.issue33307@psf.upfronthosting.co.za> Message-ID: <1524057136.83.0.682650639539.issue33307@psf.upfronthosting.co.za> Kaulkwappe added the comment: But why does socket.send() throws an exception in this case only when sending a large amount of bytes? That would mean it is impossible to send large amount of bytes over SSL sockets as it would fail everytime. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 09:24:11 2018 From: report at bugs.python.org (Aviv Palivoda) Date: Wed, 18 Apr 2018 13:24:11 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1524057851.2.0.682650639539.issue24905@psf.upfronthosting.co.za> Aviv Palivoda added the comment: As I wrote in the PR: I think that the contains operation should not be supported for blobs. As blobs can be very large, looking for a subset of bytes inside them will be a very inefficient process in memory or in compute. I believe that this is a very good feature for the sqlite module. I know that there is no active core developer that is currently working on sqlite module but this patch is already waiting 2 years. Could I do anything to help this patch merged? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 09:33:53 2018 From: report at bugs.python.org (Christian Heimes) Date: Wed, 18 Apr 2018 13:33:53 +0000 Subject: [issue33307] socket.send() fails to send large amount of bytes In-Reply-To: <1524048775.4.0.682650639539.issue33307@psf.upfronthosting.co.za> Message-ID: <1524058433.61.0.682650639539.issue33307@psf.upfronthosting.co.za> Christian Heimes added the comment: The same way as with any other non-blocking I/O system. You have to keep track how much data you have already sent and repeat non-blocking send() until you have succeeded. With TLS/SSL it's even more complex, because a send() also requires reading and a recv() also involves writing. PS: bugs.python.org is an issue tracker, not a help forum. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 09:45:21 2018 From: report at bugs.python.org (Kaulkwappe) Date: Wed, 18 Apr 2018 13:45:21 +0000 Subject: [issue33307] socket.send() fails to send large amount of bytes In-Reply-To: <1524048775.4.0.682650639539.issue33307@psf.upfronthosting.co.za> Message-ID: <1524059121.01.0.682650639539.issue33307@psf.upfronthosting.co.za> Kaulkwappe added the comment: Thank you for your answer Christian. Indeed it seems a little more complex. As I worked with Non-TLS sockets before it looked like unexpected behaviour to me as on non-blocking sockets socket.send() would normally return 0 when no data was sent. By the way this is the code I currently use: Code: n = 0 while 1: time.sleep(0.001) try: buffer = socket.recv(8192) if not buffer: break except OSError: print('{0}. try to send:'.format(n), len(blark), 'bytes') try: sent = socket.send(blark) except ssl.SSLWantWriteError: sent = 0 n += 1 print('Bytes sent:', sent) else: [...] Result: 1. try to send: 33554469 bytes Bytes sent: 0 [...] 137. try to send: 33554469 bytes Bytes sent: 0 138. try to send: 33554469 bytes Bytes sent: 0 139. try to send: 33554469 bytes Bytes sent: 33554469 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 09:59:21 2018 From: report at bugs.python.org (Thomas Wouters) Date: Wed, 18 Apr 2018 13:59:21 +0000 Subject: [issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning In-Reply-To: <1453205670.9.0.210259286868.issue26153@psf.upfronthosting.co.za> Message-ID: <1524059961.74.0.682650639539.issue26153@psf.upfronthosting.co.za> Thomas Wouters added the comment: We ran into this at work, with Python 3.6, where it involved extension types with a reference to files, with the (open) files being deallocated during interpreter exit and raising ResourceWarnings because of that. I tried to create a simple reproducer and failed, but I *did* manage to reproduce it in 2.7: % cat warningscrash.py import threading import warnings class WarnOnDel(object): def __del__(self): warnings.warn("oh no something went wrong", UserWarning) def do_work(): while True: w = WarnOnDel() for i in range(10): t = threading.Thread(target=do_work) t.setDaemon(1) t.start() % python2 warningscrash.py warningscrash.py:7: UserWarning: oh no something went wrong warnings.warn("oh no something went wrong", UserWarning) Fatal Python error: PyImport_GetModuleDict: no module dictionary! Aborted (core dumped) It's clearly dependent on timing, as even when starting 10 threads it doesn't always happen. Starting more threads makes it happen more often (but might cause your machine to trash a little). This doesn't reproduce it with Python 3.6, but I do believe it's possible there, too, but perhaps it requires threads that release the GIL for a longer period of time, or do deallocations with less overhead. Python 2.7's warnings module doesn't try to do anything sensible during interpreter shutdown, as far as I can tell. Python 3.6's warnings module does, a little, but it's still possible to get this crash. The problem is that interp->modules (sys.modules) is deleted right before the _warnings module tries to access it (with PyImport_GetModuleDict in Python/_warnings.c:get_warnings_attr). I think a fix for 3.6 shouldn't be too hard, since we can check _Py_Finalizing. ---------- nosy: +twouters versions: +Python 2.7, Python 3.4, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 10:21:13 2018 From: report at bugs.python.org (Thomas Wouters) Date: Wed, 18 Apr 2018 14:21:13 +0000 Subject: [issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning In-Reply-To: <1453205670.9.0.210259286868.issue26153@psf.upfronthosting.co.za> Message-ID: <1524061273.87.0.682650639539.issue26153@psf.upfronthosting.co.za> Change by Thomas Wouters : ---------- keywords: +patch pull_requests: +6211 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 10:24:37 2018 From: report at bugs.python.org (Thomas Wouters) Date: Wed, 18 Apr 2018 14:24:37 +0000 Subject: [issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning In-Reply-To: <1453205670.9.0.210259286868.issue26153@psf.upfronthosting.co.za> Message-ID: <1524061477.55.0.682650639539.issue26153@psf.upfronthosting.co.za> Thomas Wouters added the comment: Looks like this was fixed in 3.7 by checking PyThreadState_GET()->interp->modules before trying to use it. That leaves the crash in 3.6 and earlier, though. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 11:32:26 2018 From: report at bugs.python.org (Brett Cannon) Date: Wed, 18 Apr 2018 15:32:26 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError Message-ID: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> New submission from Brett Cannon : `parser.st2list(parser.suite(""), col_info=True)` causes: Fatal Python error: a function returned a result with an error set IndexError: list assignment index out of range ``` The above exception was the direct cause of the following exception: SystemError: returned a result with an error set Current thread 0x00007fff9ca99380 (most recent call first): File "/private/tmp/tester/lazy/sub.py", line 3 in fish: '/Users/brettcannon/Repositories?' terminated by signal SIGABRT (Abort) ``` ---------- components: Library (Lib) messages: 315455 nosy: brett.cannon priority: normal severity: normal stage: test needed status: open title: parser.st2list(..., col_info=True) triggers a SystemError type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 11:53:04 2018 From: report at bugs.python.org (Nathaniel Duarte) Date: Wed, 18 Apr 2018 15:53:04 +0000 Subject: [issue33309] Unittest Mock objects do not freeze arguments they are called with Message-ID: <1524066784.49.0.682650639539.issue33309@psf.upfronthosting.co.za> New submission from Nathaniel Duarte : It is possible to make a call with a Mock object, for example, where a dictionary is passed to the mock and later modified. If a call assertion is then made against the mock using the initial value/contents of the dictionary the assertion will fail. ---------- components: Library (Lib) files: mock_issue.py messages: 315456 nosy: slacknate priority: normal severity: normal status: open title: Unittest Mock objects do not freeze arguments they are called with type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file47539/mock_issue.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 12:06:42 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 16:06:42 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError In-Reply-To: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> Message-ID: <1524067602.65.0.682650639539.issue33308@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka components: +Extension Modules -Library (Lib) nosy: +serhiy.storchaka type: behavior -> crash versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 12:16:40 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 16:16:40 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError In-Reply-To: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> Message-ID: <1524068200.35.0.682650639539.issue33308@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6212 stage: test needed -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 12:40:26 2018 From: report at bugs.python.org (Thomas Wouters) Date: Wed, 18 Apr 2018 16:40:26 +0000 Subject: [issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning In-Reply-To: <1453205670.9.0.210259286868.issue26153@psf.upfronthosting.co.za> Message-ID: <1524069626.53.0.682650639539.issue26153@psf.upfronthosting.co.za> Change by Thomas Wouters : ---------- pull_requests: +6213 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 13:28:40 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Apr 2018 17:28:40 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1524072520.57.0.682650639539.issue33283@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 14:16:48 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Apr 2018 18:16:48 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1524075408.95.0.682650639539.issue33283@psf.upfronthosting.co.za> miss-islington added the comment: New changeset b88f73749db98ed62dbc8fa59480aa62202e25d7 by Miss Islington (bot) in branch '3.7': bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) https://github.com/python/cpython/commit/b88f73749db98ed62dbc8fa59480aa62202e25d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 14:38:33 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 18:38:33 +0000 Subject: [issue33310] Update references to PIL-style arrays Message-ID: <1524076713.71.0.682650639539.issue33310@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The documentation for buffer protocol and memoryview objects contains references to "PIL-style arrays". Since PIL [1] seems dead (it was not ported to Python 3) and superseded by Pillow [2], I think it is worth to update these references. Either rename "PIL-style arrays" to "Pillow-style arrays" or change the wording to more general. [1] http://www.pythonware.com/products/pil/ [2] http://python-pillow.org/ ---------- assignee: docs at python components: Documentation messages: 315458 nosy: docs at python, pitrou, serhiy.storchaka, skrah priority: normal severity: normal status: open title: Update references to PIL-style arrays type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 14:39:52 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Wed, 18 Apr 2018 18:39:52 +0000 Subject: [issue33311] cgitb: remove parentheses when the error is in module Message-ID: <1524076792.36.0.682650639539.issue33311@psf.upfronthosting.co.za> New submission from St?phane Blondon : The cgitb module displays a traceback in text or html. When a module is called, there are no parameters (displayed as '()'). I think they are unnecessary and the parentheses should be removed. ### example for the text version ### $ python3 demo.py [...] /home/stephane/src/cgitest/demo.py in () 7 def func1(a, b): ^-- to be removed? [...] ### end of example ### It occurs in both text and html versions. ---------- components: Library (Lib) messages: 315459 nosy: sblondon priority: normal severity: normal status: open title: cgitb: remove parentheses when the error is in module type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 14:45:49 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Wed, 18 Apr 2018 18:45:49 +0000 Subject: [issue33311] cgitb: remove parentheses when the error is in module In-Reply-To: <1524076792.36.0.682650639539.issue33311@psf.upfronthosting.co.za> Message-ID: <1524077149.04.0.682650639539.issue33311@psf.upfronthosting.co.za> Change by St?phane Blondon : ---------- keywords: +patch pull_requests: +6215 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 14:45:49 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Wed, 18 Apr 2018 18:45:49 +0000 Subject: [issue3356] some tests fail with 'make EXTRA_CFLAGS="-DPy_DEBUG"' (test_distutils, test_set) In-Reply-To: <1216070128.91.0.762620118024.issue3356@psf.upfronthosting.co.za> Message-ID: <1524077149.16.0.0935424498089.issue3356@psf.upfronthosting.co.za> Change by St?phane Blondon : ---------- pull_requests: +6216 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 14:55:49 2018 From: report at bugs.python.org (Stefan Krah) Date: Wed, 18 Apr 2018 18:55:49 +0000 Subject: [issue33310] Update references to PIL-style arrays In-Reply-To: <1524076713.71.0.682650639539.issue33310@psf.upfronthosting.co.za> Message-ID: <1524077749.51.0.682650639539.issue33310@psf.upfronthosting.co.za> Stefan Krah added the comment: I guess I don't really see much of an issue: The first link for "PIL Python" goes Pillow page and since Pillow is just a fork, the technical term is IMHO "PIL-style". I like to give credit to original authors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 14:59:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 18:59:27 +0000 Subject: [issue33310] Update references to PIL-style arrays In-Reply-To: <1524076713.71.0.682650639539.issue33310@psf.upfronthosting.co.za> Message-ID: <1524077967.05.0.682650639539.issue33310@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Indeed, the name of the top-level package is PIL in Pillow. Unless you want to rewrite the wording or add links I think this issue can be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 15:08:33 2018 From: report at bugs.python.org (Stefan Krah) Date: Wed, 18 Apr 2018 19:08:33 +0000 Subject: [issue33310] Update references to PIL-style arrays In-Reply-To: <1524076713.71.0.682650639539.issue33310@psf.upfronthosting.co.za> Message-ID: <1524078513.93.0.682650639539.issue33310@psf.upfronthosting.co.za> Stefan Krah added the comment: I think I want to leave it as is. Probably no one is using suboffsets anyway. :-) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 15:17:00 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 19:17:00 +0000 Subject: [issue33310] Update references to PIL-style arrays In-Reply-To: <1524076713.71.0.682650639539.issue33310@psf.upfronthosting.co.za> Message-ID: <1524079020.32.0.682650639539.issue33310@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 15:44:34 2018 From: report at bugs.python.org (=?utf-8?q?Nicol=C3=A1s_Hatcher?=) Date: Wed, 18 Apr 2018 19:44:34 +0000 Subject: [issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8' In-Reply-To: <1523352074.24.0.682650639539.issue33255@psf.upfronthosting.co.za> Message-ID: <1524080674.56.0.682650639539.issue33255@psf.upfronthosting.co.za> Change by Nicol?s Hatcher : ---------- keywords: +patch pull_requests: +6217 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 17:59:39 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 18 Apr 2018 21:59:39 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) Message-ID: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> New submission from Gregory P. Smith : Build CPython (master in this case - though I originally noticed the problem when building a 3.6 tree) as follows with clang installed: build$ LD=clang-5.0 LDFLAGS=-fsanitize=undefined CC=clang-5.0 CXX=clang-5.0 CFLAGS=-fsanitize=undefined CXXFLAGS=-fsanitize=undefined ../gpshead/configure build$ make -j12 ... notice many of the warnings scroll by during the build itself as it executes the interpreter then execute it yourself at the end and you'll get a bunch of these: ../gpshead/Objects/dictobject.c:547:12: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:1145:18: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:2817:15: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:831:27: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:1144:18: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:1034:15: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:728:11: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:1064:9: runtime error: index 64 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:2960:31: runtime error: index 64 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:1489:11: runtime error: index 32 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:637:27: runtime error: index 128 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:788:27: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:1671:22: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:554:31: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:1223:15: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:876:27: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:2396:15: runtime error: index 32 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:2078:10: runtime error: index 128 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:3584:38: runtime error: index 16 out of bounds for type 'int8_t [8]' ../gpshead/Objects/dictobject.c:3502:38: runtime error: index 64 out of bounds for type 'int8_t [8]' At issue is the hash table here: https://github.com/python/cpython/blob/3.7/Objects/dict-common.h which is intentionally meant to be indexed "out of bounds" off the end of the struct. I'm not a strict C language definition so I don't know if that is _supposed_ to be defined behavior as we all tend to assume it is in C or not. If it is supposed to be okay, we should be able to annotate it as such to avoid the warning under ubsan builds. If it is not, we need to change the way this is written. ---------- messages: 315464 nosy: gregory.p.smith priority: normal severity: normal stage: needs patch status: open title: ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) type: compile error versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:01:33 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 18 Apr 2018 22:01:33 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524088893.55.0.682650639539.issue33312@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- nosy: +benjamin.peterson, fweimer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:01:56 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 18 Apr 2018 22:01:56 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524088916.8.0.682650639539.issue33312@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- nosy: +twouters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:17:43 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Apr 2018 22:17:43 +0000 Subject: [issue33313] pwritev, preadv and posix_spawn are missing from "What's new in 3.7" Message-ID: <1524089863.52.0.682650639539.issue33313@psf.upfronthosting.co.za> New submission from Pablo Galindo Salgado : The "What's new in 3.7" is missing the functions exposed in issue31368 and issue20104: pwritev, preadv and posix_spawn. ---------- messages: 315465 nosy: gregory.p.smith, pablogsal, serhiy.storchaka priority: normal severity: normal status: open title: pwritev, preadv and posix_spawn are missing from "What's new in 3.7" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:18:37 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Apr 2018 22:18:37 +0000 Subject: [issue33313] pwritev, preadv and posix_spawn are missing from "What's new in 3.7" In-Reply-To: <1524089863.52.0.682650639539.issue33313@psf.upfronthosting.co.za> Message-ID: <1524089917.27.0.682650639539.issue33313@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- assignee: -> pablogsal components: +Documentation priority: normal -> high stage: -> needs patch type: -> enhancement versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:19:48 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Apr 2018 22:19:48 +0000 Subject: [issue33313] pwritev, preadv and posix_spawn are missing from "What's new in 3.7" In-Reply-To: <1524089863.52.0.682650639539.issue33313@psf.upfronthosting.co.za> Message-ID: <1524089988.44.0.682650639539.issue33313@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +6218 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:27:28 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 18 Apr 2018 22:27:28 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524090448.32.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: related: https://ssl.icu-project.org/trac/ticket/13503 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:30:31 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Apr 2018 22:30:31 +0000 Subject: [issue33314] Bad rendering in the documentation for the os module Message-ID: <1524090631.89.0.682650639539.issue33314@psf.upfronthosting.co.za> New submission from Pablo Galindo Salgado : Currently, there are rendering issues in the os module documentation for the constants os.RWF_HIPRI and os.RWF_NOWAIT: https://docs.python.org/3.7/library/os.html#os.RWF_HIPRI https://docs.python.org/3.7/library/os.html#os.RWF_NOWAIT ---------- assignee: pablogsal components: Documentation messages: 315467 nosy: pablogsal priority: high severity: normal stage: needs patch status: open title: Bad rendering in the documentation for the os module versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:31:37 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Apr 2018 22:31:37 +0000 Subject: [issue33314] Bad rendering in the documentation for the os module In-Reply-To: <1524090631.89.0.682650639539.issue33314@psf.upfronthosting.co.za> Message-ID: <1524090697.98.0.682650639539.issue33314@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +6219 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:55:39 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Apr 2018 22:55:39 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError In-Reply-To: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> Message-ID: <1524092139.58.0.682650639539.issue33308@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset e5362eaa75a154c6e91c5b1c47719d0a0f5ca48b by Serhiy Storchaka in branch 'master': bpo-33308: Fix a crash in the parser module when convert an ST object. (#6519) https://github.com/python/cpython/commit/e5362eaa75a154c6e91c5b1c47719d0a0f5ca48b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:56:05 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Apr 2018 22:56:05 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError In-Reply-To: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> Message-ID: <1524092165.95.0.682650639539.issue33308@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6220 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 18:56:48 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Apr 2018 22:56:48 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError In-Reply-To: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> Message-ID: <1524092208.55.0.682650639539.issue33308@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6221 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 19:50:27 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Apr 2018 23:50:27 +0000 Subject: [issue31583] 2to3 call for file in current directory yields error In-Reply-To: <1506401881.51.0.156968615835.issue31583@psf.upfronthosting.co.za> Message-ID: <1524095427.71.0.682650639539.issue31583@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset e3a523a0fa16aec880880928303bfcbd1fb74bc2 by ?ukasz Langa (Denis Osipov) in branch 'master': bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) https://github.com/python/cpython/commit/e3a523a0fa16aec880880928303bfcbd1fb74bc2 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 19:51:35 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Apr 2018 23:51:35 +0000 Subject: [issue31583] 2to3 call for file in current directory yields error In-Reply-To: <1506401881.51.0.156968615835.issue31583@psf.upfronthosting.co.za> Message-ID: <1524095495.87.0.682650639539.issue31583@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6222 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 19:52:34 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Apr 2018 23:52:34 +0000 Subject: [issue31583] 2to3 call for file in current directory yields error In-Reply-To: <1506401881.51.0.156968615835.issue31583@psf.upfronthosting.co.za> Message-ID: <1524095554.8.0.682650639539.issue31583@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6223 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 20:15:12 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Apr 2018 00:15:12 +0000 Subject: [issue31583] 2to3 call for file in current directory yields error In-Reply-To: <1506401881.51.0.156968615835.issue31583@psf.upfronthosting.co.za> Message-ID: <1524096912.72.0.682650639539.issue31583@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset 67067d85eb1df8c52399f9fc74dc4c1a32ec86cd by ?ukasz Langa (Miss Islington (bot)) in branch '3.7': bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) (#6528) https://github.com/python/cpython/commit/67067d85eb1df8c52399f9fc74dc4c1a32ec86cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 21:59:20 2018 From: report at bugs.python.org (iunknwn) Date: Thu, 19 Apr 2018 01:59:20 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1524103160.71.0.682650639539.issue24882@psf.upfronthosting.co.za> Change by iunknwn : ---------- pull_requests: +6224 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 22:01:36 2018 From: report at bugs.python.org (iunknwn) Date: Thu, 19 Apr 2018 02:01:36 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1524103296.63.0.682650639539.issue24882@psf.upfronthosting.co.za> iunknwn added the comment: Done - as recommend, I've opened a new PR that changes the behavior to spawn all worker threads when the executor is created. This eliminates all the thread logic from the submit function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 18 22:54:31 2018 From: report at bugs.python.org (Max Rees) Date: Thu, 19 Apr 2018 02:54:31 +0000 Subject: [issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks In-Reply-To: <1478471671.65.0.611428361622.issue28627@psf.upfronthosting.co.za> Message-ID: <1524106471.37.0.682650639539.issue28627@psf.upfronthosting.co.za> Max Rees added the comment: Actually the symlinks don't need to be broken. It fails for any kind of symlink on musl. $ ls -l /tmp/symtest lrwxrwxrwx 1 mcrees mcrees 10 Apr 18 21:16 empty -> /var/empty -rw-r--r-- 1 mcrees mcrees 0 Apr 18 21:16 regular lrwxrwxrwx 1 mcrees mcrees 16 Apr 18 21:16 resolv.conf -> /etc/resolv.conf $ python3 >>> import shutil; shutil.copytree('/tmp/symtest', '/tmp/symtest2', symlinks=True) shutil.Error: [('/tmp/symtest/resolv.conf', '/tmp/symtest2/resolv.conf', "[Errno 95] Not supported: '/tmp/symtest2/resolv.conf'"), ('/tmp/symtest/empty', '/tmp/symtest2/empty', "[Errno 95] Not supported: '/tmp/symtest2/empty'")] $ ls -l /tmp/symtest2 total 0 lrwxrwxrwx 1 mcrees mcrees 10 Apr 18 21:16 empty -> /var/empty -rw-r--r-- 1 mcrees mcrees 0 Apr 18 21:16 regular lrwxrwxrwx 1 mcrees mcrees 16 Apr 18 21:16 resolv.conf -> /etc/resolv.conf The implication of these bugs mean that things like pip may fail if it calls shutil.copytree(..., symlinks=True) on a directory that contains symlinks(!) Attached is a patch that works around the issue but does not address why chmod is returning OSError instead of NotImplementedError. ---------- keywords: +patch nosy: +sroracle Added file: https://bugs.python.org/file47540/musl-eopnotsupp.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 00:25:41 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 19 Apr 2018 04:25:41 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524111941.44.0.682650639539.issue33312@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Yeah, I've run into this before. The "correct" thing to do is use C99 VLAs. Unfortunately, that doesn't work for PyDictKeysObject because it really wants a union of VLAs but that isn't supported. The best I could do is making a struct for every possible member of the union. See the attached patch. I didn't land it because it's gross. OTOH, undefined behavior is bad, so I'm okay landing this if you don't find it too revolting. ---------- keywords: +patch Added file: https://bugs.python.org/file47541/horrible.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 01:10:01 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Apr 2018 05:10:01 +0000 Subject: [issue31583] 2to3 call for file in current directory yields error In-Reply-To: <1506401881.51.0.156968615835.issue31583@psf.upfronthosting.co.za> Message-ID: <1524114601.35.0.682650639539.issue31583@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset 1957e7b76a1319995360492223a4dfe1cd5d105c by ?ukasz Langa (Miss Islington (bot)) in branch '3.6': bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) (GH-6529) https://github.com/python/cpython/commit/1957e7b76a1319995360492223a4dfe1cd5d105c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 01:10:39 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Apr 2018 05:10:39 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError In-Reply-To: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> Message-ID: <1524114639.19.0.682650639539.issue33308@psf.upfronthosting.co.za> miss-islington added the comment: New changeset b27c71cdc02ae01081c14e7192f47abe636a831f by Miss Islington (bot) in branch '3.7': bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519) https://github.com/python/cpython/commit/b27c71cdc02ae01081c14e7192f47abe636a831f ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 01:11:07 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Apr 2018 05:11:07 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError In-Reply-To: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> Message-ID: <1524114667.5.0.682650639539.issue33308@psf.upfronthosting.co.za> miss-islington added the comment: New changeset fc8693dc7a228d687bf066e163f82a7724b58b68 by Miss Islington (bot) in branch '3.6': bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519) https://github.com/python/cpython/commit/fc8693dc7a228d687bf066e163f82a7724b58b68 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 01:23:50 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Apr 2018 05:23:50 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError In-Reply-To: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> Message-ID: <1524115430.66.0.682650639539.issue33308@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6225 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 01:26:27 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Apr 2018 05:26:27 +0000 Subject: [issue33313] pwritev, preadv and posix_spawn are missing from "What's new in 3.7" In-Reply-To: <1524089863.52.0.682650639539.issue33313@psf.upfronthosting.co.za> Message-ID: <1524115587.08.0.682650639539.issue33313@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6226 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 01:28:07 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Apr 2018 05:28:07 +0000 Subject: [issue33299] Return an object itself for some types in _PyCode_ConstantKey() In-Reply-To: <1523984052.37.0.682650639539.issue33299@psf.upfronthosting.co.za> Message-ID: <1524115687.1.0.682650639539.issue33299@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b7e1eff8436f6e0c4aac440036092fcf96f82960 by Serhiy Storchaka in branch 'master': bpo-33299: Return an object itself for some types in _PyCode_ConstantKey(). (GH-6513) https://github.com/python/cpython/commit/b7e1eff8436f6e0c4aac440036092fcf96f82960 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 01:28:42 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Apr 2018 05:28:42 +0000 Subject: [issue33299] Return an object itself for some types in _PyCode_ConstantKey() In-Reply-To: <1523984052.37.0.682650639539.issue33299@psf.upfronthosting.co.za> Message-ID: <1524115722.55.0.682650639539.issue33299@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 01:29:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Apr 2018 05:29:16 +0000 Subject: [issue33313] pwritev, preadv and posix_spawn are missing from "What's new in 3.7" In-Reply-To: <1524089863.52.0.682650639539.issue33313@psf.upfronthosting.co.za> Message-ID: <1524115756.57.0.682650639539.issue33313@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 01:47:35 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Apr 2018 05:47:35 +0000 Subject: [issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8' In-Reply-To: <1523352074.24.0.682650639539.issue33255@psf.upfronthosting.co.za> Message-ID: <1524116855.14.0.682650639539.issue33255@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In simplejson: >>> simplejson.dumps({u"greeting": "hi", "currency": "?"}, ensure_ascii=False, encoding="utf8") u'{"currency": "\u20ac", "greeting": "hi"}' >>> simplejson.dumps({u"greeting": "hi", "currency": "?"}, ensure_ascii=False) u'{"currency": "\u20ac", "greeting": "hi"}' I think it makes sense to fix the case for "utf-8". ---------- nosy: +bob.ippolito, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 01:54:11 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 19 Apr 2018 05:54:11 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524117251.33.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: I think it is worth getting such a change in. its arguable that the compiler should be able to see through the union for this use case but I assume such a fix would only land in a recent clang version. i'm attaching a variant on your patch that doesn't cast entire structs but just casts the VLA. thoughts? ---------- Added file: https://bugs.python.org/file47542/maybe-less-horrible-gps01.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 02:16:47 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Apr 2018 06:16:47 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError In-Reply-To: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> Message-ID: <1524118607.35.0.682650639539.issue33308@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset d988c0b6bd1c5965fdc51428119e9104211e688f by Serhiy Storchaka in branch '2.7': [2.7] bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519) (GH-6532) https://github.com/python/cpython/commit/d988c0b6bd1c5965fdc51428119e9104211e688f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 02:17:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Apr 2018 06:17:16 +0000 Subject: [issue33308] parser.st2list(..., col_info=True) triggers a SystemError In-Reply-To: <1524065546.01.0.682650639539.issue33308@psf.upfronthosting.co.za> Message-ID: <1524118636.95.0.682650639539.issue33308@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 02:23:05 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Apr 2018 06:23:05 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1524118985.47.0.682650639539.issue33189@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 69524821a87251b7aee966f6e46b3810ff5aaa64 by Serhiy Storchaka in branch 'master': bpo-33189: pygettext.py now accepts only literal strings (GH-6364) https://github.com/python/cpython/commit/69524821a87251b7aee966f6e46b3810ff5aaa64 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 02:24:25 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Apr 2018 06:24:25 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1524119065.54.0.682650639539.issue33189@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6227 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 02:25:20 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Apr 2018 06:25:20 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1524119120.06.0.682650639539.issue33189@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 02:49:18 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Apr 2018 06:49:18 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1524120558.12.0.682650639539.issue33189@psf.upfronthosting.co.za> miss-islington added the comment: New changeset a4fb580f701df5bf07ce569a4f43abfb05c92759 by Miss Islington (bot) in branch '3.7': bpo-33189: pygettext.py now accepts only literal strings (GH-6364) https://github.com/python/cpython/commit/a4fb580f701df5bf07ce569a4f43abfb05c92759 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 03:02:04 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Apr 2018 07:02:04 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1524121324.08.0.682650639539.issue33189@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6229 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 03:34:30 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Apr 2018 07:34:30 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1524123270.13.0.682650639539.issue33189@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 6f870935c2e024cbd1cc379f85e6a66d7711dcc7 by Miss Islington (bot) in branch '3.6': bpo-33189: pygettext.py now accepts only literal strings (GH-6364) https://github.com/python/cpython/commit/6f870935c2e024cbd1cc379f85e6a66d7711dcc7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 03:48:45 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Apr 2018 07:48:45 +0000 Subject: [issue33189] pygettext doesn't work with f-strings In-Reply-To: <1522441516.38.0.467229070634.issue33189@psf.upfronthosting.co.za> Message-ID: <1524124125.59.0.682650639539.issue33189@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 06:13:59 2018 From: report at bugs.python.org (Joachim Wagner) Date: Thu, 19 Apr 2018 10:13:59 +0000 Subject: [issue24318] Better documentaiton of profile-opt (and release builds in general?) In-Reply-To: <1432830865.51.0.995414707141.issue24318@psf.upfronthosting.co.za> Message-ID: <1524132839.89.0.682650639539.issue24318@psf.upfronthosting.co.za> Joachim Wagner added the comment: The readme in 3.6.5 has a section on PGO but the sentence "If ran, ``make profile-opt`` will do several steps." can be misunderstood that one has to run this command instead of "make" after "configure --enable-optimizations". Furthermore, a 2015 post suggests that most Linux distributions use a different workload than the one provided for much better results. The readme should talk about this, either clarifying that this issue has been resolved or making recommendations for the workload. (I understand that licence incompatibilities or the size of the workload may be reasons for not including the recommended workload in the source distribution.) ---------- nosy: +jwagner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 06:27:47 2018 From: report at bugs.python.org (Nathaniel Smith) Date: Thu, 19 Apr 2018 10:27:47 +0000 Subject: [issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning In-Reply-To: <1453205670.9.0.210259286868.issue26153@psf.upfronthosting.co.za> Message-ID: <1524133667.86.0.682650639539.issue26153@psf.upfronthosting.co.za> Change by Nathaniel Smith : ---------- pull_requests: +6230 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 06:43:25 2018 From: report at bugs.python.org (Thomas Wouters) Date: Thu, 19 Apr 2018 10:43:25 +0000 Subject: [issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s) In-Reply-To: <1516259345.01.0.467229070634.issue32591@psf.upfronthosting.co.za> Message-ID: <1524134605.67.0.682650639539.issue32591@psf.upfronthosting.co.za> Change by Thomas Wouters : ---------- pull_requests: +6231 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 06:46:04 2018 From: report at bugs.python.org (Thomas Wouters) Date: Thu, 19 Apr 2018 10:46:04 +0000 Subject: [issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning In-Reply-To: <1453205670.9.0.210259286868.issue26153@psf.upfronthosting.co.za> Message-ID: <1524134764.11.0.682650639539.issue26153@psf.upfronthosting.co.za> Change by Thomas Wouters : ---------- pull_requests: +6232 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 07:04:02 2018 From: report at bugs.python.org (INADA Naoki) Date: Thu, 19 Apr 2018 11:04:02 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1524135842.93.0.682650639539.issue24882@psf.upfronthosting.co.za> INADA Naoki added the comment: Why not just remove TODO comment? Thread is cheap, but not zero-cost. ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 07:17:22 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Thu, 19 Apr 2018 11:17:22 +0000 Subject: [issue31463] test_multiprocessing_fork hangs test_subprocess In-Reply-To: <1505370960.72.0.0292264137903.issue31463@psf.upfronthosting.co.za> Message-ID: <1524136642.65.0.682650639539.issue31463@psf.upfronthosting.co.za> Miro Hron?ok added the comment: This started to bother us in Fedora for various Python versions, so chances are something changed on the system level. However for us it seams test_multiprocessing_fork hangs by itself, so this might or might not be relevant to # python3.7 -m test.regrtest test_multiprocessing_fork test_subprocess Run tests sequentially 0:00:00 load avg: 1.16 [1/2] test_multiprocessing_fork /usr/lib64/python3.7/multiprocessing/semaphore_tracker.py:55: UserWarning: semaphore_tracker: process died unexpectedly, relaunching. Some semaphores might leak. warnings.warn('semaphore_tracker: process died unexpectedly, ' Exception in thread Thread-26: Traceback (most recent call last): File "/usr/lib64/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib64/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.7/multiprocessing/resource_sharer.py", line 139, in _serve signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG)) File "/usr/lib64/python3.7/signal.py", line 60, in pthread_sigmask sigs_set = _signal.pthread_sigmask(how, mask) ValueError: signal number 32 out of range (hangs) ^CProcess Process-184: Traceback (most recent call last): File "/usr/lib64/python3.7/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/usr/lib64/python3.7/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.7/test/_test_multiprocessing.py", line 3328, in child_access w = conn.recv() File "/usr/lib64/python3.7/multiprocessing/connection.py", line 251, in recv return _ForkingPickler.loads(buf.getbuffer()) File "/usr/lib64/python3.7/multiprocessing/connection.py", line 960, in rebuild_connection fd = df.detach() File "/usr/lib64/python3.7/multiprocessing/resource_sharer.py", line 57, in detach with _resource_sharer.get_connection(self._id) as conn: File "/usr/lib64/python3.7/multiprocessing/resource_sharer.py", line 87, in get_connection c = Client(address, authkey=process.current_process().authkey) File "/usr/lib64/python3.7/multiprocessing/connection.py", line 498, in Client answer_challenge(c, authkey) File "/usr/lib64/python3.7/multiprocessing/connection.py", line 741, in answer_challenge message = connection.recv_bytes(256) # reject large message File "/usr/lib64/python3.7/multiprocessing/connection.py", line 216, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/lib64/python3.7/multiprocessing/connection.py", line 407, in _recv_bytes buf = self._recv(4) File "/usr/lib64/python3.7/multiprocessing/connection.py", line 379, in _recv chunk = read(handle, remaining) KeyboardInterrupt Warning -- multiprocessing.process._dangling was modified by test_multiprocessing_fork Before: <_weakrefset.WeakSet object at 0x7f4b63782dd8> After: <_weakrefset.WeakSet object at 0x7f4b637821d0> Warning -- threading._dangling was modified by test_multiprocessing_fork Before: <_weakrefset.WeakSet object at 0x7f4b63782780> After: <_weakrefset.WeakSet object at 0x7f4b63782da0> Test suite interrupted by signal SIGINT. 2 tests omitted: test_multiprocessing_fork test_subprocess Total duration: 1 min 35 sec Tests result: INTERRUPTED # python3.7 --version Python 3.7.0b3 # python3.6 -m test.regrtest test_multiprocessing_fork test_subprocess Run tests sequentially 0:00:00 load avg: 1.84 [1/2] test_multiprocessing_fork /usr/lib64/python3.6/multiprocessing/semaphore_tracker.py:55: UserWarning: semaphore_tracker: process died unexpectedly, relaunching. Some semaphores might leak. warnings.warn('semaphore_tracker: process died unexpectedly, ' Exception in thread Thread-20: Traceback (most recent call last): File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib64/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.6/multiprocessing/resource_sharer.py", line 139, in _serve signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG)) File "/usr/lib64/python3.6/signal.py", line 60, in pthread_sigmask sigs_set = _signal.pthread_sigmask(how, mask) ValueError: signal number 32 out of range (hangs) ^CProcess Process-178: Traceback (most recent call last): ... KeyboardInterrupt Warning -- multiprocessing.process._dangling was modified by test_multiprocessing_fork Before: <_weakrefset.WeakSet object at 0x7f1873917c88> After: <_weakrefset.WeakSet object at 0x7f188516d978> Warning -- threading._dangling was modified by test_multiprocessing_fork Before: <_weakrefset.WeakSet object at 0x7f1873917d68> After: <_weakrefset.WeakSet object at 0x7f1873917e48> Test suite interrupted by signal SIGINT. 2 tests omitted: test_multiprocessing_fork test_subprocess Total duration: 51 sec Tests result: INTERRUPTED # python3.6 --version Python 3.6.5 # python3.5 -m test.regrtest test_multiprocessing_fork test_subprocess 0:00:00 load avg: 1.83 [1/2] test_multiprocessing_fork Exception in thread Thread-20: Traceback (most recent call last): File "/usr/lib64/python3.5/threading.py", line 914, in _bootstrap_inner self.run() File "/usr/lib64/python3.5/threading.py", line 862, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.5/multiprocessing/resource_sharer.py", line 139, in _serve signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG)) File "/usr/lib64/python3.5/signal.py", line 60, in pthread_sigmask sigs_set = _signal.pthread_sigmask(how, mask) ValueError: signal number 32 out of range (hangs) ^CProcess Process-178: Traceback (most recent call last): ... KeyboardInterrupt Warning -- multiprocessing.process._dangling was modified by test_multiprocessing_fork Before: <_weakrefset.WeakSet object at 0x7f2bb3923ba8> After: <_weakrefset.WeakSet object at 0x7f2bc4d88b38> Warning -- threading._dangling was modified by test_multiprocessing_fork Before: <_weakrefset.WeakSet object at 0x7f2bb3923be0> After: <_weakrefset.WeakSet object at 0x7f2bb3923f28> Test suite interrupted by signal SIGINT. 2 tests omitted: test_multiprocessing_fork test_subprocess Tests result: INTERRUPTED # python3.5 --version Python 3.5.4 # python3.4 -m test.regrtest test_multiprocessing_fork test_subprocess [1/2] test_multiprocessing_fork Exception in thread Thread-21: Traceback (most recent call last): File "/usr/lib64/python3.4/threading.py", line 911, in _bootstrap_inner self.run() File "/usr/lib64/python3.4/threading.py", line 859, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.4/multiprocessing/resource_sharer.py", line 139, in _serve signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG)) ValueError: signal number 32 out of range (hangs) ^CTraceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.4/multiprocessing/forkserver.py", line 170, in main Warning -- multiprocessing.process._dangling was modified by test_multiprocessing_fork Warning -- threading._dangling was modified by test_multiprocessing_fork Process Process-180: Traceback (most recent call last): ... KeyboardInterrupt Test suite interrupted by signal SIGINT. 2 tests omitted: test_multiprocessing_fork test_subprocess # python3.4 --version Python 3.4.8 ---------- nosy: +hroncok versions: +Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 07:19:16 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Thu, 19 Apr 2018 11:19:16 +0000 Subject: [issue31463] test_multiprocessing_fork hangs test_subprocess In-Reply-To: <1505370960.72.0.0292264137903.issue31463@psf.upfronthosting.co.za> Message-ID: <1524136756.79.0.682650639539.issue31463@psf.upfronthosting.co.za> Miro Hron?ok added the comment: Sorry, I've pressed the button before finishing the thought. ...so this might or might not be relevant to what you observe with master and originally reported. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 08:02:56 2018 From: report at bugs.python.org (Semyon Proshev) Date: Thu, 19 Apr 2018 12:02:56 +0000 Subject: [issue33315] Allow queue.Queue to be used in type annotations Message-ID: <1524139376.68.0.682650639539.issue33315@psf.upfronthosting.co.za> New submission from Semyon Proshev : from queue import Queue a: Queue[int] This code throws a TypeError in runtime. But its pyi stub allows to use it in such a way (https://github.com/python/typeshed/blob/master/stdlib/3/queue.pyi) I'd suggest to update classes in queue module to allow them to be used in type annotations. ---------- components: Library (Lib) messages: 315488 nosy: sproshev priority: normal severity: normal status: open title: Allow queue.Queue to be used in type annotations versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 09:05:49 2018 From: report at bugs.python.org (INADA Naoki) Date: Thu, 19 Apr 2018 13:05:49 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524143149.61.0.682650639539.issue33312@psf.upfronthosting.co.za> Change by INADA Naoki : ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 11:14:06 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 19 Apr 2018 15:14:06 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524150846.15.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: notably, C99 variable length arrays syntax is not mentioned as allowed in https://www.python.org/dev/peps/pep-0007/. If we want to use VLAs, that should be clarified. But both our solutions should work with [1] instead of [] which is allowed by the ubsan checker. it means keeping the annoying "- Py_MEMBER_SIZE(...)" of the array on all size calculations (but because of that the patch is smaller). ---------- Added file: https://bugs.python.org/file47543/maybe-less-horrible-no-vla-gps02.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 11:37:24 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 19 Apr 2018 15:37:24 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524152244.77.0.682650639539.issue33312@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +6233 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 11:44:21 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 19 Apr 2018 15:44:21 +0000 Subject: [issue24318] Better documentaiton of profile-opt (and release builds in general?) In-Reply-To: <1432830865.51.0.995414707141.issue24318@psf.upfronthosting.co.za> Message-ID: <1524152660.99.0.682650639539.issue24318@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +6234 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 11:47:36 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 19 Apr 2018 15:47:36 +0000 Subject: [issue24318] Better documentaiton of profile-opt (and release builds in general?) In-Reply-To: <1432830865.51.0.995414707141.issue24318@psf.upfronthosting.co.za> Message-ID: <1524152856.5.0.682650639539.issue24318@psf.upfronthosting.co.za> Gregory P. Smith added the comment: FYI - The test suite minus some of the crazier tests (multiprocessing) that the makefile uses today is the recommended workload and is effectively what linux distros I've looked at use. It is a myth that the specific application workload matters a great deal for building a Python PGO interpreter. The layer of indirection provided by an interpreter makes it easier. All you really need is code that exercises the major important C speed paths. The eval loop, unicode internals, long bignum internals, marshal, re, pickle, json, xml, and cdecimal are all well exercised by running the test suite. A specific Python application's actual logic is not going to exercise the internals of those in a meaningfully different manner. Performance experiments bear this out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 12:14:10 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Apr 2018 16:14:10 +0000 Subject: [issue24318] Better documentaiton of profile-opt (and release builds in general?) In-Reply-To: <1432830865.51.0.995414707141.issue24318@psf.upfronthosting.co.za> Message-ID: <1524154450.02.0.682650639539.issue24318@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6235 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 12:15:29 2018 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Apr 2018 16:15:29 +0000 Subject: [issue24318] Better documentaiton of profile-opt (and release builds in general?) In-Reply-To: <1432830865.51.0.995414707141.issue24318@psf.upfronthosting.co.za> Message-ID: <1524154529.06.0.682650639539.issue24318@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6236 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 12:18:09 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 19 Apr 2018 16:18:09 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524154689.88.0.682650639539.issue33312@psf.upfronthosting.co.za> Benjamin Peterson added the comment: Your PR is basically what we did prior to 186122ead26f3ae4c2bc9f6715d2a29d339fdc5a. The problem is that may run afoul of different UB, namely strict aliasing. (Though, I suppose we could probably also avoid that by making dk_indices char[].) If VLAs work with whatever MSVC we're using, it seems fine to add it to PEP 7. At worst, we can #ifdef sanitizer it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 12:45:41 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 19 Apr 2018 16:45:41 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524156341.33.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: By my reading on how strict aliasing works, I think just changing the int64_t[1] or int32_t[1] in my PR to char[1] will work as char is always assumed to alias? the clang ubsan i was testing my PR against wasn't warning me about strict aliasing. :/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 13:01:07 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 19 Apr 2018 17:01:07 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524157267.78.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: I'm going to see what appveyor says with the VLA code on the PR. I've updated it to use char[]. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 13:03:49 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 19 Apr 2018 17:03:49 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524157429.38.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: My PR is almost a revert of https://github.com/python/cpython/commit/186122ead26f3ae4c2bc9f6715d2a29d339fdc5a so I'm curious what your motivation behind that change to use the union was? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 16:35:31 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 19 Apr 2018 20:35:31 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524170131.78.0.682650639539.issue33312@psf.upfronthosting.co.za> Benjamin Peterson added the comment: I was fixing strict aliasing problems in the code and I thought the union was cleaner than a bunch of casts. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 16:42:09 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 19 Apr 2018 20:42:09 +0000 Subject: [issue29319] Embedded 3.6.0 distribution cannot run pyz files In-Reply-To: <1484827891.73.0.559570067048.issue29319@psf.upfronthosting.co.za> Message-ID: <1524170529.05.0.682650639539.issue29319@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 20:16:17 2018 From: report at bugs.python.org (Alex Gaynor) Date: Fri, 20 Apr 2018 00:16:17 +0000 Subject: [issue991266] Cookie.py does not correctly quote Morsels Message-ID: <1524183377.62.0.682650639539.issue991266@psf.upfronthosting.co.za> Alex Gaynor added the comment: Berker your patch looks good to me. Convert it to a PR and then merge? ---------- nosy: +alex _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 20:18:56 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Fri, 20 Apr 2018 00:18:56 +0000 Subject: [issue33316] PyThread_release_lock always fails Message-ID: <1524183536.18.0.682650639539.issue33316@psf.upfronthosting.co.za> New submission from Ivan Pozdeev : In win7 x64 debug mode with thread_debug=1, every PyThread_release_lock() is accompanied with a message on stderr: Could not PyThread_release_lock() error: 0 ---------- components: Interpreter Core, Windows messages: 315497 nosy: Ivan.Pozdeev, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: PyThread_release_lock always fails type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 20:25:42 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Fri, 20 Apr 2018 00:25:42 +0000 Subject: [issue33316] PyThread_release_lock always fails In-Reply-To: <1524183536.18.0.682650639539.issue33316@psf.upfronthosting.co.za> Message-ID: <1524183942.61.0.682650639539.issue33316@psf.upfronthosting.co.za> Change by Ivan Pozdeev : ---------- keywords: +patch pull_requests: +6237 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 21:51:56 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 20 Apr 2018 01:51:56 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1524189116.22.0.682650639539.issue33283@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- pull_requests: +6238 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 22:04:19 2018 From: report at bugs.python.org (Mark Williams) Date: Fri, 20 Apr 2018 02:04:19 +0000 Subject: [issue991266] Cookie.py does not correctly quote Morsels Message-ID: <1524189859.86.0.682650639539.issue991266@psf.upfronthosting.co.za> Mark Williams added the comment: This patch only quotes the Comment attribute, and the rest of the code only quotes attributes if they're of the expected type. Consider Expires: >>> from http.cookies import SimpleCookie >>> c = SimpleCookie() >>> c['name'] = 'value' >>> c['name']['comment'] = '\n' >>> c['name']['expires'] = 123 >>> c.output() 'Set-Cookie: name=value; Comment="\\012"; expires=Fri, 20 Apr 2018 02:03:13 GMT' >>> c['name']['expires'] = '123; path=.example.invalid' 'Set-Cookie: name=value; Comment="\\012"; expires=123; path=.example.invalid' Here's the offending line: https://github.com/python/cpython/blob/b87c1c92fc93c5733cd3d8606ab2301ca6ba208f/Lib/http/cookies.py#L415 Why not quote all attribute values? ---------- nosy: +Mark.Williams versions: +Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 23:04:19 2018 From: report at bugs.python.org (Berker Peksag) Date: Fri, 20 Apr 2018 03:04:19 +0000 Subject: [issue991266] Cookie.py does not correctly quote Morsels Message-ID: <1524193459.21.0.682650639539.issue991266@psf.upfronthosting.co.za> Berker Peksag added the comment: >>> from http.cookies import SimpleCookie >>> c = SimpleCookie() >>> c['name'] = 'value' >>> c['name']['comment'] = '\n' >>> c['name']['expires'] = '123; path=.example.invalid' 'Set-Cookie: name=value; Comment="\\012"; expires=123; path=.example.invalid' What do you think that the snippet above should return? 'Set-Cookie: name=value; Comment="\\012"; expires=Fri, 20 Apr 2018 02:03:13 GMT; path=.example.invalid' or 'Set-Cookie: name=value; Comment="\\012"; expires=Fri, 20 Apr 2018 02:03:13 GMT; path=".example.invalid"' or 'Set-Cookie: name=value; Comment="\\012"; expires=123; path=".example.invalid"' ? I don't think the path attribute (or all of them) needs to be quoted unconditionally. Looking at https://tools.ietf.org/html/rfc6265#section-4.1.1, it looks like quoting for cookie-value is optional. Is there a use case or examples from other programming languages you can share with us? ---------- versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 19 23:07:18 2018 From: report at bugs.python.org (Alex Gaynor) Date: Fri, 20 Apr 2018 03:07:18 +0000 Subject: [issue991266] Cookie.py does not correctly quote Morsels Message-ID: <1524193638.22.0.682650639539.issue991266@psf.upfronthosting.co.za> Alex Gaynor added the comment: None of the above :-) I'd expect the last one, but with quoting. You should not be able to set fields in a cookie by injection. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 01:41:28 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 20 Apr 2018 05:41:28 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524202888.71.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 397f1b28c4a12e3b3ed59a89599eabc457412649 by Gregory P. Smith in branch 'master': bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) https://github.com/python/cpython/commit/397f1b28c4a12e3b3ed59a89599eabc457412649 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 01:42:39 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 05:42:39 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524202959.03.0.682650639539.issue33312@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6239 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 01:43:28 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 05:43:28 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524203008.07.0.682650639539.issue33312@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6240 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 02:15:04 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Apr 2018 06:15:04 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1524204904.09.0.682650639539.issue33283@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 7a45eb9efb6fffdb4051d1f62b3af4f50c083bf1 by Serhiy Storchaka (Andr?s Delfino) in branch '2.7': bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) (GH-6542) https://github.com/python/cpython/commit/7a45eb9efb6fffdb4051d1f62b3af4f50c083bf1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 02:15:43 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Apr 2018 06:15:43 +0000 Subject: [issue33283] Mention PNG as a supported image format by Tcl/Tk In-Reply-To: <1523802192.37.0.682650639539.issue33283@psf.upfronthosting.co.za> Message-ID: <1524204943.15.0.682650639539.issue33283@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 02:33:11 2018 From: report at bugs.python.org (Florian Weimer) Date: Fri, 20 Apr 2018 06:33:11 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524205991.23.0.682650639539.issue33312@psf.upfronthosting.co.za> Florian Weimer added the comment: Why does the code even need the flexible struct member? If you use the surrounding backing store directly, the aliasing issue disappears if the backing store is untyped memory (if not, you have the aliasing problem with the rest of the struct anyway). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 03:24:42 2018 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Fri, 20 Apr 2018 07:24:42 +0000 Subject: [issue33317] `repr()` of string in NFC and NFD forms does not differ Message-ID: <1524209082.19.0.682650639539.issue33317@psf.upfronthosting.co.za> New submission from Pekka Kl?rck : If I have two strings that look the same but have different Unicode form, it's very hard to see where the problem actually is: >>> a = 'hyv\xe4' >>> b = 'hyva\u0308' >>> print(a) hyv? >>> print(b) hyva? >>> a == b False >>> print(repr(a)) 'hyv?' >>> print(repr(b)) 'hyva?' This affects, for example, test automation frameworks using `repr()` in error reporting. For example, both unittest and pytest report `self.assertEqual('hyv\xe4', 'hyva\u0308')` like this: AssertionError: 'hyv?' != 'hyva?' - hyv? + hyva? Because the NFC form is used by strings by default, I would propose that `repr()` would show the decomposed form if the string is in NFD. In practice I'd like `repr('hyva\0308')` to yield `'hyva\0308'`. ---------- messages: 315504 nosy: pekka.klarck priority: normal severity: normal status: open title: `repr()` of string in NFC and NFD forms does not differ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 03:32:27 2018 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Fri, 20 Apr 2018 07:32:27 +0000 Subject: [issue33317] `repr()` of string in NFC and NFD forms does not differ In-Reply-To: <1524209082.19.0.682650639539.issue33317@psf.upfronthosting.co.za> Message-ID: <1524209547.88.0.682650639539.issue33317@psf.upfronthosting.co.za> Pekka Kl?rck added the comment: Forgot to mention that this doesn't affect Python 2: >>> a = u'hyv\xe4' >>> b = u'hyva\u0308' >>> print(repr(a)) u'hyv\xe4' >>> print(repr(b)) u'hyva\u0308' In addition to hoping `repr()` would be enhanced in future Python 3 versions, I'm also looking for a way how to show differences between strings that look the same but are different. Currently the best I've found is this: >>> print('hyva\u0308'.encode('unicode_escape').decode('ASCII')) hyva\u0308 ---------- versions: +Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 03:54:47 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Apr 2018 07:54:47 +0000 Subject: [issue33317] `repr()` of string in NFC and NFD forms does not differ In-Reply-To: <1524209082.19.0.682650639539.issue33317@psf.upfronthosting.co.za> Message-ID: <1524210887.17.0.682650639539.issue33317@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Use ascii() in Python 3 if you want the behavior of repr() in Python 2. It escapes all non-ascii characters. But escaping only combining characters in addition to non-printable characters in repr() looks an interesting idea. ---------- components: +Interpreter Core, Unicode nosy: +benjamin.peterson, ezio.melotti, lemburg, serhiy.storchaka, vstinner type: -> enhancement versions: +Python 3.8 -Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 04:53:49 2018 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Fri, 20 Apr 2018 08:53:49 +0000 Subject: [issue33317] `repr()` of string in NFC and NFD forms does not differ In-Reply-To: <1524209082.19.0.682650639539.issue33317@psf.upfronthosting.co.za> Message-ID: <1524214429.86.0.682650639539.issue33317@psf.upfronthosting.co.za> Pekka Kl?rck added the comment: Thanks for pointing out `ascii()`. Seems to do exactly what I want. `repr()` showing combining characters would, in my opinion, still be useful to avoid problems like I demonstrated with unittest and pytest. I doubt it's a good idea with them to use `ascii()` instead of `repr()` by default because on Python 3 the latter generally works much better with non-ASCII text. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 08:57:21 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Apr 2018 12:57:21 +0000 Subject: [issue33318] Move folding tuples of constants into compiler.c from peephole.c Message-ID: <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Explicit tuples of constants are folded in the AST optimizer since 3.7. But peephole.c still contains the code for folding tuples of constants, because there are tuples created by the compiler. For example "[1, 2, *a]", "f(1, 2, *a)", "def f(a=1, b=2)" all create a tuple (1, 2). The following PR moves this code from peephole.c into compiler.c. This makes the code a tiny bit clearer, because it works on higher level than a bytecode. An obvious benefit -- the optimization is performed before calculating the depth of the stack, thus it will be more exact. ---------- components: Interpreter Core messages: 315508 nosy: benjamin.peterson, brett.cannon, inada.naoki, ncoghlan, pitrou, rhettinger, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Move folding tuples of constants into compiler.c from peephole.c type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 09:01:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Apr 2018 13:01:28 +0000 Subject: [issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler. In-Reply-To: <1523982101.74.0.682650639539.issue33298@psf.upfronthosting.co.za> Message-ID: <1524229288.03.0.682650639539.issue33298@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset d70c2a6894d80410b6f5a3129d6b1062ea8fd4e4 by Serhiy Storchaka in branch 'master': bpo-33298: Wrap only constants with _PyCode_ConstantKey() in the compiler. (GH-6512) https://github.com/python/cpython/commit/d70c2a6894d80410b6f5a3129d6b1062ea8fd4e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 09:05:14 2018 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Fri, 20 Apr 2018 13:05:14 +0000 Subject: [issue33319] `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe Message-ID: <1524229514.84.0.682650639539.issue33319@psf.upfronthosting.co.za> New submission from Pekka Kl?rck : I'm porting old scripts from Python 2.7 to 3.6 and plan to change `subprocess.call()` to `subprocess.run()` at the same time. When using `call()` I've used `tempfile.TemporaryFile` as stdout because it's documentation has this warning: Note: Do not use stdout=PIPE or stderr=PIPE with this function. The child process will block if it generates enough output to a pipe to fill up the OS pipe buffer as the pipes are not being read from. Interestingly there is no such note in the docs of `run()`, and based on my (possibly inadequate) testing I couldn't get it to hang either. I'm still somewhat worried about using `stdout=PIPE` with it because the docs don't explicitly say it would be safe. I'm especially worried because the docs of `call()` nowadays say that it's equivalent to `run(...).returncode`. If that's the case, then I would expect the warning in `call()` to apply also to `run()`. Or is the warning nowadays outdated altogether? ---------- messages: 315510 nosy: pekka.klarck priority: normal severity: normal status: open title: `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 09:05:37 2018 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Fri, 20 Apr 2018 13:05:37 +0000 Subject: [issue33319] `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe In-Reply-To: <1524229514.84.0.682650639539.issue33319@psf.upfronthosting.co.za> Message-ID: <1524229537.48.0.682650639539.issue33319@psf.upfronthosting.co.za> Change by Pekka Kl?rck : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 09:07:09 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Apr 2018 13:07:09 +0000 Subject: [issue33318] Move folding tuples of constants into compiler.c from peephole.c In-Reply-To: <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za> Message-ID: <1524229629.95.0.682650639539.issue33318@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6241 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 09:08:41 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Apr 2018 13:08:41 +0000 Subject: [issue33298] Wrap only constants with _PyCode_ConstantKey() in the compiler. In-Reply-To: <1523982101.74.0.682650639539.issue33298@psf.upfronthosting.co.za> Message-ID: <1524229721.01.0.682650639539.issue33298@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 10:00:14 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 20 Apr 2018 14:00:14 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1524232814.46.0.682650639539.issue33264@psf.upfronthosting.co.za> Andr?s Delfino added the comment: I believe this issue can be closed, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 10:15:01 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 20 Apr 2018 14:15:01 +0000 Subject: [issue33320] Clarify who can add the "skip issue" label on GitHub Message-ID: <1524233701.12.0.682650639539.issue33320@psf.upfronthosting.co.za> New submission from Andr?s Delfino : IMHO, the wording of https://devguide.python.org/pullrequest/ is somewhat confusing regarding the "skip issue" label. I thought that I (with no commit access) should add the label, but, as far I understand, that is a responsibility of developers with commit access. The PR offers a wording to clarify this. ---------- assignee: docs at python components: Documentation messages: 315512 nosy: adelfino, docs at python priority: normal severity: normal status: open title: Clarify who can add the "skip issue" label on GitHub type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 10:16:55 2018 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 20 Apr 2018 14:16:55 +0000 Subject: [issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO In-Reply-To: <1523487424.62.0.682650639539.issue33264@psf.upfronthosting.co.za> Message-ID: <1524233815.96.0.682650639539.issue33264@psf.upfronthosting.co.za> Senthil Kumaran added the comment: Indeed. Thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 10:18:47 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 20 Apr 2018 14:18:47 +0000 Subject: [issue33320] Clarify who can add the "skip issue" label on GitHub In-Reply-To: <1524233701.12.0.682650639539.issue33320@psf.upfronthosting.co.za> Message-ID: <1524233927.98.0.682650639539.issue33320@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- keywords: +patch pull_requests: +6242 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 10:18:59 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 20 Apr 2018 14:18:59 +0000 Subject: [issue33320] Clarify who can add the "skip issue" label on GitHub In-Reply-To: <1524233701.12.0.682650639539.issue33320@psf.upfronthosting.co.za> Message-ID: <1524233939.94.0.682650639539.issue33320@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- pull_requests: -6242 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 10:19:13 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 20 Apr 2018 14:19:13 +0000 Subject: [issue33320] Clarify who can add the "skip issue" label on GitHub In-Reply-To: <1524233701.12.0.682650639539.issue33320@psf.upfronthosting.co.za> Message-ID: <1524233953.11.0.682650639539.issue33320@psf.upfronthosting.co.za> Andr?s Delfino added the comment: This is the PR: https://github.com/python/devguide/pull/359 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 10:33:06 2018 From: report at bugs.python.org (Xavier de Gaye) Date: Fri, 20 Apr 2018 14:33:06 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1524234786.25.0.682650639539.issue32232@psf.upfronthosting.co.za> Xavier de Gaye added the comment: To answer my own comment in PR 6489 about the interference of the pyconfig.h macros with the build of std lib extension modules, the py_config_macros.py script prints the list of pyconfig.h.in macros that are being used by the standard library extension modules that do not access the interpreter internals. The script prints: errnomodule.c: const So the conclusion is that this is not a problem. ---------- Added file: https://bugs.python.org/file47544/py_config_macros.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 10:58:54 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 20 Apr 2018 14:58:54 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1524236334.78.0.682650639539.issue32232@psf.upfronthosting.co.za> Nick Coghlan added the comment: I also resolved my own puzzlement from the PR comments regarding why _weakrefs.c was fine with being built as a regular extension module: it's because the C level access API for __weakrefs__ is published through the regular C API, not as a core-only internal API. So it wouldn't work if you tried to build it against the stable ABI (since it needs access to object internals), but it's fine without Py_BUILD_CORE. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 11:02:53 2018 From: report at bugs.python.org (Paul Moore) Date: Fri, 20 Apr 2018 15:02:53 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1524236573.14.0.682650639539.issue33131@psf.upfronthosting.co.za> Change by Paul Moore : ---------- keywords: +patch pull_requests: +6243 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 11:03:51 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 20 Apr 2018 15:03:51 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1524236631.39.0.682650639539.issue32232@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 063db62aab4041ac47798e7e48b27b2f2bef21c5 by Nick Coghlan (xdegaye) in branch 'master': bpo-32232: by default, Setup modules are no longer built with -DPy_BUILD_CORE (GH-6489) https://github.com/python/cpython/commit/063db62aab4041ac47798e7e48b27b2f2bef21c5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 11:04:18 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 15:04:18 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1524236658.29.0.682650639539.issue32232@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6244 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 11:17:11 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Fri, 20 Apr 2018 15:17:11 +0000 Subject: [issue33320] Clarify who can add the "skip issue" label on GitHub In-Reply-To: <1524233701.12.0.682650639539.issue33320@psf.upfronthosting.co.za> Message-ID: <1524237431.36.0.682650639539.issue33320@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 11:39:27 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 15:39:27 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1524238767.96.0.682650639539.issue32232@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 18cd82815b9bdeabc5ac03aa7f58102109ccf368 by Miss Islington (bot) in branch '3.7': bpo-32232: by default, Setup modules are no longer built with -DPy_BUILD_CORE (GH-6489) https://github.com/python/cpython/commit/18cd82815b9bdeabc5ac03aa7f58102109ccf368 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 12:16:02 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 20 Apr 2018 16:16:02 +0000 Subject: [issue32232] building extensions as builtins is broken in 3.7 In-Reply-To: <1512565420.17.0.213398074469.issue32232@psf.upfronthosting.co.za> Message-ID: <1524240962.4.0.682650639539.issue32232@psf.upfronthosting.co.za> Nick Coghlan added the comment: Xavier's changes should fix the reported compile error, while keeping the increased isolation of the interpreter core from the optional extension modules. If the latter change causes a detectable performance regression, then I think that would make more sense as a separate performance issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 12:26:16 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 20 Apr 2018 16:26:16 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524241576.53.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: If you think this should be written differently, please propose it in a PR so we can see what you are suggesting. An unbounded member at the end of a struct is quite a common practice in C. ex: PyBytesObject ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 12:28:14 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 20 Apr 2018 16:28:14 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1524241694.62.0.682650639539.issue33277@psf.upfronthosting.co.za> Nick Coghlan added the comment: -1 from me for __package__, as setting that's the preferred way for directly executed scripts to fix their explicit relative imports (rather than trying to retroactively fix their spec). (https://docs.python.org/3/library/importlib.html also doesn't say anything about __package__ being deprecated) I'd be OK with seeing __file__/__cached__/__loader__ get deprecated, but before they went away, I'd like to see "importlib.util.get_filename()", "importlib.util.get_cache_filename()", and "importlib.util.get_loader()" helpers added. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 12:33:08 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 20 Apr 2018 16:33:08 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524241988.82.0.682650639539.issue33312@psf.upfronthosting.co.za> Ned Deily added the comment: Greg, this change has broken some buildbots: http://buildbot.python.org/all/#/builders/85/builds/934 http://buildbot.python.org/all/#/builders/21/builds/951 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 13:06:30 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 20 Apr 2018 17:06:30 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524243990.66.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 392520bd78cd18639a27e5d2803c2e1c2bd593a8 by Gregory P. Smith (Miss Islington (bot)) in branch '3.7': bpo-33312: Fix clang ubsan out of bounds warnings in dict. (GH-6537) (GH-6543) https://github.com/python/cpython/commit/392520bd78cd18639a27e5d2803c2e1c2bd593a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 13:08:03 2018 From: report at bugs.python.org (Jakub Wilk) Date: Fri, 20 Apr 2018 17:08:03 +0000 Subject: [issue21314] Document '/' in signatures In-Reply-To: <1397988439.5.0.703056699862.issue21314@psf.upfronthosting.co.za> Message-ID: <1524244083.29.0.682650639539.issue21314@psf.upfronthosting.co.za> Change by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 13:18:45 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 20 Apr 2018 17:18:45 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524244725.18.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: ned: yes, it supposedly has. test_gdb. in a manner i cannot reproduce or debug without error output that indicates anything about the problem. test_gdb passes on my systems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 13:21:39 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 20 Apr 2018 17:21:39 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524244899.31.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: I see one line in Tools/gdb/libpython.py that may be related. i'll try changing that. the only way i have to _test_ it is to merge it into master. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 13:26:03 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Fri, 20 Apr 2018 17:26:03 +0000 Subject: [issue33319] `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe In-Reply-To: <1524229514.84.0.682650639539.issue33319@psf.upfronthosting.co.za> Message-ID: <1524245163.19.0.682650639539.issue33319@psf.upfronthosting.co.za> Josh Rosenberg added the comment: If the goal is just to suppress stdout, that's what passing subprocess.DEVNULL is for (doesn't exist in Py2, but opening os.devnull and passing that is a slightly higher overhead equivalent). subprocess.run includes a call to communicate as part of its default behavior, and stores its results, so call() isn't quite equivalent to run().returncode when PIPE was passed for standard handles, because call only includes an implicit call to wait, not communicate, and therefore pipes are not explicitly read and can block. Basically, subprocess.run is deadlock-safe (because it uses communicate, not just wait), but if you don't care about the results, and the results might be huge, don't pass it PIPE for stdout/stderr (because it will store the complete outputs in memory, just like any use of communicate with PIPE). The docs effectively tell you PIPE is safe; it returns a CompletedProcess object, and explicitly tells you that it has attributes that are (completely) populated based on whether capture was requested. If it had such attributes and still allowed deadlocks, it would definitely merit a warning. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 13:27:39 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 20 Apr 2018 17:27:39 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524245259.49.0.682650639539.issue33312@psf.upfronthosting.co.za> Change by Gregory P. Smith : ---------- pull_requests: +6245 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 13:38:29 2018 From: report at bugs.python.org (Josh Rosenberg) Date: Fri, 20 Apr 2018 17:38:29 +0000 Subject: [issue33315] Allow queue.Queue to be used in type annotations In-Reply-To: <1524139376.68.0.682650639539.issue33315@psf.upfronthosting.co.za> Message-ID: <1524245909.14.0.682650639539.issue33315@psf.upfronthosting.co.za> Josh Rosenberg added the comment: None of the actual classes outside of the typing module support this either to my knowledge. You can't do: from collections import deque a: deque[int] nor can you do: a: list[int] Adding Queue to the typing module might make sense (feel free to edit it if that's what you're looking for), but unless something has changed in 3.7 (my local install is 3.6.4), it's never been legal to do what you're trying to do with queue.Queue itself with the original type, only with the special typing types that exist for that specific purpose. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 14:32:12 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 20 Apr 2018 18:32:12 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524249132.16.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 53f67d401df40486fd0fb8fbcf9da725cd37290c by Gregory P. Smith in branch 'master': bpo-33312: update Tools/gdb/libpython.py to match. (GH-6548) https://github.com/python/cpython/commit/53f67d401df40486fd0fb8fbcf9da725cd37290c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 14:32:29 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 18:32:29 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524249149.25.0.682650639539.issue33312@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6246 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 15:45:08 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 20 Apr 2018 19:45:08 +0000 Subject: [issue33318] Move folding tuples of constants into compiler.c from peephole.c In-Reply-To: <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za> Message-ID: <1524253508.81.0.682650639539.issue33318@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +0 It looks like there is a small net win. Conceptually, constant folding is better done upstream where more semantic information is available (rather than downstream when the meaning has to be deduced from the opcodes). The only drawback is that if unfolded tuples ever leak out of the AST step or get created by the peephole optimization step, then they won't get fixed-up downstream (as functionality gets moved out of peephole.c, it creates more obligations on the AST code generation step to always produce the best possible code because the finally neatening-up step no longer occurs). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 15:54:44 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Fri, 20 Apr 2018 19:54:44 +0000 Subject: [issue33318] Move folding tuples of constants into compiler.c from peephole.c In-Reply-To: <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za> Message-ID: <1524254084.44.0.682650639539.issue33318@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I'm not convinced by this. One of the points of separating the optimizer from the compiler is that people wanting to study/extend the compiler don't have to filter through optimization-related routines. Separating initial code generation from optimization passes is an established practice in compiler design. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:02:40 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 20 Apr 2018 20:02:40 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524254560.32.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: New changeset 11659d00b9185c8f02ea6b642fa475a80e21f1a9 by Gregory P. Smith (Miss Islington (bot)) in branch '3.7': bpo-33312: update Tools/gdb/libpython.py to match. (GH-6549) https://github.com/python/cpython/commit/11659d00b9185c8f02ea6b642fa475a80e21f1a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:06:54 2018 From: report at bugs.python.org (Paul Moore) Date: Fri, 20 Apr 2018 20:06:54 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1524254814.28.0.682650639539.issue33131@psf.upfronthosting.co.za> Paul Moore added the comment: New changeset 0399cf9b5e370516e3d0aed6a63ff74aff5eadb5 by Paul Moore in branch 'master': bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546) https://github.com/python/cpython/commit/0399cf9b5e370516e3d0aed6a63ff74aff5eadb5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:07:07 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 20:07:07 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1524254827.32.0.682650639539.issue33131@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6247 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:08:02 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 20:08:02 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1524254882.78.0.682650639539.issue33131@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6248 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:15:10 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 20 Apr 2018 20:15:10 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1524255310.22.0.682650639539.issue33131@psf.upfronthosting.co.za> Ned Deily added the comment: Since 2.7 was upgraded, I think 3.6.x should be upgraded to 10.0.x, as well. ---------- versions: +Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:20:53 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 20 Apr 2018 20:20:53 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1524255653.17.0.682650639539.issue33277@psf.upfronthosting.co.za> Raymond Hettinger added the comment: +1 from me. The visual clutter in dir() has proven to be somewhat distracting in introduction-to-python courses. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:22:38 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 20:22:38 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1524255758.5.0.682650639539.issue33131@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6249 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:25:02 2018 From: report at bugs.python.org (Ned Deily) Date: Fri, 20 Apr 2018 20:25:02 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524255902.39.0.682650639539.issue33312@psf.upfronthosting.co.za> Ned Deily added the comment: Thanks, Greg, looking better! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:25:14 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 20 Apr 2018 20:25:14 +0000 Subject: [issue33144] random._randbelow optimization In-Reply-To: <1522076428.25.0.467229070634.issue33144@psf.upfronthosting.co.za> Message-ID: <1524255914.2.0.682650639539.issue33144@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:29:19 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 20 Apr 2018 20:29:19 +0000 Subject: [issue32886] new Boolean ABC in numbers module In-Reply-To: <1519133521.3.0.467229070634.issue32886@psf.upfronthosting.co.za> Message-ID: <1524256159.07.0.682650639539.issue32886@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > If I get you correctly, then the minimal `Boolean` ABC would only need > to contain the `__bool__` method, without the bitwise operations Once reduced to just having `__bool__`, I think there is no value added and would prefer to leave this out. We really don't have to have an ABC for every single type in Python, something that will end-up just being clutter that we have to support in perpetuity. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:47:54 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 20:47:54 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1524257274.09.0.682650639539.issue33131@psf.upfronthosting.co.za> miss-islington added the comment: New changeset b221107d32370670905fefb569b3104748f92afe by Miss Islington (bot) in branch '3.7': bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546) https://github.com/python/cpython/commit/b221107d32370670905fefb569b3104748f92afe ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 16:48:46 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 20:48:46 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1524257326.02.0.682650639539.issue33131@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 4caba7a94024d8af2eed26300f13ff4433dcb05b by Miss Islington (bot) in branch '2.7': bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546) https://github.com/python/cpython/commit/4caba7a94024d8af2eed26300f13ff4433dcb05b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 17:11:25 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 20 Apr 2018 21:11:25 +0000 Subject: [issue33276] Clarify that __path__ can't be set to just anything In-Reply-To: <1523646496.5.0.682650639539.issue33276@psf.upfronthosting.co.za> Message-ID: <1524258685.85.0.682650639539.issue33276@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- keywords: +patch pull_requests: +6250 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 17:15:42 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 20 Apr 2018 21:15:42 +0000 Subject: [issue25427] Remove the pyvenv script in Python 3.8 In-Reply-To: <1445033746.77.0.533143282748.issue25427@psf.upfronthosting.co.za> Message-ID: <1524258942.6.0.682650639539.issue25427@psf.upfronthosting.co.za> Brett Cannon added the comment: New changeset a8c342465b977115b88a4f130833a2fd4c4e7356 by Brett Cannon in branch 'master': bpo-25427: Remove pyvenv (GH-5962) https://github.com/python/cpython/commit/a8c342465b977115b88a4f130833a2fd4c4e7356 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 17:16:07 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 20 Apr 2018 21:16:07 +0000 Subject: [issue25427] Remove the pyvenv script in Python 3.8 In-Reply-To: <1445033746.77.0.533143282748.issue25427@psf.upfronthosting.co.za> Message-ID: <1524258967.23.0.682650639539.issue25427@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- resolution: -> fixed stage: commit review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 17:23:16 2018 From: report at bugs.python.org (Martin Panter) Date: Fri, 20 Apr 2018 21:23:16 +0000 Subject: [issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks In-Reply-To: <1478471671.65.0.611428361622.issue28627@psf.upfronthosting.co.za> Message-ID: <1524259396.96.0.682650639539.issue28627@psf.upfronthosting.co.za> Martin Panter added the comment: This looks like it may be covered by Issue 31940, about the ?shutil.copystat? API. See Anthony?s initial proposal at . Max: I think you need the ?else? branch to reraise the exception if ?errno? doesn?t match. Perhaps a test case would have picked this up. ---------- nosy: +martin.panter superseder: -> copystat on symlinks fails for alpine -- faulty lchmod implementation? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 17:29:51 2018 From: report at bugs.python.org (Berker Peksag) Date: Fri, 20 Apr 2018 21:29:51 +0000 Subject: [issue991266] Cookie.py does not correctly quote Morsels Message-ID: <1524259791.09.0.682650639539.issue991266@psf.upfronthosting.co.za> Change by Berker Peksag : ---------- pull_requests: +6251 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 17:39:33 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 20 Apr 2018 21:39:33 +0000 Subject: [issue33254] Have importlib.resources.contents() return an interable instead of an iterator In-Reply-To: <1523320022.42.0.682650639539.issue33254@psf.upfronthosting.co.za> Message-ID: <1524260373.96.0.682650639539.issue33254@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- title: importlib.resources.contents() incorrectly yields an empty list -> Have importlib.resources.contents() return an interable instead of an iterator _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 18:03:01 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 22:03:01 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1524261781.83.0.682650639539.issue33131@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 47d57bfd3d6ceb08f98fcff14fe3c8bb41ca0664 by Miss Islington (bot) in branch '3.6': bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546) https://github.com/python/cpython/commit/47d57bfd3d6ceb08f98fcff14fe3c8bb41ca0664 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 19:33:43 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 20 Apr 2018 23:33:43 +0000 Subject: [issue33276] Clarify that __path__ can't be set to just anything In-Reply-To: <1523646496.5.0.682650639539.issue33276@psf.upfronthosting.co.za> Message-ID: <1524267223.66.0.682650639539.issue33276@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 19:35:37 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 23:35:37 +0000 Subject: [issue33276] Clarify that __path__ can't be set to just anything In-Reply-To: <1523646496.5.0.682650639539.issue33276@psf.upfronthosting.co.za> Message-ID: <1524267337.47.0.682650639539.issue33276@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6252 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 19:35:47 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Apr 2018 23:35:47 +0000 Subject: [issue33276] Clarify that __path__ can't be set to just anything In-Reply-To: <1523646496.5.0.682650639539.issue33276@psf.upfronthosting.co.za> Message-ID: <1524267347.47.0.682650639539.issue33276@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6253 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 19:48:22 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 20 Apr 2018 23:48:22 +0000 Subject: [issue33321] Add a Linux clang ubsan undefined behavior sanitizer buildbot Message-ID: <1524268101.98.0.682650639539.issue33321@psf.upfronthosting.co.za> New submission from Gregory P. Smith : CPython needs to be regularly built and vetted for C undefined behavior. CFLAGS=-fsanitize=undefined LDFLAGS=-fsanitize=undefined CC=clang LD=clang ./configure is all it takes to start with. if you do this today, test_ctypes will knock your socks off with errors. We should detect this type of build and intentionally skip its tests on ubsan, tracking that with another yet to be filed issue. I'll look into having Google run one. ---------- assignee: gregory.p.smith components: Build keywords: buildbot messages: 315542 nosy: gregory.p.smith priority: normal severity: normal status: open title: Add a Linux clang ubsan undefined behavior sanitizer buildbot type: compile error versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 19:50:31 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 20 Apr 2018 23:50:31 +0000 Subject: [issue33312] ubsan undefined behavior sanitizer flags struct _dictkeysobject (PyDictKeysObj) In-Reply-To: <1524088779.29.0.682650639539.issue33312@psf.upfronthosting.co.za> Message-ID: <1524268231.75.0.682650639539.issue33312@psf.upfronthosting.co.za> Gregory P. Smith added the comment: Sorry for the breakage. I'm glad the fix was that greppable and easy given I had no idea where to start otherwise. :) This is in for 3.7. The PR for 3.6 is pending, i want to let it out in the next 3.7 builds for a while before i merge it into 3.6 even though I've got pretty high confidence at this point. issue33321 filed to track getting an ubsan buildbot setup. Also, thank you Benjamin for your patch and pointing out the strict aliasing issue. so many undefined behaviors. it's a wonder the language even works. :) ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 20:31:15 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Apr 2018 00:31:15 +0000 Subject: [issue33274] minidom removeAttributeNode returns None In-Reply-To: <1523644603.75.0.682650639539.issue33274@psf.upfronthosting.co.za> Message-ID: <1524270675.32.0.682650639539.issue33274@psf.upfronthosting.co.za> Terry J. Reedy added the comment: It is standard in the Python stdlib that mutation methods usually return None and never echo an input argument. If one can pass a node to element.removeAttributeNode(node), there is no need to echo it back. So I suspect that the current behavior is intended. David, is there a general (perhaps unwritten) rule about how Python translates such functions? The other 'remove' methods also default to returning None. Same for the 'set' methods. All methods would need review before changing just one. ---------- nosy: +r.david.murray, terry.reedy type: behavior -> enhancement versions: -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 20:36:55 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Apr 2018 00:36:55 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: <1524271015.6.0.682650639539.issue33275@psf.upfronthosting.co.za> Terry J. Reedy added the comment: How about adding a sentence to the end of the first paragraph. glob.glob(pathname, *, recursive=False) Return a possibly-empty list of path names that match pathname, which must be a string containing a path specification. pathname can be either absolute (like /usr/src/Python-1.5/Makefile) or relative (like ../../Tools/*/*.gif), and can contain shell-style wildcards. Broken symlinks are included in the results (as in the shell). Whether or not the results are sorted depends on the file system. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 21:17:50 2018 From: report at bugs.python.org (Ari Krupnik) Date: Sat, 21 Apr 2018 01:17:50 +0000 Subject: [issue33274] minidom removeAttributeNode returns None In-Reply-To: <1523644603.75.0.682650639539.issue33274@psf.upfronthosting.co.za> Message-ID: <1524273470.31.0.682650639539.issue33274@psf.upfronthosting.co.za> Ari Krupnik added the comment: I guess the main question if whether minidom wants to adhere to the standard or be pythonic, and it's not up to me to decide, although personally I like standards. The common use case for DOM functions returning the relevant nodes is for the caller to chain calls, e.g., e1.setAttributeNode(e0.removeAttributeNode(e0.getAttributeNode("a"))) instead of a=e0.getAttributeNode("foo") e0.removeAttributeNode(a) e1.setAttributeNode(a) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 22:20:45 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Apr 2018 02:20:45 +0000 Subject: [issue33284] Increase test coverage for numbers.py In-Reply-To: <1523816095.6.0.682650639539.issue33284@psf.upfronthosting.co.za> Message-ID: <1524277245.2.0.682650639539.issue33284@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Barry, thank you for your first submission. You propose to test numbers.Complex.__bool__ def __bool__(self): """True if self != 0. Called for bool(self).""" return self != 0 by adding the following to Lib/test/test_abstract_numbers. + self.assertFalse(bool(complex(0,0))) + self.assertTrue(bool(complex(1,2))) I believe that this particular addition should be rejected. It is a concrete test of the builtin complex that partially duplicates the following in test_complex. def test_boolcontext(self): for i in range(100): self.assertTrue(complex(random() + 1e-6, random() + 1e-6)) self.assertTrue(not complex(0.0, 0.0)) Looking the tests of collections.abc in test_collections, I believe a proper test should define a subclass of Complex (in Python), with at least __init__ and __eq__ methods and test instances of *that*. If I were to review a patch, I would like to see a more extensive addition, one that imports test_collections.ABCTestCase (or copies and adapts the same) and uses it to test a much fuller implementation of Complex. As it is, none of the numbers abc class methods are tested. Raymond, were you involved with the abc tests? Either way, what do you think? ---------- nosy: +rhettinger, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 22:21:11 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Apr 2018 02:21:11 +0000 Subject: [issue33284] Increase test coverage for numbers.py In-Reply-To: <1523816095.6.0.682650639539.issue33284@psf.upfronthosting.co.za> Message-ID: <1524277271.01.0.682650639539.issue33284@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- stage: patch review -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 23:24:52 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Apr 2018 03:24:52 +0000 Subject: [issue33289] tkinter askcolor returning floats for r, g, b values instead of ints In-Reply-To: <1523915381.82.0.682650639539.issue33289@psf.upfronthosting.co.za> Message-ID: <1524281092.48.0.682650639539.issue33289@psf.upfronthosting.co.za> Terry J. Reedy added the comment: For future reference, 3.4 and 3.5 only get security fixes. The quoted line of code is from the main part of tkinter.colorchooser,Chooser._fixresult: r, g, b = widget.winfo_rgb(result) return (r/256, g/256, b/256), str(result) where tkinter.Misc defines def winfo_rgb(self, color): """Return tuple of decimal values for red, green, blue for COLOR in this widget.""" return self._getints( self.tk.call('winfo', 'rgb', self._w, color)) The code in tkColorChooser and Tkinter in 2.x is the same. The docstring for winfo_rgb is wrong as it returns a tuple of ints in range(2**16256). For red, the results are >>> Tk().winfo_rgb('red') (65535, 0, 0) # 2.x and 3.x >>> cc.askcolor('red') ((255, 0, 0), '#ff0000') # 2.7 >>> cc.askcolor('red') ((255.99609375, 0.0, 0.0), '#ff0000') # 3.8 In addition to fixing the winfo_rgb docstring (in all versions), and adding doc strings to colorchooser, it seems that '/' should be '//' in 3.x. I don't know if I would fix this in 3.6. ---------- nosy: +serhiy.storchaka, terry.reedy title: askcolor is returning floats for r,g,b values instead of ints -> tkinter askcolor returning floats for r,g,b values instead of ints type: -> behavior versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 23:27:48 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Apr 2018 03:27:48 +0000 Subject: [issue33303] ElementTree Comment text isn't escaped In-Reply-To: <1524011592.66.0.682650639539.issue33303@psf.upfronthosting.co.za> Message-ID: <1524281268.71.0.682650639539.issue33303@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- versions: -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 20 23:30:56 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Apr 2018 03:30:56 +0000 Subject: [issue33309] Unittest Mock objects do not freeze arguments they are called with In-Reply-To: <1524066784.49.0.682650639539.issue33309@psf.upfronthosting.co.za> Message-ID: <1524281456.01.0.682650639539.issue33309@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- nosy: +ezio.melotti, michael.foord, rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 00:58:22 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 21 Apr 2018 04:58:22 +0000 Subject: [issue33131] Upgrade to pip 10 for Python 3.7 In-Reply-To: <1521876461.03.0.467229070634.issue33131@psf.upfronthosting.co.za> Message-ID: <1524286702.95.0.682650639539.issue33131@psf.upfronthosting.co.za> Change by Nick Coghlan : ---------- assignee: -> paul.moore resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 01:29:52 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 21 Apr 2018 05:29:52 +0000 Subject: [issue33318] Move folding tuples of constants into compiler.c from peephole.c In-Reply-To: <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za> Message-ID: <1524288592.19.0.682650639539.issue33318@psf.upfronthosting.co.za> Nick Coghlan added the comment: If I recall Eugene Toder's previous AST-level compilation patches correctly, they handle this problem by putting the AST optimisation step *after* the output of the Py_CF_ONLY_AST step. This meant that if you're running the source->AST step explicitly, you still get the original unoptimised AST out, which is what you actually want for a lot of source-code-analysis-or-manipulation related use cases. The optimisation steps then all remained in the "AST -> executable opcodes" phase, they were just structured a bit differently due to the addition of an extra step (AST -> optimised AST -> executable opcodes -> optimised opcodes). This is more work initially (since it involves building out a completely new compiler pass for the "AST -> optimised AST" step), but means that: * existing source->AST use cases are unaffected by the compiler change * existing AST->opcode use cases continue to benefit from all of the optimisation passes, regardless of whether those optimisations are applied at the AST or opcode level ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 01:52:46 2018 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 21 Apr 2018 05:52:46 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1524289966.8.0.682650639539.issue33277@psf.upfronthosting.co.za> Nick Coghlan added the comment: As a concrete proposal for 3.8, how about: 1. Add the following utility functions to importlib.util (names adjusted to match PEP 451 rather than my initial suggestions above): def get_location(module): try: return module.__file__ except AttributeError: pass spec = module.__spec__ if spec.has_location: return spec.origin return None def get_cached_location(module): try: return module.__cached__ except AttributeError: pass spec = module.__spec__ if spec.has_location: return spec.cached return None def get_loader(module): try: return module.__loader__ except AttributeError: pass return module.__spec__.loader 2. Explicitly make __file__/__cached__/__loader__ optional, and require 3rd party tools to use the relevant `importlib.util.get_*` APIs when they're defined rather than accessing the dunder-attributes directly. I think those 3 are clear, but the right API for replacing direct access to __package__ is less clear, since there are two cases for querying the package name: whether you want actual packages to return their own name, or whether you want the name of their parent. If we decide the relevant use case is "get the base package name for relative imports", then the following helper API may work: def get_base_package_name(module): """Get the package name to pass to resolve_name() for this module""" try: return module.__package__ except AttributeError: pass modname = module.__name__ try: path = module.__path__ except AttributeError: pass else: return modname return module.__spec__.parent ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 02:47:32 2018 From: report at bugs.python.org (Jacob Thalman) Date: Sat, 21 Apr 2018 06:47:32 +0000 Subject: [issue33322] Overridden __getitem__ not called on use of slice syntax when inheriting from tuple Message-ID: <1524293252.15.0.682650639539.issue33322@psf.upfronthosting.co.za> New submission from Jacob Thalman : class MyTuple(tuple): def __getitem__(self, item): print "Getting {}".format(item) t = MyTuple((1, 2)) t[0] -> "Getting 0" t[1] -> "Getting 1" t[slice(None)] -> "Getting slice(None, None, None)" t[:] -> (1, 2) t[slice(None, 1)] -> "Getting slice(None, 1, None)" t[:1] -> (1,) Overriding __getattribute__ confirms that the overridden __getitem__ is never called when syntactic slice syntax is used. ---------- messages: 315551 nosy: jpthalman priority: normal severity: normal status: open title: Overridden __getitem__ not called on use of slice syntax when inheriting from tuple type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 03:17:10 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 07:17:10 +0000 Subject: [issue33318] Move folding tuples of constants into compiler.c from peephole.c In-Reply-To: <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za> Message-ID: <1524295030.97.0.682650639539.issue33318@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: For clarifying, this issue doesn't have any relations to the AST optimizer. Tuples of constants are already optimized at the AST level, but there are other tuples created in code, which don't correspond any AST node. They are worth to be optimized too. That is why we need (and have) two codes for folding tuples of constants -- at high level (in AST) and at low level (in generated bytecode). Different kinds of optimizations can be applied at different stages. 1. On AST. Optimizations applied here are: constant folding (evaluating expressions with unary and binary operators and subscriptions on constants and folding tuples of constants), constant propagation of __debug__, converting "in list/set" into "in tuple/frozenset". 2. At code generation stage. Optimizations applied here are: some special cases for "if" and "while" with a constant condition, optimizing short-circuit jumps in complex boolean expressions, avoiding generating some code (like for "if" without "else"), special case for literal dicts with constant keys, merging equal constants and names. 3. On generated intermediate representation of bytecode (a graph of sequences of instructions). Some unreachable code is eliminated here. 4. On raw bytecode (in peephole.c). Optimizations applied here are: other special cases for "if" and "while" with a constant condition, folding tuples of constants created at code generation stage, special cases for multitarget assignments (1-3 targets), optimizing more short-circuit jumps in complex boolean expressions, replacing jumps to unconditional jumps, removing unreachable code after RETURN_VALUE. 5. In the code object constructor (it is applied also when unmarshal code). Names and identifier-like string constants (including nested in tuples and frozensets) are interned here. PR 6545 moves a particular optimization from stage 4 to stage 3 (to a tiny bit higher level). Issue32477 moves other 2 or 3 optimizations from stage 4 to stage 3. It is possible to move this particular optimization even to stage 2, but I'm not sure that mixing code generation with optimization would look better. At stage 3 it is more isolated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 03:21:09 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 21 Apr 2018 07:21:09 +0000 Subject: [issue33322] Overridden __getitem__ not called on use of slice syntax when inheriting from tuple In-Reply-To: <1524293252.15.0.682650639539.issue33322@psf.upfronthosting.co.za> Message-ID: <1524295269.96.0.682650639539.issue33322@psf.upfronthosting.co.za> Steven D'Aprano added the comment: In Python 2, you have to override __getslice__ as well as __getitem__. Try this instead: class MyTuple(tuple): def __getitem__(self, pos): print "get item {}".format(pos) return super(MyTuple, self).__getitem__(pos) def __getslice__(self, *args): print "get slice {}".format(args) return super(MyTuple, self).__getslice__(*args) I don't believe this is a bug. If you try with the above fix, and still believe there is a bug, please feel free to re-open the issue. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 03:23:10 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 07:23:10 +0000 Subject: [issue33322] Overridden __getitem__ not called on use of slice syntax when inheriting from tuple In-Reply-To: <1524293252.15.0.682650639539.issue33322@psf.upfronthosting.co.za> Message-ID: <1524295390.97.0.682650639539.issue33322@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In Python 2 things are more complex than in Python 3. You have to define __getslice__ for handling the case of literal slices. This was fixed in Python 3. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 03:35:56 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 07:35:56 +0000 Subject: [issue33289] tkinter askcolor returning floats for r, g, b values instead of ints In-Reply-To: <1523915381.82.0.682650639539.issue33289@psf.upfronthosting.co.za> Message-ID: <1524296156.31.0.682650639539.issue33289@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Good catch! A color tuple will likely be used in '#%02x%02x%02x' % color, and this will fail because %x works only with integers (in general sense). Therefore returning a tuple of floats is a bug. The downside is that we loss some information. Tk supports up to 16 bit per color component, and askcolor() keeps only higher 8 of them. This can't be changed for backward compatibility, but it may be worth to add an option for control the representation of the result. winfo_rgb() returns 16-bit color components. This is a separate issue. ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 03:36:05 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 07:36:05 +0000 Subject: [issue33289] tkinter askcolor returning floats for r, g, b values instead of ints In-Reply-To: <1523915381.82.0.682650639539.issue33289@psf.upfronthosting.co.za> Message-ID: <1524296165.1.0.682650639539.issue33289@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 03:55:23 2018 From: report at bugs.python.org (Xiang Zhang) Date: Sat, 21 Apr 2018 07:55:23 +0000 Subject: [issue32799] returned a result with an error set In-Reply-To: <1518103707.85.0.467229070634.issue32799@psf.upfronthosting.co.za> Message-ID: <1524297323.91.0.682650639539.issue32799@psf.upfronthosting.co.za> Xiang Zhang added the comment: Our application also runs into this error today and this is an occasional error that we didn't encounter before and can't reproduce currently. Although our application uses the outdated 2.7.5 but the problem looks similar. Our exception traceback points to `PyCell_Get`: ... RROR nova.api.openstack File "/opt/cloud/services/cascading-nova/venv/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py", line 222, in get RROR nova.api.openstack with self._cache_pool.reserve() as cache: RROR nova.api.openstack File "/usr/lib64/python2.7/contextlib.py", line 84, in helper RROR nova.api.openstack return GeneratorContextManager(func(*args, **kwds)) RROR nova.api.openstack SystemError: /home/abuild/rpmbuild/BUILD/Python-2.7.5/Objects/cellobject.c:24: bad argument to internal function ---------- nosy: +xiang.zhang resolution: works for me -> stage: resolved -> status: closed -> open versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 04:57:32 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 08:57:32 +0000 Subject: [issue13940] imaplib: Mailbox names are not quoted In-Reply-To: <1328357098.01.0.78801274991.issue13940@psf.upfronthosting.co.za> Message-ID: <1524301052.29.0.682650639539.issue13940@psf.upfronthosting.co.za> Change by Matej Cepl : ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 05:01:04 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 09:01:04 +0000 Subject: [issue5305] imaplib should support international mailbox names In-Reply-To: <1234935371.11.0.35650041724.issue5305@psf.upfronthosting.co.za> Message-ID: <1524301264.62.0.682650639539.issue5305@psf.upfronthosting.co.za> Change by Matej Cepl : ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 05:07:12 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 09:07:12 +0000 Subject: [issue18280] Documentation is too personalized In-Reply-To: <1371889714.5.0.753258621658.issue18280@psf.upfronthosting.co.za> Message-ID: <1524301632.29.0.682650639539.issue18280@psf.upfronthosting.co.za> Matej Cepl added the comment: What about WONTFIX here? I completely agree with rhettinger: this is a waste of time with potential for causing damage. ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 05:10:30 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 09:10:30 +0000 Subject: [issue26375] Python 2.7.10 and 3.4.4 hang on imaplib.IMAP4_SSL() In-Reply-To: <1455716357.67.0.858374272161.issue26375@psf.upfronthosting.co.za> Message-ID: <1524301830.01.0.682650639539.issue26375@psf.upfronthosting.co.za> Matej Cepl added the comment: Are you able to reproduce it with IMAP4.debug value set to 3 or more? Clean up passwords etc. and paste the log here, please. Thank you. ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 05:12:51 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 09:12:51 +0000 Subject: [issue18540] imaplib.IMAP4() ends with "Name or service not known" on Fedora 18 In-Reply-To: <1374657571.18.0.17831195671.issue18540@psf.upfronthosting.co.za> Message-ID: <1524301971.51.0.682650639539.issue18540@psf.upfronthosting.co.za> Matej Cepl added the comment: ping? ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 05:14:32 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 09:14:32 +0000 Subject: [issue24027] IMAP library lacks documentation about expected parameter types In-Reply-To: <1429715983.31.0.608966950375.issue24027@psf.upfronthosting.co.za> Message-ID: <1524302072.77.0.682650639539.issue24027@psf.upfronthosting.co.za> Matej Cepl added the comment: UTF-7 is tackled in https://bugs.python.org/issue5305 ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 06:53:20 2018 From: report at bugs.python.org (Naris R) Date: Sat, 21 Apr 2018 10:53:20 +0000 Subject: [issue33323] inconsistent stack trace for exceptions thrown in generators passed to min/max Message-ID: <1524308000.84.0.682650639539.issue33323@psf.upfronthosting.co.za> New submission from Naris R : if a generator passed to min/max throws an exception, the stack trace is normally shown on the line that caused the exception, but if the exception is a StopIteration, the trace only shows the line where the max/min function was called. I was writing a minimax and alphabeta search with generator expression and list comprehension and accidentally passed an empty iterator to the next function while computing states for minimax and it took a very long time to find out where the error was actually caused. ---------- messages: 315561 nosy: Naris R priority: normal severity: normal status: open title: inconsistent stack trace for exceptions thrown in generators passed to min/max type: behavior versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 07:50:02 2018 From: report at bugs.python.org (Alfonso Chavez) Date: Sat, 21 Apr 2018 11:50:02 +0000 Subject: [issue33324] Bug in documentation 3.6: string-methods - str.center Message-ID: <1524311402.18.0.682650639539.issue33324@psf.upfronthosting.co.za> New submission from Alfonso Chavez : Hi. In https://docs.python.org/3/library/stdtypes.html#string-methods says: str.center(width[, fillchar]) But, I tried in Windows 10 and Ubuntu Server: >>> var = 'Variable de prueba' >>> str.center(50, var) Traceback (most recent call last): File "", line 1, in TypeError: descriptor 'center' requires a 'str' object but received a 'int' Then, I tried this: >>> str.center(var, 50) ' Variable de prueba ' I think the documentation should read: str.center(fillchar[, width]) Version in Windows: Python 3.6.5 Version in Ubuntu Server: Python 3.5.2 ---------- assignee: docs at python components: Documentation messages: 315562 nosy: Alfonso Chavez, docs at python priority: normal severity: normal status: open title: Bug in documentation 3.6: string-methods - str.center type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 07:55:21 2018 From: report at bugs.python.org (Alfonso Chavez) Date: Sat, 21 Apr 2018 11:55:21 +0000 Subject: [issue33324] Bug in documentation 3.6: string-methods - str.center In-Reply-To: <1524311402.18.0.682650639539.issue33324@psf.upfronthosting.co.za> Message-ID: <1524311721.13.0.682650639539.issue33324@psf.upfronthosting.co.za> Change by Alfonso Chavez : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 08:09:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 12:09:20 +0000 Subject: [issue33325] Optimize sequences of constants in the compiler Message-ID: <1524312560.56.0.682650639539.issue33325@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The following PR makes three optimizations in the compiler. 1. A sequence of several LOAD_CONSTs is replaced with a single LOAD_CONST followed by UNPACK_SEQUENCE. For example, "{'a': 1, 'b': 2, 'c': 3}" is currently compiled to 1 0 LOAD_CONST 0 (1) 2 LOAD_CONST 1 (2) 4 LOAD_CONST 2 (3) 6 LOAD_CONST 3 (('a', 'b', 'c')) 8 BUILD_CONST_KEY_MAP 3 10 POP_TOP 12 LOAD_CONST 4 (None) 14 RETURN_VALUE With this optimization it will be compiled to: 1 0 LOAD_CONST 5 ((('a', 'b', 'c'), 3, 2, 1)) 2 UNPACK_SEQUENCE 4 4 BUILD_CONST_KEY_MAP 3 6 POP_TOP 8 LOAD_CONST 4 (None) 10 RETURN_VALUE 2. Optimized building lists and sets of constants. [1, 2, 3, 4, 5] will be compiled to [*(1, 2, 3, 4, 5)], and {1, 2, 3, 4, 5} will be compiled to {*frozenset(1, 2, 3, 4, 5)}, where (1, 2, 3, 4, 5) and frozenset(1, 2, 3, 4, 5) are just constants. x = [1, 2, 3, 4, 5] y = {1, 2, 3, 4, 5} currently is compiled to 1 0 LOAD_CONST 0 (1) 2 LOAD_CONST 1 (2) 4 LOAD_CONST 2 (3) 6 LOAD_CONST 3 (4) 8 LOAD_CONST 4 (5) 10 BUILD_LIST 5 12 STORE_NAME 0 (x) 2 14 LOAD_CONST 0 (1) 16 LOAD_CONST 1 (2) 18 LOAD_CONST 2 (3) 20 LOAD_CONST 3 (4) 22 LOAD_CONST 4 (5) 24 BUILD_SET 5 26 STORE_NAME 1 (y) 28 LOAD_CONST 5 (None) 30 RETURN_VALUE With optimization 1 it will be compiled to 1 0 LOAD_CONST 6 ((5, 4, 3, 2, 1)) 2 UNPACK_SEQUENCE 5 4 BUILD_LIST 5 6 STORE_NAME 0 (x) 2 8 LOAD_CONST 6 ((5, 4, 3, 2, 1)) 10 UNPACK_SEQUENCE 5 12 BUILD_SET 5 14 STORE_NAME 1 (y) 16 LOAD_CONST 5 (None) 18 RETURN_VALUE And with optimization 2 it will be compiled to 1 0 LOAD_CONST 0 ((1, 2, 3, 4, 5)) 2 BUILD_LIST_UNPACK 1 4 STORE_NAME 0 (x) 2 6 LOAD_CONST 1 (frozenset({1, 2, 3, 4, 5})) 8 BUILD_SET_UNPACK 1 10 STORE_NAME 1 (y) 12 LOAD_CONST 2 (None) 14 RETURN_VALUE 3. Remove unused constants. After folding tuples of constants created at code generation level, eliminating unreachable code, and after the above two optimizations, unused constants are left in the co_consts tuple. The third optimization removes them and reenumerate constants in the order of occurrence. The above example will be compiled to: 1 0 LOAD_CONST 0 ((1, 2, 3, 4, 5)) 2 BUILD_LIST_UNPACK 1 4 STORE_NAME 0 (x) 2 6 LOAD_CONST 1 (frozenset({1, 2, 3, 4, 5})) 8 BUILD_SET_UNPACK 1 10 STORE_NAME 1 (y) 12 LOAD_CONST 2 (None) 14 RETURN_VALUE See issue28813 for the implementation of this optimization on the level of raw bytecode (in peephole.c). These optimizations are useful not only for initializing collections of constants. Calling function with constant arguments "f(x, a=1, b=2)": Current: 1 0 LOAD_NAME 0 (f) 2 LOAD_NAME 1 (x) 4 LOAD_CONST 0 (None) 6 LOAD_CONST 1 (1) 8 LOAD_CONST 2 (2) 10 LOAD_CONST 3 (('a', 'b')) 12 CALL_FUNCTION_KW 4 14 POP_TOP 16 LOAD_CONST 0 (None) 18 RETURN_VALUE Optimized: 1 0 LOAD_NAME 0 (f) 2 LOAD_NAME 1 (x) 4 LOAD_CONST 0 ((('a', 'b'), 2, 1, None)) 6 UNPACK_SEQUENCE 4 8 CALL_FUNCTION_KW 4 10 POP_TOP 12 LOAD_CONST 1 (None) 14 RETURN_VALUE This issue depends on issue33318. ---------- components: Interpreter Core messages: 315563 nosy: benjamin.peterson, brett.cannon, inada.naoki, ncoghlan, pitrou, rhettinger, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Optimize sequences of constants in the compiler type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 08:14:13 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 12:14:13 +0000 Subject: [issue33325] Optimize sequences of constants in the compiler In-Reply-To: <1524312560.56.0.682650639539.issue33325@psf.upfronthosting.co.za> Message-ID: <1524312853.31.0.682650639539.issue33325@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6254 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 08:17:32 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 12:17:32 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1524313052.09.0.682650639539.issue33297@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b81ca28b378c8b29204a37f8bd433a3379f53f7d by Serhiy Storchaka (Andr?s Delfino) in branch 'master': bpo-33297: Mention Pillow to work with more image formats. (#6505) https://github.com/python/cpython/commit/b81ca28b378c8b29204a37f8bd433a3379f53f7d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 08:17:47 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Apr 2018 12:17:47 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1524313067.39.0.682650639539.issue33297@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6255 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 08:18:36 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Apr 2018 12:18:36 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1524313116.05.0.682650639539.issue33297@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6256 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 09:03:58 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Apr 2018 13:03:58 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1524315838.65.0.682650639539.issue33297@psf.upfronthosting.co.za> miss-islington added the comment: New changeset f9005030fee6af333fada014da3eb0144078779f by Miss Islington (bot) in branch '3.7': bpo-33297: Mention Pillow to work with more image formats. (GH-6505) https://github.com/python/cpython/commit/f9005030fee6af333fada014da3eb0144078779f ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 09:04:10 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Apr 2018 13:04:10 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1524315850.61.0.682650639539.issue33297@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 5c0a8bb1c2c8d77c4b2d5002259d08fe6a277b40 by Miss Islington (bot) in branch '3.6': bpo-33297: Mention Pillow to work with more image formats. (GH-6505) https://github.com/python/cpython/commit/5c0a8bb1c2c8d77c4b2d5002259d08fe6a277b40 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 09:05:33 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 21 Apr 2018 13:05:33 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1524315933.93.0.682650639539.issue33297@psf.upfronthosting.co.za> Andr?s Delfino added the comment: Currently cherry picking the commit for 2.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 09:06:31 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 13:06:31 +0000 Subject: [issue33323] inconsistent stack trace for exceptions thrown in generators passed to min/max In-Reply-To: <1524308000.84.0.682650639539.issue33323@psf.upfronthosting.co.za> Message-ID: <1524315991.18.0.682650639539.issue33323@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Could you please provide a sample code? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 09:19:47 2018 From: report at bugs.python.org (Naris R) Date: Sat, 21 Apr 2018 13:19:47 +0000 Subject: [issue33323] inconsistent stack trace for exceptions thrown in generators passed to min/max In-Reply-To: <1524308000.84.0.682650639539.issue33323@psf.upfronthosting.co.za> Message-ID: <1524316787.66.0.682650639539.issue33323@psf.upfronthosting.co.za> Naris R added the comment: This is a little bit contrived but it demonstrates the problem. ``` def good_exception(): raise Exception('something bad happened') def bad_exception(): return next(iter([])) def good(n): return good_exception() + n def bad(n): return n - bad_exception() import traceback try: max(good(i) for i in range(4)) # desirable behaviour except: traceback.print_exc() try: min(bad(i) for i in range(7)) # unhelpful error message except: traceback.print_exc() ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 10:06:39 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 21 Apr 2018 14:06:39 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1524319599.53.0.682650639539.issue33297@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- pull_requests: +6257 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 10:35:54 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 14:35:54 +0000 Subject: [issue33144] random._randbelow optimization In-Reply-To: <1522076428.25.0.467229070634.issue33144@psf.upfronthosting.co.za> Message-ID: <1524321354.46.0.682650639539.issue33144@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6258 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 10:45:25 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 14:45:25 +0000 Subject: [issue33144] random._randbelow optimization In-Reply-To: <1522076428.25.0.467229070634.issue33144@psf.upfronthosting.co.za> Message-ID: <1524321925.88.0.682650639539.issue33144@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 6291 didn't work properly with case 1. Rand2 uses getrandbits() since it is overridden in the parent despites the fact that random() is defined later. PR 6563 fixes this. It walks classes in method resolution order and finds the first class that defines random() or getrandbits(). PR 6563 also makes tests not using logging for testing purpose. ---------- resolution: fixed -> stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 10:48:34 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 21 Apr 2018 14:48:34 +0000 Subject: [issue33144] random._randbelow optimization In-Reply-To: <1522076428.25.0.467229070634.issue33144@psf.upfronthosting.co.za> Message-ID: <1524322114.64.0.682650639539.issue33144@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: rhettinger -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 11:19:08 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 15:19:08 +0000 Subject: [issue33323] inconsistent stack trace for exceptions thrown in generators passed to min/max In-Reply-To: <1524308000.84.0.682650639539.issue33323@psf.upfronthosting.co.za> Message-ID: <1524323948.34.0.682650639539.issue33323@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In Python 2.7 and 3.6 I got the following traceback for the second case: Traceback (most recent call last): File "issue33323.py", line 21, in min(bad(i) for i in range(7)) # unhelpful error message ValueError: max() arg is an empty sequence StopIteration in generator expressions didn't treated as an error. It just stopped the iteration. The exception is raised by the consumer of generated values, min(), because it doesn't work with empty sequences by default. This behavior caused hard to investigate bugs and was considered harmful. Fortunately it will be fixed in Python 3.7. The traceback in 3.7: Traceback (most recent call last): File "issue33323.py", line 21, in min(bad(i) for i in range(7)) # unhelpful error message File "issue33323.py", line 11, in bad return n - bad_exception() File "issue33323.py", line 5, in bad_exception return next(iter([])) StopIteration The above exception was the direct cause of the following exception: Traceback (most recent call last): File "issue33323.py", line 21, in min(bad(i) for i in range(7)) # unhelpful error message RuntimeError: generator raised StopIteration You can enable this behavior in earlier versions (3.5+) by adding the future import: from __future__ import generator_stop See PEP 479 for details. ---------- components: +Interpreter Core resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 12:06:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 16:06:49 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1524326809.02.0.682650639539.issue33297@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b9827b762093f2b295934bed755b4de0049b1f15 by Serhiy Storchaka (Andr?s Delfino) in branch '2.7': [2.7] bpo-33297: Mention Pillow to work with more image formats. (GH-6505) (GH-6562) https://github.com/python/cpython/commit/b9827b762093f2b295934bed755b4de0049b1f15 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 12:08:06 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Apr 2018 16:08:06 +0000 Subject: [issue33297] Mention Pillow package on tkinter.rst to work with more image formats In-Reply-To: <1523963526.08.0.682650639539.issue33297@psf.upfronthosting.co.za> Message-ID: <1524326886.11.0.682650639539.issue33297@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 14:23:55 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 18:23:55 +0000 Subject: [issue18921] In imaplib, cached capabilities may be out of date after login In-Reply-To: <1378304850.85.0.68028293284.issue18921@psf.upfronthosting.co.za> Message-ID: <1524335035.33.0.682650639539.issue18921@psf.upfronthosting.co.za> Matej Cepl added the comment: Well, and would it be too much to refresh capabilities attribute in the end of login method? ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 14:31:58 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 18:31:58 +0000 Subject: [issue28320] Hostname validation is False by default in imaplib In-Reply-To: <1475269182.78.0.632593451926.issue28320@psf.upfronthosting.co.za> Message-ID: <1524335518.09.0.682650639539.issue28320@psf.upfronthosting.co.za> Matej Cepl added the comment: I do agree with http://legacy.python.org/dev/peps/pep-0476/#other-protocols: This PEP only proposes requiring this level of validation for HTTP clients, not for other protocols such as SMTP. This is because while a high percentage of HTTPS servers have correct certificates, as a result of the validation performed by browsers, for other protocols self-signed or otherwise incorrect certificates are far more common. With HTTP (and thanks to Let?s Encrypt) the situation seems to be really good, and most publicly accessible webserver will hopefully have soon good signed certificates, but I am afraid that with other servers (and especially but certainly not limited to IMAP servers) there are just too many self-signed certificates (or ones signed by suspicious internal CAs) in various internal email servers, that changing defaults would do more harm than good, I am afraid. Also, arguing about defaults is the way of The Waste of Time, so I will try to limit myself just to this one comment on this bug. ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 14:33:35 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 18:33:35 +0000 Subject: [issue5430] imaplib: must not replace LF or CR by CRLF in literals In-Reply-To: <1236325877.36.0.637700625895.issue5430@psf.upfronthosting.co.za> Message-ID: <1524335615.95.0.682650639539.issue5430@psf.upfronthosting.co.za> Matej Cepl added the comment: > Module imaplib has pretty sparse test code. On that note: would anybody be willing to express in form of (simplified) test case, what's the problem reported here? I am not sure, I follow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 14:52:42 2018 From: report at bugs.python.org (Kirill Balunov) Date: Sat, 21 Apr 2018 18:52:42 +0000 Subject: [issue33326] Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type Message-ID: <1524336762.03.0.682650639539.issue33326@psf.upfronthosting.co.za> New submission from Kirill Balunov : The opcode module contains several collections: `cmp_op` `hasconst` `hasname` `hasjrel` ... which are only used for `in` checks. At the same time, they are stored as `list`s and `cmp_op` as tuple. Both these types are not optimal for `__contains__` checks. Maybe it is worth at least to convert them to `frozenset` type after they are filled? ---------- components: Library (Lib) messages: 315576 nosy: godaygo priority: normal severity: normal status: open title: Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type type: performance versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 14:53:37 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 18:53:37 +0000 Subject: [issue5430] imaplib: must not replace LF or CR by CRLF in literals In-Reply-To: <1236325877.36.0.637700625895.issue5430@psf.upfronthosting.co.za> Message-ID: <1524336817.01.0.682650639539.issue5430@psf.upfronthosting.co.za> Matej Cepl added the comment: Oh, this is 2.6 bug. This should be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 15:10:03 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 19:10:03 +0000 Subject: [issue33327] Add a method to move messages to IMAPlib Message-ID: <1524337803.72.0.682650639539.issue33327@psf.upfronthosting.co.za> New submission from Matej Cepl : I am in the process of writing script working with IMAP first time using Python 3 for it (unfortunately, most of servers where I run other code is so ancient that even Python 2.7 is a stretch), and it is really nice experience so far. Many problems which are dealt with on the StackExchange with arcane workarounds are now resolved in email or imaplib libraries. Thank you, everybody! However, it seems to me that few higher level commands could greatly improve useability of imaplib library. For example, moving messages (not fault of imaplib) is still horrible mess. In the end I had to write this monstrosity just to make moving messages working: Capas = collections.namedtuple('Capas', ['MOVE', 'UIDPLUS']) def __login(self, host='localhost', username=None, password=None, ssl=None): self.box = imaplib.IMAP4_SSL(host=host) ok, data = self.box.login(username, password) if ok != 'OK': raise IOError('Cannot login with credentials %s' % str((host, username, password,))) ok, data = box.capability() capas = data[0].decode() box.features_present = Capas._make(['MOVE' in capas, 'UIDPLUS' in capas]) def move_messages(self, target, messages): if self.box.features_present.MOVE: ok, data = self.box.uid('MOVE', '%s %s' % (messages, target)) if ok != 'OK': raise IOError('Cannot move messages to folder %s' % target) elif self.box.features_present.UIDPLUS: ok, data = self.box.uid('COPY', '%s %s' % (messages, target)) if ok != 'OK': raise IOError('Cannot copy messages to folder %s' % target) ok, data = self.box.uid('STORE', r'+FLAGS.SILENT (\DELETED) %s' % messages) if ok != 'OK': raise IOError('Cannot delete messages.') ok, data = self.box.uid('EXPUNGE', messages) if ok != 'OK': raise IOError('Cannot expunge messages.') else: ok, data = self.box.uid('COPY', '%s %s' % (messages, target)) if ok != 'OK': raise IOError('Cannot copy messages to folder %s' % target) ok, data = self.box.uid('STORE', r'+FLAGS.SILENT (\DELETED) %s' % messages) if ok != 'OK': raise IOError('Cannot delete messages.') It would be nice if some capabilities detection (see issue 18921) was embedded into login method, and if some version of move_messages was included in imaplib itself. ---------- components: Library (Lib) messages: 315578 nosy: mcepl priority: normal severity: normal status: open title: Add a method to move messages to IMAPlib 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 Sat Apr 21 15:11:49 2018 From: report at bugs.python.org (Matej Cepl) Date: Sat, 21 Apr 2018 19:11:49 +0000 Subject: [issue28320] Hostname validation is False by default in imaplib In-Reply-To: <1475269182.78.0.632593451926.issue28320@psf.upfronthosting.co.za> Message-ID: <1524337909.33.0.682650639539.issue28320@psf.upfronthosting.co.za> Matej Cepl added the comment: See also issue 33327. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 16:17:41 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 21 Apr 2018 20:17:41 +0000 Subject: [issue31463] test_multiprocessing_fork hangs test_subprocess In-Reply-To: <1505370960.72.0.0292264137903.issue31463@psf.upfronthosting.co.za> Message-ID: <1524341861.98.0.682650639539.issue31463@psf.upfronthosting.co.za> Antoine Pitrou added the comment: @Benjamin I can't reproduce here. It's true that test_multiprocessing_fork leaves two processes being itself, but that doesn't seem to disturb test_subprocess. @Miro Could you report the signal number issue separately? Thank you! ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 16:21:15 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 21 Apr 2018 20:21:15 +0000 Subject: [issue32911] Doc strings no longer stored in body of AST In-Reply-To: <1519302007.93.0.467229070634.issue32911@psf.upfronthosting.co.za> Message-ID: <1524342075.75.0.682650639539.issue32911@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Inadasan, what Francis is referring to is that people often use `ast.parse()` to parse code fragments, not entire modules. For example: >>> some_code = '"just a string"' >>> some_code_ast = ast.parse(some_code) The way `ast.parse()` works, it always considers the input to be a module: >>> some_code_ast <_ast.Module object at 0x109537a18> Before Python 3.7, you could parse out a string from such "module": >>> some_code.body [<_ast.Expr object at 0x1079aaa20>] >>> some_code.body[0].value <_ast.Str object at 0x107a45198> However, starting with Python 3.7, this module is empty: >>> some_code_ast.body [] >>> some_code_ast.docstring 'just a string' `ast.literal_eval()` does not have this problem. And now: where is the bug? I think the user code has a bug trying to parse a code fragment with `mode="exec"`. Instead of using the default `mode="exec"`, it seems to me `mode="single"` fits the bill better. In some cases the programmer might prefer `mode="eval"` if they don't want to allow statements at all. Inadasan, I think what we should do is to amend `ast.parse()` and `compile()` docs that mode="exec" treats given code as a module, we should even give the docstring handling as an example. Francis, if your use case requires passing multiple statements/expressions at once and a string in the first statement has semantic meaning, please provide us with a concrete example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 16:28:24 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 21 Apr 2018 20:28:24 +0000 Subject: [issue32911] Doc strings no longer stored in body of AST In-Reply-To: <1519302007.93.0.467229070634.issue32911@psf.upfronthosting.co.za> Message-ID: <1524342504.69.0.682650639539.issue32911@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Oh, and Francis, you might actually want to use lib2to3.pytree instead, which will provide you with a Concrete Syntax Tree ("lossless AST"). That tree will keep information like whitespace, comments, and other semantically insignificant tokens like commas and parentheses. This tree will never modify your input whereas in the AST we might be doing more modifications in the future (like cutting `if` branches that we statically know are always False, and so on). Granted, the lib2to3 tree is a bit awkward to query since the concrete tree exposes the raw Python grammar and not the simplified AST grammar. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 16:34:29 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Sat, 21 Apr 2018 20:34:29 +0000 Subject: [issue31463] test_multiprocessing_fork hangs test_subprocess In-Reply-To: <1505370960.72.0.0292264137903.issue31463@psf.upfronthosting.co.za> Message-ID: <1524342869.96.0.682650639539.issue31463@psf.upfronthosting.co.za> Benjamin Peterson added the comment: It doesn't hang for me anymore, but does print this warning: 0:00:00 load avg: 1.59 [1/2] test_multiprocessing_fork Lib/multiprocessing/semaphore_tracker.py:55: UserWarning: semaphore_tracker: process died unexpectedly, relaunching. Some semaphores might leak. warnings.warn('semaphore_tracker: process died unexpectedly, ' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 16:41:59 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 21 Apr 2018 20:41:59 +0000 Subject: [issue31463] test_multiprocessing_fork hangs test_subprocess In-Reply-To: <1505370960.72.0.0292264137903.issue31463@psf.upfronthosting.co.za> Message-ID: <1524343319.39.0.682650639539.issue31463@psf.upfronthosting.co.za> Antoine Pitrou added the comment: There's a test that deliberately kills the semaphore tracker, so that warning should be expected (I don't see it myself, but that might be because of differing warning settings). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 18:33:10 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 21 Apr 2018 22:33:10 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1524349990.67.0.682650639539.issue33277@psf.upfronthosting.co.za> Antoine Pitrou added the comment: This sounds like gratuitous breakage to me. __file__ in particular is used quite often. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 19:46:18 2018 From: report at bugs.python.org (pmpp) Date: Sat, 21 Apr 2018 23:46:18 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1524354378.95.0.682650639539.issue33277@psf.upfronthosting.co.za> Change by pmpp : ---------- nosy: +pmpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 23:03:53 2018 From: report at bugs.python.org (Rick Teachey) Date: Sun, 22 Apr 2018 03:03:53 +0000 Subject: [issue33328] pdb error when stepping through generator Message-ID: <1524366233.1.0.682650639539.issue33328@psf.upfronthosting.co.za> New submission from Rick Teachey : Hello: The attached python file runs a pdb interactive session for a generator. It produces an error in Python 3.7 Beta 3, but no error in 3.6. I searched for this issue and there do seem to be things that are related to it already, but I haven't investigated the cause of this issue and am not acquainted with the details of the pdb module, so I was unable to determine whether previous reports discuss this same problem. ---------- files: demo.py messages: 315586 nosy: Ricyteach priority: normal severity: normal status: open title: pdb error when stepping through generator versions: Python 3.7 Added file: https://bugs.python.org/file47545/demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 21 23:05:51 2018 From: report at bugs.python.org (Rick Teachey) Date: Sun, 22 Apr 2018 03:05:51 +0000 Subject: [issue33328] pdb error when stepping through generator In-Reply-To: <1524366233.1.0.682650639539.issue33328@psf.upfronthosting.co.za> Message-ID: <1524366351.85.0.682650639539.issue33328@psf.upfronthosting.co.za> Rick Teachey added the comment: The interactive session result is below: GeneratorExit Exception ignored in: Traceback (most recent call last): File "C:\Users\ricky\AppData\Local\Programs\Python\Python37\lib\types.py", line 27, in _ag File "C:\Users\ricky\AppData\Local\Programs\Python\Python37\lib\bdb.py", line 90, in trace_dispatch File "C:\Users\ricky\AppData\Local\Programs\Python\Python37\lib\bdb.py", line 128, in dispatch_call File "C:\Users\ricky\AppData\Local\Programs\Python\Python37\lib\bdb.py", line 250, in break_anywhere File "C:\Users\ricky\AppData\Local\Programs\Python\Python37\lib\bdb.py", line 49, in canonic AttributeError: 'NoneType' object has no attribute 'abspath' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 00:45:03 2018 From: report at bugs.python.org (Rick Teachey) Date: Sun, 22 Apr 2018 04:45:03 +0000 Subject: [issue33328] pdb error when stepping through generator In-Reply-To: <1524366233.1.0.682650639539.issue33328@psf.upfronthosting.co.za> Message-ID: <1524372303.95.0.682650639539.issue33328@psf.upfronthosting.co.za> Change by Rick Teachey : ---------- components: +Library (Lib) type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 01:45:39 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 05:45:39 +0000 Subject: [issue33328] pdb error when stepping through generator In-Reply-To: <1524366233.1.0.682650639539.issue33328@psf.upfronthosting.co.za> Message-ID: <1524375939.74.0.682650639539.issue33328@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you for your report Rick. But I get the same error in 3.6. An AttributeError is raised if the debugger runs at the interpreter shutdown stage (sys.is_finalizing() returns True). sys.path was set to None at the beginning of modules cleanup. The debugger traces the _ag() asynchronous generator in types.py. You can see some details when run Python with option -v. $ ./python -v ../demo.py ... import 'pdb' # <_frozen_importlib_external.SourceFileLoader object at 0x7f5b45debae8> # extension module 'readline' loaded from '/home/serhiy/py/cpython/build/lib.linux-x86_64-3.8-pydebug/readline.cpython-38dm-x86_64-linux-gnu.so' # extension module 'readline' executed from '/home/serhiy/py/cpython/build/lib.linux-x86_64-3.8-pydebug/readline.cpython-38dm-x86_64-linux-gnu.so' import 'readline' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f5b45d94608> GeneratorExit # clear builtins._ # clear sys.path # clear sys.argv ... # cleanup[3] wiping re # destroy _locale # destroy sre_compile # destroy copyreg # cleanup[3] wiping enum # cleanup[3] wiping types Exception ignored in: Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/types.py", line 27, in _ag File "/home/serhiy/py/cpython/Lib/bdb.py", line 90, in trace_dispatch File "/home/serhiy/py/cpython/Lib/bdb.py", line 128, in dispatch_call File "/home/serhiy/py/cpython/Lib/bdb.py", line 250, in break_anywhere File "/home/serhiy/py/cpython/Lib/bdb.py", line 49, in canonic AttributeError: 'NoneType' object has no attribute 'abspath' Adding "del _ag" in types.py fixes this issue. But there are open questions. Is it good that the debugger is enabled at the shutdown stage? Why the code of the never used asynchronous generator is executed at all? ---------- nosy: +pitrou, serhiy.storchaka, yselivanov versions: +Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 02:17:43 2018 From: report at bugs.python.org (Rick Teachey) Date: Sun, 22 Apr 2018 06:17:43 +0000 Subject: [issue33328] pdb error when stepping through generator In-Reply-To: <1524366233.1.0.682650639539.issue33328@psf.upfronthosting.co.za> Message-ID: <1524377863.9.0.682650639539.issue33328@psf.upfronthosting.co.za> Rick Teachey added the comment: I am on Anaconda 4.5.1 on Windows 10 (Python 3.6.5). I have confirmed that I DO get the error on another machine with the same version installed, so the lack of an error seems specific to my current machine. I do not know what could be causing this; it is very odd. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 04:07:53 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 08:07:53 +0000 Subject: [issue33329] test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range Message-ID: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> New submission from Miro Hron?ok : Originally reported in https://bugs.python.org/issue31463 This started to bother us in Fedora rawhide for various Python versions, so chances are something changed on the system level. # python3.7 -m test.regrtest test_multiprocessing_fork Run tests sequentially 0:00:00 load avg: 1.24 [1/1] test_multiprocessing_fork /usr/lib64/python3.7/multiprocessing/semaphore_tracker.py:55: UserWarning: semaphore_tracker: process died unexpectedly, relaunching. Some semaphores might leak. warnings.warn('semaphore_tracker: process died unexpectedly, ' Exception in thread Thread-26: Traceback (most recent call last): File "/usr/lib64/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib64/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.7/multiprocessing/resource_sharer.py", line 139, in _serve signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG)) File "/usr/lib64/python3.7/signal.py", line 60, in pthread_sigmask sigs_set = _signal.pthread_sigmask(how, mask) ValueError: signal number 32 out of range (hangs...) ^CProcess Process-184: Traceback (most recent call last): File "/usr/lib64/python3.7/multiprocessing/process.py", line 297, in _bootstrap self.run() File "/usr/lib64/python3.7/multiprocessing/process.py", line 99, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.7/test/_test_multiprocessing.py", line 3328, in child_access w = conn.recv() File "/usr/lib64/python3.7/multiprocessing/connection.py", line 251, in recv return _ForkingPickler.loads(buf.getbuffer()) File "/usr/lib64/python3.7/multiprocessing/connection.py", line 960, in rebuild_connection fd = df.detach() File "/usr/lib64/python3.7/multiprocessing/resource_sharer.py", line 57, in detach with _resource_sharer.get_connection(self._id) as conn: File "/usr/lib64/python3.7/multiprocessing/resource_sharer.py", line 87, in get_connection c = Client(address, authkey=process.current_process().authkey) File "/usr/lib64/python3.7/multiprocessing/connection.py", line 498, in Client answer_challenge(c, authkey) File "/usr/lib64/python3.7/multiprocessing/connection.py", line 741, in answer_challenge message = connection.recv_bytes(256) # reject large message File "/usr/lib64/python3.7/multiprocessing/connection.py", line 216, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/lib64/python3.7/multiprocessing/connection.py", line 407, in _recv_bytes buf = self._recv(4) File "/usr/lib64/python3.7/multiprocessing/connection.py", line 379, in _recv chunk = read(handle, remaining) KeyboardInterrupt Warning -- multiprocessing.process._dangling was modified by test_multiprocessing_fork Before: <_weakrefset.WeakSet object at 0x7f2abd5f6d30> After: <_weakrefset.WeakSet object at 0x7f2abd5f6128> Warning -- threading._dangling was modified by test_multiprocessing_fork Before: <_weakrefset.WeakSet object at 0x7f2abd5f66d8> After: <_weakrefset.WeakSet object at 0x7f2abc835048> Test suite interrupted by signal SIGINT. 1 test omitted: test_multiprocessing_fork Total duration: 3 min 43 sec Tests result: INTERRUPTED -------------------------------- # python3.7 -m test.regrtest test_multiprocessing_forkserver Run tests sequentially 0:00:00 load avg: 1.00 [1/1] test_multiprocessing_forkserver Exception in thread Thread-26: Traceback (most recent call last): File "/usr/lib64/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib64/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.7/multiprocessing/resource_sharer.py", line 139, in _serve signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG)) File "/usr/lib64/python3.7/signal.py", line 60, in pthread_sigmask sigs_set = _signal.pthread_sigmask(how, mask) ValueError: signal number 32 out of range (hangs...) ^CProcess Process-184: Traceback (most recent call last): ... KeyboardInterrupt Warning -- multiprocessing.process._dangling was modified by test_multiprocessing_forkserver Before: <_weakrefset.WeakSet object at 0x7f0323ecde10> After: <_weakrefset.WeakSet object at 0x7f0323ecd208> Warning -- threading._dangling was modified by test_multiprocessing_forkserver Before: <_weakrefset.WeakSet object at 0x7f0323ecd7b8> After: <_weakrefset.WeakSet object at 0x7f0323ecddd8> Test suite interrupted by signal SIGINT. 1 test omitted: test_multiprocessing_forkserver Total duration: 55 sec Tests result: INTERRUPTED -------------------------------- # python3.7 -m test.regrtest test_multiprocessing_spawn Run tests sequentially 0:00:00 load avg: 1.49 [1/1] test_multiprocessing_spawn Exception in thread Thread-26: Traceback (most recent call last): File "/usr/lib64/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib64/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/usr/lib64/python3.7/multiprocessing/resource_sharer.py", line 139, in _serve signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG)) File "/usr/lib64/python3.7/signal.py", line 60, in pthread_sigmask sigs_set = _signal.pthread_sigmask(how, mask) ValueError: signal number 32 out of range (hangs...) ^CProcess Process-184: Traceback (most recent call last): ... KeyboardInterrupt Warning -- multiprocessing.process._dangling was modified by test_multiprocessing_spawn Before: <_weakrefset.WeakSet object at 0x7fb2134a9dd8> After: <_weakrefset.WeakSet object at 0x7fb2134a91d0> Warning -- threading._dangling was modified by test_multiprocessing_spawn Before: <_weakrefset.WeakSet object at 0x7fb2134a9780> After: <_weakrefset.WeakSet object at 0x7fb2134a9da0> Test suite interrupted by signal SIGINT. 1 test omitted: test_multiprocessing_spawn Total duration: 54 sec Tests result: INTERRUPTED -------------------------------- Happens with all 3 tests on 3.4 to 3.7. To test in docker, one can do: $ docker run -ti fedora:rawhide /bin/bash # dnf update # dnf install python37 # or python3-test for 3.6, or python35, python34 Note that without `dnf update`, the tests work for me (for now) so attaching a full package diff that "starts" this. ---------- components: Tests files: upgraded_packages.txt messages: 315590 nosy: hroncok priority: normal severity: normal status: open title: test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7 Added file: https://bugs.python.org/file47546/upgraded_packages.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 04:08:49 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 08:08:49 +0000 Subject: [issue31463] test_multiprocessing_fork hangs test_subprocess In-Reply-To: <1505370960.72.0.0292264137903.issue31463@psf.upfronthosting.co.za> Message-ID: <1524384529.77.0.682650639539.issue31463@psf.upfronthosting.co.za> Miro Hron?ok added the comment: > Could you report the signal number issue separately? Thank you! https://bugs.python.org/issue33329 Resetting the Versions back. ---------- versions: -Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 04:56:30 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 08:56:30 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() Message-ID: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : The proposed PR adds missed checks for errors and PyErr_Clear() calls in PyImport_Cleanup(). It may be worth to use PyErr_WriteUnraisable() in place of PyErr_Clear() (newly added and existing) in most cases. But this can add an unexpected noise, and I don't wont to do this at this stage of 3.7. It could be done in 3.8 though, and backported to 3.7 later. I'm not sure that PyImport_Cleanup() works properly if sys.modules is not a dict. At this stage a custom mapping will likely be broken when most of modules are destroyed. ---------- components: Interpreter Core messages: 315592 nosy: brett.cannon, eric.snow, ncoghlan, pitrou, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Better error handling in PyImport_Cleanup() type: behavior versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 05:06:02 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 09:06:02 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1524387962.36.0.682650639539.issue33330@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6259 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 05:49:08 2018 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sun, 22 Apr 2018 09:49:08 +0000 Subject: [issue33315] Allow queue.Queue to be used in type annotations In-Reply-To: <1524139376.68.0.682650639539.issue33315@psf.upfronthosting.co.za> Message-ID: <1524390548.17.0.682650639539.issue33315@psf.upfronthosting.co.za> Ivan Levkivskyi added the comment: I think this issue appeared previously on typing tracker. The current recommendation is to escape problematic annotations with quotes: q: 'Queue[int]' I don't think it will be added to typing, because following this way typing will grow infinitely to include all generics in stdlib. Another solution may be to add a simple `__class_getitem__` to `Queue` that will just return `cls` (so that we don't import `typing`). Although it will skip all the normal typing checks (so that `Queue[42]` will not raise at runtime), static type checkers like mypy will flag such errors. Guido, what do you think about such experiment? ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 05:59:35 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 09:59:35 +0000 Subject: [issue33329] test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524391175.16.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Perhaps you can compile and run this C program, before and after the system changes, and post the output: #include #include #include int main(int argc, char** argv) { sigset_t set; int i, ret; printf("NSIG = %d\n", NSIG); for (i = 1; i < NSIG; i++) { errno = 0; ret = sigaddset(&set, i); printf("sigaddset(%d) returned %d, errno =%d\n", i, ret, errno); } return 0; } (on Ubuntu 16.04, I get NSIG = 65, and all signal numbers work fine) ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:12:50 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 10:12:50 +0000 Subject: [issue33329] test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524391970.73.0.682650639539.issue33329@psf.upfronthosting.co.za> Miro Hron?ok added the comment: I'll try. In the meantime, I've checked and it's glibc update that makes the difference: glibc-2.27.9000-7.fc29 -> glibc-2.27.9000-14.fc29 I'll see what was changed there and whether is was intentional, or bug in Fedora. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:16:46 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 10:16:46 +0000 Subject: [issue33329] test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524392206.84.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I was able to compile the program above after the system upgrade using your Docker image, and the following stands out: sigaddset(31) returned 0, errno = 0 sigaddset(32) returned -1, errno = 22 sigaddset(33) returned -1, errno = 22 sigaddset(34) returned 0, errno = 0 However, I do not know how to compile it *before* the system upgrade ("dnf install gcc" seems to install gcc). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:17:01 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 10:17:01 +0000 Subject: [issue33329] test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524392221.67.0.682650639539.issue33329@psf.upfronthosting.co.za> Miro Hron?ok added the comment: glibc-2.27.9000-14.fc29: NSIG = 65 sigaddset(32) returned -1, errno =22 sigaddset(33) returned -1, errno =22 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:18:15 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 10:18:15 +0000 Subject: [issue33329] test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524392295.36.0.682650639539.issue33329@psf.upfronthosting.co.za> Miro Hron?ok added the comment: "dnf install gcc" upgrades glibc, yes. OK, I'll dig into it a bit more, see why and where this change happened. Thanks for hints. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:24:47 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 10:24:47 +0000 Subject: [issue33329] test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524392687.3.0.682650639539.issue33329@psf.upfronthosting.co.za> Miro Hron?ok added the comment: dnf install https://kojipkgs.fedoraproject.org/packages/glibc/2.27.9000/7.fc29/x86_64/glibc-headers-2.27.9000-7.fc29.x86_64.rpm https://kojipkgs.fedoraproject.org/packages/glibc/2.27.9000/7.fc29/x86_64/glibc-devel-2.27.9000-7.fc29.x86_64.rpm dnf install gcc NSIG = 65 sigaddset(1) returned 0, errno =0 ... all ok ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:35:00 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 10:35:00 +0000 Subject: [issue33329] test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524393300.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Miro Hron?ok added the comment: glibc-2.27.9000-13.fc29 ... all ok glibc-2.27.9000-14.fc29 ... 32, 33 fail glibc-2.27.9000-15.fc29 (latest built) ... 32, 33 fail 13 to 14 is this in upstream commits: d39c0a459ef32a41daac4840859bf304d931adab to 583a27d525ae189bdfaa6784021b92a9a1dae12e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:35:16 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 10:35:16 +0000 Subject: [issue33329] test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524393316.71.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Ok, this is due to: https://sourceware.org/bugzilla/show_bug.cgi?id=22391 Short explanation here: https://unix.stackexchange.com/a/155846 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:37:24 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 10:37:24 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524393444.7.0.682650639539.issue33329@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- priority: normal -> critical stage: -> needs patch title: test_multiprocessing_fork, _forkserver, _spawn hangs: ValueError: signal number 32 out of range -> sigaddset() can fail on some signal numbers type: -> behavior versions: +Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:38:05 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 10:38:05 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524393485.57.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Miro, could you check whether 2.7 is affected too? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:38:18 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 10:38:18 +0000 Subject: [issue33331] Clean modules in the reversed order Message-ID: <1524393498.13.0.682650639539.issue33331@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Since dict is ordered, modules in sys.modules are ordered for the time of importing. Currently they are cleaned in PyImport_Cleanup() in the direct order -- from imported first to imported later. I wonder if cleaning them in the reversed order can solve some problems with the interpreter shutdown. For example reverting the order fixes issue33328 and may help in other cases. If revert the order, should only iterating weaklist be reverted (with setting all module globals to None), or iterating sys.modules (with setting sys.module values to None) too? ---------- components: Interpreter Core messages: 315603 nosy: brett.cannon, eric.snow, ncoghlan, pitrou, serhiy.storchaka priority: normal severity: normal status: open title: Clean modules in the reversed order versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:44:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 10:44:27 +0000 Subject: [issue33331] Clean modules in the reversed order In-Reply-To: <1524393498.13.0.682650639539.issue33331@psf.upfronthosting.co.za> Message-ID: <1524393867.02.0.682650639539.issue33331@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6260 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:47:17 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 10:47:17 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524394037.7.0.682650639539.issue33329@psf.upfronthosting.co.za> Miro Hron?ok added the comment: I cannot find a corresponding test in 2.7. Running the entire build (incl. tests) to see what happens. Is there a command or a couple I could try instead? I'm afraid I don't understand how does that test work (I seems a bit complicated) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 06:55:42 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 10:55:42 +0000 Subject: [issue24024] str.__doc__ needs an update In-Reply-To: <1429708426.75.0.208318155296.issue24024@psf.upfronthosting.co.za> Message-ID: <1524394542.17.0.682650639539.issue24024@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> rejected stage: needs patch -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 07:00:54 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 11:00:54 +0000 Subject: [issue25205] setattr accepts invalid identifiers In-Reply-To: <1442861960.51.0.201067879836.issue25205@psf.upfronthosting.co.za> Message-ID: <1524394854.4.0.682650639539.issue25205@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 07:01:49 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 11:01:49 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524394909.78.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Running the whole test suite sounds fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 07:03:27 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 11:03:27 +0000 Subject: [issue33332] Expose valid signal set (sigfillset()) Message-ID: <1524395007.64.0.682650639539.issue33332@psf.upfronthosting.co.za> New submission from Antoine Pitrou : See issue33329: it would be nice to expose a signal module function to get the set of user-actionable signals. Hopefully sigfillset() does that. ---------- messages: 315606 nosy: pitrou priority: normal severity: normal stage: needs patch status: open title: Expose valid signal set (sigfillset()) type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 07:15:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 11:15:28 +0000 Subject: [issue10117] Tools/scripts/reindent.py fails on non-UTF-8 encodings In-Reply-To: <1287161682.26.0.892900314694.issue10117@psf.upfronthosting.co.za> Message-ID: <1524395728.01.0.682650639539.issue10117@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I concur with ?ric. Standard input and output are text streams in Python 3. The user can control their encoding by setting locale or PYTHONIOENCODING. I think this issue can be closed now unless somebody want to backport the fix to 2.7. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 07:20:36 2018 From: report at bugs.python.org (Chris Bradbury) Date: Sun, 22 Apr 2018 11:20:36 +0000 Subject: [issue33333] ConfigParser.items returns items present in `DEFAULTSECT` when section argument given. Message-ID: <1524396036.58.0.682650639539.issue33333@psf.upfronthosting.co.za> New submission from Chris Bradbury : According to `ConfigParser.items` docs: > When section is not given, return a list of section_name, section_proxy pairs, including DEFAULTSECT. > Otherwise, return a list of name, value pairs for the options in the given section. Optional arguments have the same meaning as for the get() method. https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.items However due to `d = self._defaults.copy()` on line 843 of configparser.py the default section is always included, even when a section argument is specified. ---------- messages: 315608 nosy: chrBrd priority: normal severity: normal status: open title: ConfigParser.items returns items present in `DEFAULTSECT` when section argument given. type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 07:27:55 2018 From: report at bugs.python.org (Chris Bradbury) Date: Sun, 22 Apr 2018 11:27:55 +0000 Subject: [issue33333] ConfigParser.items returns items present in `DEFAULTSECT` when section argument given. In-Reply-To: <1524396036.58.0.682650639539.issue33333@psf.upfronthosting.co.za> Message-ID: <1524396475.52.0.682650639539.issue33333@psf.upfronthosting.co.za> Change by Chris Bradbury : ---------- keywords: +patch pull_requests: +6261 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 07:31:36 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 11:31:36 +0000 Subject: [issue33333] ConfigParser.items returns items present in `DEFAULTSECT` when section argument given. In-Reply-To: <1524396036.58.0.682650639539.issue33333@psf.upfronthosting.co.za> Message-ID: <1524396696.41.0.682650639539.issue33333@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Library (Lib) nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 07:52:13 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 11:52:13 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524397933.25.0.682650639539.issue33329@psf.upfronthosting.co.za> Miro Hron?ok added the comment: Python 2 testsuite runs fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 07:58:50 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 11:58:50 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524398330.56.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Setting as release blocker as it impacts functionality of the multiprocessing module. ---------- nosy: +ned.deily priority: critical -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 07:59:55 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 11:59:55 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524398395.16.0.682650639539.issue33329@psf.upfronthosting.co.za> Miro Hron?ok added the comment: Should the fix be to exclude 32 and 33 from multiprocessing.resource_sharer:_serve? if hasattr(signal, 'pthread_sigmask'): signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 08:01:09 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 12:01:09 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524398469.57.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: We could do that, but I'd rather something not multiprocessing-specific. I think we have to ignore the return value of sigaddset() until issue33332 allows us to be smarter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 08:01:41 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 12:01:41 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524398501.05.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > We could do that, but I'd rather something not multiprocessing-specific ... and also not Linux-specific. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 08:11:53 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 12:11:53 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524399113.33.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Miro, can you give the following patch a try? diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 7916160..ca76a20 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -819,7 +819,6 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask) int result = -1; PyObject *iterator, *item; long signum; - int err; sigemptyset(mask); @@ -841,11 +840,10 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask) Py_DECREF(item); if (signum == -1 && PyErr_Occurred()) goto error; - if (0 < signum && signum < NSIG) - err = sigaddset(mask, (int)signum); - else - err = 1; - if (err) { + if (0 < signum && signum < NSIG) { + (void) sigaddset(mask, (int)signum); + } + else { PyErr_Format(PyExc_ValueError, "signal number %ld out of range", signum); goto error; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 08:30:27 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Sun, 22 Apr 2018 12:30:27 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524400227.56.0.682650639539.issue33329@psf.upfronthosting.co.za> Miro Hron?ok added the comment: This indeed makes the tests pass again: # python3.7 -m test.regrtest test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_spawn Run tests sequentially 0:00:00 load avg: 1.02 [1/3] test_multiprocessing_fork /usr/lib64/python3.7/multiprocessing/semaphore_tracker.py:55: UserWarning: semaphore_tracker: process died unexpectedly, relaunching. Some semaphores might leak. warnings.warn('semaphore_tracker: process died unexpectedly, ' 0:01:05 load avg: 1.00 [2/3] test_multiprocessing_forkserver -- test_multiprocessing_fork passed in 1 min 6 sec 0:02:16 load avg: 1.69 [3/3] test_multiprocessing_spawn -- test_multiprocessing_forkserver passed in 1 min 11 sec test_multiprocessing_spawn passed in 1 min 23 sec All 3 tests OK. Total duration: 3 min 40 sec Tests result: SUCCESS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 09:56:37 2018 From: report at bugs.python.org (Adhemerval Zanella) Date: Sun, 22 Apr 2018 13:56:37 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524405397.49.0.682650639539.issue33329@psf.upfronthosting.co.za> Adhemerval Zanella added the comment: Why not export and use the canonical way of sigemptyset/sigfillset/sigaddset/sigdelset/sigismember instead of pushing for more potential non-conformant code? For glibc sigfillset will correctly fill all the signal set structure while removing the internal used signals. This is par what POSIX specifies [1] where it states that: 'either sigemptyset() or sigfillset() must be called prior to any other use of the signal set' And more importantly: 'For example, blocking or ignoring an implementation-defined signal may have undesirable side-effects, whereas the default action for that signal is harmless. In such a case, it would be preferable for such a signal to be excluded from the signal set returned by sigfillset().' Also keep that since is an implementation detail, different libcs can use different internal signals. UCLIBC, for instance, uses the same 2 signals as GLIBC, however MUSL allocates signal 32, 33, and 34 for internal usage (and excludes in sigfillset and warns with EINVAL on sigaddset). [1] http://pubs.opengroup.org/onlinepubs/9699919799/ ---------- nosy: +azanella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 10:03:18 2018 From: report at bugs.python.org (Adhemerval Zanella) Date: Sun, 22 Apr 2018 14:03:18 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524405798.89.0.682650639539.issue33329@psf.upfronthosting.co.za> Adhemerval Zanella added the comment: Also keep in mind that POSIX [1] specifies that sigaddset *may* fail with EINVAL for not support signals, so a conforming implementation may not fail on sigaddset and still remove the internal signal in a sigprocmask (uclibc for instance). [1] http://pubs.opengroup.org/onlinepubs/9699919799/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 11:12:01 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 15:12:01 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524409921.86.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > Why not export and use the canonical way of sigemptyset/sigfillset/sigaddset/sigdelset/sigismember instead of pushing for more potential non-conformant code? I agree this is the proper fix and that's what I plan to do in Python 3.8. For Python 3.7 and earlier, though, we cannot add new features anymore, which is why I'm leaning towards a variant of the patch I showed above (which also minimizes the risk for regressions by introducing and using a new API). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 11:13:17 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 22 Apr 2018 15:13:17 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524409997.86.0.682650639539.issue33329@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- assignee: -> pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 11:43:03 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Sun, 22 Apr 2018 15:43:03 +0000 Subject: [issue33289] tkinter askcolor returning floats for r, g, b values instead of ints In-Reply-To: <1523915381.82.0.682650639539.issue33289@psf.upfronthosting.co.za> Message-ID: <1524411783.69.0.682650639539.issue33289@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Adding to what Serhiy said about the askcolor() return value is an issue that also affects input: >>> cc.askcolor('red') ((255, 0, 0), '#ff0000') >>> cc.askcolor((255, 0, 0)) ((255, 0, 0), '#ff0000') >>> cc.askcolor((65535, 0, 0)) Traceback (most recent call last): File "", line 1, in File "/home/cheryl/cpython/Lib/tkinter/colorchooser.py", line 75, in askcolor return Chooser(**options).show() File "/home/cheryl/cpython/Lib/tkinter/commondialog.py", line 43, in show s = w.tk.call(self.command, *w._options(self.options)) _tkinter.TclError: invalid color name "#ffff0000" Changing _fixoptions to format initialcolor using "#%04x%04x%04x" % color. allows for 16-bit hex values, but it's not the same as 8-bit. >>> cc.askcolor('red') ((255, 0, 0), '#ff0000') >>> cc.askcolor((255, 0, 0)) ((0, 0, 0), '#000000') >>> cc.askcolor((65535, 0, 0)) ((255, 0, 0), '#ff0000') (255, 0, 0) in the second call is black and not red. ---------- nosy: +csabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 12:52:33 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 22 Apr 2018 16:52:33 +0000 Subject: [issue33331] Clean modules in the reversed order In-Reply-To: <1524393498.13.0.682650639539.issue33331@psf.upfronthosting.co.za> Message-ID: <1524415953.35.0.682650639539.issue33331@psf.upfronthosting.co.za> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 13:00:15 2018 From: report at bugs.python.org (Barry A. Warsaw) Date: Sun, 22 Apr 2018 17:00:15 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1524416415.61.0.682650639539.issue33277@psf.upfronthosting.co.za> Barry A. Warsaw added the comment: Not that I've thought this through in much detail, but what if we start out by proxying those module attributes to the spec via PEP 562 hooks? We can do that in 3.8, issue (silent?) deprecation warnings, and then do a full deprecation process for those module attributes? It's not a terrible thing to keep those attributes as long as they match what's in the spec. It's a problem when they're out of sync (see bpo-32305 and bpo-32303). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 13:09:37 2018 From: report at bugs.python.org (Matthias Kievernagel) Date: Sun, 22 Apr 2018 17:09:37 +0000 Subject: [issue3405] Add support for the new data option supported by event generate (Tk 8.5) In-Reply-To: <1216385566.01.0.7972232454.issue3405@psf.upfronthosting.co.za> Message-ID: <1524416977.79.0.682650639539.issue3405@psf.upfronthosting.co.za> Matthias Kievernagel added the comment: I have a patched Python 3.5.3 running mostly following the comments by O.C. If no one else is active on this I can try to prepare something for submission. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 13:11:17 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 17:11:17 +0000 Subject: [issue33334] Add support of NOP and EXTENDED_ARG in stack_effect() Message-ID: <1524417077.19.0.682650639539.issue33334@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Currently dis.stack_effect() doesn't support opcodes NOP and EXTENDED_ARG. NOP is never emitted by the standard compiler (it is temporary added in the peephole optimizer, but later it is removed). EXTENDED_ARG is a special case, it is considered as a part of long instructions. dis.stack_effect() itself is not used in the dis module. It can be used in the third-party code, and the third-party code can produce bytecode with non-standard use of NOP and EXTENDED_ARG. Supporting them in dis.stack_effect() can avoid the need of special casing them in the third-party code. I don't know whether this is a bug fix or a new feature. ---------- components: Library (Lib) messages: 315622 nosy: larry, serhiy.storchaka priority: normal severity: normal status: open title: Add support of NOP and EXTENDED_ARG in stack_effect() versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 13:25:11 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 17:25:11 +0000 Subject: [issue33334] Add support of NOP and EXTENDED_ARG in stack_effect() In-Reply-To: <1524417077.19.0.682650639539.issue33334@psf.upfronthosting.co.za> Message-ID: <1524417911.88.0.682650639539.issue33334@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6262 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 13:30:40 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sun, 22 Apr 2018 17:30:40 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524418240.22.0.682650639539.issue33280@psf.upfronthosting.co.za> Andr?s Delfino added the comment: I have updated the PR: * Now we mention that python -m tkinter shows the installed Tcl/Tk version so users can read the right man pages. * Only mention the link to documentation page (sadly, there doesn't seem to exist an "Archived man pages", and mentioning 8.5/8.4 man pages doesn't seem right). * I have merged the two "See also" sections of the page, separating Tkinter-specific documentation from Tcl/Tk general documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 13:33:22 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Apr 2018 17:33:22 +0000 Subject: [issue3405] Add support for the new data option supported by event generate (Tk 8.5) In-Reply-To: <1216385566.01.0.7972232454.issue3405@psf.upfronthosting.co.za> Message-ID: <1524418402.8.0.682650639539.issue3405@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Fill free to create a pull request. It may need tests and documentation though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 14:03:14 2018 From: report at bugs.python.org (Chris Bradbury) Date: Sun, 22 Apr 2018 18:03:14 +0000 Subject: [issue33333] ConfigParser.items returns items present in `DEFAULTSECT` when section argument given. In-Reply-To: <1524396036.58.0.682650639539.issue33333@psf.upfronthosting.co.za> Message-ID: <1524420194.75.0.682650639539.issue33333@psf.upfronthosting.co.za> Chris Bradbury added the comment: The fix for the actual issue is quite trivial (and should fix bpo-33251 at the same time). However `ExtendedInterpolation::_interpolate_some` relies on the options from the default section always being returned. Not only does this make the fix more complicated, it also makes me worry that aligning behaviour to match the documentation (which I personally feel makes more sense) will breake backwards compatibility. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 14:14:49 2018 From: report at bugs.python.org (Paul Ganssle) Date: Sun, 22 Apr 2018 18:14:49 +0000 Subject: [issue28602] `tzinfo.fromutc()` fails when used for a fold-aware tzinfo implementation In-Reply-To: <1478199350.04.0.93782925147.issue28602@psf.upfronthosting.co.za> Message-ID: <1524420889.41.0.682650639539.issue28602@psf.upfronthosting.co.za> Change by Paul Ganssle : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 14:26:41 2018 From: report at bugs.python.org (Adhemerval Zanella) Date: Sun, 22 Apr 2018 18:26:41 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524421601.39.0.682650639539.issue33329@psf.upfronthosting.co.za> Adhemerval Zanella added the comment: One option would be to create a list of possible defined signals and check if the signal is on the list. For realtime signals, it just a matter to check if SIGRTMIN <= signal <= SIGRTMAX. The glibc defined signals can be checked at tst-signal.c [1] or from main signal(7). It should cover usual ISO C, POSIX, and some linux arch-specific signals, but you will still need to check if other OS defined extra signals uses elsewhere (another option would to add this check only for Linux/glibc). [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=signal/tst-sigset.c;h=a2b764de5ad66ee960c94ec18df75a07fce4b9a6;hb=HEAD ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 14:34:37 2018 From: report at bugs.python.org (J E) Date: Sun, 22 Apr 2018 18:34:37 +0000 Subject: [issue33335] turtle.onkey doesn't pass key information when key is None Message-ID: <1524422076.99.0.682650639539.issue33335@psf.upfronthosting.co.za> New submission from J E : I use the turtle module to teach Python to university students. The turtle.onkey function allows a program to register a callback function to handle a keyboard when the turtle window has a focus. For example, this call will result in myfun() getting called when the "s" key is pressed: def myfun(): print("You pressed s") turtle.onkey(myfun, "s") turtle.listen() But what if I want to handle all keys? I could create a bunch of functions, and register a separate callback for each possible; that's not a great solution. A better solution is to let turtle call a single function when any key is pressed. Fortunately, this is possible by passing None in for the key: def myfun(): print("You pressed some key") turtle.onkey(myfun, None) turtle.listen() However: there is no way for myfun to determine which key was pressed. It is called with no parameters, and has no way to recover information about which key was pressed, so this approach is useless. The only way to handle all keyboard events it to call onkey, with a separate handler, for every key you potentially want to handle. >From the source [1] this looks like it was intended that when key is None, turtle would pass a Tkinter event to the handler, so that it could recover information about the event, but this doesn't happen. [1] https://hg.python.org/cpython/file/3.6/Lib/turtle.py#l700 I would argue that correct behavior is not to expose Tkinter event to users of the higher-level turtle library, but rather to pass the name of the key as a string parameter, so you could write this: def myfun(key): print("You pressed "+key) turtle.onkey(myfun, None) turtle.listen() This is an easy fix and I'd be happy to submit a patch. ---------- components: Tkinter messages: 315627 nosy: je1234 priority: normal severity: normal status: open title: turtle.onkey doesn't pass key information when key is None 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 Sun Apr 22 15:02:19 2018 From: report at bugs.python.org (Ned Deily) Date: Sun, 22 Apr 2018 19:02:19 +0000 Subject: [issue33015] Fix function cast warning in thread_pthread.h In-Reply-To: <1520362573.83.0.467229070634.issue33015@psf.upfronthosting.co.za> Message-ID: <1524423739.54.0.682650639539.issue33015@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 17:13:47 2018 From: report at bugs.python.org (Chris Bradbury) Date: Sun, 22 Apr 2018 21:13:47 +0000 Subject: [issue33333] ConfigParser.items returns items present in `DEFAULTSECT` when section argument given. In-Reply-To: <1524396036.58.0.682650639539.issue33333@psf.upfronthosting.co.za> Message-ID: <1524431627.19.0.682650639539.issue33333@psf.upfronthosting.co.za> Change by Chris Bradbury : ---------- pull_requests: +6263 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 17:13:47 2018 From: report at bugs.python.org (Chris Bradbury) Date: Sun, 22 Apr 2018 21:13:47 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1524431627.28.0.0935424498089.issue33251@psf.upfronthosting.co.za> Change by Chris Bradbury : ---------- pull_requests: +6264 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 17:37:43 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Apr 2018 21:37:43 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1524433063.05.0.682650639539.issue33251@psf.upfronthosting.co.za> ?ukasz Langa added the comment: > What *actually* was changed in 3.2? In terms of this issue, nothing. That piece of documentation was put without proper testing, based purely on a comment that somebody put on issue12036. My mistake. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 17:38:17 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Apr 2018 21:38:17 +0000 Subject: [issue33333] ConfigParser.items returns items present in `DEFAULTSECT` when section argument given. In-Reply-To: <1524396036.58.0.682650639539.issue33333@psf.upfronthosting.co.za> Message-ID: <1524433097.92.0.682650639539.issue33333@psf.upfronthosting.co.za> ?ukasz Langa added the comment: See line 379 in configparser.py. BasicInterpolation is also assumed to work for values from the default section. This is why the default section exists in the first place. More importantly, as you're pointing out, even though this is an omission of the documentation, existing code in the wild probably assumes that `items()` include pairs from the default section. This is how ConfigParser worked in Python 2. If you don't want this behavior, use cfgparser[section].items() instead which does what you want. If you think this is helpful, go ahead and extend the documentation of ConfigParser.items() to point out this weirdness. But we won't be going forward with PR 6567. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 17:48:56 2018 From: report at bugs.python.org (Chris Bradbury) Date: Sun, 22 Apr 2018 21:48:56 +0000 Subject: [issue33333] ConfigParser.items returns items present in `DEFAULTSECT` when section argument given. In-Reply-To: <1524396036.58.0.682650639539.issue33333@psf.upfronthosting.co.za> Message-ID: <1524433736.68.0.682650639539.issue33333@psf.upfronthosting.co.za> Chris Bradbury added the comment: I'll make the documentation changes instead, not overly surprised to hear this is intentional. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 17:52:38 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Apr 2018 21:52:38 +0000 Subject: [issue31457] LoggerAdapter objects cannot be nested In-Reply-To: <1505333712.03.0.134308685605.issue31457@psf.upfronthosting.co.za> Message-ID: <1524433958.82.0.682650639539.issue31457@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6265 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 17:53:20 2018 From: report at bugs.python.org (Chris Bradbury) Date: Sun, 22 Apr 2018 21:53:20 +0000 Subject: [issue33333] ConfigParser.items returns items present in `DEFAULTSECT` when section argument given. In-Reply-To: <1524396036.58.0.682650639539.issue33333@psf.upfronthosting.co.za> Message-ID: <1524434000.13.0.682650639539.issue33333@psf.upfronthosting.co.za> Change by Chris Bradbury : ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 18:00:33 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Apr 2018 22:00:33 +0000 Subject: [issue31457] LoggerAdapter objects cannot be nested In-Reply-To: <1505333712.03.0.134308685605.issue31457@psf.upfronthosting.co.za> Message-ID: <1524434433.14.0.682650639539.issue31457@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset 26c289dd76ed07dbf37494bfa483c525f6828bd9 by ?ukasz Langa (Miss Islington (bot)) in branch '3.6': bpo-31457: Don't omit inner ``process()`` calls with nested LogAdapters (GH-4044) (#6568) https://github.com/python/cpython/commit/26c289dd76ed07dbf37494bfa483c525f6828bd9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 18:05:28 2018 From: report at bugs.python.org (Chris Bradbury) Date: Sun, 22 Apr 2018 22:05:28 +0000 Subject: [issue33333] ConfigParser.items returns items present in `DEFAULTSECT` when section argument given. In-Reply-To: <1524396036.58.0.682650639539.issue33333@psf.upfronthosting.co.za> Message-ID: <1524434728.75.0.682650639539.issue33333@psf.upfronthosting.co.za> Change by Chris Bradbury : ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python resolution: not a bug -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 18:29:42 2018 From: report at bugs.python.org (Matej Cepl) Date: Sun, 22 Apr 2018 22:29:42 +0000 Subject: [issue33336] [imaplib] MOVE is a legal command Message-ID: <1524436182.1.0.682650639539.issue33336@psf.upfronthosting.co.za> New submission from Matej Cepl : When running box = IMAP4_SSL(host) box.login(user, pass) msgs = somehowget_uids_of_messsages_to_move() box.uid('MOVE', msgs, 'target') I get an error "Unknown IMAP4 UID command: MOVE". The problem is that imaplib contains a list Commands of the permitted IMAP commands, and MOVE is not included, even though it is perfectly legal (and quite widely supported) command according to RFC-6851. ---------- components: Library (Lib) messages: 315632 nosy: mcepl priority: normal severity: normal status: open title: [imaplib] MOVE is a legal command versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 18:43:16 2018 From: report at bugs.python.org (Matej Cepl) Date: Sun, 22 Apr 2018 22:43:16 +0000 Subject: [issue33336] [imaplib] MOVE is a legal command In-Reply-To: <1524436182.1.0.682650639539.issue33336@psf.upfronthosting.co.za> Message-ID: <1524436996.56.0.682650639539.issue33336@psf.upfronthosting.co.za> Change by Matej Cepl : ---------- keywords: +patch pull_requests: +6266 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 18:58:00 2018 From: report at bugs.python.org (Matej Cepl) Date: Sun, 22 Apr 2018 22:58:00 +0000 Subject: [issue18153] python imaplib - error 'unexpected repsonse' In-Reply-To: <1370564442.51.0.371517794914.issue18153@psf.upfronthosting.co.za> Message-ID: <1524437880.69.0.682650639539.issue18153@psf.upfronthosting.co.za> Change by Matej Cepl : ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 19:42:12 2018 From: report at bugs.python.org (Mark Shannon) Date: Sun, 22 Apr 2018 23:42:12 +0000 Subject: [issue33325] Optimize sequences of constants in the compiler In-Reply-To: <1524312560.56.0.682650639539.issue33325@psf.upfronthosting.co.za> Message-ID: <1524440532.8.0.682650639539.issue33325@psf.upfronthosting.co.za> Mark Shannon added the comment: There seems to be an implicit assumption here that fewer bytecodes is better. But that isn't always the case. Do you have evidence that the sequence 0 LOAD_CONST 5 ((('a', 'b', 'c'), 3, 2, 1)) 2 UNPACK_SEQUENCE 4 is actually faster than 0 LOAD_CONST 0 (1) 2 LOAD_CONST 1 (2) 4 LOAD_CONST 2 (3) 6 LOAD_CONST 3 (('a', 'b', 'c')) ? The second sequence has more bytecodes, but the first has to create a new object. I think you ought to be careful using the word "optimize" unless the output is incontrovertibly superior. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 19:48:14 2018 From: report at bugs.python.org (Berker Peksag) Date: Sun, 22 Apr 2018 23:48:14 +0000 Subject: [issue991266] Cookie.py does not correctly quote Morsels Message-ID: <1524440894.49.0.682650639539.issue991266@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset d5a2377c3d70e4143bcbee4a765b3434e21f683a by Berker Peksag in branch 'master': bpo-991266: Fix quoting of Comment attribute of SimpleCookie (GH-6555) https://github.com/python/cpython/commit/d5a2377c3d70e4143bcbee4a765b3434e21f683a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 19:48:27 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Apr 2018 23:48:27 +0000 Subject: [issue991266] Cookie.py does not correctly quote Morsels Message-ID: <1524440907.6.0.682650639539.issue991266@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6267 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 19:49:21 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Apr 2018 23:49:21 +0000 Subject: [issue991266] Cookie.py does not correctly quote Morsels Message-ID: <1524440961.39.0.682650639539.issue991266@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6268 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 20:22:11 2018 From: report at bugs.python.org (Brett Cannon) Date: Mon, 23 Apr 2018 00:22:11 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1524442931.96.0.682650639539.issue33277@psf.upfronthosting.co.za> Brett Cannon added the comment: @Nick: We've had this discussion before about specs being a "receipt" of import versus not and the last time we agreed on not. :) That's why we raise a warning if __package__ doesn't match __spec__.parent: https://github.com/python/cpython/blob/d5a2377c3d70e4143bcbee4a765b3434e21f683a/Lib/importlib/_bootstrap.py#L1056-L1059 It's documented through https://docs.python.org/3/reference/import.html#__package__ by saying __package__ has to match __spec__.parent. We didn't make it stronger since we can't get rid of any of these attributes until Python 2.7 compatibility is no longer a concern. And I believe __package__/__spec__.parent is the only attribute whose data is in any way directly relied on in importlib which is being proposed for removal (e.g. __file__, __cached__, and __loader__ are just recorded). @Raymond: Thanks for the teaching info. I actually opened this after running dir() on a module and having there be just as many module-related attributes as defined attributes. @Antoine: we can keep __file__ if necessary (I was on the fence about keeping it to begin with). But as Barry pointed out, bugs have occurred because we now have two places for most of these details and people don't always know which one to update. @Barry: the tricky bit is what to do if someone sets their own __getattr__() on a module? E.g. I just published modutil which provides a __getattr__ for lazy importing, so users of this would need a way to not have either function get stomped on by the other. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 20:58:33 2018 From: report at bugs.python.org (Berker Peksag) Date: Mon, 23 Apr 2018 00:58:33 +0000 Subject: [issue991266] Cookie.py does not correctly quote Morsels Message-ID: <1524445113.11.0.682650639539.issue991266@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 9fc998d761591f2741d8e94f5b3009c56ae83882 by Berker Peksag (Miss Islington (bot)) in branch '3.7': bpo-991266: Fix quoting of Comment attribute of SimpleCookie (GH-6555) https://github.com/python/cpython/commit/9fc998d761591f2741d8e94f5b3009c56ae83882 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 20:58:53 2018 From: report at bugs.python.org (Berker Peksag) Date: Mon, 23 Apr 2018 00:58:53 +0000 Subject: [issue991266] Cookie.py does not correctly quote Morsels Message-ID: <1524445133.77.0.682650639539.issue991266@psf.upfronthosting.co.za> Berker Peksag added the comment: New changeset 8a6f4b4bba950fb8eead1b176c58202d773f2f70 by Berker Peksag (Miss Islington (bot)) in branch '3.6': bpo-991266: Fix quoting of Comment attribute of SimpleCookie (GH-6555) https://github.com/python/cpython/commit/8a6f4b4bba950fb8eead1b176c58202d773f2f70 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:04:08 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:04:08 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library Message-ID: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> New submission from ?ukasz Langa : Python includes a set of batteries that enable parsing of Python code. This includes its own AST (provided in the standard library under the `ast` module), as well as a pure Python tokenizer (provided in the standard library under `tokenize` and `token`). It also provides an undocumented CST under lib2to3, which contains its own outdated and patched copies of `tokenize` and `token`. This situation causes the following issues for users of Python: - the built-in AST does not preserve comments or whitespace; - the built-in AST increasingly modifies the tree before presenting it to user code (constant folding moved to the AST in Python 3.7); - the built-in tokenize.py can only be used to parse Python 3.7+ code; - the version in lib2to3 is partially customized and partially outdated, leaving bits of new grammar not supported; new bits of grammar very often get overlooked in lib2to3. - lib2to3 is not documented. So if users want to write tools that manipulate Python code, the standard library doesn't provide them with great options. I suggest the following plan: 1. Bring Lib/lib2to3/pgen2/tokenize.py to the same state as Lib/tokenize.py (leaving the bits that allow for parsing of Python 3.6 and older files). 2. Merge the two tokenizers in Python 3.8 so that Lib/tokenize.py now officially supports tokenizing Python 2.7 - 3.7 code. 3. Update Lib/lib2to3/pgen2 and move it under Lib/pgen. Document it as the built-in CST provided by Python for use in applications which require code modification. Make it still officially support parsing of Python 2.7 - 3.7 code. All three changes are made in a backwards-compatible fashion, existing code should NOT break. That being said, the parser under Lib/pgen might grow some new behavior compared to the compatibility mode for lib2to3, I specifically seek to improve handling of comments and error recovery. ---------- components: Library (Lib) messages: 315638 nosy: benjamin.peterson, gregory.p.smith, gvanrossum, lukasz.langa, serhiy.storchaka priority: normal severity: normal status: open title: Provide a supported Concrete Syntax Tree implementation in the standard library versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:04:56 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:04:56 +0000 Subject: [issue33338] [lib2to3] Synchronize token.py and tokenize.py with the standard library Message-ID: <1524445496.4.0.682650639539.issue33338@psf.upfronthosting.co.za> New submission from ?ukasz Langa : lib2to3's token.py and tokenize.py were initially copies of the respective files from the standard library. They were copied to allow Python 3 to read Python 2's grammar. Since 2006, lib2to3 grew to be widely used as a Concrete Syntax Tree, also for parsing Python 3 code. Additions to support Python 3 grammar were added but sadly, the main token.py and tokenize.py diverged. This change brings them back together, minimizing the differences to the bare minimum that is in fact required by lib2to3. Before this change, almost every line in lib2to3/pgen2/tokenize.py was different from tokenize.py. After this change, the diff between the two files is only 175 lines long and is entirely filled with relevant Python 2 compatibility bits. Merging the implementations, there's numerous fixes to the lib2to3 tokenizer: + docstrings made as similar as possible + ported `TokenInfo` + ported `tokenize.tokenize()` and `tokenize.open()` + removed Python 2-only implementation cruft + fixes Unicode identifier handling + fixes string prefix handling + fixes Ellipsis handling + Untokenizer backported bugfixes: - 5e6db313686c200da425a54d2e0c95fa40107b1d - 9dc3a36c849c15c227a8af218cfb215abe7b3c48 - 5b8d2c3af76e704926cf5915ad0e6af59a232e61 - e411b6629fb5f7bc01bec89df75737875ce6d8f5 - BPO-2495 + tokenizer doesn't crash on missing newline at the end of the stream (added \Z (end of string) to PseudoExtras) - BPO-16152 + `find_cookie` includes file name in error messages, if available + `find_cookie` raises SyntaxError on invalid encodings: BPO-14990 Improvements to lib2to3/pgen2/token.py: + taken from the current Lib/token.py + tokens renumbered to match Lib/token.py + `__all__` properly defined + ASYNC, AWAIT and BACKQUOTE exist under different numbers (100 + old number) + ELLIPSIS added + ENCODING added ---------- components: 2to3 (2.x to 3.x conversion tool), Library (Lib) messages: 315639 nosy: lukasz.langa priority: normal severity: normal status: open title: [lib2to3] Synchronize token.py and tokenize.py with the standard library versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:05:31 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:05:31 +0000 Subject: [issue33338] [lib2to3] Synchronize token.py and tokenize.py with the standard library In-Reply-To: <1524445496.4.0.682650639539.issue33338@psf.upfronthosting.co.za> Message-ID: <1524445531.55.0.682650639539.issue33338@psf.upfronthosting.co.za> ?ukasz Langa added the comment: ### Diff between files The unified diff between tokenize implementations is here: https://gist.github.com/ambv/679018041d85dd1a7497e6d89c45fb86 It clocks at 275 lines but that's because it gives context. The actual diff is 175 lines long. To make it that small, I needed to move some insignificant bits in Lib/tokenize.py. This is what the other PR on this issue is about. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:09:05 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:09:05 +0000 Subject: [issue33338] [lib2to3] Synchronize token.py and tokenize.py with the standard library In-Reply-To: <1524445496.4.0.682650639539.issue33338@psf.upfronthosting.co.za> Message-ID: <1524445745.42.0.682650639539.issue33338@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- keywords: +patch pull_requests: +6269 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:09:05 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:09:05 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524445745.52.0.0935424498089.issue33337@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- keywords: +patch pull_requests: +6270 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:09:05 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:09:05 +0000 Subject: [issue2495] tokenize doesn't handle __future__.unicode_literals correctly In-Reply-To: <1206618603.55.0.554342479222.issue2495@psf.upfronthosting.co.za> Message-ID: <1524445745.63.0.548999895584.issue2495@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- pull_requests: +6271 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:09:05 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:09:05 +0000 Subject: [issue14990] detect_encoding should fail with SyntaxError on invalid encoding In-Reply-To: <1338719342.67.0.917704298784.issue14990@psf.upfronthosting.co.za> Message-ID: <1524445745.69.0.918678401297.issue14990@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- pull_requests: +6272 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:09:05 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:09:05 +0000 Subject: [issue16152] Trailing whitespace makes tokenize.generate_tokens pathological In-Reply-To: <1349557761.41.0.537472367724.issue16152@psf.upfronthosting.co.za> Message-ID: <1524445745.79.0.808014300838.issue16152@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- pull_requests: +6273 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:12:32 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:12:32 +0000 Subject: [issue33338] [lib2to3] Synchronize token.py and tokenize.py with the standard library In-Reply-To: <1524445496.4.0.682650639539.issue33338@psf.upfronthosting.co.za> Message-ID: <1524445952.81.0.682650639539.issue33338@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- pull_requests: +6274 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:17:36 2018 From: report at bugs.python.org (kmoultry37@gmail.com) Date: Mon, 23 Apr 2018 01:17:36 +0000 Subject: [issue33321] Add a Linux clang ubsan undefined behavior sanitizer buildbot In-Reply-To: <1524268101.98.0.682650639539.issue33321@psf.upfronthosting.co.za> Message-ID: <1524446256.76.0.682650639539.issue33321@psf.upfronthosting.co.za> Change by kmoultry37 at gmail.com : ---------- versions: +Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:26:42 2018 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 23 Apr 2018 01:26:42 +0000 Subject: [issue16152] Trailing whitespace makes tokenize.generate_tokens pathological In-Reply-To: <1349557761.41.0.537472367724.issue16152@psf.upfronthosting.co.za> Message-ID: <1524446802.26.0.682650639539.issue16152@psf.upfronthosting.co.za> Ned Batchelder added the comment: PR 6273 is mentioned, but I think 6573 is the correct number. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:28:03 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:28:03 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524446883.02.0.682650639539.issue33337@psf.upfronthosting.co.za> ?ukasz Langa added the comment: See BPO-33338 for an implementation of Step 1. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:28:54 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:28:54 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524446934.79.0.682650639539.issue33337@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- pull_requests: -6270 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:29:14 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 01:29:14 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524446954.69.0.682650639539.issue33337@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- keywords: -patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 21:41:08 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Apr 2018 01:41:08 +0000 Subject: [issue33315] Allow queue.Queue to be used in type annotations In-Reply-To: <1524139376.68.0.682650639539.issue33315@psf.upfronthosting.co.za> Message-ID: <1524447668.43.0.682650639539.issue33315@psf.upfronthosting.co.za> Raymond Hettinger added the comment: > Another solution may be to add a simple `__class_getitem__` to `Queue` > that will just return `cls` I don't think it makes sense to let typing considerations start to spill into the rest of the standard library. Either add support to typing or not. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 22:36:16 2018 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 23 Apr 2018 02:36:16 +0000 Subject: [issue33315] Allow queue.Queue to be used in type annotations In-Reply-To: <1524447668.43.0.682650639539.issue33315@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Disagree strongly. More later. On Sun, Apr 22, 2018, 18:41 Raymond Hettinger wrote: > > Raymond Hettinger added the comment: > > > Another solution may be to add a simple `__class_getitem__` to `Queue` > > that will just return `cls` > > I don't think it makes sense to let typing considerations start to spill > into the rest of the standard library. Either add support to typing or not. > > ---------- > nosy: +rhettinger > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 22 22:41:59 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Apr 2018 02:41:59 +0000 Subject: [issue25478] Consider adding a normalize() method to collections.Counter() In-Reply-To: <1445826280.05.0.307309053044.issue25478@psf.upfronthosting.co.za> Message-ID: <1524451319.28.0.682650639539.issue25478@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +6275 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 00:23:55 2018 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 23 Apr 2018 04:23:55 +0000 Subject: [issue33315] Allow queue.Queue to be used in type annotations In-Reply-To: <1524139376.68.0.682650639539.issue33315@psf.upfronthosting.co.za> Message-ID: <1524457435.56.0.682650639539.issue33315@psf.upfronthosting.co.za> Guido van Rossum added the comment: [Raymond] > I don't think it makes sense to let typing considerations > start to spill into the rest of the standard library. > Either add support to typing or not. We can't possibly add every stdlib class that's generic to typing.py -- it just doesn't scale. It also doesn't make sense to import everything from typing. Arguably there are already some things in typing that don't belong there -- I'm thinking in particular of the 'io' and 're' classes. Those were a compromise to get the (in my opinion) most popular and fundamental classes quickly typed. But we definitely shouldn't continue down this path. Type annotations is here to stay (there's an increasing number of PEPs about it) and in the longer term we should support it directly in the appropriate stdlib modules. We're not ready to do that but we should start thinking about it. Until we've gotten a firmer decision I don't think we should do one-offs, so I don't think Queue should be made generic right now, but we definitely shouldn't add it to typing. Users who are using typing should continue to consider themselves lucky to be early adopters and will occasionally pay a small price, such as putting the type in quotes or (for users on 3.7+) using "from __future__ import annotations". PS. Raymond, please avoid pejoratives like "spill" in the future when talking about types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 00:48:05 2018 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 23 Apr 2018 04:48:05 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524458885.95.0.682650639539.issue33337@psf.upfronthosting.co.za> Guido van Rossum added the comment: I'm glad you've rediscovered pgen2! I'm in favor of unifying the tokenizers and of updating and moving pgen2 (though I don't have time to do the work). I'm not sure if it's technically possible to give tokenize.py the ability to tokenize Python 2.7 and up without some version-selection flag -- have you researched this part yet? Also I think you may have to make a distinction between the parser generator and its data structures, and between the generated parser for Python vs. the parser for other LL(1) grammars one might feed into it. And I don't think you're proposing to replace Parser/pgen.c with Lib/pgen/, right? Nor to replace the CST actually used by CPython's parser with the data structures used by pgen2's driver. So the relationship between the CST you propose to document and CPython internals wouldn't be quite the same as that between the AST used by CPython and the ast module (since those *do* actually use the same code). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 03:01:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Apr 2018 07:01:28 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524466888.49.0.682650639539.issue33337@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > - the built-in AST increasingly modifies the tree before presenting it to user > code (constant folding moved to the AST in Python 3.7); These modification are applied only before bytecodecode generation. The AST presented to user is not modified. > - the built-in tokenize.py can only be used to parse Python 3.7+ code; Is this a problem? 2.7 is a dead Lib/lib2to3/pgen2/tokenize.pyend, its support will be ended in less than 2 years. Even 3.6 will be moved to a security only fixes stage short time after releasing 3.8. I'm in favor of updating Lib/lib2to3/pgen2/tokenize.py, but I don't understand why Lib/tokenize.py should parse 2.7. I'm in favor of reimplementing pgen in Python if this will simplify the code and the building process. Python code is simpler than C code, this code is not performance critical, and in any case we need an external Python when modify grammar of bytecode. See also issue30455 where I try to get rid of duplications by generating all tokens-related data and code from a single source (token.py or external text file). For what purposes the CST is needed besides 2to3? I know only that it could help to determine the correct position in docstrings in doctests and similar tools which need to process docstrings and report errors. This is not possible with AST due to inlined '\n', escaped newlines, and string literals concatenation. Changes in 3.7 made this even worse (see issue32911). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 03:36:12 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 07:36:12 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524468972.68.0.682650639539.issue33337@psf.upfronthosting.co.za> ?ukasz Langa added the comment: > I'm in favor of unifying the tokenizers and of updating and moving pgen2 (though I don't have time to do the work). I'm willing to do all the work as long as I have somebody to review it. Case in point: BPO-33338. > Also I think you may have to make a distinction between the parser generator and its data structures, and between the generated parser for Python vs. the parser for other LL(1) grammars one might feed into it. Technically pgen2 has the ability to parse any LL(1) grammar but so far the plumbing is tightly tied to the tokenizer. We'd need to enable plugging that in, too. > And I don't think you're proposing to replace Parser/pgen.c with Lib/pgen/, right? No, I'm not. > Nor to replace the CST actually used by CPython's parser with the data structures used by pgen2's driver. No, I'm not. > So the relationship between the CST you propose to document and CPython internals wouldn't be quite the same as that between the AST used by CPython and the ast module (since those *do* actually use the same code). Right. Once we unify the standard library tokenizers (note: *not* tokenizer.c which will stay), there wouldn't be much extra documentation to write for Lib/tokenize.py. For Lib/pgen/ itself, we'd need to provide both an API rundown and an intro to the high-level functionality (how to create trees from files, string, etc.; how to visit trees and edit them; and so on). > I'm not sure if it's technically possible to give tokenize.py the ability to tokenize Python 2.7 and up without some version-selection flag -- have you researched this part yet? There's two schools. This is going to take a while to explain :) One school is to force the caller to declare what Python version they want to parse. This is algorithmically cleaner because we can then literally take Grammar/Grammar from various versions of Python and have the user worry about picking the right one. The other school is what lib2to3 does currently, which is to try to implement as much of a superset of Python versions as possible. This is way easier to use because the grammar is very forgiving. However, this has limitations. There are three major incompatibilities that we need to deal with, with raising degree of severity: - async/await; - print statements; - exec statements. Async and await became proper keywords in 3.7 and thus broke usage of those as names. It's relatively easy to work around this one seamlessly by keeping the grammar trickery we've had in place for 3.5 and 3.6. This is what lib2to3 does today already?? The print statement is fundamentally incompatible with the print function. lib2to3 has two grammar variants and most users by default choose the one without the print statement. Why? Because it cannot be reliably sniffed anymore. Python 3-only code will not use the __future__ import. In fact, 2to3 also doesn't do auto-detection, relies on the user running `2to3 -p` to indicate they mean the grammar with the print function. The exec statement is even worse because there isn't even a __future__ import. It's annoying because it creates a third combination. ?? So now the driver has to attempt three grammars (in this order): - the almost compatible combined Python 2 + Python 3 one (that assumes exec is a function and print is a function); - the one that assumes exec is a *statement* but print is still a function (because __future__ import); - the one that exposes the legacy exec and print statements. This approach has one annoying wart. Imagine you have a file like this: print('msg', file=sys.stderr) if Now the driver will attempt all three grammars and fail, and will report that the parse error is on the print line. This can be overcome by comparing syntax errors from each grammar and showing the one on the furthest line (which is the most likely to be the real culprit). But it's still annoying and will sometimes not do what the user wanted. -- OK, OK. So which to choose? And now, while this sounds like more work and is harder to get right, I still think the combined grammar with minimal incompatibilities is the better approach. Why? Two reasons. 1. Nobody ever knows what Python version *exactly* a given file is. Most files aren't even considering compatibility that fine-grained. And having to attempt to parse not three but potentially 8 grammars (3.7 - 3.2, 2.7, 2.6) would be prohibitively slow. 2. My tool maybe wants to actually *modify* the compatibility level by, say, rewriting ''.format() with f-strings or putting trailing commas where old Pythons didn't accept them. So it would be awkward if the grammar I used to read the file wasn't compatible with my later changes. Unless I'm swayed otherwise, I'd continue on what lib2to3 did, with the exception that we need to add a grammar variant without the `exec` statement, and the driver needs to attempt parsing with the three grammars on its own, with proper syntax error reporting. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 04:01:21 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 08:01:21 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524470481.51.0.682650639539.issue33337@psf.upfronthosting.co.za> ?ukasz Langa added the comment: > These modification are applied only before bytecodecode generation. The AST presented to user is not modified. This bit me when implementing PEP 563 but I was then on the compile path, right. Still, the latest docstring folding would qualify as an example here, too, no? > Is this a problem? 2.7 is a dead end, its support will be ended in less than 2 years. Even 3.6 will be moved to a security only fixes stage short time after releasing 3.8. Yes, it is a problem. We will support Python 2 until 2020 but people will be running Python 2 code for a decade *at least*. We need to provide those people a way to move their code forward. Static analysis tools like formatters, linters, type checkers, or 2to3-style translators, are all soon going to run on Python 3. It would be a shame if those programs were barred from helping users that are still struggling on Python 2. A closer example is async/await. It would be a shame if running on Python 3.7 meant you can't write a tool that renames (or even just *detects*) invalid uses of async/await. I firmly believe that the version of the runtime should be indepedent of the version it's able to analyze. > I'm in favor of updating Lib/lib2to3/pgen2/tokenize.py, but I don't understand why Lib/tokenize.py should parse 2.7. Hopefully I sufficiently explained that above. > I'm in favor of reimplementing pgen in Python if this will simplify the code and the building process. Python code is simpler than C code, this code is not performance critical, and in any case we need an external Python when modify grammar of bytecode. Well, I didn't think about abandoning pgen. I admit that's mostly because my knee-jerk reaction was that it would be too slow. But you're right that this is not performance critical because every `pip install` runs `compileall`. I guess we could parse in "strict" mode for Python itself but allow for multiple grammars for standard library use (as I explained in the reply to Guido). And this would most likely give us opportunity to iterate on grammar improvements in the future. And yet, I'm cautious here. Even ignoring performance, that sounds like a more ambitious task from what I'm attempting. Unless I find partners in crime for this, I wouldn't attempt that. And I would need thumbs up from the BDFL and performance-wary contributors. > For what purposes the CST is needed besides 2to3? Anywhere where you need the full view of the code which includes non-semantic pieces. Those include: - whitespace; - comments; - parentheses; - commas; - strings prefixes. The main use case is linters and refactoring tools. For example mypy is using a modified AST to support type comments. YAPF and Black are based on lib2to3 because as formatters they can't lose comments, string prefixes, and organizational parentheses either. JEDI is using Parso, a lib2to3 fork, for similar reasons. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 04:07:19 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 08:07:19 +0000 Subject: [issue33338] [lib2to3] Synchronize token.py and tokenize.py with the standard library In-Reply-To: <1524445496.4.0.682650639539.issue33338@psf.upfronthosting.co.za> Message-ID: <1524470839.92.0.682650639539.issue33338@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset c2d384dbd7c6ed9bdfaac45f05b463263c743ee7 by ?ukasz Langa in branch 'master': bpo-33338: [tokenize] Minor code cleanup (#6573) https://github.com/python/cpython/commit/c2d384dbd7c6ed9bdfaac45f05b463263c743ee7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 04:23:44 2018 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Mon, 23 Apr 2018 08:23:44 +0000 Subject: [issue33319] `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe In-Reply-To: <1524229514.84.0.682650639539.issue33319@psf.upfronthosting.co.za> Message-ID: <1524471824.82.0.682650639539.issue33319@psf.upfronthosting.co.za> Pekka Kl?rck added the comment: My goal is to read stdout. It's good to hear `subprocess.run()` is deadlock-safe and I can use it safely. Making the docs explicit about it so that others know it's safe would in my opinion be a good idea as well. Casual users don't know `run()` it uses `communicate()`, not `wait()`, internally, or even that this would mean it cannot deadlock. The current situation when the docs say that `call()` shouldn't be used with `stdout=PIPE` and that `call(...)` is equivalent to `run(...).returncode` indicates `stdout=PIPE` is unsafe with `run()` as well. A separate questions is that if `call(...)` is equivalent to `run(...).returncode`, should it also be implemented that way. Based on this discussion it would avoid the problem with `stdout=PIPE` also in that case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 04:38:32 2018 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Mon, 23 Apr 2018 08:38:32 +0000 Subject: [issue33339] Using default encoding with `subprocess.run()` is not obvious Message-ID: <1524472712.16.0.682650639539.issue33339@psf.upfronthosting.co.za> New submission from Pekka Kl?rck : It is possible to use `subprocess.run()` with the system's default encoding by using `universal_newlines=True`. This is very handy, but it's not at all obvious (at least for me) that setting such option has effect on encoding. This is especially true when the docs don't explain this explicitly: """If encoding or errors are specified, or universal_newlines is true, file objects for stdin, stdout and stderr are opened in text mode using the specified encoding and errors or the io.TextIOWrapper default.""" This is such a useful feature that it ought to be documented better, preferably with an example. >From code reading point of view, I would also consider `encoding=True` to be more explicit that `universal_newlines=True`. I can submit a separate issue about that if others feel the same. ---------- messages: 315652 nosy: pekka.klarck priority: normal severity: normal status: open title: Using default encoding with `subprocess.run()` is not obvious _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 05:51:36 2018 From: report at bugs.python.org (sam_b) Date: Mon, 23 Apr 2018 09:51:36 +0000 Subject: [issue33340] Inaccurate docs on `import` behaviour Message-ID: <1524477096.11.0.682650639539.issue33340@psf.upfronthosting.co.za> New submission from sam_b : The docs https://docs.python.org/3/tutorial/modules.html#the-module-search-path describe: > When a module named spam is imported, the interpreter first searches for a built-in module with that name. If not found, it then searches for a file named spam.py in a list of directories given by the variable sys.path. sys.path is initialized from these locations: > - The directory containing the input script (or the current directory when no file is specified). > - PYTHONPATH (a list of directory names, with the same syntax as the shell variable PATH). > - The installation-dependent default. However, it seems like "the directory containing the input script" is checked *before* the standard library: ? tmp more logging.py def foo(): print('bar') ? tmp python Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import logging >>> logging.foo() bar >>> logging.WARNING Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'WARNING' >>> Am I misunderstanding the docs? ---------- assignee: docs at python components: Documentation messages: 315653 nosy: docs at python, sam_b priority: normal severity: normal status: open title: Inaccurate docs on `import` behaviour type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 05:59:42 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 09:59:42 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524477582.33.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: I don't think we want to be in the business of maintaining a list of cross-platform of supported signal values. Python may be compiled on bizarre non-glibc systems (or even systems with a proprietary libc). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 06:08:13 2018 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 23 Apr 2018 10:08:13 +0000 Subject: [issue33340] Inaccurate docs on `import` behaviour In-Reply-To: <1524477096.11.0.682650639539.issue33340@psf.upfronthosting.co.za> Message-ID: <1524478093.99.0.682650639539.issue33340@psf.upfronthosting.co.za> Eric V. Smith added the comment: "built-in modules" has the specific meaning of modules that are compiled in to the python executable. It doesn't mean modules in the standard library. See https://docs.python.org/3.6/library/sys.html#sys.builtin_module_names Python 3.6.4 (default, Jan 7 2018, 15:53:53) [GCC 6.4.0] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.builtin_module_names ('_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype', 'zipimport') ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 06:12:22 2018 From: report at bugs.python.org (Gianfranco) Date: Mon, 23 Apr 2018 10:12:22 +0000 Subject: [issue33341] python3 fails to build if directory or sysroot contains "*icc*" string Message-ID: <1524478342.39.0.682650639539.issue33341@psf.upfronthosting.co.za> New submission from Gianfranco : Hello, as said, in yocto we pass in $CC environment, also the --sysroot keyword. If --sysroot contains the "*icc*" or "*gcc*" in path, the build fails because of wrong autoconf checks. checking in a case switch for *icc* seems bad to me, I propose to change it with something like "*icc" so we might exclude when icc is not the compiler. I know this isn't a strong patch, but maybe we can apply it while writing some better detect code. The build fails as descripted in the yocto bug https://bugzilla.yoctoproject.org/show_bug.cgi?id=12703 ---------- components: Build files: patch messages: 315656 nosy: locutusofborg priority: normal severity: normal status: open title: python3 fails to build if directory or sysroot contains "*icc*" string type: compile error versions: Python 3.8 Added file: https://bugs.python.org/file47547/patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 06:27:58 2018 From: report at bugs.python.org (sam_b) Date: Mon, 23 Apr 2018 10:27:58 +0000 Subject: [issue33340] Inaccurate docs on `import` behaviour In-Reply-To: <1524477096.11.0.682650639539.issue33340@psf.upfronthosting.co.za> Message-ID: <1524479278.03.0.682650639539.issue33340@psf.upfronthosting.co.za> sam_b added the comment: Thanks, I thought it might be something like that. Would it be worth clarifying the distinction in the docs? It was certainly surprising to me that `import time` and `import logging` behave differently. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 06:30:32 2018 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 23 Apr 2018 10:30:32 +0000 Subject: [issue33340] Inaccurate docs on `import` behaviour In-Reply-To: <1524477096.11.0.682650639539.issue33340@psf.upfronthosting.co.za> Message-ID: <1524479432.37.0.682650639539.issue33340@psf.upfronthosting.co.za> Eric V. Smith added the comment: If you have a suggested improvement, please create a pull request. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 06:58:13 2018 From: report at bugs.python.org (Adhemerval Zanella) Date: Mon, 23 Apr 2018 10:58:13 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524481093.83.0.682650639539.issue33329@psf.upfronthosting.co.za> Adhemerval Zanella added the comment: Yes I am aware, but I can't see a really portable way to provide the same functionality as 'sigfillset'. Ideally a libc implementation would return EINVAL on 'sigaddset' for invalid signals, but even for glibc this is not true (the very issue I fixed). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 07:10:25 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 11:10:25 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524481825.43.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Right, but it seems that even if sigaddset() allowed you to "set" signals 32 and 33, that would be ignored by pthread_sigmask(). This is what I get here (Ubuntu 16.04, glibc 2.23): >>> signal.pthread_sigmask(signal.SIG_BLOCK, range(1, 65)) set() >>> signal.pthread_sigmask(signal.SIG_BLOCK, range(1, 65)) {, , , , , , , , , , , , , , 16, , , , , , , , , , , , , , , , 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 07:22:54 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 11:22:54 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524482574.96.0.682650639539.issue33329@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- keywords: +patch pull_requests: +6276 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 07:29:19 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 11:29:19 +0000 Subject: [issue30750] Update `make patchcheck` to understand Misc/NEWS.d In-Reply-To: <1498347959.85.0.344853864513.issue30750@psf.upfronthosting.co.za> Message-ID: <1524482959.14.0.682650639539.issue30750@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- pull_requests: +6277 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 08:16:07 2018 From: report at bugs.python.org (Adhemerval Zanella) Date: Mon, 23 Apr 2018 12:16:07 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524485767.11.0.682650639539.issue33329@psf.upfronthosting.co.za> Adhemerval Zanella added the comment: Yes, this is the issue I referred in previous comment [1]. Unfortunately it is only fixed on master (which will become 2.28). [1] https://sourceware.org/bugzilla/show_bug.cgi?id=22391 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 08:21:40 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 12:21:40 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524486100.16.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Not sure what you mean. In the example above, I try to block signals 32 and 33 using pthread_sigmask(), but the pthread_sigmask() return value shows they weren't blocked, which is ok. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 08:29:41 2018 From: report at bugs.python.org (Semyon Proshev) Date: Mon, 23 Apr 2018 12:29:41 +0000 Subject: [issue33315] Allow queue.Queue to be used in type annotations In-Reply-To: <1524139376.68.0.682650639539.issue33315@psf.upfronthosting.co.za> Message-ID: <1524486581.79.0.682650639539.issue33315@psf.upfronthosting.co.za> Semyon Proshev added the comment: I had been thinking about `__class_getitem__` when the issue were created. I suspected it's not difficult to implement and it follows PEP 560. So I'm +1 for `__class_item__`, quotes and postponed evaluation are also ok. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 08:32:22 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 23 Apr 2018 12:32:22 +0000 Subject: [issue31500] IDLE: Tiny font on HiDPI display In-Reply-To: <1505674446.46.0.331613884884.issue31500@psf.upfronthosting.co.za> Message-ID: <1524486742.81.0.682650639539.issue31500@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I guess I was not clear enough that I will test on Windows after someone else does a backport that works on Linux. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 08:34:51 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Apr 2018 12:34:51 +0000 Subject: [issue25478] Consider adding a normalize() method to collections.Counter() In-Reply-To: <1445826280.05.0.307309053044.issue25478@psf.upfronthosting.co.za> Message-ID: <1524486891.26.0.682650639539.issue25478@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Was __rtruediv__ discussed before? What is the use case for it? Besides __rtruediv__ all LGTM. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 08:54:32 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Apr 2018 12:54:32 +0000 Subject: [issue31500] IDLE: Tiny font on HiDPI display In-Reply-To: <1505674446.46.0.331613884884.issue31500@psf.upfronthosting.co.za> Message-ID: <1524488072.91.0.682650639539.issue31500@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: You promised to make backports to 2.7 when did the mass files renaming. The simple cherry-picking doesn't work, and I even don't know what files in 2.7 should be changed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 09:01:04 2018 From: report at bugs.python.org (Adhemerval Zanella) Date: Mon, 23 Apr 2018 13:01:04 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524488464.63.0.682650639539.issue33329@psf.upfronthosting.co.za> Adhemerval Zanella added the comment: What I mean is for master glibc, which contains BZ#22391, 'sigaddset' will fail do add signal 32 and 33. But since you are now ignoring 'sigaddset' return code, it does not matter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 09:44:30 2018 From: report at bugs.python.org (benaryorg) Date: Mon, 23 Apr 2018 13:44:30 +0000 Subject: [issue33342] urllib IPv6 parsing fails with special characters in passwords Message-ID: <1524491070.85.0.682650639539.issue33342@psf.upfronthosting.co.za> New submission from benaryorg : The documentation specifies to follow RFC 2396 (https://tools.ietf.org/html/rfc2396.html) but fails to parse a user:password at host url in urllib.parse.urlsplit (https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlsplit) when the password contains an '[' character. This is because the urlsplit code does not strip the authority part (everything from index 0 up to and including the last '@') before checking whether the hostname contains '[' for detecting whether it's an IPv6 address (https://github.com/python/cpython/blob/8a6f4b4bba950fb8eead1b176c58202d773f2f70/Lib/urllib/parse.py#L416-L418). ---------- components: Library (Lib) messages: 315668 nosy: benaryorg priority: normal severity: normal status: open title: urllib IPv6 parsing fails with special characters in passwords versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 09:44:45 2018 From: report at bugs.python.org (benaryorg) Date: Mon, 23 Apr 2018 13:44:45 +0000 Subject: [issue33342] urllib IPv6 parsing fails with special characters in passwords In-Reply-To: <1524491070.85.0.682650639539.issue33342@psf.upfronthosting.co.za> Message-ID: <1524491085.04.0.682650639539.issue33342@psf.upfronthosting.co.za> Change by benaryorg : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 11:04:18 2018 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 23 Apr 2018 15:04:18 +0000 Subject: [issue33315] Allow queue.Queue to be used in type annotations In-Reply-To: <1524486581.79.0.682650639539.issue33315@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Could you please product a draft PR showing how that would work? It might not be accepted right away but it would be useful to have. On Mon, Apr 23, 2018, 05:29 Semyon Proshev wrote: > > Semyon Proshev added the comment: > > I had been thinking about `__class_getitem__` when the issue were created. > > I suspected it's not difficult to implement and it follows PEP 560. > So I'm +1 for `__class_item__`, quotes and postponed evaluation are also > ok. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 11:08:18 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 15:08:18 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524496098.93.0.682650639539.issue33329@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- nosy: +neologix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 12:40:10 2018 From: report at bugs.python.org (Steve Dower) Date: Mon, 23 Apr 2018 16:40:10 +0000 Subject: [issue33316] PyThread_release_lock always fails In-Reply-To: <1524183536.18.0.682650639539.issue33316@psf.upfronthosting.co.za> Message-ID: <1524501610.12.0.682650639539.issue33316@psf.upfronthosting.co.za> Steve Dower added the comment: Looks okay, but I wonder whether the implementation of PyMUTEX_UNLOCK should return something other than zero? What is it meant to return? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 13:46:18 2018 From: report at bugs.python.org (Victor Porton) Date: Mon, 23 Apr 2018 17:46:18 +0000 Subject: [issue33343] Subcommand abbreviations Message-ID: <1524505578.79.0.682650639539.issue33343@psf.upfronthosting.co.za> New submission from Victor Porton : https://docs.python.org/3/library/argparse.html does not allow abbreviations for subparsers ("subcommands"). It seems inconsistent that long options can be abbreviated but subcommands cannot. Either implement subcommand abbreviations or explain in the docs why there is none. ---------- components: Library (Lib) messages: 315671 nosy: porton priority: normal severity: normal status: open title: Subcommand abbreviations type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 13:46:51 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 23 Apr 2018 17:46:51 +0000 Subject: [issue33289] tkinter askcolor returning floats for r, g, b values instead of ints In-Reply-To: <1523915381.82.0.682650639539.issue33289@psf.upfronthosting.co.za> Message-ID: <1524505611.06.0.682650639539.issue33289@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- keywords: +patch pull_requests: +6278 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 14:53:43 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 18:53:43 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524509623.32.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 25038ecfb665bef641abf8cb61afff7505b0e008 by Antoine Pitrou in branch 'master': bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) https://github.com/python/cpython/commit/25038ecfb665bef641abf8cb61afff7505b0e008 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 14:54:17 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Apr 2018 18:54:17 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524509657.88.0.682650639539.issue33329@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6279 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 14:54:46 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Apr 2018 18:54:46 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524509686.78.0.682650639539.issue33329@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6280 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 15:16:23 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 19:16:23 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1524510983.18.0.682650639539.issue33251@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset 1d4a733cceee237f0850b7887c2945dee707da27 by ?ukasz Langa (Chris Bradbury) in branch 'master': bpo-33251: Prevent ConfigParser.items returning items present in vars. (#6446) https://github.com/python/cpython/commit/1d4a733cceee237f0850b7887c2945dee707da27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 15:42:28 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 19:42:28 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524512548.85.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset 75a3e3d5bc0be1ce41289b661e7c53039cf3d5ba by Antoine Pitrou (Miss Islington (bot)) in branch '3.7': bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) (GH-6579) https://github.com/python/cpython/commit/75a3e3d5bc0be1ce41289b661e7c53039cf3d5ba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 15:43:27 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 19:43:27 +0000 Subject: [issue33332] Expose valid signal set (sigfillset()) In-Reply-To: <1524395007.64.0.682650639539.issue33332@psf.upfronthosting.co.za> Message-ID: <1524512607.62.0.682650639539.issue33332@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- keywords: +patch pull_requests: +6281 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 15:43:50 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 19:43:50 +0000 Subject: [issue33332] Expose valid signal set (sigfillset()) In-Reply-To: <1524395007.64.0.682650639539.issue33332@psf.upfronthosting.co.za> Message-ID: <1524512630.36.0.682650639539.issue33332@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 15:44:07 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 19:44:07 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524512647.65.0.682650639539.issue33329@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 15:47:04 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 19:47:04 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524512824.67.0.682650639539.issue33329@psf.upfronthosting.co.za> Change by Antoine Pitrou : ---------- pull_requests: +6282 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 16:22:45 2018 From: report at bugs.python.org (Chris Bradbury) Date: Mon, 23 Apr 2018 20:22:45 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1524514965.34.0.682650639539.issue33251@psf.upfronthosting.co.za> Change by Chris Bradbury : ---------- pull_requests: +6283 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 16:22:51 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 20:22:51 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524514971.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: New changeset b0ca398cabd2d2ea2d66fa50b08e297a60388c75 by Antoine Pitrou in branch '3.6': [3.6] bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) (GH-6582) https://github.com/python/cpython/commit/b0ca398cabd2d2ea2d66fa50b08e297a60388c75 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 16:23:54 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Apr 2018 20:23:54 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524515034.85.0.682650639539.issue33329@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Miro, this should be fixed now. Please reopen if it isn't. The sigfillset() functionality will be exposed to Python users in bpo-33332. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 16:31:08 2018 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 23 Apr 2018 20:31:08 +0000 Subject: [issue33329] sigaddset() can fail on some signal numbers In-Reply-To: <1524384471.45.0.682650639539.issue33329@psf.upfronthosting.co.za> Message-ID: <1524515468.56.0.682650639539.issue33329@psf.upfronthosting.co.za> Miro Hron?ok added the comment: Antoine, thank you very much for swift communication and fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 16:51:29 2018 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 23 Apr 2018 20:51:29 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524516689.92.0.682650639539.issue33337@psf.upfronthosting.co.za> Gregory P. Smith added the comment: +1 in general to this work. ?ukasz is effectively preaching to the choir by looping me in here. :) It is a big challenge to practically support Python in that we have no good ability to parse and understand all language syntax versions via a single API that does not depend on the version of the language your own tools process is running under. lib2to3.pgen2 is the closest thing we've got and it used by a notable crop of python refactoring tools today because there really wasn't another available choice. All they know is that they've got a ".py" file, they can't know which specific language versions it may be intended for. Nor should they ever need to run _on_ that language version. That situation is a nightmare (ex: pylint uses ast and must run on the version of the language it is to analyze as) I'd love to see a ponycorn module that everything could use to run on top of Python 3.recent yet be able to meaningfully process 2.7 and 3.4-3.7 code. This is an area where the language versions we support parsing and analyzing should _not_ be limited to the current CPython org still supported releases. Does this need to go in the CPython project and integrate with its internals such as pgen.c or pgen2? I don't know. From my perspective this could be a PyPI project. Even if it seems odd that we have stdlib ast and lib2to3.pgen2 modules and pgen internal to CPython; at some point those could be seen as implementation details and made private in favor of tool application code using a canonical ponycorn thing on PyPI. The important part is that it is maintained and kept up to date with future language grammar changes while maintaining "backwards grammar compatibility". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 16:56:49 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 20:56:49 +0000 Subject: [issue33251] ConfigParser.items returns items present in vars In-Reply-To: <1523304266.46.0.682650639539.issue33251@psf.upfronthosting.co.za> Message-ID: <1524517009.77.0.682650639539.issue33251@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset e500839796c7fa43998e72edb77165872b9ce034 by ?ukasz Langa (Chris Bradbury) in branch 'master': bpo-33251: Update documentation to reflect change. (GH-6446) (#6583) https://github.com/python/cpython/commit/e500839796c7fa43998e72edb77165872b9ce034 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 17:02:27 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 21:02:27 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524517347.17.0.682650639539.issue33337@psf.upfronthosting.co.za> ?ukasz Langa added the comment: > The important part is that it is maintained and kept up to date with future language grammar changes while maintaining "backwards grammar compatibility". Yes, which is why I have trouble believing this can be effectively outsourced. Existing third-party libraries always stalled at some point in this regard. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 17:32:16 2018 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 23 Apr 2018 21:32:16 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524517347.17.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: But lib2to3 is proof that the stdlib is just as much subject to stalling. Maybe lib2to3 and pgen2 would have a livelier future if they weren't limited to updates in sync with Python releases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 19:28:30 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Apr 2018 23:28:30 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524526110.33.0.682650639539.issue33337@psf.upfronthosting.co.za> ?ukasz Langa added the comment: > But lib2to3 is proof that the stdlib is just as much subject to stalling. The issue here is internal visibility. "lib2to3" is a library that supports "2to3" which is rather neglected internally since we started promoting `six` as a better migration strategy to Python 3. Most core devs don't even *know* new syntax is supposed to be added to lib2to3. Case in point: somehow Lib/tokenize.py was updated just in time for f-strings to be released but not Lib/lib2to3/pgen2/tokenize.py. By unifying the tokenizers and moving the CST out of lib2to3's guts (and documenting it as a supported feature!), I'm pretty sure we can eliminate the danger of forgetting to update it in the future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 20:34:19 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Tue, 24 Apr 2018 00:34:19 +0000 Subject: [issue31500] IDLE: Tiny font on HiDPI display In-Reply-To: <1505674446.46.0.331613884884.issue31500@psf.upfronthosting.co.za> Message-ID: <1524530059.52.0.682650639539.issue31500@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- pull_requests: +6284 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 20:44:57 2018 From: report at bugs.python.org (Nathaniel Smith) Date: Tue, 24 Apr 2018 00:44:57 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524530697.62.0.682650639539.issue33337@psf.upfronthosting.co.za> Nathaniel Smith added the comment: It does seem like it'd be unfortunate to end up in a situation like "sorry, there's a bug in handling this python 2 code, so black won't be able to reformat it until the next major python release". And I assume this issue is motivated by running into limitations of the current version; waiting for 3.8 before you can fix those seems unfortunate too? Another option to think about: make the library something that's maintained by python-dev, but released separately on PyPI. ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 22:18:15 2018 From: report at bugs.python.org (Oscar Esteban) Date: Tue, 24 Apr 2018 02:18:15 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1524536295.25.0.682650639539.issue22393@psf.upfronthosting.co.za> Oscar Esteban added the comment: We use multiprocessing to parallelize many tasks that run either python code or call subprocess.run that are memory hungry. At times the OOM Killer kicks in. When one of the workers is killed, the queue never returns an error for the task being run by the worker. Are there any plans to merge the patch proposed in this issue? ---------- nosy: +Oscar Esteban _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 23:49:42 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 24 Apr 2018 03:49:42 +0000 Subject: [issue33317] `repr()` of string in NFC and NFD forms does not differ In-Reply-To: <1524209082.19.0.682650639539.issue33317@psf.upfronthosting.co.za> Message-ID: <1524541782.53.0.682650639539.issue33317@psf.upfronthosting.co.za> Benjamin Peterson added the comment: As stated, the bug report is invalid: the repr _does_ differ, it's just not presented that way by however you're viewing the two reprs. Distinct codepoint sequences that look identical under certain circumstances can happen many different ways with Unicode. repr's humble mission is to produce a Python literal equivalent to its argument not to produce unambiguous representations of codepoint sequences after font rendering. Possibly, this could be converted to a unittest RFE, but I'm not sure if there's a good way to detect whether two unicode strings are going to display confusingly similarly. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 23 23:54:06 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 24 Apr 2018 03:54:06 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524542046.2.0.682650639539.issue33337@psf.upfronthosting.co.za> Change by ?ukasz Langa : ---------- keywords: +patch pull_requests: +6285 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 00:12:44 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 24 Apr 2018 04:12:44 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524543164.35.0.682650639539.issue33337@psf.upfronthosting.co.za> Benjamin Peterson added the comment: The stdlib is a bad place for anything that needs to evolve at a non-glacial place. For example, even when 2to3 had not yet fallen out of favor, there were effectively 3 versions of it: one 2.7 and two in maintained 3.x branches. That was a large pain. 2to3 also could only be updated as quickly as Python is released. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 01:47:01 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 24 Apr 2018 05:47:01 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1524548821.8.0.682650639539.issue22393@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Oscar, the patch posted here needs updating for the latest git master. If you want to avoid this issue, you can also use concurrent.futures where the issue is fixed. ---------- stage: -> needs patch versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 03:31:12 2018 From: report at bugs.python.org (Kasra Vand) Date: Tue, 24 Apr 2018 07:31:12 +0000 Subject: [issue33344] Use logical negation of integers directly in arithmatic propostions and equations Message-ID: <1524555072.69.0.682650639539.issue33344@psf.upfronthosting.co.za> New submission from Kasra Vand : Logical Negation of integers in Python always returns a Boolean result which can be achieve using `not`. Sometimes it's necessary to use this result directly in a proposition within a list comprehension (mostly). But if we use `not` directly in such arithmatic proposition it will raise a `SyntaxError. ``` In [46]: 3 + not(4) File "", line 1 3 + not(4) ^ SyntaxError: invalid syntax ``` Isn't that possible to make this work for integers in future releases? I was more curious to know what would be the drawbacks of such feature if there are any? ---------- components: Interpreter Core messages: 315688 nosy: Kasra Vand priority: normal severity: normal status: open title: Use logical negation of integers directly in arithmatic propostions and equations type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 03:35:49 2018 From: report at bugs.python.org (Kasra Vand) Date: Tue, 24 Apr 2018 07:35:49 +0000 Subject: [issue33344] Use logical negation of integers directly in arithmatic propostions and equations In-Reply-To: <1524555072.69.0.682650639539.issue33344@psf.upfronthosting.co.za> Message-ID: <1524555349.36.0.682650639539.issue33344@psf.upfronthosting.co.za> Kasra Vand added the comment: This may seem not very useful while except 0 for other numbers it returns False but one may want to use another proposition inside `not` that can use either 0 or a nonzero number. Also, in this case we can form more comprehensive logical propositions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 03:44:04 2018 From: report at bugs.python.org (Steve Piercy) Date: Tue, 24 Apr 2018 07:44:04 +0000 Subject: [issue33345] Documentation for PowerShell instructions Message-ID: <1524555844.08.0.682650639539.issue33345@psf.upfronthosting.co.za> New submission from Steve Piercy : Effective 2017-11-20, PowerShell is now the default command shell on Windows 10, and possibly other versions. Command Prompt (cmd.exe) is still present, just no longer the default. https://support.microsoft.com/en-us/help/4027690/windows-powershell-is-replacing-command-prompt Current instructions for installing and configuring Python on Windows reference only Command Prompt. There may be other places. https://docs.python.org/3/using/windows.html#configuring-python FYI, we're in the process of updating our documentation for Pyramid where we have both PowerShell and Command Prompt. At some point in the future, we may drop the latter. https://github.com/Pylons/pyramid/issues/3260 Let me know what y'all think is the best way to proceed, even if that is no action. ---------- assignee: docs at python components: Documentation messages: 315690 nosy: docs at python, stevepiercy priority: normal severity: normal status: open title: Documentation for PowerShell instructions type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 03:59:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Apr 2018 07:59:20 +0000 Subject: [issue33344] Use logical negation of integers directly in arithmatic propostions and equations In-Reply-To: <1524555072.69.0.682650639539.issue33344@psf.upfronthosting.co.za> Message-ID: <1524556760.8.0.682650639539.issue33344@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: You can use 3 + (not 4). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 04:42:35 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Apr 2018 08:42:35 +0000 Subject: [issue33345] Documentation for PowerShell instructions In-Reply-To: <1524555844.08.0.682650639539.issue33345@psf.upfronthosting.co.za> Message-ID: <1524559355.91.0.682650639539.issue33345@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 07:05:41 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 24 Apr 2018 11:05:41 +0000 Subject: [issue33346] Syntax error with async generator inside dictionary comprehension Message-ID: <1524567941.57.0.682650639539.issue33346@psf.upfronthosting.co.za> New submission from Pablo Galindo Salgado : Given this async function: async def elements(n): yield n yield n*2 yield n*3 yield n*4 This definition is considered invalid: async def test(): return { n: [x async for x in elements(n)] for n in range(3)} SyntaxError: asynchronous comprehension outside of an asynchronous function The reason (I suspect) is because the dict comprehension is not an async context (it would be if range was an async iterable and we use `async for n in range(3)`). Is this expected behaviour or something it needs to change? ---------- components: asyncio messages: 315692 nosy: asvetlov, pablogsal, yselivanov priority: normal severity: normal status: open title: Syntax error with async generator inside dictionary comprehension type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 07:06:00 2018 From: report at bugs.python.org (Lucian Cristian) Date: Tue, 24 Apr 2018 11:06:00 +0000 Subject: [issue33347] zlibmodule undefined reference Message-ID: <1524567960.98.0.682650639539.issue33347@psf.upfronthosting.co.za> New submission from Lucian Cristian : trying to compile a utility in Openwrt and when pip-install is selected and zlib is linked to python I get this: staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_crc32': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1045: undefined reference to `crc32' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1053: undefined reference to `crc32' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_adler32': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1013: undefined reference to `adler32' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:1021: undefined reference to `adler32' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `Decomp_dealloc': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:469: undefined reference to `inflateEnd' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `Comp_dealloc': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:459: undefined reference to `deflateEnd' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_objcompress': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:504: undefined reference to `deflate' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_copy': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:772: undefined reference to `deflateCopy' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_uncopy': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:821: undefined reference to `inflateCopy' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_decompressobj': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:434: undefined reference to `inflateInit2_' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_compressobj': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:398: undefined reference to `deflateInit2_' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_objdecompress': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:632: undefined reference to `inflate' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_decompress': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:308: undefined reference to `inflateInit2_' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:335: undefined reference to `inflate' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:360: undefined reference to `inflateEnd' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:318: undefined reference to `inflateEnd' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:344: undefined reference to `inflateEnd' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:349: undefined reference to `inflateEnd' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:330: undefined reference to `inflateEnd' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o):build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:365: more undefined references to `inflateEnd' follow staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_unflush': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:892: undefined reference to `inflate' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:918: undefined reference to `inflateEnd' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_flush': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:713: undefined reference to `deflate' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:728: undefined reference to `deflateEnd' staging_dir/hostpkg/lib/libpython2.7.a(zlibmodule.o): In function `PyZlib_compress': build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:220: undefined reference to `deflateInit_' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:233: undefined reference to `deflateEnd' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:250: undefined reference to `deflate' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:245: undefined reference to `deflateEnd' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:254: undefined reference to `deflateEnd' build_dir/hostpkg/Python-2.7.14/./Modules/zlibmodule.c:265: undefined reference to `deflateEnd' collect2: error: ld returned 1 exit status python has access to zlib headers and libraries ---------- components: Build messages: 315693 nosy: Lucian Cristian priority: normal severity: normal status: open title: zlibmodule undefined reference type: compile error versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 07:21:47 2018 From: report at bugs.python.org (Kasra Vand) Date: Tue, 24 Apr 2018 11:21:47 +0000 Subject: [issue33344] Use logical negation of integers directly in arithmatic propostions and equations In-Reply-To: <1524555072.69.0.682650639539.issue33344@psf.upfronthosting.co.za> Message-ID: <1524568907.35.0.682650639539.issue33344@psf.upfronthosting.co.za> Kasra Vand added the comment: Thanks, Indeed. But my question is more about the syntax and why it's not that straight? The reasons for that is because Python is known as a scientific programming language and many people come with mathematical background and may want to use this kind of syntax. So is it possible to add this feature? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 07:33:16 2018 From: report at bugs.python.org (=?utf-8?q?Pekka_Kl=C3=A4rck?=) Date: Tue, 24 Apr 2018 11:33:16 +0000 Subject: [issue33317] `repr()` of string in NFC and NFD forms does not differ In-Reply-To: <1524209082.19.0.682650639539.issue33317@psf.upfronthosting.co.za> Message-ID: <1524569596.77.0.682650639539.issue33317@psf.upfronthosting.co.za> Pekka Kl?rck added the comment: I didn't submit this as a bug report but as an enhancement request. From usability point of view, saying that results differ but you just cannot see the difference is not very helpful. The exact reason I didn't submit this as an enhancement request for unittest, pytest, and all other modules/tools being affected is that "I'm not sure if there's a good way to detect whether two unicode strings are going to display confusingly similarly". Enhancing `repr()` would be a logical solution to this problem. Finally, would any harm be done if `repr('hyva\u0308')` would be changed to `'hyva\\u0308'`? I don't see it being any different than `repr('foo\x00')` being `'foo\\x00'`; in both cases you can `eval()` the result to get the original value back like `repr()` is supposed to do when possible. Most importantly, the result would show that the value actually contains like you generally expect `repr()` to do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 07:51:53 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Apr 2018 11:51:53 +0000 Subject: [issue33344] Use logical negation of integers directly in arithmatic propostions and equations In-Reply-To: <1524555072.69.0.682650639539.issue33344@psf.upfronthosting.co.za> Message-ID: <1524570713.26.0.682650639539.issue33344@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: If `3 + not 4` be accepted, should it be evaluated to the same value as `not 4 + 3`? Currently the result of `not 4 + 3` is False. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 07:54:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Apr 2018 11:54:19 +0000 Subject: [issue33344] Use logical negation of integers directly in arithmatic propostions and equations In-Reply-To: <1524555072.69.0.682650639539.issue33344@psf.upfronthosting.co.za> Message-ID: <1524570859.19.0.682650639539.issue33344@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: And consider the example `3 + not 4 + 5`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 08:11:17 2018 From: report at bugs.python.org (Zsolt Dollenstein) Date: Tue, 24 Apr 2018 12:11:17 +0000 Subject: [issue33348] lib2to3 doesn't parse f(*[] or []) Message-ID: <1524571877.77.0.682650639539.issue33348@psf.upfronthosting.co.za> Change by Zsolt Dollenstein : ---------- components: 2to3 (2.x to 3.x conversion tool) nosy: zsol priority: normal severity: normal status: open title: lib2to3 doesn't parse f(*[] or []) type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 08:13:05 2018 From: report at bugs.python.org (Zsolt Dollenstein) Date: Tue, 24 Apr 2018 12:13:05 +0000 Subject: [issue33348] lib2to3 doesn't parse f(*[] or []) Message-ID: <1524571985.34.0.682650639539.issue33348@psf.upfronthosting.co.za> Change by Zsolt Dollenstein : ---------- keywords: +patch pull_requests: +6286 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 08:42:07 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Apr 2018 12:42:07 +0000 Subject: [issue33348] lib2to3 doesn't parse f(*[] or []) Message-ID: <1524573727.4.0.682650639539.issue33348@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : See related issue24176 and issue24791. ---------- nosy: +benjamin.peterson, lukasz.langa, serhiy.storchaka, yselivanov versions: +Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 08:48:05 2018 From: report at bugs.python.org (Kasra Vand) Date: Tue, 24 Apr 2018 12:48:05 +0000 Subject: [issue33344] Use logical negation of integers directly in arithmatic propostions and equations In-Reply-To: <1524555072.69.0.682650639539.issue33344@psf.upfronthosting.co.za> Message-ID: <1524574085.3.0.682650639539.issue33344@psf.upfronthosting.co.za> Kasra Vand added the comment: I think this will contradict to Python's operators precedence. What I mentioned seems like you're passing the number as an argument to `not`, and this is while `not` is not a function. There is an `operator.not_` function that does the same job as expected though. Now I see why it's not efficient and wise to do so. This is violation of operators precedence. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 08:48:42 2018 From: report at bugs.python.org (Kasra Vand) Date: Tue, 24 Apr 2018 12:48:42 +0000 Subject: [issue33344] Use logical negation of integers directly in arithmatic propostions and equations In-Reply-To: <1524555072.69.0.682650639539.issue33344@psf.upfronthosting.co.za> Message-ID: <1524574122.47.0.682650639539.issue33344@psf.upfronthosting.co.za> Change by Kasra Vand : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 09:02:45 2018 From: report at bugs.python.org (Zsolt Dollenstein) Date: Tue, 24 Apr 2018 13:02:45 +0000 Subject: [issue33349] 2to3 fails to parse async generators in non-async functions Message-ID: <1524574965.95.0.682650639539.issue33349@psf.upfronthosting.co.za> New submission from Zsolt Dollenstein : This is valid since python3.7: ``` def f(): return (i * 2 async for i in arange(42)) ``` but lib2to3 doesn't parse this properly, because `async` is tokenized as a `NAME` instead of `ASYNC` ---------- components: 2to3 (2.x to 3.x conversion tool) messages: 315700 nosy: zsol priority: normal severity: normal status: open title: 2to3 fails to parse async generators in non-async functions type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 09:03:43 2018 From: report at bugs.python.org (Zsolt Dollenstein) Date: Tue, 24 Apr 2018 13:03:43 +0000 Subject: [issue33266] 2to3 doesn't parse all valid string literals In-Reply-To: <1523521499.6.0.682650639539.issue33266@psf.upfronthosting.co.za> Message-ID: <1524575023.01.0.682650639539.issue33266@psf.upfronthosting.co.za> Change by Zsolt Dollenstein : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 09:20:27 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Apr 2018 13:20:27 +0000 Subject: [issue33349] 2to3 fails to parse async generators in non-async functions In-Reply-To: <1524574965.95.0.682650639539.issue33349@psf.upfronthosting.co.za> Message-ID: <1524576027.36.0.682650639539.issue33349@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +benjamin.peterson, lukasz.langa, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 09:21:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Apr 2018 13:21:20 +0000 Subject: [issue33344] Use logical negation of integers directly in arithmatic propostions and equations In-Reply-To: <1524555072.69.0.682650639539.issue33344@psf.upfronthosting.co.za> Message-ID: <1524576080.07.0.682650639539.issue33344@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 09:34:46 2018 From: report at bugs.python.org (Elena Oat) Date: Tue, 24 Apr 2018 13:34:46 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: <1524576886.41.0.682650639539.issue33275@psf.upfronthosting.co.za> Change by Elena Oat : ---------- keywords: +patch pull_requests: +6287 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 09:41:32 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Apr 2018 13:41:32 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: <1524577292.8.0.682650639539.issue33275@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Are there such notes in the descriptions of os.listdir(), os.scandir(), os.walk(), os.fwalk() and corresponding Path methods? If explicitly document the sorting, this should be made for all files enumerating functions. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 10:15:41 2018 From: report at bugs.python.org (Ben FrantzDale) Date: Tue, 24 Apr 2018 14:15:41 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1524577292.8.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: Ben FrantzDale added the comment: Great point. Looks like the phrase is "in arbitrary order" in the docs for those (both 2.7 and 3), which is better than saying nothing. I'd still prefer a bit more specificity about the potential gotcha since "arbitrary" seems a lot less deterministic than "some file systems will give you sorted order, some won't". On Tue, Apr 24, 2018 at 9:41 AM, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > Are there such notes in the descriptions of os.listdir(), os.scandir(), > os.walk(), os.fwalk() and corresponding Path methods? If explicitly > document the sorting, this should be made for all files enumerating > functions. > > ---------- > nosy: +serhiy.storchaka > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 10:55:18 2018 From: report at bugs.python.org (Zsolt Dollenstein) Date: Tue, 24 Apr 2018 14:55:18 +0000 Subject: [issue33349] 2to3 fails to parse async generators in non-async functions In-Reply-To: <1524574965.95.0.682650639539.issue33349@psf.upfronthosting.co.za> Message-ID: <1524581718.21.0.682650639539.issue33349@psf.upfronthosting.co.za> Change by Zsolt Dollenstein : ---------- keywords: +patch pull_requests: +6288 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 10:55:27 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Tue, 24 Apr 2018 14:55:27 +0000 Subject: [issue32797] Tracebacks from Cython modules no longer work In-Reply-To: <1518090924.55.0.467229070634.issue32797@psf.upfronthosting.co.za> Message-ID: <1524581727.31.0.682650639539.issue32797@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: Alternatively, instead of not implementing `loader.get_source()`, we could define a new semantic: if it returns `NotImplemented`, assume that the loader doesn't know how to get the sources. In that case, linecache would fall back to the old behaviour. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 11:09:08 2018 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 24 Apr 2018 15:09:08 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524543164.35.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: Lukasz, pleased consider seriously to move to a 3rd party package. Even pgen2. On Mon, Apr 23, 2018, 21:12 Benjamin Peterson wrote: > > Benjamin Peterson added the comment: > > The stdlib is a bad place for anything that needs to evolve at a > non-glacial place. For example, even when 2to3 had not yet fallen out of > favor, there were effectively 3 versions of it: one 2.7 and two in > maintained 3.x branches. That was a large pain. 2to3 also could only be > updated as quickly as Python is released. > > ---------- > stage: patch review -> > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 11:42:32 2018 From: report at bugs.python.org (Elena Oat) Date: Tue, 24 Apr 2018 15:42:32 +0000 Subject: [issue24356] venv documentation incorrect / misleading In-Reply-To: <1433197293.5.0.203233804739.issue24356@psf.upfronthosting.co.za> Message-ID: <1524584552.06.0.682650639539.issue24356@psf.upfronthosting.co.za> Change by Elena Oat : ---------- keywords: +patch pull_requests: +6289 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 11:55:06 2018 From: report at bugs.python.org (Lucian Cristian) Date: Tue, 24 Apr 2018 15:55:06 +0000 Subject: [issue33347] zlibmodule undefined reference In-Reply-To: <1524567960.98.0.682650639539.issue33347@psf.upfronthosting.co.za> Message-ID: <1524585306.61.0.682650639539.issue33347@psf.upfronthosting.co.za> Lucian Cristian added the comment: it seems that python-config --libs doesn't detect -lz and appending -lz fixes the problem - PYTHON_LIBS="`\"${PYTHONCONFIG}\" --libs`" + PYTHON_LIBS="`\"${PYTHONCONFIG}\" --libs` -lz" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 12:03:21 2018 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 24 Apr 2018 16:03:21 +0000 Subject: [issue1284316] Win32: Security problem with default installation directory Message-ID: <1524585801.27.0.682650639539.issue1284316@psf.upfronthosting.co.za> Jason R. Coombs added the comment: For those installing Python 2.7, I share here for others the [Powershell module](https://www.dropbox.com/s/62m9easad0iakat/python.ps1?dl=0) I include in my profile. With this module loaded, `get-python-ver 2.7.14` installs Python 2.7.14 64-bit to "C:\Program Files\Python27". Feel free to copy/adopt the routine if you're deploying more than a couple of installs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 12:51:16 2018 From: report at bugs.python.org (Alisue Lambda) Date: Tue, 24 Apr 2018 16:51:16 +0000 Subject: [issue33350] WinError 10038 is raised when loop.sock_connect is wrapped with asyncio.wait_for Message-ID: <1524588676.0.0.682650639539.issue33350@psf.upfronthosting.co.za> New submission from Alisue Lambda : This is my first time to create an issue on the python bug tracker so let me know if I don't follow the rule which I need to follow. # Summary Using 'loop.sock_connect' with 'asyncio.wait_for' raises 'OSError [WinError 10038]' in Windows 10 Pro when timed-out. # Detail I use 'loop.sock_connect' to establish a TCP connection for checking if a particular port on a target host is available. However, when I wrap the coroutine with 'asyncio.wait_for', the following exception is raised when the wrapped coroutine has timed-out. Traceback (most recent call last): File "C:\Users\alisue/test.py", line 41, in loop.run_until_complete(test(loop)) File "C:\Python36\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Python36\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Python36\lib\asyncio\base_events.py", line 1395, in _run_once event_list = self._selector.select(timeout) File "C:\Python36\lib\selectors.py", line 323, in select r, w, _ = self._select(self._readers, self._writers, [], timeout) File "C:\Python36\lib\selectors.py", line 314, in _select r, w, x = select.select(r, w, w, timeout) OSError: [WinError 10038] ........... While it is raised from 'lib\selectors.py', I cannot catch this exception so the event loop has halted. The attached 'test.py' is a minimum script to reproduce the error. Thanks. ---------- components: asyncio files: test.py messages: 315707 nosy: Alisue Lambda, asvetlov, yselivanov priority: normal severity: normal status: open title: WinError 10038 is raised when loop.sock_connect is wrapped with asyncio.wait_for type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47548/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 12:55:16 2018 From: report at bugs.python.org (Alisue Lambda) Date: Tue, 24 Apr 2018 16:55:16 +0000 Subject: [issue33350] WinError 10038 is raised when loop.sock_connect is wrapped with asyncio.wait_for In-Reply-To: <1524588676.0.0.682650639539.issue33350@psf.upfronthosting.co.za> Message-ID: <1524588916.08.0.682650639539.issue33350@psf.upfronthosting.co.za> Alisue Lambda added the comment: I should have mentioned that the script works well on macOS and Linux. This issue exists only on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 13:21:25 2018 From: report at bugs.python.org (Alisue Lambda) Date: Tue, 24 Apr 2018 17:21:25 +0000 Subject: [issue33350] WinError 10038 is raised when loop.sock_connect is wrapped with asyncio.wait_for In-Reply-To: <1524588676.0.0.682650639539.issue33350@psf.upfronthosting.co.za> Message-ID: <1524590485.25.0.682650639539.issue33350@psf.upfronthosting.co.za> Alisue Lambda added the comment: I've found an workaround. The point is that 'with s' should be included in a coroutine which will be timed-out. import asyncio import socket ADDR = ('10.0.2.1', 22) async def check(loop): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setblocking(False) with s: await loop.sock_connect(s, ADDR) async def test(loop): try: await asyncio.wait_for( check(loop), timeout=3, loop=loop, ) except Exception as e: print('Fail: %s' % e) else: print('Success') if __name__ == '__main__': loop = asyncio.get_event_loop() loop.run_until_complete(test(loop)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 13:35:31 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 24 Apr 2018 17:35:31 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: <1524591331.22.0.682650639539.issue33275@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I agree that anything that has the same FS-determined sorted or not behavior should get the same note, for the same reason. Ben, can you test? Eryk, can you enlighten us further? PS: Ben, when responding by email, please delete the quote, as it is duplicate noise on the web page. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 14:05:48 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 24 Apr 2018 18:05:48 +0000 Subject: [issue33343] [argparse] Add subcommand abbreviations In-Reply-To: <1524505578.79.0.682650639539.issue33343@psf.upfronthosting.co.za> Message-ID: <1524593148.38.0.682650639539.issue33343@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- title: Subcommand abbreviations -> [argparse] Add subcommand abbreviations _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 14:13:31 2018 From: report at bugs.python.org (Alden) Date: Tue, 24 Apr 2018 18:13:31 +0000 Subject: [issue17050] argparse.REMAINDER doesn't work as first argument In-Reply-To: <1359276661.57.0.274871702559.issue17050@psf.upfronthosting.co.za> Message-ID: <1524593611.55.0.682650639539.issue17050@psf.upfronthosting.co.za> Alden added the comment: Paul. This is a bug, not a feature in argparse. Devin is 100% correct. According to the docs REMAINDER should be greedy and is used for passing arguments to sub commands. In your example the expected behavior is that if you do put "d --foo x a b c" that --foo is none and args gets everything. We shouldn't need to use a gatekeeper or resort to manually parsing the remainder arguments. It also shouldn't take 5 years to acknowledged that it needs to be fixed. I'm happy to make a patch if its a bandwidth issue. Am I misunderstanding and you feel like its not possible to fix? I guess if there is a backward compatibility issue then we need to write a new option that does literally return the remainder arguments as documented. ---------- nosy: +aldencolerain _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 14:34:58 2018 From: report at bugs.python.org (paul j3) Date: Tue, 24 Apr 2018 18:34:58 +0000 Subject: [issue33343] [argparse] Add subcommand abbreviations In-Reply-To: <1524505578.79.0.682650639539.issue33343@psf.upfronthosting.co.za> Message-ID: <1524594898.34.0.682650639539.issue33343@psf.upfronthosting.co.za> paul j3 added the comment: This issue was raised in https://bugs.python.org/issue12713, argparse: allow abbreviation of sub commands by users A patch was implemented, and then reverted when it was found to be buggy. Subcommands are not parsed the same as long options. Subcommands are actually 'choices' of a positional argument. Trying to allow abbreviations of subcommands allowed them in all 'choices', resulting in backward compatibility problems. I recommend using the suparser alias mechanism instead. (I think this issue should be closed). ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 15:05:46 2018 From: report at bugs.python.org (paul j3) Date: Tue, 24 Apr 2018 19:05:46 +0000 Subject: [issue32552] Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class In-Reply-To: <1515976536.21.0.467229070634.issue32552@psf.upfronthosting.co.za> Message-ID: <1524596746.85.0.682650639539.issue32552@psf.upfronthosting.co.za> paul j3 added the comment: This subclass makes are one method change: from: def _get_help_string(self, action): return action.help to: def _get_help_string(self, action): help = action.help if '%(default)' not in action.help: if action.default is not SUPPRESS: defaulting_nargs = [OPTIONAL, ZERO_OR_MORE] if action.option_strings or action.nargs in defaulting_nargs: help += ' (default: %(default)s)' return help So it conditionally adds a '%(default)s' to the help string. And in: def _expand_help(self, action): ... return self._get_help_string(action) % params where 'params' is derived from the attributes of the 'Action' object. I don't off hand see a clean way of suppressing this addition. We don't want to add a parameter to 'add_argument' just for this. As a user you can explicitly add the `%(default)s` to selected arguments, and use the regular formatter. Admittedly it involves a bit more typing. Or write your own version of the formatter subclass. ---------- nosy: +paul.j3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 15:24:04 2018 From: report at bugs.python.org (Eric N. Vander Weele) Date: Tue, 24 Apr 2018 19:24:04 +0000 Subject: [issue33346] Syntax error with async generator inside dictionary comprehension In-Reply-To: <1524567941.57.0.682650639539.issue33346@psf.upfronthosting.co.za> Message-ID: <1524597844.62.0.682650639539.issue33346@psf.upfronthosting.co.za> Change by Eric N. Vander Weele : ---------- nosy: +ericvw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 17:36:56 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Tue, 24 Apr 2018 21:36:56 +0000 Subject: [issue33316] PyThread_release_lock always fails In-Reply-To: <1524183536.18.0.682650639539.issue33316@psf.upfronthosting.co.za> Message-ID: <1524605816.86.0.682650639539.issue33316@psf.upfronthosting.co.za> Ivan Pozdeev added the comment: In all PyMUTEX_* and most PyCOND_* functions, all the underlying APIs are void. So there's no point for the functions to return anything other than as convention. A comment at the start of condvar.h says: "APIs generally return 0 on success and non-zero on error". In Python\ceval_gil.h:57, there are boilerplace checker macros for them (which will never fire). So I guess this is done for uniformity. Regardless, PyMUTEX_UNLOCK and PyMUTEX_LOCK at least are called both with and without checking the return value. So I would drop the pretense and make these fns void. --- That said, the reported error still persists after the fix. The code confusing about which value LeaveNonRecursiveMutex should return on success. Pushed another commit, confirmed to work now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 18:32:23 2018 From: report at bugs.python.org (iunknwn) Date: Tue, 24 Apr 2018 22:32:23 +0000 Subject: [issue24882] ThreadPoolExecutor doesn't reuse threads until #threads == max_workers In-Reply-To: <1439823540.4.0.657998470812.issue24882@psf.upfronthosting.co.za> Message-ID: <1524609143.72.0.682650639539.issue24882@psf.upfronthosting.co.za> iunknwn added the comment: I feel like there are two reasonable options here: 1) We can implement a thread pool with basic resource tracking. This means idle threads get recycled, and threads that have been sitting idle for a while are terminated as demand drops, so resources can be reclaimed. This wouldn't require very much work - we would just need to modify some of the queue operations to have timeouts, and track the number of idle threads (most of that's already in my first PR). We could easily add options like min_threads and idle_thread_timeout as options in kwargs to the init routine. 2) We can skip all tracking, and spin a fixed number of threads at initialization. This removes the complexity of locks and counts, and means the thread pool executor will work identically to the process pool executor (which also eagerly spawns resources). If we want this, this is ready to go in the second PR. I personally like option 1 because it feels closer to other languages I've worked in, but I'd like a bit more guidance from the reviewers before proceeding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 19:30:19 2018 From: report at bugs.python.org (paul j3) Date: Tue, 24 Apr 2018 23:30:19 +0000 Subject: [issue17050] argparse.REMAINDER doesn't work as first argument In-Reply-To: <1359276661.57.0.274871702559.issue17050@psf.upfronthosting.co.za> Message-ID: <1524612619.61.0.682650639539.issue17050@psf.upfronthosting.co.za> paul j3 added the comment: Since this feature is buggy, and there isn't an easy fix, we should probably remove any mention of it from the docs. We can still leave it as an undocumented legacy feature. There is precedent for leaving `nargs` constants undocumented. `argparse.PARSER` ('+...') is used by the subparser mechanism, but is not documented. https://bugs.python.org/issue16988 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 20:13:19 2018 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 25 Apr 2018 00:13:19 +0000 Subject: [issue33211] lineno and col_offset are wrong on function definitions with decorators In-Reply-To: <1522732409.34.0.467229070634.issue33211@psf.upfronthosting.co.za> Message-ID: <1524615199.83.0.682650639539.issue33211@psf.upfronthosting.co.za> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 21:05:22 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 25 Apr 2018 01:05:22 +0000 Subject: [issue33343] [argparse] Add subcommand abbreviations In-Reply-To: <1524505578.79.0.682650639539.issue33343@psf.upfronthosting.co.za> Message-ID: <1524618322.67.0.682650639539.issue33343@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: -> bethard nosy: +bethard _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 22:22:35 2018 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 25 Apr 2018 02:22:35 +0000 Subject: [issue33128] PathFinder is twice on sys.meta_path In-Reply-To: <1521847841.75.0.467229070634.issue33128@psf.upfronthosting.co.za> Message-ID: <1524622955.44.0.682650639539.issue33128@psf.upfronthosting.co.za> Nick Coghlan added the comment: New changeset 0977091dca59709864b14cfc129388f1f0de7bf7 by Nick Coghlan (Pablo Galindo) in branch 'master': bpo-33128 Fix duplicated call to importlib._install_external_importers (GH-6273) https://github.com/python/cpython/commit/0977091dca59709864b14cfc129388f1f0de7bf7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 22:22:52 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Apr 2018 02:22:52 +0000 Subject: [issue33128] PathFinder is twice on sys.meta_path In-Reply-To: <1521847841.75.0.467229070634.issue33128@psf.upfronthosting.co.za> Message-ID: <1524622972.58.0.682650639539.issue33128@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6290 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 22:39:54 2018 From: report at bugs.python.org (Zsolt Dollenstein) Date: Wed, 25 Apr 2018 02:39:54 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524623994.52.0.682650639539.issue33337@psf.upfronthosting.co.za> Change by Zsolt Dollenstein : ---------- nosy: +zsol _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 22:48:07 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Apr 2018 02:48:07 +0000 Subject: [issue33128] PathFinder is twice on sys.meta_path In-Reply-To: <1521847841.75.0.467229070634.issue33128@psf.upfronthosting.co.za> Message-ID: <1524624487.03.0.682650639539.issue33128@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 52a5a17338dfa7fed259027e1ecceba9c8491189 by Miss Islington (bot) in branch '3.7': bpo-33128 Fix duplicated call to importlib._install_external_importers (GH-6273) https://github.com/python/cpython/commit/52a5a17338dfa7fed259027e1ecceba9c8491189 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Apr 24 22:58:44 2018 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 25 Apr 2018 02:58:44 +0000 Subject: [issue33128] PathFinder is twice on sys.meta_path In-Reply-To: <1521847841.75.0.467229070634.issue33128@psf.upfronthosting.co.za> Message-ID: <1524625124.35.0.682650639539.issue33128@psf.upfronthosting.co.za> Nick Coghlan added the comment: Hartmut, thanks for the issue report, and Pablo, thanks for the PR to resolve it! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 00:32:03 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 25 Apr 2018 04:32:03 +0000 Subject: [issue33317] `repr()` of string in NFC and NFD forms does not differ In-Reply-To: <1524569596.77.0.682650639539.issue33317@psf.upfronthosting.co.za> Message-ID: <1524630720.483631.1349836744.2F8C2CB5@webmail.messagingengine.com> Benjamin Peterson added the comment: On Tue, Apr 24, 2018, at 04:33, Pekka Kl?rck wrote: > > Pekka Kl?rck added the comment: > > I didn't submit this as a bug report but as an enhancement request. From > usability point of view, saying that results differ but you just cannot > see the difference is not very helpful. > > The exact reason I didn't submit this as an enhancement request for > unittest, pytest, and all other modules/tools being affected is that > "I'm not sure if there's a good way to detect whether two unicode > strings are going to display confusingly similarly". Enhancing `repr()` > would be a logical solution to this problem. I should have said "there's no way to unambiguously represent a particular unicode string except as a sequence of integers, which isn't normally want anyone wants to see". This decomposition problem is only one of many. Even in ASCII land, fonts often have very similar glyphs for "l", "I", and "1". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 00:36:44 2018 From: report at bugs.python.org (Ethan Smith) Date: Wed, 25 Apr 2018 04:36:44 +0000 Subject: [issue33351] Support compiling with clang-cl on Windows Message-ID: <1524631004.17.0.682650639539.issue33351@psf.upfronthosting.co.za> New submission from Ethan Smith : The clang folks have been hard at work making an ABI compatible backend to clang for Windows. Additionally they have created a cl compatible driver for clang, which can be used in lieu of cl itself. Clang-cl has been adopted to build Chrome on Windows http://blog.llvm.org/2018/03/clang-is-now-used-to-build-chrome-for.html, so I think it is stable enough to be considered for use. Clang-cl has several advantages, such as computed goto support and many other optimizations which would make Python faster on Windows. I would be happy to start contributing patches to further this goal, I already have a couple of small patches. ---------- components: Build messages: 315721 nosy: Ethan Smith priority: normal severity: normal status: open title: Support compiling with clang-cl on Windows type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 00:57:10 2018 From: report at bugs.python.org (pmpp) Date: Wed, 25 Apr 2018 04:57:10 +0000 Subject: [issue33351] Support compiling with clang-cl on Windows In-Reply-To: <1524631004.17.0.682650639539.issue33351@psf.upfronthosting.co.za> Message-ID: <1524632230.74.0.682650639539.issue33351@psf.upfronthosting.co.za> Change by pmpp : ---------- nosy: +pmpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 07:05:08 2018 From: report at bugs.python.org (Steve Piercy) Date: Wed, 25 Apr 2018 11:05:08 +0000 Subject: [issue33345] Documentation for PowerShell instructions In-Reply-To: <1524555844.08.0.682650639539.issue33345@psf.upfronthosting.co.za> Message-ID: <1524654307.99.0.682650639539.issue33345@psf.upfronthosting.co.za> Steve Piercy added the comment: After reviewing PowerShell syntax, I found it is impractical to support in Pyramid's documentation. The discussion we had may be useful. https://github.com/Pylons/pyramid/issues/3260 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 07:06:04 2018 From: report at bugs.python.org (Alex Walters) Date: Wed, 25 Apr 2018 11:06:04 +0000 Subject: [issue33351] Support compiling with clang-cl on Windows In-Reply-To: <1524631004.17.0.682650639539.issue33351@psf.upfronthosting.co.za> Message-ID: <1524654364.93.0.682650639539.issue33351@psf.upfronthosting.co.za> Alex Walters added the comment: Is this the same as the clang/llvm C1 that you can enable from inside Visual Studio? ---------- nosy: +tritium _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 07:08:13 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 11:08:13 +0000 Subject: [issue33305] Improve syntax error for numbers with leading zero In-Reply-To: <1524016031.89.0.682650639539.issue33305@psf.upfronthosting.co.za> Message-ID: <1524654493.7.0.682650639539.issue33305@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In Python 2.5 `0or[]` is valid syntax, but it is not valid in newer versions. What is the good error message for this case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 07:15:13 2018 From: report at bugs.python.org (Ethan Smith) Date: Wed, 25 Apr 2018 11:15:13 +0000 Subject: [issue33351] Support compiling with clang-cl on Windows In-Reply-To: <1524631004.17.0.682650639539.issue33351@psf.upfronthosting.co.za> Message-ID: <1524654913.48.0.682650639539.issue33351@psf.upfronthosting.co.za> Ethan Smith added the comment: No, this is provided from llvm.org. You can find it as e.g. "Clang for Windows (64-bit)" here: http://releases.llvm.org/download.html#6.0.0 The Clang/C2 in Visual Studio is very different, and deprecated anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 07:16:42 2018 From: report at bugs.python.org (Ethan Smith) Date: Wed, 25 Apr 2018 11:16:42 +0000 Subject: [issue33315] Allow queue.Queue to be used in type annotations In-Reply-To: <1524139376.68.0.682650639539.issue33315@psf.upfronthosting.co.za> Message-ID: <1524655002.04.0.682650639539.issue33315@psf.upfronthosting.co.za> Change by Ethan Smith : ---------- nosy: +Ethan Smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 07:17:07 2018 From: report at bugs.python.org (Ethan Smith) Date: Wed, 25 Apr 2018 11:17:07 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524655027.43.0.682650639539.issue33337@psf.upfronthosting.co.za> Change by Ethan Smith : ---------- nosy: +Ethan Smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 08:48:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 12:48:04 +0000 Subject: [issue30465] FormattedValue expressions have wrong lineno and col_offset information In-Reply-To: <1495666417.53.0.222363680661.issue30465@psf.upfronthosting.co.za> Message-ID: <1524660484.34.0.682650639539.issue30465@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +6291 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 08:57:26 2018 From: report at bugs.python.org (Alex Walters) Date: Wed, 25 Apr 2018 12:57:26 +0000 Subject: [issue33351] Support compiling with clang-cl on Windows In-Reply-To: <1524631004.17.0.682650639539.issue33351@psf.upfronthosting.co.za> Message-ID: <1524661046.28.0.682650639539.issue33351@psf.upfronthosting.co.za> Alex Walters added the comment: When supporting platforms comes up, there's a usual list of questions, especially for windows. I can remember two of them off the top of my head: * Are you suggesting that CPython's build system move away from MSVC as the platform compiler for Windows? * Are you able to provide a machine to run buildbots on? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 09:01:11 2018 From: report at bugs.python.org (Matthijs Kooijman) Date: Wed, 25 Apr 2018 13:01:11 +0000 Subject: [issue22454] Adding the opposite function of shlex.split() In-Reply-To: <1411328149.26.0.00522128245951.issue22454@psf.upfronthosting.co.za> Message-ID: <1524661271.35.0.682650639539.issue22454@psf.upfronthosting.co.za> Change by Matthijs Kooijman : ---------- nosy: +Matthijs Kooijman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 09:06:02 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 13:06:02 +0000 Subject: [issue27645] Supporting native backup facility of SQLite In-Reply-To: <1469728098.24.0.732586701981.issue27645@psf.upfronthosting.co.za> Message-ID: <1524661562.34.0.682650639539.issue27645@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +6292 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 09:14:50 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 13:14:50 +0000 Subject: [issue33041] Issues with "async for" In-Reply-To: <1520687441.8.0.467229070634.issue33041@psf.upfronthosting.co.za> Message-ID: <1524662090.46.0.682650639539.issue33041@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- pull_requests: +6293 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 09:24:17 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 13:24:17 +0000 Subject: [issue32710] test_asyncio leaked [4, 4, 3] memory blocks, sum=11 on AMD64 Windows8.1 Refleaks 3.x In-Reply-To: <1517229818.86.0.467229070634.issue32710@psf.upfronthosting.co.za> Message-ID: <1524662657.86.0.682650639539.issue32710@psf.upfronthosting.co.za> STINNER Victor added the comment: The test is still leaking memory blocks. Any progress on investigating the issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 09:24:27 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 13:24:27 +0000 Subject: [issue32710] test_asyncio leaked [4, 4, 3] memory blocks, sum=11 on AMD64 Windows8.1 Refleaks 3.x In-Reply-To: <1517229818.86.0.467229070634.issue32710@psf.upfronthosting.co.za> Message-ID: <1524662667.38.0.682650639539.issue32710@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 09:25:22 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 13:25:22 +0000 Subject: [issue32706] test_check_hostname() of test_ftplib started to fail randomly In-Reply-To: <1517225256.94.0.467229070634.issue32706@psf.upfronthosting.co.za> Message-ID: <1524662722.72.0.682650639539.issue32706@psf.upfronthosting.co.za> STINNER Victor added the comment: Christian Heimes: "Ned, I'm going to rewrite part of the test infrastructure during beta phase. (...)" Any progress on rewriting these tests? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 09:27:18 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 13:27:18 +0000 Subject: [issue32652] test_distutils: BuildRpmTestCase tests fail on RHEL buildbots In-Reply-To: <1516811734.58.0.467229070634.issue32652@psf.upfronthosting.co.za> Message-ID: <1524662838.59.0.682650639539.issue32652@psf.upfronthosting.co.za> STINNER Victor added the comment: test_distutils pass on s390x RHEL 3.x buildbot. I close the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 09:46:37 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 13:46:37 +0000 Subject: [issue33352] Windows: test_regrtest fails on installed Python Message-ID: <1524663997.77.0.682650639539.issue33352@psf.upfronthosting.co.za> New submission from STINNER Victor : Failure on Windows 10 with Python 3.7 beta 3: ====================================================================== ERROR: test_pcbuild_rt (test.test_regrtest.ProgramsTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\test\test_regrtest.py", line 602, in test_pcbuild_rt self.run_batch(script, *rt_args, *self.regrtest_args, *self.tests) File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\test\test_regrtest.py", line 577, in run_batch proc = self.run_command(args) File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\test\test_regrtest.py", line 475, in run_command **kw) File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 453, in run with Popen(*popenargs, **kwargs) as process: File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 756, in __init__ restore_signals, start_new_session) File "C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1155, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified We may just skip the test if the script is not installed. ---------- components: Tests, Windows messages: 315730 nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: Windows: test_regrtest fails on installed Python versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 09:47:13 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 13:47:13 +0000 Subject: [issue31606] [Windows] Tests failing on installed Python 3.7a1 on Windows In-Reply-To: <1506506227.02.0.154975027568.issue31606@psf.upfronthosting.co.za> Message-ID: <1524664033.59.0.682650639539.issue31606@psf.upfronthosting.co.za> STINNER Victor added the comment: > test_regrtest: "ERROR: test_pcbuild_rt (test.test_regrtest.ProgramsTestCase)" because the tested script is not installed. I created bpo-33352 for this one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 09:49:00 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 13:49:00 +0000 Subject: [issue31606] [Windows] Tests failing on installed Python 3.7a1 on Windows In-Reply-To: <1506506227.02.0.154975027568.issue31606@psf.upfronthosting.co.za> Message-ID: <1524664140.83.0.682650639539.issue31606@psf.upfronthosting.co.za> STINNER Victor added the comment: I tested Python 3.7 beta 3: test_marshal crashed and test_tools fails when running with python -m test -j2, but it seems like these two issues were already fixed in the 3.7 development branch. I close this issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:08:30 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:08:30 +0000 Subject: [issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD Message-ID: <1524665310.44.0.682650639539.issue33353@psf.upfronthosting.co.za> New submission from STINNER Victor : Example with a timeout of 10 seconds: vstinner at freebsd$ ./python -m test -v test_asyncio -m test_sock_sendfile_mix_with_regular_send -v --timeout=10 == CPython 3.8.0a0 (heads/master:0977091dca, Apr 25 2018, 14:02:04) [Clang 4.0.0 (tags/RELEASE_400/final 297347)] == FreeBSD-11.1-RELEASE-amd64-64bit-ELF little-endian == cwd: /usr/home/vstinner/prog/python/master/build/test_python_8317 == CPU count: 2 == encodings: locale=UTF-8, FS=utf-8 Run tests sequentially 0:00:00 load avg: 0.59 [1/1] test_asyncio test_sock_sendfile_mix_with_regular_send (test.test_asyncio.test_events.KqueueEventLoopTests) ... Timeout (0:00:10)! Thread 0x0000000801a16000 (most recent call first): File "/usr/home/vstinner/prog/python/master/Lib/asyncio/selector_events.py", line 456 in _sock_sendall File "/usr/home/vstinner/prog/python/master/Lib/asyncio/events.py", line 88 in _run File "/usr/home/vstinner/prog/python/master/Lib/asyncio/base_events.py", line 1738 in _run_once File "/usr/home/vstinner/prog/python/master/Lib/asyncio/base_events.py", line 521 in run_forever File "/usr/home/vstinner/prog/python/master/Lib/asyncio/base_events.py", line 553 in run_until_complete File "/usr/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_events.py", line 2117 in run_loop File "/usr/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_events.py", line 2213 in test_sock_sendfile_mix_with_regular_send (...) The test has been introduced in by the commit a19fb3c6aaa7632410d1d9dcb395d7101d124da4, bpo-32622. The FreeBSD 3.7 and 3.x buildbots are broken, likely since this commit. ---------- components: FreeBSD, asyncio messages: 315733 nosy: asvetlov, koobs, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:14:15 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:14:15 +0000 Subject: [issue33354] Python2, FreeBSD: test_ssl fails on non-ASCII path Message-ID: <1524665655.9.0.682650639539.issue33354@psf.upfronthosting.co.za> New submission from STINNER Victor : The FreeBSD 2.7 buildbot is failing because of test_ssl: test test_ssl failed -- Traceback (most recent call last): File "/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/test/test_ssl.py", line 1005, in test_load_dh_params shutil.copy(DHFILE, fname) File "/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/shutil.py", line 131, in copy if os.path.isdir(dst): File "/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/genericpath.py", line 49, in isdir st = os.stat(s) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 18: ordinal not in range(128) ====================================================================== ERROR: test_load_dh_params (test.test_ssl.ContextTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/test/test_ssl.py", line 1005, in test_load_dh_params shutil.copy(DHFILE, fname) File "/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/shutil.py", line 131, in copy if os.path.isdir(dst): File "/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/genericpath.py", line 49, in isdir st = os.stat(s) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 18: ordinal not in range(128) test.pythoninfo: * os.cwd: /usr/home/buildbot/python/2.7.koobs-freebsd10/build * sys.filesystem_encoding: US-ASCII The failure is likely related to the commit 6e8f395001b026daea047cf225dcca5a973ae824, bpo-25404: --- commit 6e8f395001b026daea047cf225dcca5a973ae824 Author: Christian Heimes Date: Sun Feb 25 09:48:02 2018 +0100 bpo-25404: SSLContext.load_dh_params() non-ASCII path (GH-3459) SSLContext.load_dh_params() now supports non-ASCII path. Signed-off-by: Christian Heimes --- Maybe the test should be skipped if the filesystem encoding cannot encode the path? ---------- assignee: christian.heimes components: FreeBSD, SSL messages: 315734 nosy: christian.heimes, koobs, vstinner priority: normal severity: normal status: open title: Python2, FreeBSD: test_ssl fails on non-ASCII path versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:16:26 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:16:26 +0000 Subject: [issue33354] Python2: test_ssl fails on non-ASCII path In-Reply-To: <1524665655.9.0.682650639539.issue33354@psf.upfronthosting.co.za> Message-ID: <1524665786.6.0.682650639539.issue33354@psf.upfronthosting.co.za> STINNER Victor added the comment: The issue is not specific to FreeBSD, it depends on the locale (on the Python filesystem encoding). I reproduced the issue on Linux: vstinner at apu$ LC_ALL=C ./python -m test test_ssl Run tests sequentially 0:00:00 load avg: 0.27 [1/1] test_ssl test test_ssl failed -- Traceback (most recent call last): File "/home/vstinner/prog/python/2.7/Lib/test/test_ssl.py", line 1005, in test_load_dh_params shutil.copy(DHFILE, fname) File "/home/vstinner/prog/python/2.7/Lib/shutil.py", line 131, in copy if os.path.isdir(dst): File "/home/vstinner/prog/python/2.7/Lib/genericpath.py", line 49, in isdir st = os.stat(s) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 18: ordinal not in range(128) 1 test failed: test_ssl Total duration: 1 sec Tests result: FAILURE ---------- components: -FreeBSD nosy: -koobs title: Python2, FreeBSD: test_ssl fails on non-ASCII path -> Python2: test_ssl fails on non-ASCII path _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:24:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:24:56 +0000 Subject: [issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize() Message-ID: <1524666296.0.0.682650639539.issue33355@psf.upfronthosting.co.za> New submission from STINNER Victor : Windows10 3.x: http://buildbot.python.org/all/#/builders/3/builds/817 Timeout (0:15:00)! Thread 0x00001e5c (most recent call first): File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test_mmap.py", line 754 in _make_test_file File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test_mmap.py", line 769 in test_large_filesize ... ---------- components: Tests messages: 315736 nosy: vstinner priority: normal severity: normal status: open title: Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize() versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:26:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:26:40 +0000 Subject: [issue33356] Windows 10 buildbot: test__xxsubinterpreters.test_already_running() fails randomly Message-ID: <1524666400.61.0.682650639539.issue33356@psf.upfronthosting.co.za> New submission from STINNER Victor : Windows10 3.x: test_already_running() failed once, but passed when run again: http://buildbot.python.org/all/#/builders/3/builds/817/steps/3/logs/stdio ====================================================================== FAIL: test_already_running (test.test__xxsubinterpreters.RunStringTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test__xxsubinterpreters.py", line 561, in test_already_running interpreters.run_string(self.id, 'print("spam")') AssertionError: RuntimeError not raised (...) Re-running test 'test__xxsubinterpreters' in verbose mode (...) Ran 94 tests in 14.582s OK (skipped=3) ---------- components: Tests messages: 315737 nosy: eric.snow, vstinner priority: normal severity: normal status: open title: Windows 10 buildbot: test__xxsubinterpreters.test_already_running() fails randomly versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:27:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:27:59 +0000 Subject: [issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize() In-Reply-To: <1524666296.0.0.682650639539.issue33355@psf.upfronthosting.co.za> Message-ID: <1524666479.25.0.682650639539.issue33355@psf.upfronthosting.co.za> STINNER Victor added the comment: The test also fails on Windows10 3.6 and Windows10 3.7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:30:42 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:30:42 +0000 Subject: [issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize() In-Reply-To: <1524666296.0.0.682650639539.issue33355@psf.upfronthosting.co.za> Message-ID: <1524666642.87.0.682650639539.issue33355@psf.upfronthosting.co.za> STINNER Victor added the comment: Similar bug on AMD64 Windows8 3.x buildbot: Timeout (0:15:00)! Thread 0x00001014 (most recent call first): File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_mmap.py", line 754 in _make_test_file File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_mmap.py", line 764 in test_large_offset Same failure on AMD64 Windows8 3.6 and AMD64 Windows8 3.7. ---------- versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:39:14 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:39:14 +0000 Subject: [issue33357] [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory Message-ID: <1524667154.63.0.682650639539.issue33357@psf.upfronthosting.co.za> New submission from STINNER Victor : vstinner at apu$ ./python -m test test_posix -R 3:3 -m test.test_posix.PosixTester.test_posix_spawn_file_actions Run tests sequentially 0:00:00 load avg: 0.58 [1/1] test_posix beginning 6 repetitions 123456 ...... test_posix leaked [7, 7, 7] references, sum=21 test_posix leaked [1, 2, 1] memory blocks, sum=4 test_posix failed 1 test failed: test_posix Total duration: 315 ms Tests result: FAILURE I bet that the leak was introduced by: commit 6c6ddf97c402709713d668d0ed53836a7749ba99 Author: Pablo Galindo Date: Mon Jan 29 01:56:10 2018 +0000 bpo-20104: Expose `posix_spawn` in the os module (GH-5109) Add os.posix_spawn to wrap the low level POSIX API of the same name. Contributed by Pablo Galindo. -- IMHO this issue is easy to fix, so I suggest to leave it to new contributors, or the author of the change. ---------- components: Tests messages: 315740 nosy: vstinner priority: normal severity: normal status: open title: [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:39:30 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:39:30 +0000 Subject: [issue33357] [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory In-Reply-To: <1524667154.63.0.682650639539.issue33357@psf.upfronthosting.co.za> Message-ID: <1524667170.07.0.682650639539.issue33357@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:41:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:41:16 +0000 Subject: [issue33358] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails Message-ID: <1524667276.72.0.682650639539.issue33358@psf.upfronthosting.co.za> New submission from STINNER Victor : Re-running test 'test_embed' in verbose mode test_bpo20891 (test.test_embed.EmbeddingTests) ... ok test_forced_io_encoding (test.test_embed.EmbeddingTests) ... ok test_pre_initialization_api (test.test_embed.EmbeddingTests) ... ok test_pre_initialization_sys_options (test.test_embed.EmbeddingTests) ... --- ['/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Programs/_testembed', 'pre_initialization_sys_options'] failed --- stdout: stderr: /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Programs/_testembed: error while loading shared libraries: libpython3.8dm.so.1.0: cannot open shared object file: No such file or directory ------ FAIL test_subinterps_different_ids (test.test_embed.EmbeddingTests) ... ok test_subinterps_distinct_state (test.test_embed.EmbeddingTests) ... ok test test_embed failed test_subinterps_main (test.test_embed.EmbeddingTests) ... ok ====================================================================== FAIL: test_pre_initialization_sys_options (test.test_embed.EmbeddingTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_embed.py", line 213, in test_pre_initialization_sys_options "pre_initialization_sys_options", env=env) File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_embed.py", line 59, in run_embedded_interpreter (p.returncode, err)) AssertionError: 127 != 0 : bad returncode 127, stderr is '/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Programs/_testembed: error while loading shared libraries: libpython3.8dm.so.1.0: cannot open shared object file: No such file or directory\n' ---------------------------------------------------------------------- Ran 7 tests in 7.218s FAILED (failures=1) 1 test failed again: test_embed ---------- components: Tests messages: 315741 nosy: vstinner priority: normal severity: normal status: open title: x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:54:41 2018 From: report at bugs.python.org (Michael Felt) Date: Wed, 25 Apr 2018 14:54:41 +0000 Subject: [issue33281] ctypes.util.find_library not working on macOS In-Reply-To: <1523771801.88.0.682650639539.issue33281@psf.upfronthosting.co.za> Message-ID: <902d6a83-66e0-a6ac-d8b6-81eddbdc3f40@felt.demon.nl> Michael Felt added the comment: On 15/04/2018 07:56, Ned Deily wrote: > Ned Deily added the comment: > > Thanks for the report and the good detective work! I see the same results. It appears that the error was introduced by c5ae169e1b73315672770517bf51cf8464286c76 for Issue26439. It looks we need both a fix and a test for this. This really needs to be fixed for 3.7.0b4. Perhaps he can give a bit more info. I do not understand how this could break things, as the darwin code is earlier in the queue. if os.name == "posix" and sys.platform == "darwin": ??? from ctypes.macholib.dyld import dyld_find as _dyld_find ??? def find_library(name): ??????? possible = ['lib%s.dylib' % name, ??????????????????? '%s.dylib' % name, ??????????????????? '%s.framework/%s' % (name, name)] ??????? for name in possible: ??????????? try: ??????????????? return _dyld_find(name) ??????????? except ValueError: ??????????????? continue ??????? return None if sys.platform.startswith("aix"): ??? # AIX has two styles of storing shared libraries ??? # GNU auto_tools refer to these as svr4 and aix ??? # svr4 (System V Release 4) is a regular file, often with .so as suffix ??? # AIX style uses an archive (suffix .a) with members (e.g., shr.o, libssl.so) ??? # see issue#26439 and _aix.py for more details ??? from ctypes._aix import find_library elif os.name == "posix": ??? # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump ??? import re, tempfile ??? def _findLib_gcc(name): As I understand the code above (and maybe I am wrong) - the code should be calling the unchanged routines in the macholib subdirectory. A simple test on macOS would be to comment out the two lines if sys.platform.startswith("aix"): ??? from ctypes._aix import find_library That will "delete" the AIX find_library logic. In other words - can someone check whether the unchanged Lib/ctypes/macholib/* files are being used? And if not, then something surprising is preventing that. If they are - no idea how the macholib code got effected by this. The goal was to have all changes in the _aix.py file, rather than in util.py. > > ---------- > nosy: +Michael.Felt, ned.deily, vstinner > priority: normal -> release blocker > stage: -> needs patch > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:56:22 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Apr 2018 14:56:22 +0000 Subject: [issue33357] [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory In-Reply-To: <1524667154.63.0.682650639539.issue33357@psf.upfronthosting.co.za> Message-ID: <1524668182.64.0.682650639539.issue33357@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: I think PR6332 is already addressing this https://github.com/python/cpython/pull/6332 , right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 10:59:03 2018 From: report at bugs.python.org (STINNER Victor) Date: Wed, 25 Apr 2018 14:59:03 +0000 Subject: [issue33357] [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory In-Reply-To: <1524667154.63.0.682650639539.issue33357@psf.upfronthosting.co.za> Message-ID: <1524668343.67.0.682650639539.issue33357@psf.upfronthosting.co.za> STINNER Victor added the comment: I confirm that PR 6332 fixes the leak. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 11:03:53 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Apr 2018 15:03:53 +0000 Subject: [issue33357] [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory In-Reply-To: <1524667154.63.0.682650639539.issue33357@psf.upfronthosting.co.za> Message-ID: <1524668633.52.0.682650639539.issue33357@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- superseder: -> expose posix_spawn(p) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 11:12:14 2018 From: report at bugs.python.org (Kaeptm Blaubaer) Date: Wed, 25 Apr 2018 15:12:14 +0000 Subject: [issue30613] Distutils register command creates non-standard multipart data In-Reply-To: <1497009325.99.0.168340984159.issue30613@psf.upfronthosting.co.za> Message-ID: <1524669134.16.0.682650639539.issue30613@psf.upfronthosting.co.za> Change by Kaeptm Blaubaer : ---------- keywords: +patch pull_requests: +6294 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 11:36:16 2018 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 25 Apr 2018 15:36:16 +0000 Subject: [issue30613] Distutils register command creates non-standard multipart data In-Reply-To: <1497009325.99.0.168340984159.issue30613@psf.upfronthosting.co.za> Message-ID: <1524670576.0.0.682650639539.issue30613@psf.upfronthosting.co.za> ?ric Araujo added the comment: I think this is a duplicate, could you search existing bugs? But given issue33071 , is this still relevant? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 11:41:48 2018 From: report at bugs.python.org (Carl) Date: Wed, 25 Apr 2018 15:41:48 +0000 Subject: [issue33258] Unable to install 3.6.5 on Windows Server 2008 In-Reply-To: <1523379903.12.0.682650639539.issue33258@psf.upfronthosting.co.za> Message-ID: <1524670908.16.0.682650639539.issue33258@psf.upfronthosting.co.za> Carl added the comment: The Windows server 2008 is in the process of being updated to 2012. Thanks for all the feedback ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 11:46:31 2018 From: report at bugs.python.org (Kaeptm Blaubaer) Date: Wed, 25 Apr 2018 15:46:31 +0000 Subject: [issue30613] Distutils register command creates non-standard multipart data In-Reply-To: <1497009325.99.0.168340984159.issue30613@psf.upfronthosting.co.za> Message-ID: <1524671191.19.0.682650639539.issue30613@psf.upfronthosting.co.za> Kaeptm Blaubaer added the comment: Yes, I think it's relevant, "not require register anymore, although other package indexes might" This means other package indexes are required to be able to parse this HTTP. That's not good and has lead to workarounds (chishop for example= which might change the long-description in the body. And it seems like the command hasn't changed since I developed the patch (around 10 months ago). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 11:47:39 2018 From: report at bugs.python.org (Eryk Sun) Date: Wed, 25 Apr 2018 15:47:39 +0000 Subject: [issue33275] glob.glob should explicitly note that results aren't sorted In-Reply-To: <1523644726.46.0.682650639539.issue33275@psf.upfronthosting.co.za> Message-ID: <1524671259.5.0.682650639539.issue33275@psf.upfronthosting.co.za> Eryk Sun added the comment: As I said, some file systems such as NTFS and ISO 9660 (or Joliet) store directories in lexicographically sorted order. NTFS does this using a b-tree and case-insensitive comparison, which helps the driver efficiently implement filtering a directory listing using a pattern such as "spam*eggs?.txt". (Filtering of a directory listing at the syscall level is peculiar to Windows and not supported by Python.) I like the phrase "arbitrary order". I don't think it's wise for an application to ever depend on the order. Also, we usually want natural-language collation for display purposes (e.g. spam2.txt should come before spam10.txt), so we have to sort the result regardless of the file system. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 13:22:17 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 25 Apr 2018 17:22:17 +0000 Subject: [issue22069] TextIOWrapper(newline="\n", line_buffering=True) mistakenly treat \r as a newline In-Reply-To: <1406306623.81.0.633771356606.issue22069@psf.upfronthosting.co.za> Message-ID: <1524676937.09.0.682650639539.issue22069@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- keywords: +easy stage: -> needs patch versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 13:25:32 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Wed, 25 Apr 2018 17:25:32 +0000 Subject: [issue19950] Document that unittest.TestCase.__init__ is called once per test In-Reply-To: <1386714858.72.0.878231586551.issue19950@psf.upfronthosting.co.za> Message-ID: <1524677132.18.0.682650639539.issue19950@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- keywords: +easy -patch stage: -> needs patch versions: +Python 3.7, Python 3.8 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 13:29:59 2018 From: report at bugs.python.org (Ethan Smith) Date: Wed, 25 Apr 2018 17:29:59 +0000 Subject: [issue33351] Support compiling with clang-cl on Windows In-Reply-To: <1524631004.17.0.682650639539.issue33351@psf.upfronthosting.co.za> Message-ID: <1524677399.08.0.682650639539.issue33351@psf.upfronthosting.co.za> Ethan Smith added the comment: >* Are you suggesting that CPython's build system move away from MSVC as the platform compiler for Windows? Not immediately, I don't think we should give up on the stability that currently exists with the cl based compilation. However, I think once CPython on clang-cl becomes stable, it will be compelling to switch. Clang-cl has the benefit of backwards compatibility with existing MSVC compiled c extensions, while generating a faster interpreter (perhaps 30% faster or more!). * Are you able to provide a machine to run buildbots on? I'm afraid not, I am just a college student :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 13:54:00 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 17:54:00 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524678840.79.0.682650639539.issue33280@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 67a8f4fed3169e1b8c947c10f6e06863e399ae32 by Serhiy Storchaka (Andr?s Delfino) in branch 'master': bpo-33280: Reorganize external Tcl/Tk references. (GH-6473) https://github.com/python/cpython/commit/67a8f4fed3169e1b8c947c10f6e06863e399ae32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 13:56:37 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Apr 2018 17:56:37 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524678997.64.0.682650639539.issue33280@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6295 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 13:58:43 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 17:58:43 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1524679123.19.0.682650639539.issue33330@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset e9d9494d6b2a5e0c2d48d22c7f0d5e95504b4f7e by Serhiy Storchaka in branch 'master': bpo-33330: Improve error handling in PyImport_Cleanup(). (GH-6564) https://github.com/python/cpython/commit/e9d9494d6b2a5e0c2d48d22c7f0d5e95504b4f7e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 13:59:50 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Apr 2018 17:59:50 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1524679190.63.0.682650639539.issue33330@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6296 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:13:44 2018 From: report at bugs.python.org (Uzume) Date: Wed, 25 Apr 2018 18:13:44 +0000 Subject: [issue33359] curses.has_key failure Message-ID: <1524680024.26.0.682650639539.issue33359@psf.upfronthosting.co.za> New submission from Uzume : The following change is broken and should be reverted (for the one file anyway): https://github.com/python/cpython/commit/6e3dbbdf39f3b4eb6f18c0165e446df17218b7dc#diff-c322497c7350a91fc1d78da0bb76b5b5 This does not seem to affect master but I did not check every Python version. This causes the following broken behavior (as found on Python 2.7): $ python -m curses.has_key yields the exception "TypeError: argument of type 'module' is not iterable" ---------- components: Library (Lib) messages: 315752 nosy: benjamin.peterson, uzume priority: normal severity: normal status: open title: curses.has_key failure type: behavior versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:28:26 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 18:28:26 +0000 Subject: [issue33359] curses.has_key failure In-Reply-To: <1524680024.26.0.682650639539.issue33359@psf.upfronthosting.co.za> Message-ID: <1524680905.99.0.682650639539.issue33359@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: python -m curses.has_key ---------- keywords: +easy nosy: +serhiy.storchaka stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:29:07 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Wed, 25 Apr 2018 18:29:07 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524680947.5.0.682650639539.issue33280@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- pull_requests: +6297 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:30:13 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Apr 2018 18:30:13 +0000 Subject: [issue33314] Bad rendering in the documentation for the os module In-Reply-To: <1524090631.89.0.682650639539.issue33314@psf.upfronthosting.co.za> Message-ID: <1524681013.6.0.682650639539.issue33314@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6298 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:30:46 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 18:30:46 +0000 Subject: [issue33314] Bad rendering in the documentation for the os module In-Reply-To: <1524090631.89.0.682650639539.issue33314@psf.upfronthosting.co.za> Message-ID: <1524681046.84.0.682650639539.issue33314@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 6a1799e6f02ef0db85d96d45d1f0a40ae72c9afe by Serhiy Storchaka (Miss Islington (bot)) in branch '3.7': bpo-33314: Fix rendering issues in the documentation for the os module (GH-6525) (GH-6597) https://github.com/python/cpython/commit/6a1799e6f02ef0db85d96d45d1f0a40ae72c9afe ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:31:00 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Apr 2018 18:31:00 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524681060.96.0.682650639539.issue33280@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 53d36cc961ff2080fa91a216cce718295259d723 by Miss Islington (bot) in branch '3.7': bpo-33280: Reorganize external Tcl/Tk references. (GH-6473) https://github.com/python/cpython/commit/53d36cc961ff2080fa91a216cce718295259d723 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:32:54 2018 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Apr 2018 18:32:54 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1524681174.53.0.682650639539.issue33330@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 291c9d4f74f3c7c57ae18e1aca617206795a090d by Miss Islington (bot) in branch '3.7': bpo-33330: Improve error handling in PyImport_Cleanup(). (GH-6564) https://github.com/python/cpython/commit/291c9d4f74f3c7c57ae18e1aca617206795a090d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:40:00 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Wed, 25 Apr 2018 18:40:00 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524681600.09.0.682650639539.issue33280@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- pull_requests: +6299 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:46:56 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 18:46:56 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1524682016.2.0.682650639539.issue33330@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6300 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:47:48 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 18:47:48 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1524682068.22.0.682650639539.issue33330@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6301 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:52:07 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 18:52:07 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1524682327.94.0.682650639539.issue33330@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6302 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 14:56:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 18:56:28 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1524682588.93.0.682650639539.issue33330@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PR 6606 replaces PyErr_Clear() with PyErr_WriteUnraisable(). This may add an unexpected noise at shutdown' but on other hand, this may be a helpful information in the case if something wrong happen. It doesn't produce additional output when run all tests, this means that that all is successful. I wonder in which circumstance that output will be occurred. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 15:04:15 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 19:04:15 +0000 Subject: [issue33334] Add support of NOP and EXTENDED_ARG in stack_effect() In-Reply-To: <1524417077.19.0.682650639539.issue33334@psf.upfronthosting.co.za> Message-ID: <1524683055.45.0.682650639539.issue33334@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 57faf348872d1d0af1808c82f535cf220d64b028 by Serhiy Storchaka in branch 'master': bpo-33334: Support NOP and EXTENDED_ARG in dis.stack_effect(). (#6566) https://github.com/python/cpython/commit/57faf348872d1d0af1808c82f535cf220d64b028 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 15:06:05 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Apr 2018 19:06:05 +0000 Subject: [issue33334] Add support of NOP and EXTENDED_ARG in stack_effect() In-Reply-To: <1524417077.19.0.682650639539.issue33334@psf.upfronthosting.co.za> Message-ID: <1524683165.66.0.682650639539.issue33334@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 17:00:12 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Wed, 25 Apr 2018 21:00:12 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524690012.2.0.682650639539.issue33280@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- pull_requests: +6303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 17:15:09 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 25 Apr 2018 21:15:09 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524690909.26.0.682650639539.issue33337@psf.upfronthosting.co.za> ?ukasz Langa added the comment: [njs] > "there's a bug in handling this python 2 code, so black won't be able to reformat it until the next major python release" Nah, we're still allowed to fix bugs in micro releases. We should have more of those instead of sitting on fixed bugs for months. That's a discussion for a different venue though. [gutworth] > The stdlib is a bad place for anything that needs to evolve at a non-glacial place. The syntax tree only needs to evolve to keep up with current Python development. That's why I think it makes sense to tie the two. [gvr] > please consider seriously to move to a 3rd party package Does that also invalidate the idea to merge the tokenizers? And if so, does that also invalidate the idea to update lib2to3's tokenizer (BPO-33338)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 17:37:44 2018 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 25 Apr 2018 21:37:44 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524690909.26.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: Guido van Rossum added the comment: I think merging the tokenizers still makes sense. We can then document top-level tokenize.py (in 3.8 and later) as guaranteed to be able to tokenize anything going back to Python 2.7. And since lib2to3/pgen2 it is undocumented I presume removing lib2to3/pgen2/tokenize.py isn't going to break anything -- but if we worry about that it could be made into a trivial wrapper for top-level tokenize.py. Still, the improvements you're planning to lib2to3 (no matter how compatible) will benefit more people sooner if you extract it into its own PyPI package. Not everybody can upgrade to 3.7 as soon as Instagram. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 18:43:47 2018 From: report at bugs.python.org (Paul Goins) Date: Wed, 25 Apr 2018 22:43:47 +0000 Subject: [issue21822] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1524696227.87.0.682650639539.issue21822@psf.upfronthosting.co.za> Paul Goins added the comment: I've confirmed this issue on Windows. Attached is an SSCCE which seems to reliably reproduce the issue in a Windows environment. Long story short: if a KeyboardInterrupt occurs during Thread.join(), there's a good chance that Thread._is_stopped never gets set. ---------- nosy: +pdgoins versions: +Python 3.6 Added file: https://bugs.python.org/file47549/sscce_thread_join_fails_on_keyboardinterrupt.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 18:49:32 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Wed, 25 Apr 2018 22:49:32 +0000 Subject: [issue21822] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1524696572.12.0.682650639539.issue21822@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Thanks for the update. Since I still can't reproduce on Linux, perhaps you (or one of our resident Windows experts) can try to propose a patch fixing the issue? ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 18:58:37 2018 From: report at bugs.python.org (Juan Postlbauer) Date: Wed, 25 Apr 2018 22:58:37 +0000 Subject: [issue33360] ALternative recipe for password using secrets Message-ID: <1524697117.91.0.682650639539.issue33360@psf.upfronthosting.co.za> New submission from Juan Postlbauer : Chapter 15.3.4 shows a recipe with an infinite potential loop. An alternative would be: ''.join(sorted([choice(string.ascii_lowercase) for i in range(1)]+[choice(string.ascii_uppercase) for i in range(1)]+[choice(string.digits) for i in range(3)]+[choice(string.ascii_letters+string.digits) for i in range(10-(1+1+3))],key=lambda x:randbelow(4096))) Can we assume secrets.SystemRandom is cryptographically strong but has all the methods of random?? If so it can be done in a more understandable way by using choices and shuffle. (see 2 examples below) def generate_password_random(totalchars=10,minlower=1,minupper=1,mindigits=3): restcount= totalchars-(minlower+minupper+mindigits) if restcount<0: raise ValueError("Impossible conditions") lowerchars=random.choices(string.ascii_lowercase,k=minlower) upperchars=random.choices(string.ascii_uppercase,k=minupper) digitchars=random.choices(string.digits,k=mindigits) restchars=random.choices(string.ascii_letters+string.digits,k=restcount) allchars=lowerchars+upperchars+digitchars+restchars random.shuffle(allchars) password=''.join(allchars) return password def generate_password_secrets(totalchars=10,minlower=1,minupper=1,mindigits=3): restcount= totalchars- (minlower+minupper+mindigits) if restcount<0: raise ValueError("Impossible conditions") lowerchars=[secrets.choice(string.ascii_lowercase) for _ in range(minlower)] upperchars=[secrets.choice(string.ascii_uppercase) for _ in range(minupper)] digitchars=[secrets.choice(string.digits) for _ in range (mindigits)] restchars=[secrets.choice(string.ascii_letters+string.digits) for _ in range (restcount)] allchars=lowerchars+upperchars+digitchars+restchars allchars.sort(key=lambda x:secrets.randbelow(4096)) password=''.join(allchars) return password ---------- assignee: docs at python components: Documentation messages: 315763 nosy: docs at python, jpc4242 priority: normal severity: normal status: open title: ALternative recipe for password using secrets type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 19:46:53 2018 From: report at bugs.python.org (Mariatta Wijaya) Date: Wed, 25 Apr 2018 23:46:53 +0000 Subject: [issue3692] improper scope in list comprehension, when used in class declaration In-Reply-To: <1219792814.12.0.663300668565.issue3692@psf.upfronthosting.co.za> Message-ID: <1524700013.72.0.682650639539.issue3692@psf.upfronthosting.co.za> Mariatta Wijaya added the comment: I'm re-opening this, since the behavior sounds like a bug to me. While I understand why it behaves the way it is now, but it seems wrong behavior. Perhaps we should look into finding a solution. ---------- nosy: +Mariatta resolution: wont fix -> status: closed -> open versions: +Python 3.8 -Python 3.0 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 19:51:57 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 25 Apr 2018 23:51:57 +0000 Subject: [issue27485] urllib.splitport -- is it official or not? In-Reply-To: <1468260123.51.0.000787877209911.issue27485@psf.upfronthosting.co.za> Message-ID: <1524700317.5.0.682650639539.issue27485@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset 0250de48199552cdaed5a4fe44b3f9cdb5325363 by ?ukasz Langa (Cheryl Sabella) in branch 'master': bpo-27485: Rename and deprecate undocumented functions in urllib.parse (GH-2205) https://github.com/python/cpython/commit/0250de48199552cdaed5a4fe44b3f9cdb5325363 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 20:27:56 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 00:27:56 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1524702476.14.0.682650639539.issue33330@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset b16681fb1e63f45361d1d68333d6dbdd4bf5435d by Serhiy Storchaka in branch '3.6': [3.6] bpo-33330: Improve error handling in PyImport_Cleanup(). (GH-6564). (GH-6604) https://github.com/python/cpython/commit/b16681fb1e63f45361d1d68333d6dbdd4bf5435d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 20:28:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 00:28:16 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1524702496.93.0.682650639539.issue33330@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 55299fffe328c3d2dfc222a22116b7e53bf2e962 by Serhiy Storchaka in branch '2.7': [2.7] bpo-33330: Improve error handling in PyImport_Cleanup(). (GH-6564). (GH-6605) https://github.com/python/cpython/commit/55299fffe328c3d2dfc222a22116b7e53bf2e962 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 21:06:03 2018 From: report at bugs.python.org (Diego Argueta) Date: Thu, 26 Apr 2018 01:06:03 +0000 Subject: [issue33361] readline() + seek() on io.EncodedFile breaks next readline() Message-ID: <1524704763.78.0.682650639539.issue33361@psf.upfronthosting.co.za> New submission from Diego Argueta : It appears that calling readline() on a codecs.EncodedFile stream breaks seeking and causes subsequent attempts to iterate over the lines or call readline() to backtrack and return already consumed lines. A minimal example: ``` from __future__ import print_function import codecs import io def run(stream): offset = stream.tell() try: stream.seek(0) header_row = stream.readline() finally: stream.seek(offset) print('Got header: %r' % header_row) if stream.tell() == 0: print('Skipping the header: %r' % stream.readline()) for index, line in enumerate(stream, start=2): print('Line %d: %r' % (index, line)) b = io.BytesIO(u'a,b\r\n"asdf","jkl;"\r\n'.encode('utf-16-le')) s = codecs.EncodedFile(b, 'utf-8', 'utf-16-le') run(s) ``` Output: ``` Got header: 'a,b\r\n' Skipping the header: '"asdf","jkl;"\r\n' <-- this is line 2 Line 2: 'a,b\r\n' <-- this is line 1 Line 3: '"asdf","jkl;"\r\n' <-- now we're back to line 2 ``` As you can see, the line being skipped is actually the second line, and when we try reading from the stream again, the iterator starts from the beginning of the file. Even weirder, adding a second call to readline() to skip the second line shows it's going **backwards**: ``` Got header: 'a,b\r\n' Skipping the header: '"asdf","jkl;"\r\n' <-- this is actually line 2 Skipping the second line: 'a,b\r\n' <-- this is line 1 Line 2: '"asdf","jkl;"\r\n' <-- this is now correct ``` The expected output shows that we got a header, skipped it, and then read one data line. ``` Got header: 'a,b' Skipping the header: 'a,b\r\n' Line 2: '"asdf","jkl;"\r\n' ``` I'm sure this is related to the implementation of readline() because if we change this: ``` header_row = stream.readline() ``` to this: ``` header_row = stream.read().splitlines()[0] ``` then we get the expected output. If on the other hand we comment out the seek() in the finally clause, we also get the expected output (minus the "skipping the header") code. ---------- components: IO, Library (Lib) messages: 315768 nosy: da priority: normal severity: normal status: open title: readline() + seek() on io.EncodedFile breaks next readline() type: behavior versions: Python 2.7, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 22:10:18 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Apr 2018 02:10:18 +0000 Subject: [issue27485] urllib.splitport -- is it official or not? In-Reply-To: <1468260123.51.0.000787877209911.issue27485@psf.upfronthosting.co.za> Message-ID: <1524708618.84.0.682650639539.issue27485@psf.upfronthosting.co.za> ?ukasz Langa added the comment: Thanks! This is now fixed for Python 3.8 \o/ ---------- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.8 -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 22:21:03 2018 From: report at bugs.python.org (Connor W Fitzgerald) Date: Thu, 26 Apr 2018 02:21:03 +0000 Subject: [issue32209] Crash in set_traverse Within the Garbage Collector's collect_generations() In-Reply-To: <1512358631.67.0.213398074469.issue32209@psf.upfronthosting.co.za> Message-ID: <1524709263.3.0.682650639539.issue32209@psf.upfronthosting.co.za> Connor W Fitzgerald added the comment: I'm going to close this. It's been a really long time and this was for an assignment and I rewrote it before we put it into a github repo so I don't even have the buggy code still. Additionally I think it may have been the fault of some faulty memory I had in my computer so I'm betting that it wasn't pythons fault. Cheers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 22:21:16 2018 From: report at bugs.python.org (Connor W Fitzgerald) Date: Thu, 26 Apr 2018 02:21:16 +0000 Subject: [issue32209] Crash in set_traverse Within the Garbage Collector's collect_generations() In-Reply-To: <1512358631.67.0.213398074469.issue32209@psf.upfronthosting.co.za> Message-ID: <1524709276.11.0.682650639539.issue32209@psf.upfronthosting.co.za> Change by Connor W Fitzgerald : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 22:50:46 2018 From: report at bugs.python.org (David Ghiurco) Date: Thu, 26 Apr 2018 02:50:46 +0000 Subject: [issue33362] string strip() strips extra characters that it shouldn't Message-ID: <1524711046.09.0.682650639539.issue33362@psf.upfronthosting.co.za> New submission from David Ghiurco : No PR is attached since the issue is pretty trivial to reproduce but important nonetheless: string = "LDA/AIC2/1919uc1b354363457" print(string) print(string.lstrip("LDA/")) the stripped string should be "AIC2/1919uc1b354363457" but is instead "IC2/1919uc1b354363457" notice the leading "A" missing. I've noticed this happens when the letter immediately following the slash is the same letter as the one immediately before the slash. Never contributed to python so I'm not exactly sure how to, but if anyone knowledgeable could take a look, this will probably be an easy fix. Note: I am experiencing this on Python 3.6.4, specifically the Anaconda distribution. I have not tried another version. ---------- messages: 315771 nosy: rahvan priority: normal severity: normal status: open title: string strip() strips extra characters that it shouldn't versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Apr 25 22:55:51 2018 From: report at bugs.python.org (pmpp) Date: Thu, 26 Apr 2018 02:55:51 +0000 Subject: [issue33362] string strip() strips extra characters that it shouldn't In-Reply-To: <1524711046.09.0.682650639539.issue33362@psf.upfronthosting.co.za> Message-ID: <1524711351.69.0.682650639539.issue33362@psf.upfronthosting.co.za> pmpp added the comment: lstrip(chars=None, /) method of builtins.str instance Return a copy of the string with leading whitespace removed. If chars is given and not None, remove characters in chars instead. all L D A / single chars get removed, while there is *any* of them of the left. not the "LDA/" block as you probably expected ---------- nosy: +pmpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 00:09:16 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 26 Apr 2018 04:09:16 +0000 Subject: [issue33362] string strip() strips extra characters that it shouldn't In-Reply-To: <1524711046.09.0.682650639539.issue33362@psf.upfronthosting.co.za> Message-ID: <1524715756.9.0.682650639539.issue33362@psf.upfronthosting.co.za> Steven D'Aprano added the comment: the argument to string.strip (also lstrip and rstrip) is not an exact substring to remove, but a set of characters to remove: py> 'zyxzz1234'.strip('xyz') '1234' ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 00:55:42 2018 From: report at bugs.python.org (David Ghiurco) Date: Thu, 26 Apr 2018 04:55:42 +0000 Subject: [issue33362] string strip() strips extra characters that it shouldn't In-Reply-To: <1524711046.09.0.682650639539.issue33362@psf.upfronthosting.co.za> Message-ID: <1524718542.95.0.682650639539.issue33362@psf.upfronthosting.co.za> David Ghiurco added the comment: Thanks guys. I should have used .replace(). My bad. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 01:18:50 2018 From: report at bugs.python.org (Zsolt Dollenstein) Date: Thu, 26 Apr 2018 05:18:50 +0000 Subject: [issue33363] async for statement is not a syntax error in sync context Message-ID: <1524719930.25.0.682650639539.issue33363@psf.upfronthosting.co.za> New submission from Zsolt Dollenstein : Since 3.7, async generators can be used in non-async functions. The way this is implemented allows the following to be valid syntax: def f(): async for i in aiterable: pass return 1 The return value of the above function is a Future that will never be done(). ---------- components: Interpreter Core messages: 315775 nosy: zsol priority: normal severity: normal status: open title: async for statement is not a syntax error in sync context type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 01:24:07 2018 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 26 Apr 2018 05:24:07 +0000 Subject: [issue33363] async for statement is not a syntax error in sync context In-Reply-To: <1524719930.25.0.682650639539.issue33363@psf.upfronthosting.co.za> Message-ID: <1524720247.52.0.682650639539.issue33363@psf.upfronthosting.co.za> Yury Selivanov added the comment: Wow, this is a regression that has to be fixed in 3.7. ---------- nosy: +ned.deily, yselivanov priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 01:28:06 2018 From: report at bugs.python.org (Nathaniel Smith) Date: Thu, 26 Apr 2018 05:28:06 +0000 Subject: [issue33363] async for statement is not a syntax error in sync context In-Reply-To: <1524719930.25.0.682650639539.issue33363@psf.upfronthosting.co.za> Message-ID: <1524720486.41.0.682650639539.issue33363@psf.upfronthosting.co.za> Change by Nathaniel Smith : ---------- nosy: +njs priority: release blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 01:28:34 2018 From: report at bugs.python.org (Nathaniel Smith) Date: Thu, 26 Apr 2018 05:28:34 +0000 Subject: [issue33363] async for statement is not a syntax error in sync context In-Reply-To: <1524719930.25.0.682650639539.issue33363@psf.upfronthosting.co.za> Message-ID: <1524720514.16.0.682650639539.issue33363@psf.upfronthosting.co.za> Nathaniel Smith added the comment: Sorry, not sure why bpo decided to reset the priority there. ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 01:43:20 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 26 Apr 2018 05:43:20 +0000 Subject: [issue33359] curses.has_key failure In-Reply-To: <1524680024.26.0.682650639539.issue33359@psf.upfronthosting.co.za> Message-ID: <1524721400.79.0.682650639539.issue33359@psf.upfronthosting.co.za> Change by Benjamin Peterson : ---------- keywords: +patch pull_requests: +6304 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 01:57:37 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 26 Apr 2018 05:57:37 +0000 Subject: [issue33359] curses.has_key failure In-Reply-To: <1524680024.26.0.682650639539.issue33359@psf.upfronthosting.co.za> Message-ID: <1524722257.03.0.682650639539.issue33359@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset 3219bbf6a159110d293dcfef2d5889ab020f4c5b by Benjamin Peterson in branch '2.7': fix running the curses.has_key module (closes bpo-33359) (GH-6608) https://github.com/python/cpython/commit/3219bbf6a159110d293dcfef2d5889ab020f4c5b ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 02:37:08 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 06:37:08 +0000 Subject: [issue31455] ElementTree.XMLParser() mishandles exceptions In-Reply-To: <1505323719.65.0.33849698499.issue31455@psf.upfronthosting.co.za> Message-ID: <1524724628.33.0.682650639539.issue31455@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 03:02:07 2018 From: report at bugs.python.org (Juan Enrique Segebre Zaghmout) Date: Thu, 26 Apr 2018 07:02:07 +0000 Subject: [issue33364] Conditionals not evaluating propertly Message-ID: <1524726127.25.0.682650639539.issue33364@psf.upfronthosting.co.za> New submission from Juan Enrique Segebre Zaghmout : The following code generates False when it should generate true: True == False < 20 Either way the order of operation is taken should result in True but the answer still results in False. To further confirm this issue I did a simple test in which we would group the operations, the test uses print statements to visualize results. The short following code represents the above conditional and the two order of operations possibilities. print(True == False < 20); print((True == False) < 20); print(True == (False < 20)); This yields the following output: False True True Proving the bug. To explain even further, the code shall be interpreted in either of the following two ways: 1. True == False < 20 False < 20 True 2. True == False < 20 True == True True In either case the result is True, yet python yields False. ---------- components: Interpreter Core messages: 315779 nosy: Segebre priority: normal severity: normal status: open title: Conditionals not evaluating propertly type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 03:05:10 2018 From: report at bugs.python.org (Juan Postlbauer) Date: Thu, 26 Apr 2018 07:05:10 +0000 Subject: [issue33360] ALternative recipe for password using secrets In-Reply-To: <1524697117.91.0.682650639539.issue33360@psf.upfronthosting.co.za> Message-ID: <1524726310.38.0.682650639539.issue33360@psf.upfronthosting.co.za> Juan Postlbauer added the comment: Just a clarification: by "infinite potential loop" I meant a loop that *theoretically* could last forever. Of course in practice it won't, but my experiments show that for the conditions in the example in average the current recipe generates 5 tentative passwords before finding one that fulfills all conditions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 03:05:50 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 07:05:50 +0000 Subject: [issue33364] Conditionals not evaluating propertly In-Reply-To: <1524726127.25.0.682650639539.issue33364@psf.upfronthosting.co.za> Message-ID: <1524726350.43.0.682650639539.issue33364@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In Python "True == False < 20" is evaluated as "True == False and False < 20". See https://docs.python.org/3/reference/expressions.html#comparisons ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 03:48:09 2018 From: report at bugs.python.org (Ori Avtalion) Date: Thu, 26 Apr 2018 07:48:09 +0000 Subject: [issue31155] Encode set, frozenset, bytearray, and iterators as json arrays In-Reply-To: <1502270596.69.0.819927554445.issue31155@psf.upfronthosting.co.za> Message-ID: <1524728889.61.0.682650639539.issue31155@psf.upfronthosting.co.za> Ori Avtalion added the comment: If sets are to be supported, then so should dictionary views. Please also consider the range type. ---------- nosy: +salty-horse _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 06:00:51 2018 From: report at bugs.python.org (Freek Dijkstra) Date: Thu, 26 Apr 2018 10:00:51 +0000 Subject: [issue27227] argparse fails to parse [] when using choices and nargs='*' In-Reply-To: <1465117156.8.0.428303445441.issue27227@psf.upfronthosting.co.za> Message-ID: <1524736851.64.0.682650639539.issue27227@psf.upfronthosting.co.za> Freek Dijkstra added the comment: I don't think that this issue27227 and issue9625 are the same (although they may have the same root cause, and I would be in favour of fixing both issues). At least, I think the unit test are distinct: This issue27227 is that argparse does not accept 0 options is '0 or more' are specified in nargs. Issue9625 is that argparse returns a different type if a default is specified or when it is not. So I propose to reopen this ticket: it is not fixed, and different from the referred ticket. ---------- nosy: +macfreek versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 06:12:27 2018 From: report at bugs.python.org (Barry Devlin) Date: Thu, 26 Apr 2018 10:12:27 +0000 Subject: [issue33284] Increase test coverage for numbers.py In-Reply-To: <1524277245.2.0.682650639539.issue33284@psf.upfronthosting.co.za> Message-ID: Barry Devlin added the comment: Hey, I updated my pull request based in your advice. Could you review it please? Best, Barry On Sat, 21 Apr 2018, 03:20 Terry J. Reedy, wrote: > > Terry J. Reedy added the comment: > > Barry, thank you for your first submission. > > You propose to test numbers.Complex.__bool__ > > def __bool__(self): > """True if self != 0. Called for bool(self).""" > return self != 0 > > by adding the following to Lib/test/test_abstract_numbers. > > + self.assertFalse(bool(complex(0,0))) > + self.assertTrue(bool(complex(1,2))) > > I believe that this particular addition should be rejected. It is a > concrete test of the builtin complex that partially duplicates the > following in test_complex. > > def test_boolcontext(self): > for i in range(100): > self.assertTrue(complex(random() + 1e-6, random() + 1e-6)) > self.assertTrue(not complex(0.0, 0.0)) > > Looking the tests of collections.abc in test_collections, I believe a > proper test should define a subclass of Complex (in Python), with at least > __init__ and __eq__ methods and test instances of *that*. > > If I were to review a patch, I would like to see a more extensive > addition, one that imports test_collections.ABCTestCase (or copies and > adapts the same) and uses it to test a much fuller implementation of > Complex. As it is, none of the numbers abc class methods are tested. > > Raymond, were you involved with the abc tests? Either way, what do you > think? > > ---------- > nosy: +rhettinger, terry.reedy > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 06:12:59 2018 From: report at bugs.python.org (Elena Oat) Date: Thu, 26 Apr 2018 10:12:59 +0000 Subject: [issue22069] TextIOWrapper(newline="\n", line_buffering=True) mistakenly treat \r as a newline In-Reply-To: <1406306623.81.0.633771356606.issue22069@psf.upfronthosting.co.za> Message-ID: <1524737579.87.0.682650639539.issue22069@psf.upfronthosting.co.za> Elena Oat added the comment: Note that the correct link to the test case is: https://github.com/python/cpython/blob/master/Lib/test/test_io.py#L2565 ---------- nosy: +Elena.Oat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 06:25:07 2018 From: report at bugs.python.org (Elena Oat) Date: Thu, 26 Apr 2018 10:25:07 +0000 Subject: [issue22069] TextIOWrapper(newline="\n", line_buffering=True) mistakenly treat \r as a newline In-Reply-To: <1406306623.81.0.633771356606.issue22069@psf.upfronthosting.co.za> Message-ID: <1524738307.08.0.682650639539.issue22069@psf.upfronthosting.co.za> Change by Elena Oat : ---------- keywords: +patch pull_requests: +6305 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 07:33:14 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 26 Apr 2018 11:33:14 +0000 Subject: [issue32790] Keep trailing zeros in precision for string format option g In-Reply-To: <1518055716.96.0.467229070634.issue32790@psf.upfronthosting.co.za> Message-ID: <1524742394.2.0.682650639539.issue32790@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- keywords: +easy stage: -> needs patch versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 07:34:57 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 11:34:57 +0000 Subject: [issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful In-Reply-To: <1514642746.19.0.213398074469.issue32455@psf.upfronthosting.co.za> Message-ID: <1524742497.18.0.682650639539.issue32455@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6306 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 07:45:49 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 11:45:49 +0000 Subject: [issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful In-Reply-To: <1514642746.19.0.213398074469.issue32455@psf.upfronthosting.co.za> Message-ID: <1524743149.88.0.682650639539.issue32455@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In 3.7 the stack effect is calculated more accurately by the compiler. PR 6610 exposes this feature to users. It add jump parameter to dis.stack_effect() and to PyCompile_OpcodeStackEffect(). By default the maximal value is returned. Passing jump=True for a non-jumping code or passing jump=False to RETURN_VALUE or JUMP_ABSOLUTE don't raise an exception and don't return a special value. It is up to the caller to pass reliable arguments. This will make the workaround for stack_effect() in the bytecode project [1] not needed in 3.8. [1] https://github.com/vstinner/bytecode/pull/29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 07:46:01 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 11:46:01 +0000 Subject: [issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful In-Reply-To: <1514642746.19.0.213398074469.issue32455@psf.upfronthosting.co.za> Message-ID: <1524743161.21.0.682650639539.issue32455@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 08:05:40 2018 From: report at bugs.python.org (Freek Dijkstra) Date: Thu, 26 Apr 2018 12:05:40 +0000 Subject: [issue9625] argparse: Problem with defaults for variable nargs when using choices In-Reply-To: <1282036744.37.0.964764969496.issue9625@psf.upfronthosting.co.za> Message-ID: <1524744340.74.0.682650639539.issue9625@psf.upfronthosting.co.za> Change by Freek Dijkstra : ---------- nosy: +macfreek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 08:12:56 2018 From: report at bugs.python.org (Marco Strigl) Date: Thu, 26 Apr 2018 12:12:56 +0000 Subject: [issue33365] http/client.py does not print correct headers in debug Message-ID: <1524744776.83.0.682650639539.issue33365@psf.upfronthosting.co.za> New submission from Marco Strigl : Consider the following script: try: from urllib import request except ImportError: import urllib2 as request handler = request.HTTPSHandler(debuglevel=1) opener = request.build_opener(handler) f = opener.open('https://httpbin.org/user-agent') In python2.x this works: $ python2 http_client_bug.py send: 'GET /user-agent HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: httpbin.org\r\nConnection: close\r\nUser-Agent: Python-urllib/2.7\r\n\r\n' reply: 'HTTP/1.1 200 OK\r\n' header: Connection: close header: Server: gunicorn/19.7.1 header: Date: Thu, 26 Apr 2018 12:01:35 GMT header: Content-Type: application/json header: Access-Control-Allow-Origin: * header: Access-Control-Allow-Credentials: true header: X-Powered-By: Flask header: X-Processed-Time: 0 header: Content-Length: 40 header: Via: 1.1 vegur But in python3.x only the header keys are printed. Not the values (also a newline after each header will be nice): $ python3 http_client_bug.py send: b'GET /user-agent HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: httpbin.org\r\nUser-Agent: Python-urllib/3.6\r\nConnection: close\r\n\r\n' reply: 'HTTP/1.1 200 OK\r\n' header: Connection header: Server header: Date header: Content-Type header: Access-Control-Allow-Origin header: Access-Control-Allow-Credentials header: X-Powered-By header: X-Processed-Time header: Content-Length header: Patch for this is attached. ---------- components: Library (Lib) files: complete_pretty_headers.patch keywords: patch messages: 315787 nosy: mstrigl priority: normal severity: normal status: open title: http/client.py does not print correct headers in debug versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47550/complete_pretty_headers.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 08:16:14 2018 From: report at bugs.python.org (Elena Oat) Date: Thu, 26 Apr 2018 12:16:14 +0000 Subject: [issue33361] readline() + seek() on io.EncodedFile breaks next readline() In-Reply-To: <1524704763.78.0.682650639539.issue33361@psf.upfronthosting.co.za> Message-ID: <1524744974.06.0.682650639539.issue33361@psf.upfronthosting.co.za> Elena Oat added the comment: I cannot replicate this when the stream is: In: stream_ex = io.BytesIO(u"abc\ndef\nghi\n".encode("utf-8")) In: f = codecs.EncodedFile(stream_ex, 'utf-8') In: run(f) Out: Got header: b'abc\n' Skipping the header: b'abc\n' Line 2: b'def\n' Line 3: b'ghi\n' ---------- nosy: +Elena.Oat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 08:21:11 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 26 Apr 2018 12:21:11 +0000 Subject: [issue31155] Encode set, frozenset, bytearray, and iterators as json arrays In-Reply-To: <1502270596.69.0.819927554445.issue31155@psf.upfronthosting.co.za> Message-ID: <1524745271.45.0.682650639539.issue31155@psf.upfronthosting.co.za> Raymond Hettinger added the comment: There is some virtue to the current design. Having a user explicitly cast to a list will avoid unintentional conversions. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 08:21:26 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 26 Apr 2018 12:21:26 +0000 Subject: [issue31141] Start should be a keyword argument of the built-in sum In-Reply-To: <1502193168.16.0.095124886528.issue31141@psf.upfronthosting.co.za> Message-ID: <1524745286.98.0.682650639539.issue31141@psf.upfronthosting.co.za> Cheryl Sabella added the comment: Hi Mark, Are you able to make the Argument Clinic change the Serhiy suggested to come up with new benchmarks? Thanks! ---------- nosy: +csabella _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 08:33:00 2018 From: report at bugs.python.org (Marco Strigl) Date: Thu, 26 Apr 2018 12:33:00 +0000 Subject: [issue33365] http/client.py does not print correct headers in debug In-Reply-To: <1524744776.83.0.682650639539.issue33365@psf.upfronthosting.co.za> Message-ID: <1524745980.84.0.682650639539.issue33365@psf.upfronthosting.co.za> Change by Marco Strigl : ---------- pull_requests: +6307 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 08:43:34 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 12:43:34 +0000 Subject: [issue31141] Start should be a keyword argument of the built-in sum In-Reply-To: <1502193168.16.0.095124886528.issue31141@psf.upfronthosting.co.za> Message-ID: <1524746614.09.0.682650639539.issue31141@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: First than to allow this argument be passes by keyword, we mast choose its name. See the discussion "Start argument for itertools.accumulate()" on Python-ideas (https://mail.python.org/pipermail/python-ideas/2018-April/049649.html). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 08:47:52 2018 From: report at bugs.python.org (Tom Christie) Date: Thu, 26 Apr 2018 12:47:52 +0000 Subject: [issue33366] `contextvars` documentation incorrectly refers to "non-local state". Message-ID: <1524746872.41.0.682650639539.issue33366@psf.upfronthosting.co.za> New submission from Tom Christie : The `contextvars` documentation, at https://docs.python.org/3.7/library/contextvars.html starts with the following: "This module provides APIs to manage, store, and access non-local state." I assume that must be a documentation bug, right. The module isn't for managing non-local state, it's for managing state that *is* local. I'd assume it ought to read... "This module provides APIs to manage, store, and access context-local state." (ie. for managing state that is transparently either thread-local or task-local depending on the current execution context.) ---------- assignee: docs at python components: Documentation, asyncio messages: 315792 nosy: asvetlov, docs at python, tomchristie, yselivanov priority: normal severity: normal status: open title: `contextvars` documentation incorrectly refers to "non-local state". type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 08:55:35 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Apr 2018 12:55:35 +0000 Subject: [issue31141] Start should be a keyword argument of the built-in sum In-Reply-To: <1502193168.16.0.095124886528.issue31141@psf.upfronthosting.co.za> Message-ID: <1524747335.5.0.682650639539.issue31141@psf.upfronthosting.co.za> STINNER Victor added the comment: > I don't think it is worth to allow passing the first argument as a keyword argument. I concur. Would you mind to add a test to make sure that passing the first argument as the "iterable" keyword doesn't work? "iterable" name comes from the Doc/library/functions.rst documentation and from the docstring. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 09:06:34 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 13:06:34 +0000 Subject: [issue31141] Start should be a keyword argument of the built-in sum In-Reply-To: <1502193168.16.0.095124886528.issue31141@psf.upfronthosting.co.za> Message-ID: <1524747994.94.0.682650639539.issue31141@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: In 2.6 it was "sequence". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 09:43:57 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 13:43:57 +0000 Subject: [issue20104] expose posix_spawn(p) In-Reply-To: <1388600000.81.0.911230526926.issue20104@psf.upfronthosting.co.za> Message-ID: <1524750237.11.0.682650639539.issue20104@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: What about posix_spawnp()? The title mentions both functions, but I don't see any mentions about posix_spawnp() in the discussion. Its omission looks unintentional to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 09:50:17 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 13:50:17 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524750617.69.0.682650639539.issue33280@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 1c6c8510f91fcd9d46a8ce9155d8c2689d7df92b by Serhiy Storchaka (Andr?s Delfino) in branch '2.7': [2.7] bpo-33280: Reorganize external Tcl/Tk references. (GH-6473). (GH-6607) https://github.com/python/cpython/commit/1c6c8510f91fcd9d46a8ce9155d8c2689d7df92b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 09:52:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Apr 2018 13:52:36 +0000 Subject: [issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails In-Reply-To: <1524667276.72.0.682650639539.issue33358@psf.upfronthosting.co.za> Message-ID: <1524750756.98.0.682650639539.issue33358@psf.upfronthosting.co.za> STINNER Victor added the comment: It seems like the failure comes from "env = dict(PYTHONPATH=os.pathsep.join(sys.path))" of Lib/test/test_embed.py. The code from test_pre_initialization_api() works properly. The fix seems easy. ---------- keywords: +easy title: x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails -> [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 09:53:42 2018 From: report at bugs.python.org (STINNER Victor) Date: Thu, 26 Apr 2018 13:53:42 +0000 Subject: [issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails In-Reply-To: <1524667276.72.0.682650639539.issue33358@psf.upfronthosting.co.za> Message-ID: <1524750822.05.0.682650639539.issue33358@psf.upfronthosting.co.za> STINNER Victor added the comment: To reproduce the bug: ./configure --with-pydebug --enabled-shared make clean make LD_LIBRARY_PATH=$PWD ./python -m test -v test_embed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 10:06:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 14:06:28 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524751588.03.0.682650639539.issue33280@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 10:09:44 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Thu, 26 Apr 2018 14:09:44 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524751784.66.0.682650639539.issue33280@psf.upfronthosting.co.za> Andr?s Delfino added the comment: There's still an open PR to backport this to 3.6: https://github.com/python/cpython/pull/6602 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 10:10:13 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 14:10:13 +0000 Subject: [issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst In-Reply-To: <1523736762.33.0.682650639539.issue33280@psf.upfronthosting.co.za> Message-ID: <1524751813.69.0.682650639539.issue33280@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 4533494ac553273239c809053b54c0ab783a0c78 by Serhiy Storchaka (Andr?s Delfino) in branch '3.6': [3.6] bpo-33280: Reorganize external Tcl/Tk references. (GH-6473). (#6602) https://github.com/python/cpython/commit/4533494ac553273239c809053b54c0ab783a0c78 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 10:31:19 2018 From: report at bugs.python.org (Erik Bray) Date: Thu, 26 Apr 2018 14:31:19 +0000 Subject: [issue32797] Tracebacks from Cython modules no longer work In-Reply-To: <1518090924.55.0.467229070634.issue32797@psf.upfronthosting.co.za> Message-ID: <1524753079.58.0.682650639539.issue32797@psf.upfronthosting.co.za> Erik Bray added the comment: +1, that seems obvious to me like better behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 10:50:37 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 14:50:37 +0000 Subject: [issue33338] [lib2to3] Synchronize token.py and tokenize.py with the standard library In-Reply-To: <1524445496.4.0.682650639539.issue33338@psf.upfronthosting.co.za> Message-ID: <1524754237.39.0.682650639539.issue33338@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It seems to me that regular expressions used in the lib2to3 version are more efficient but more complex. $ ./python -m timeit -s 'import re; p = re.compile(r"0[bB](?:_?[01])+"); s = "0b"+"_0101"*16' 'p.match(s)' 100000 loops, best of 5: 2.45 usec per loop $ ./python -m timeit -s 'import re; p = re.compile(r"0[bB]_?[01]+(?:_[01]+)*"); s = "0b"+"_0101"*16' 'p.match(s)' 200000 loops, best of 5: 1.08 usec per loop $ ./python -m timeit -s 'import re; p = re.compile(r"0[xX](?:_?[0-9a-fA-F])+[lL]?"); s = "0x_0123_4567_89ab_cdef"' 'p.match(s)' 500000 loops, best of 5: 815 nsec per loop $ ./python -m timeit -s 'import re; p = re.compile(r"0[xX]_?[\da-fA-F]+(?:_[\da-fA-F]+)*[lL]?"); s = "0x_0123_4567_89ab_cdef"' 'p.match(s)' 500000 loops, best of 5: 542 nsec per loop Since the performance of lib2to3 is important, it is better to keep the current regexpes. But using \d in Python 3 is a bug, it should be replaced with [0-9]. This also speeds up the regex: $ ./python -m timeit -s 'import re; p = re.compile(r"0[xX]_?[0-9a-fA-F]+(?:_[0-9a-fA-F]+)*[lL]?"); s = "0x_0123_4567_89ab_cdef"' 'p.match(s)' 500000 loops, best of 5: 471 nsec per loop ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 11:06:01 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Thu, 26 Apr 2018 15:06:01 +0000 Subject: [issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails In-Reply-To: <1524667276.72.0.682650639539.issue33358@psf.upfronthosting.co.za> Message-ID: <1524755161.54.0.682650639539.issue33358@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- assignee: -> csabella nosy: +csabella stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 11:24:20 2018 From: report at bugs.python.org (Yury Selivanov) Date: Thu, 26 Apr 2018 15:24:20 +0000 Subject: [issue33366] `contextvars` documentation incorrectly refers to "non-local state". In-Reply-To: <1524746872.41.0.682650639539.issue33366@psf.upfronthosting.co.za> Message-ID: <1524756260.77.0.682650639539.issue33366@psf.upfronthosting.co.za> Yury Selivanov added the comment: I like what you propose. Can you submit a PR? :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 11:25:51 2018 From: report at bugs.python.org (Soumyadipta Das) Date: Thu, 26 Apr 2018 15:25:51 +0000 Subject: [issue33367] Multiprocessing Pool workers initiated with maxtasksperchild do not execute when sharing logging Message-ID: <1524756351.27.0.682650639539.issue33367@psf.upfronthosting.co.za> New submission from Soumyadipta Das : When Multiprocessing Pool is initiated with maxtasksperchild and is sharing logging with the root process some workers do not execute. This is only on Python 2.7 and not on Python 3. Also bug is present only on linux and not on windows. ---------- files: bugdemo.py messages: 315804 nosy: Soumyadipta Das priority: normal severity: normal status: open title: Multiprocessing Pool workers initiated with maxtasksperchild do not execute when sharing logging type: behavior versions: Python 2.7 Added file: https://bugs.python.org/file47551/bugdemo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 12:33:49 2018 From: report at bugs.python.org (Gianfranco) Date: Thu, 26 Apr 2018 16:33:49 +0000 Subject: [issue33341] python3 fails to build if directory or sysroot contains "*icc*" string In-Reply-To: <1524478342.39.0.682650639539.issue33341@psf.upfronthosting.co.za> Message-ID: <1524760429.24.0.682650639539.issue33341@psf.upfronthosting.co.za> Gianfranco added the comment: I signed the contributor agreement, even if such patches shouldn't need any kind of license ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 12:42:24 2018 From: report at bugs.python.org (Big Stone) Date: Thu, 26 Apr 2018 16:42:24 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1524760944.68.0.682650639539.issue33000@psf.upfronthosting.co.za> Big Stone added the comment: WinPython-64bit-3.6.4.0Qt5b4 doesn't in fact includes IDLEX: IDLEX is not compatible with Python-3.6+ The "IDLEX" icon of WinPython switches back to "normal" IDLE, when IDLEX is not detected. As WinPython-3.5 is being deprecated, the icon should be renamed IDLE. (see also https://bugs.python.org/issue17535 quest) ---------- nosy: +Big Stone _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 13:01:08 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Apr 2018 17:01:08 +0000 Subject: [issue33338] [lib2to3] Synchronize token.py and tokenize.py with the standard library In-Reply-To: <1524445496.4.0.682650639539.issue33338@psf.upfronthosting.co.za> Message-ID: <1524762068.81.0.682650639539.issue33338@psf.upfronthosting.co.za> ?ukasz Langa added the comment: I agree with you Serhiy, there's a number things I want to make faster. But first I'd like to merge implementations so there is a clear one-way diff ("this is what we updated in lib2to3 to make it consistent it Lib/tokenize.py"). Then I want to optimize. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 14:02:41 2018 From: report at bugs.python.org (Diego Argueta) Date: Thu, 26 Apr 2018 18:02:41 +0000 Subject: [issue33361] readline() + seek() on io.EncodedFile breaks next readline() In-Reply-To: <1524704763.78.0.682650639539.issue33361@psf.upfronthosting.co.za> Message-ID: <1524765761.74.0.682650639539.issue33361@psf.upfronthosting.co.za> Diego Argueta added the comment: That's because the stream isn't transcoding, since UTF-8 is ASCII-compatible. Try using something not ASCII-compatible as the codec e.g. 'ibm500' and it'll give incorrect results. ``` b = io.BytesIO(u'a,b\r\n"asdf","jkl;"\r\n'.encode('ibm500')) s = codecs.EncodedFile(b, 'ibm500') ``` ``` Got header: '\x81k\x82\r%' Skipping the header. '\x7f\x81\xa2\x84\x86\x7fk\x7f\x91\x92\x93^\x7f\r%' Line 2: '\x81k\x82\r%' Line 3: '\x7f\x81\xa2\x84\x86\x7fk\x7f\x91\x92\x93^\x7f\r%' ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 14:08:38 2018 From: report at bugs.python.org (Diego Argueta) Date: Thu, 26 Apr 2018 18:08:38 +0000 Subject: [issue33361] readline() + seek() on io.EncodedFile breaks next readline() In-Reply-To: <1524704763.78.0.682650639539.issue33361@psf.upfronthosting.co.za> Message-ID: <1524766118.67.0.682650639539.issue33361@psf.upfronthosting.co.za> Diego Argueta added the comment: Update: If I run your exact code it still breaks for me: ``` Got header: 'abc\n' Skipping the header. 'def\n' Line 2: 'ghi\n' Line 3: 'abc\n' Line 4: 'def\n' Line 5: 'ghi\n' ``` I'm running Python 2.7.14 and 3.6.5 on OSX 10.13.4. Startup banners: Python 2.7.14 (default, Feb 7 2018, 14:15:12) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin Python 3.6.5 (default, Apr 2 2018, 14:03:12) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 14:19:03 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 26 Apr 2018 18:19:03 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1524766743.45.0.682650639539.issue33000@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Big Stone: thank you for the clarification that IDLEX, and its patching of idlelib, is not involved. WinPython is an independent augmented distribution. Your suggestion about its IDLEX icon should be sent to its authors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 15:04:40 2018 From: report at bugs.python.org (Paul Goins) Date: Thu, 26 Apr 2018 19:04:40 +0000 Subject: [issue21822] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1524769480.25.0.682650639539.issue21822@psf.upfronthosting.co.za> Paul Goins added the comment: Not sure if I'll do the full fix (need to check w/ my employer), but I'm doing some investigation. Here's what I know so far: At the Python level, the KeyboardInterrupt is being raised within _wait_for_tstate_lock, on "elif lock.acquire(block, timeout)". Going into the C code, it looks like this goes through lock_PyThread_acquire_lock -> acquire_timed -> PyThread_acquire_lock_timed. acquire_timed . lock_PyThread_acquire_lock will abort the lock if it receives PY_LOCK_INTR from acquire_timed. My best guess right now is that PyThread_acquire_lock_timed never returns PY_LOCK_INTR. Indeed, I see this comment at the top of the NT version of that function: /* Fow now, intr_flag does nothing on Windows, and lock acquires are * uninterruptible. */ And indeed, the thread_pthread.h implementations both have a path for returning PY_LOCK_INTR, while the thread_nt.h version does not. ...And that's where I am thus far. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 15:06:50 2018 From: report at bugs.python.org (Kirill Balunov) Date: Thu, 26 Apr 2018 19:06:50 +0000 Subject: [issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful In-Reply-To: <1514642746.19.0.213398074469.issue32455@psf.upfronthosting.co.za> Message-ID: <1524769610.74.0.682650639539.issue32455@psf.upfronthosting.co.za> Kirill Balunov added the comment: Sorry if this doesn't fit this issue and needs a separate one. Since Python switched to 2 byte wordcode, all opcodes which do not imply an argument, technically have it - augmented with 0. So it is convenient to iterate over bytecode like: op, arg = instruction. But there is a check in stack_effect that the second argument for this opcodes must be None. file::_opcode.c else if (oparg != Py_None) { PyErr_SetString(PyExc_ValueError, "stack_effect: opcode does not permit oparg but oparg was specified"); return -1; } So you need to perform a somewhat _redundant_ check before calling: arg = arg if op >= opcode.HAVE_ARGUMENT else None. st = stack_effect(op, arg) Maybe it's normal to relax this condition - be None or 0 for opcode < opcode.HAVE_ARGUMENT? ---------- nosy: +godaygo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 15:08:57 2018 From: report at bugs.python.org (C. Y. Hollander) Date: Thu, 26 Apr 2018 19:08:57 +0000 Subject: [issue33368] Inaccuracy in https://docs.python.org/3/library/re.html#re.match.end Message-ID: <1524769737.79.0.682650639539.issue33368@psf.upfronthosting.co.za> New submission from C. Y. Hollander : The documentation states that match.end([group]) returns "the ind[ex] of the... end of the substring matched by group". In fact, it returns [said index] + 1, as demonstrated by the example below: s = 'example' sre = re.search('le', s) s[sre.end()] Incidentally, I don't see the logic of this behaviour, but in any case it should be correctly documented. ---------- assignee: docs at python components: Documentation messages: 315813 nosy: C. Y. Hollander, docs at python priority: normal severity: normal status: open title: Inaccuracy in https://docs.python.org/3/library/re.html#re.match.end type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 15:30:00 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 19:30:00 +0000 Subject: [issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful In-Reply-To: <1514642746.19.0.213398074469.issue32455@psf.upfronthosting.co.za> Message-ID: <1524771000.48.0.682650639539.issue32455@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: I concur with Kirill and was going to propose this change in a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 15:32:52 2018 From: report at bugs.python.org (Eryk Sun) Date: Thu, 26 Apr 2018 19:32:52 +0000 Subject: [issue21822] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1524771172.81.0.682650639539.issue21822@psf.upfronthosting.co.za> Eryk Sun added the comment: For POSIX systems, try the following test function several times. For the bug to manifest, Thread._wait_for_tstate_lock has to be interrupted in between acquiring and releasing the sentinel lock. Maybe it could use a reentrant lock in order to avoid this problem. import os import signal import threading import time def raise_sigint(): print('raising SIGINT') time.sleep(0.5) if os.name == 'nt': os.kill(0, signal.CTRL_C_EVENT) else: os.kill(os.getpid(), signal.SIGINT) print('finishing') def test(f=raise_sigint): global g_sigint g_sigint = threading.Thread(target=f, name='SIGINT') g_sigint.start() print('waiting') for i in range(100): try: if not g_sigint.is_alive(): break g_sigint.join(0.01) except KeyboardInterrupt: print('KeyboardInterrupt ignored') print('g_sigint is alive:', g_sigint.is_alive()) POSIX-only code normally wouldn't join() with a small timeout in a loop as in the above example. This is a workaround for the problem that's demonstrated in msg221180, in which a signal doesn't interrupt a wait on the main thread. Other than time.sleep(), most waits in Windows CPython have not been updated to include the SIGINT Event object when waiting in the main thread. (It's possible to fix some cases such as waiting on locks, but only as long as the implementation continues to use semaphores and kernel waits instead of native condition variables with SRW locks.) ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 15:41:51 2018 From: report at bugs.python.org (Kirill Balunov) Date: Thu, 26 Apr 2018 19:41:51 +0000 Subject: [issue33326] Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type In-Reply-To: <1524336762.03.0.682650639539.issue33326@psf.upfronthosting.co.za> Message-ID: <1524771711.02.0.682650639539.issue33326@psf.upfronthosting.co.za> Change by Kirill Balunov : ---------- nosy: +larry, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 16:03:03 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 20:03:03 +0000 Subject: [issue33368] Inaccuracy in https://docs.python.org/3/library/re.html#re.match.end In-Reply-To: <1524769737.79.0.682650639539.issue33368@psf.upfronthosting.co.za> Message-ID: <1524772983.31.0.682650639539.issue33368@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: It returns not the index of the last character of the substring, but the index of the end of the substring, i.e. the position past the last character of the substring. Try s[:sre.end()] and s[sre.end():]. s[sre.begin()] gives you the part of s before the matched substring, s[sre.begin():sre.end()] gives you the matched substring itself (the same as sre.group()) and s[sre.end():] gives you the part of s after the matched substring. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 16:06:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Apr 2018 20:06:20 +0000 Subject: [issue33326] Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type In-Reply-To: <1524336762.03.0.682650639539.issue33326@psf.upfronthosting.co.za> Message-ID: <1524773180.04.0.682650639539.issue33326@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: This list are short. I don't think there is a large benefit of this change. But there is a small risk of breaking a third party code (for example hasjrel+hasjabs). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 16:51:55 2018 From: report at bugs.python.org (Kirill Balunov) Date: Thu, 26 Apr 2018 20:51:55 +0000 Subject: [issue33326] Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type In-Reply-To: <1524336762.03.0.682650639539.issue33326@psf.upfronthosting.co.za> Message-ID: <1524775915.05.0.682650639539.issue33326@psf.upfronthosting.co.za> Kirill Balunov added the comment: Small risk of breaking is a fair point (maybe some FutureWarning with new __getattr__ PEP 562?). I've checked several packages: --- vstinner/bytecode:: uses: @staticmethod def _has_jump(opcode): return (opcode in _opcode.hasjrel or opcode in _opcode.hasjabs) --- maynard:: defines them as sets and does not rely on opcode module. all_jumps = absolute_jumps | relative_jumps --- numba:: converts them to frozensets: JREL_OPS = frozenset(dis.hasjrel) JABS_OPS = frozenset(dis.hasjabs) JUMP_OPS = JREL_OPS | JABS_OPS --- codetransfromer:: uses: absjmp = opcode in hasjabs reljmp = opcode in hasjrel --- anotherassembler.py:: uses elif opcode in hasjrel or opcode in hasjabs: --- byteplay:: converts them to set: hasjrel = set(Opcode(x) for x in opcode.hasjrel) hasjabs = set(Opcode(x) for x in opcode.hasjabs) hasjump = hasjrel.union(hasjabs) --- byterun:: uses: elif byteCode in dis.hasjrel: arg = f.f_lasti + intArg elif byteCode in dis.hasjabs: arg = intArg In fact, all of the above indicated does not mean anything, but I have not found cases of hasjrel+hasjabs. Despite the fact that they are small, on average, with sets I gain 5-6x speed-up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 17:04:14 2018 From: report at bugs.python.org (R. David Murray) Date: Thu, 26 Apr 2018 21:04:14 +0000 Subject: [issue33274] minidom removeAttributeNode returns None In-Reply-To: <1523644603.75.0.682650639539.issue33274@psf.upfronthosting.co.za> Message-ID: <1524776654.68.0.682650639539.issue33274@psf.upfronthosting.co.za> R. David Murray added the comment: The rule in Python is that when a function mutates its argument it does *not* return a pointer to the object it just mutated, and likewise a method does *not* return a pointer to the parent object. Usually this means a mutating function/method return None, but there are a number of exceptions (dict.pop(), for example). If I understand correctly, in this case the method is returning the object that is its argument, and *that* object is not changed. So I'd say this is an edge case. Given the existence of a standard, I think it would probably be reasonable to implement it that way. You could think of it as analogous to list.pop(N), although in that case the argument is not what is returned, but rather the value. I think it is still analogous, though, since the way you identify the node to pop in this case is by its pointer. In the absence of a standard I'd be inclined to say no, by the way. I generally don't like chaining APIs :) So, my word should not be considered final on this, it's just my opinion, and "don't echo an argument" is indeed a generally observed rule in Python APIs, as far as I can tell. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 17:12:52 2018 From: report at bugs.python.org (Kirill Balunov) Date: Thu, 26 Apr 2018 21:12:52 +0000 Subject: [issue33326] Convert collections (cmp_op, hasconst, hasname and others) in opcode module to more optimal type In-Reply-To: <1524336762.03.0.682650639539.issue33326@psf.upfronthosting.co.za> Message-ID: <1524777172.14.0.682650639539.issue33326@psf.upfronthosting.co.za> Kirill Balunov added the comment: I apologize for FutureWarning and __getattr__. I myself do not understand what I meant and how it will help in this situation :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 17:17:48 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Apr 2018 21:17:48 +0000 Subject: [issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails In-Reply-To: <1524667276.72.0.682650639539.issue33358@psf.upfronthosting.co.za> Message-ID: <1524777468.41.0.682650639539.issue33358@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +6308 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 17:35:13 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Apr 2018 21:35:13 +0000 Subject: [issue33354] Python2: test_ssl fails on non-ASCII path In-Reply-To: <1524665655.9.0.682650639539.issue33354@psf.upfronthosting.co.za> Message-ID: <1524778513.54.0.682650639539.issue33354@psf.upfronthosting.co.za> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +6309 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 17:40:08 2018 From: report at bugs.python.org (Big Stone) Date: Thu, 26 Apr 2018 21:40:08 +0000 Subject: [issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not In-Reply-To: <1520267403.32.0.467229070634.issue33000@psf.upfronthosting.co.za> Message-ID: <1524778808.88.0.682650639539.issue33000@psf.upfronthosting.co.za> Big Stone added the comment: done, sorry for the (now) missleading icon name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 18:40:56 2018 From: report at bugs.python.org (=?utf-8?q?Peter_Bostr=C3=B6m?=) Date: Thu, 26 Apr 2018 22:40:56 +0000 Subject: [issue33369] Removing Popen log files in threads is racy on Windows Message-ID: <1524782456.24.0.682650639539.issue33369@psf.upfronthosting.co.za> New submission from Peter Bostr?m : OS: Windows 10, version 1607 (OS Build 14393.2189) Python --version: Python 2.7.3 Removing logfiles files just after Popen().wait() outside an open() block is racy on Windows. This seems to require multiple parallel workers to pull off, not sure where the synchronization issue lies (interpreter or os). This report is spun off from the following pull request where we ran into the issue (we always log to log files instead of memory pipes but sometimes discard them after the worker has finished): https://github.com/google/gtest-parallel/pull/59#issuecomment-369551914 Attaching repro script, in it essentially all workers do this: command = ['ping', '-n', '1', '127.0.0.1'] with open(file_name, 'w') as file_obj: task = subprocess.Popen(command, stdout=file_obj, stderr=file_obj) task.wait() print 'Removing %s\n' % file_name os.remove(file_name) Here os.remove() fails fairly often with an exception even though there should be no handles left to the file: WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '25436.log' Run (this seems to repro pretty reliably, more than half of the time on my machine): C:\src>del *.log C:\src>python racy_windows.py Logging to 24788.log Logging to 1052.log Logging to 32320.log Logging to 29316.log Removing 1052.log Exception in thread Thread-2: Traceback (most recent call last): File "C:\python_27_amd64\files\lib\threading.py", line 551, in __bootstrap_inner self.run() File "C:\python_27_amd64\files\lib\threading.py", line 504, in run self.__target(*self.__args, **self.__kwargs) File "racy_windows.py", line 19, in __call__ os.remove(file_name) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '1052.log' Removing 24788.log Exception in thread Thread-1: Traceback (most recent call last): File "C:\python_27_amd64\files\lib\threading.py", line 551, in __bootstrap_inner self.run() File "C:\python_27_amd64\files\lib\threading.py", line 504, in run self.__target(*self.__args, **self.__kwargs) File "racy_windows.py", line 19, in __call__ os.remove(file_name) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '24788.log' Removing 29316.log Removing 32320.log ---------- components: Windows files: racy_windows.py messages: 315822 nosy: paul.moore, pbos, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Removing Popen log files in threads is racy on Windows type: behavior versions: Python 2.7 Added file: https://bugs.python.org/file47552/racy_windows.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 19:27:40 2018 From: report at bugs.python.org (Ekin Dursun) Date: Thu, 26 Apr 2018 23:27:40 +0000 Subject: [issue33370] Addition of mypy cache to gitignore Message-ID: <1524785260.87.0.682650639539.issue33370@psf.upfronthosting.co.za> New submission from Ekin Dursun : Since Python developers started to use mypy, I need we should add .mypy_cache directories to .gitignore. ---------- messages: 315823 nosy: onlined priority: normal severity: normal status: open title: Addition of mypy cache to gitignore versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 19:30:25 2018 From: report at bugs.python.org (Ekin Dursun) Date: Thu, 26 Apr 2018 23:30:25 +0000 Subject: [issue33370] Addition of mypy cache to gitignore In-Reply-To: <1524785260.87.0.682650639539.issue33370@psf.upfronthosting.co.za> Message-ID: <1524785425.42.0.682650639539.issue33370@psf.upfronthosting.co.za> Change by Ekin Dursun : ---------- keywords: +patch pull_requests: +6310 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 19:37:00 2018 From: report at bugs.python.org (Brian Curtin) Date: Thu, 26 Apr 2018 23:37:00 +0000 Subject: [issue33371] Clarify the predicate parameter of inspect.getmembers Message-ID: <1524785820.22.0.682650639539.issue33371@psf.upfronthosting.co.za> New submission from Brian Curtin : It would be helpful to clarify what the *predicate* callable will be called with. I had to look into the source in order to figure out what it was going to receive. ---------- assignee: brian.curtin components: Documentation messages: 315824 nosy: brian.curtin priority: normal severity: normal stage: needs patch status: open title: Clarify the predicate parameter of inspect.getmembers _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 19:42:06 2018 From: report at bugs.python.org (Brian Curtin) Date: Thu, 26 Apr 2018 23:42:06 +0000 Subject: [issue33371] Clarify the predicate parameter of inspect.getmembers In-Reply-To: <1524785820.22.0.682650639539.issue33371@psf.upfronthosting.co.za> Message-ID: <1524786126.3.0.682650639539.issue33371@psf.upfronthosting.co.za> Change by Brian Curtin : ---------- keywords: +patch pull_requests: +6311 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Apr 26 19:49:19 2018 From: report at bugs.python.org (Brian Curtin) Date: Thu, 26 Apr 2018 23:49:19 +0000 Subject: [issue33371] Clarify the predicate parameter of inspect.getmembers In-Reply-To: <1524785820.22.0.682650639539.issue33371@psf.upfronthosting.co.za> Message-ID: <1524786559.57.0.682650639539.issue33371@psf.upfronthosting.co.za> Change by Brian Curtin : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 00:42:24 2018 From: report at bugs.python.org (Zachary Ware) Date: Fri, 27 Apr 2018 04:42:24 +0000 Subject: [issue33369] Removing Popen log files in threads is racy on Windows In-Reply-To: <1524782456.24.0.682650639539.issue33369@psf.upfronthosting.co.za> Message-ID: <1524804144.73.0.682650639539.issue33369@psf.upfronthosting.co.za> Zachary Ware added the comment: You will get no support for Python 2.7.3 out of us (that patch release is over 6 years old! At least try 2.7.14, or wait a week for 2.7.15) and most of us have lost interest in 2.7 altogether, particularly on Windows. However, this sounds very much like other issues I've seen around the timing of Windows file handle handling. Try adding a retry loop with a short sleep around your `os.remove` call. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 01:17:28 2018 From: report at bugs.python.org (Zsolt Dollenstein) Date: Fri, 27 Apr 2018 05:17:28 +0000 Subject: [issue33363] async for statement is not a syntax error in sync context In-Reply-To: <1524719930.25.0.682650639539.issue33363@psf.upfronthosting.co.za> Message-ID: <1524806248.2.0.682650639539.issue33363@psf.upfronthosting.co.za> Change by Zsolt Dollenstein : ---------- keywords: +patch pull_requests: +6312 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 01:33:07 2018 From: report at bugs.python.org (an0n.r00t32) Date: Fri, 27 Apr 2018 05:33:07 +0000 Subject: [issue33372] Wrong calculation Message-ID: <1524807187.54.0.682650639539.issue33372@psf.upfronthosting.co.za> New submission from an0n.r00t32 : I found that python calculate this wrong. Other calculators gave me 9997809307 not 9997809507 (python), even python3 calculated it correctly. Here is the computation expression which Python 2.7 calculated wrong. https://pastebin.com/uKx1FYx3 ---------- messages: 315826 nosy: an0n.r00t32 priority: normal severity: normal status: open title: Wrong calculation type: performance versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 01:44:29 2018 From: report at bugs.python.org (Tim Peters) Date: Fri, 27 Apr 2018 05:44:29 +0000 Subject: [issue33372] Wrong calculation In-Reply-To: <1524807187.54.0.682650639539.issue33372@psf.upfronthosting.co.za> Message-ID: <1524807869.43.0.682650639539.issue33372@psf.upfronthosting.co.za> Tim Peters added the comment: Please find a minimal example that illustrates the problem you think you've found, and paste the plain text _into_ the bug report. In the meantime, I'm closing this as "not a bug". The division operator applied to integers in Python 2 defaults doing truncating integer division, and in Python 3 defaults to doing floating point division instead. So this example all by itself is enough to show a difference: Under Python 2.7.11: >>> 1/8 0 Under Python 3.6.5: >>> 1/8 0.125 Both are expected. In exactly the same way, the subexpression "2*1*10/100*10*10+100/10" in the code you pasted returns the integer 10 under Python 2 but the floating point value 30.0 under Python 3. ---------- nosy: +tim.peters resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 02:40:31 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 27 Apr 2018 06:40:31 +0000 Subject: [issue33372] Wrong calculation In-Reply-To: <1524807187.54.0.682650639539.issue33372@psf.upfronthosting.co.za> Message-ID: <1524811231.38.0.682650639539.issue33372@psf.upfronthosting.co.za> Steven D'Aprano added the comment: I agree with Tim that this is likely to be the difference between Python 2 truncating division and Python 3 division. For the record, I get the following results: 9997809507L Python 2.7 9997809307.0 Python 3.5 9997809307 R 9997809307 Javascript (Rhino) 9997809307 OpenXion I tried it in Ruby 1.8 as well, and sometimes got a syntax error and sometimes 9999599931. I have no idea why the odd results. I'm not mad enough to type the whole thing into my calculator, but I am mad enough to simplify it by hand, and I get: -590072-2/10*100-200112-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100+9998599835 Even Ruby gets the right answer (9997809507) for that :-) In Python 2, 2/10 returns 0 unless you have run `from __future__ import division`, so the -2/10*100 terms all go to zero, and we get: -590072-2/10*100-200112-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100-18-2/10*100+9998599835 which evaluates to 9997809307.0 just as Python 2.7 says. So Tim was right, this is entirely due to the difference between / as truncating division in Python 2 and true division in Python 3. Oh, and one last thing... in Python 2, you can get the expected result by either using the future import above, or by adding a decimal point to the numbers being divided, turning them into floats and forcing Python to use floating point true division. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 02:42:37 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 27 Apr 2018 06:42:37 +0000 Subject: [issue33372] Wrong calculation In-Reply-To: <1524807187.54.0.682650639539.issue33372@psf.upfronthosting.co.za> Message-ID: <1524811357.12.0.682650639539.issue33372@psf.upfronthosting.co.za> Steven D'Aprano added the comment: > Even Ruby gets the right answer (9997809507) for that :-) Oops, I forgot to say... Ruby 1.8 also does truncating division like Python 2. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 02:45:28 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 27 Apr 2018 06:45:28 +0000 Subject: [issue33372] Wrong calculation In-Reply-To: <1524807187.54.0.682650639539.issue33372@psf.upfronthosting.co.za> Message-ID: <1524811528.3.0.682650639539.issue33372@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Ah sheesh I copied and pasted the wrong bits. After the division terms go to zero, you get -590072-200112-18-18-18-18-18-18-18-18+9998599835 which goes to 9997809507 as calculated by Ruby and Python 2, and I promise that's the end of me replying to myself :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 05:54:07 2018 From: report at bugs.python.org (Roundup Robot) Date: Fri, 27 Apr 2018 09:54:07 +0000 Subject: [issue33366] `contextvars` documentation incorrectly refers to "non-local state". In-Reply-To: <1524746872.41.0.682650639539.issue33366@psf.upfronthosting.co.za> Message-ID: <1524822847.21.0.682650639539.issue33366@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +6313 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 05:58:01 2018 From: report at bugs.python.org (Tom Christie) Date: Fri, 27 Apr 2018 09:58:01 +0000 Subject: [issue33366] `contextvars` documentation incorrectly refers to "non-local state". In-Reply-To: <1524746872.41.0.682650639539.issue33366@psf.upfronthosting.co.za> Message-ID: <1524823081.51.0.682650639539.issue33366@psf.upfronthosting.co.za> Tom Christie added the comment: Refs: https://github.com/python/cpython/pull/6617 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 06:01:37 2018 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 27 Apr 2018 10:01:37 +0000 Subject: [issue29652] Fix evaluation order of keys/values in dict comprehensions In-Reply-To: <1488052483.04.0.021043093911.issue29652@psf.upfronthosting.co.za> Message-ID: <1524823297.5.0.682650639539.issue29652@psf.upfronthosting.co.za> Nick Coghlan added the comment: The current discrepancy is odd when you compare it to the equivalent generator expression: {k:v for k, v in iterable} dict(((k, v) for k, v in iterable)) It would never have occurred to me to expect the evaluation order to match a fully unrolled loop with a nested "d[k] = v" assignment, because the dict constructor doesn't work that way - it accepts an iterable of 2-tuples. PEP 274 also specifies the iterable-of-2-tuples interpretation (using a list comprehension as its baseline rather than a generator expression): https://www.python.org/dev/peps/pep-0274/#semantics ---------- nosy: +ncoghlan versions: +Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 07:46:36 2018 From: report at bugs.python.org (Charalampos Stratakis) Date: Fri, 27 Apr 2018 11:46:36 +0000 Subject: [issue27277] Fatal Python error: Segmentation fault in test_exceptions In-Reply-To: <1465457335.09.0.330685258307.issue27277@psf.upfronthosting.co.za> Message-ID: <1524829596.56.0.682650639539.issue27277@psf.upfronthosting.co.za> Charalampos Stratakis added the comment: This is an issue with the stack size. It was encountered recently while building Python 3.6 under CentOS 6 [0] and the way to fix it was to increase the maximum stack size using ulimit e.g. [1] [0] https://bugzilla.redhat.com/show_bug.cgi?id=1572150 [1] https://src.fedoraproject.org/rpms/python3/blob/f26/f/python3.spec#_1132 ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 07:52:06 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Apr 2018 11:52:06 +0000 Subject: [issue27277] Fatal Python error: Segmentation fault in test_exceptions In-Reply-To: <1465457335.09.0.330685258307.issue27277@psf.upfronthosting.co.za> Message-ID: <1524829926.3.0.682650639539.issue27277@psf.upfronthosting.co.za> STINNER Victor added the comment: > It was encountered recently while building Python 3.6 under CentOS 6 [0] and the way to fix it was to increase the maximum stack size using ulimit e.g. [1] In a perfect world, unit tests should not depend on the environment. So Python may *try* to increase the maximum stack size when running these tests. (If the limit cannot be increased, it's fine.) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 07:53:59 2018 From: report at bugs.python.org (Elena Oat) Date: Fri, 27 Apr 2018 11:53:59 +0000 Subject: [issue33361] readline() + seek() on io.EncodedFile breaks next readline() In-Reply-To: <1524704763.78.0.682650639539.issue33361@psf.upfronthosting.co.za> Message-ID: <1524830039.49.0.682650639539.issue33361@psf.upfronthosting.co.za> Elena Oat added the comment: I've tried this with Python 3.6.0 on OSX 10.13.4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 08:23:16 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Apr 2018 12:23:16 +0000 Subject: [issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails In-Reply-To: <1524667276.72.0.682650639539.issue33358@psf.upfronthosting.co.za> Message-ID: <1524831796.41.0.682650639539.issue33358@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 4114846265536344538ae44cb8ffd8ce2903faf7 by Victor Stinner (Pablo Galindo) in branch 'master': bpo-33358: Fix test_embed.test_pre_initialization_sys_options (GH-6612) https://github.com/python/cpython/commit/4114846265536344538ae44cb8ffd8ce2903faf7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 08:27:30 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Apr 2018 12:27:30 +0000 Subject: [issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails In-Reply-To: <1524667276.72.0.682650639539.issue33358@psf.upfronthosting.co.za> Message-ID: <1524832050.41.0.682650639539.issue33358@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6314 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 08:30:04 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Apr 2018 12:30:04 +0000 Subject: [issue33041] Issues with "async for" In-Reply-To: <1520687441.8.0.467229070634.issue33041@psf.upfronthosting.co.za> Message-ID: <1524832204.04.0.682650639539.issue33041@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 078c4e3519deeef8014541925da057bb064eb5a8 by Victor Stinner in branch 'master': bpo-33041: Fix downcast warning on Windows (#6595) https://github.com/python/cpython/commit/078c4e3519deeef8014541925da057bb064eb5a8 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 08:38:23 2018 From: report at bugs.python.org (STINNER Victor) Date: Fri, 27 Apr 2018 12:38:23 +0000 Subject: [issue33041] Issues with "async for" In-Reply-To: <1520687441.8.0.467229070634.issue33041@psf.upfronthosting.co.za> Message-ID: <1524832703.74.0.682650639539.issue33041@psf.upfronthosting.co.za> STINNER Victor added the comment: I didn't check if the new warning, fixed by my PR-6595 in the master branch, exists on Windows in 3.6 and 3.7. If it does, you might want to request a backport of my PR. Usually, I only fix compiler warnings in the master branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 08:41:28 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Apr 2018 12:41:28 +0000 Subject: [issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails In-Reply-To: <1524667276.72.0.682650639539.issue33358@psf.upfronthosting.co.za> Message-ID: <1524832888.24.0.682650639539.issue33358@psf.upfronthosting.co.za> miss-islington added the comment: New changeset dd3ede7537653a62815c2fedbb67d6f2fb870d4c by Miss Islington (bot) in branch '3.7': bpo-33358: Fix test_embed.test_pre_initialization_sys_options (GH-6612) https://github.com/python/cpython/commit/dd3ede7537653a62815c2fedbb67d6f2fb870d4c ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 09:13:17 2018 From: report at bugs.python.org (Matthieu Pepin) Date: Fri, 27 Apr 2018 13:13:17 +0000 Subject: [issue31727] FTP_TLS errors when use certain subcommands In-Reply-To: <1507482521.5.0.213398074469.issue31727@psf.upfronthosting.co.za> Message-ID: <1524834797.67.0.682650639539.issue31727@psf.upfronthosting.co.za> Matthieu Pepin added the comment: I can confirm. I'm having the exact same issue in Python 3.6.5. ---------- nosy: +Matthieu Pepin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 09:46:27 2018 From: report at bugs.python.org (Elena Oat) Date: Fri, 27 Apr 2018 13:46:27 +0000 Subject: [issue33361] readline() + seek() on io.EncodedFile breaks next readline() In-Reply-To: <1524704763.78.0.682650639539.issue33361@psf.upfronthosting.co.za> Message-ID: <1524836787.81.0.682650639539.issue33361@psf.upfronthosting.co.za> Elena Oat added the comment: For you specific example I get also a weird result. Tried this in Python 2.7.10 and Python 3.6.0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 09:53:51 2018 From: report at bugs.python.org (Elena Oat) Date: Fri, 27 Apr 2018 13:53:51 +0000 Subject: [issue33361] readline() + seek() on io.EncodedFile breaks next readline() In-Reply-To: <1524704763.78.0.682650639539.issue33361@psf.upfronthosting.co.za> Message-ID: <1524837231.94.0.682650639539.issue33361@psf.upfronthosting.co.za> Elena Oat added the comment: I've modified a little your example and it's clearly that the readline moves the cursor. ``` from __future__ import print_function import codecs import io def run(stream): offset = stream.tell() try: stream.seek(0) header_row = stream.readline() finally: stream.seek(offset) print(offset) print(stream.tell()) print('Got header: %r' % header_row) if stream.tell() == 0: print(stream.tell()) print(stream.readline()) print('Skipping the header: %r' % stream.readline()) for index, line in enumerate(stream, start=2): print('Line %d: %r' % (index, line)) b = io.BytesIO(u'ab\r\ncd\ndef\n'.encode('utf-16-le')) s = codecs.EncodedFile(b, 'utf-8', 'utf-16-le') run(s) ``` The first call to readline returns cd instead of ab. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 09:54:50 2018 From: report at bugs.python.org (Thomas Kluyver) Date: Fri, 27 Apr 2018 13:54:50 +0000 Subject: [issue1692664] warnings.py gets filename wrong for eval/exec Message-ID: <1524837290.13.0.682650639539.issue1692664@psf.upfronthosting.co.za> Thomas Kluyver added the comment: Time for some bug archaeology! The reason given for not using frame.f_code.co_filename for warnings was that it can be wrong when the path of .pyc files changes. However, it looks like that was fixed in #1180193 (thanks for the pointer zseil), so I'd like this idea to be reconsidered. Python uses frame.f_code.co_filename for tracebacks and in pdb, so it's counterintuitive that the warnings module works differently. They are all trying to do the same thing: find and show the bit of code that you're interested in. This causes problems in IPython with warnings attributed to interactive code: warnings sees it all as part of the __main__ module, so we can't distinguish which input it's pointing to (it's usually obvious, but still...). We have integrated with linecache to make tracebacks work, and I think that if warnings used code.co_filename, it would also work as expected. ---------- nosy: +takluyver _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 10:28:23 2018 From: report at bugs.python.org (C.D. MacEachern) Date: Fri, 27 Apr 2018 14:28:23 +0000 Subject: [issue33373] ttk modules Label class does not respect background config option Message-ID: <1524839303.7.0.682650639539.issue33373@psf.upfronthosting.co.za> New submission from C.D. MacEachern : Python tkinter.ttk.Label instance is not respecting background configuration. I'm running 3.6.5 64-bit python with Tk 8.6 on OS X 10.13.4. Here is an output of an interactive session to demonstrate the steps. Notice that the ttk.Label keys() output shows that the ?background? config option is supported. Additionally, the ttk::label manual page (http://www.tcl.tk/man/tcl8.6/TkCmd/ttk_label.htm#M6) shows that the ?-background? option is an available ?widget-specific option?. [~/projects/parou/src (2.0)] $ python3 Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter as tk >>> import tkinter.ttk as ttk >>> root = tk.Tk() >>> tk_label = tk.Label(root) >>> tk_label.keys() ['activebackground', 'activeforeground', 'anchor', 'background', 'bd', 'bg', 'bitmap', 'borderwidth', 'compound', 'cursor', 'disabledforeground', 'fg', 'font', 'foreground', 'height', 'highlightbackground', 'highlightcolor', 'highlightthickness', 'image', 'justify', 'padx', 'pady', 'relief', 'state', 'takefocus', 'text', 'textvariable', 'underline', 'width', 'wraplength'] >>> tk_label.config(text='Old style tkinter.Label instance', foreground='blue', background='red') >>> tk_label.pack() >>> new_ttk_label = ttk.Label(root) >>> new_ttk_label.keys() ['background', 'foreground', 'font', 'borderwidth', 'relief', 'anchor', 'justify', 'wraplength', 'takefocus', 'text', 'textvariable', 'underline', 'width', 'image', 'compound', 'padding', 'state', 'cursor', 'style', 'class'] >>> new_ttk_label.config(text='New tkinter.ttk.Label instance', foreground='blue', background='blue') >>> new_ttk_label.pack() >>> tk_label.config('background') ('background', 'background', 'Background', , 'red') >>> new_ttk_label.config('background') ('background', 'frameColor', 'FrameColor', '', ) >>> new_ttk_label.config('foreground') ('foreground', 'textColor', 'TextColor', '', ) >>> root.mainloop() I would expect the background to change colour on the ttk Label the same way it does when I change the background on the tkinter.Label instance. It appears to not have worked as documented since 2014 for some, so my suggestion would be to remove 'background' as an option exposed in ttk.Label().keys(). Link to SO thread where it is discussed as well: https://stackoverflow.com/questions/23750141/tkinter-ttk-widgets-ignoring-background-color/50064376#50064376 ---------- components: Tkinter messages: 315844 nosy: cmaceachern priority: normal severity: normal status: open title: ttk modules Label class does not respect background config option type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 10:41:56 2018 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 27 Apr 2018 14:41:56 +0000 Subject: [issue1692664] warnings.py gets filename wrong for eval/exec Message-ID: <1524840116.54.0.682650639539.issue1692664@psf.upfronthosting.co.za> Guido van Rossum added the comment: I recommend opening a new issue (you can link to this one for past discussion). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 11:45:47 2018 From: report at bugs.python.org (Piotr Dobrogost) Date: Fri, 27 Apr 2018 15:45:47 +0000 Subject: [issue33374] generate-posix-vars failed when building Python 2.7.14 on Linux Message-ID: <1524843947.56.0.682650639539.issue33374@psf.upfronthosting.co.za> New submission from Piotr Dobrogost : When building Python 2.7.14 on Fedora 28 I get the following error: [piotr at demon]/tmp/Python-2.7.14% make (?) ./python -E -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi /bin/sh: line 5: 25857 Segmentation fault (core dumped) ./python -E -S -m sysconfig --generate-posix-vars generate-posix-vars failed make[2]: *** [Makefile:514: pybuilddir.txt] Error 1 make[2]: Leaving directory '/tmp/Python-2.7.14' make[1]: *** [Makefile:444: build_all_generate_profile] Error 2 make[1]: Leaving directory '/tmp/Python-2.7.14' make: *** [Makefile:429: profile-opt] Error 2 Running problematic command alone I get this: [piotr at demon]/tmp/Python-2.7.14% ./python -E -S -m sysconfig --generate-posix-vars Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] zsh: segmentation fault (core dumped) ./python -E -S -m sysconfig --generate-posix-vars I found somehow related https://bugs.python.org/issue21166 with excellent explanation by Ned Deily (https://bugs.python.org/msg225217) but that issue is supposedly fixed. I have Python 3.6.5 installed at /usr/bin/python3 and Python 2.7.14 installed at /usr/bin/python{2} ? both from RPM packages. I have Python 2.7.13 installed at /usr/local/bin/python{2} ? built from source. Running `which python` returns "/usr/local/bin/python". Trying to isolate configuration and build by prefixing commands with PATH=/usr/bin:/usr/sbin LIBRARY_PATH= LD_LIBRARY_PATH= (?) does not help. ---------- components: Build messages: 315846 nosy: ned.deily, piotr.dobrogost priority: normal severity: normal status: open title: generate-posix-vars failed when building Python 2.7.14 on Linux versions: Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 11:58:59 2018 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 27 Apr 2018 15:58:59 +0000 Subject: [issue33363] async for statement is not a syntax error in sync context In-Reply-To: <1524719930.25.0.682650639539.issue33363@psf.upfronthosting.co.za> Message-ID: <1524844739.53.0.682650639539.issue33363@psf.upfronthosting.co.za> Yury Selivanov added the comment: New changeset e2396506606115e785c94ec129eb86e2ed0aa744 by Yury Selivanov (Zsolt Dollenstein) in branch 'master': bpo-33363: raise SyntaxError for async for/with outside async functions (#6616) https://github.com/python/cpython/commit/e2396506606115e785c94ec129eb86e2ed0aa744 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 12:38:55 2018 From: report at bugs.python.org (Thomas Kluyver) Date: Fri, 27 Apr 2018 16:38:55 +0000 Subject: [issue33375] warnings: get filename from frame.f_code.co_filename Message-ID: <1524847135.79.0.682650639539.issue33375@psf.upfronthosting.co.za> New submission from Thomas Kluyver : The warnings module tries to find and show the line of code which is responsible for a warning, for the same reasons that tracebacks show a line of code from each stack frame. However, they work in quite different ways. Native tracebacks, the traceback module and pdb all do something like this: frame.f_code.co_filename But warnings does something like this (paraphrasing C code in _warnings.c): frame.f_globals.get('__file__', sys.argv[0]) This causes problems for interactive interpreters like IPython, because there are multiple pieces of entered code which have to share the same global namespace. E.g. https://github.com/ipython/ipython/issues/11080 This was raised a long time ago in #1692664. Back then, the answer was that co_filename could be wrong if the path of a pyc file changed. However, that issue was fixed in #1180193. And it seems that the co_filename approach must largely work today, because tracebacks and pdb rely on it. So I'm proposing to make warnings match how those other tools find filenames. I think this should also be a minor simplification of the code. ---------- components: Library (Lib) messages: 315848 nosy: takluyver priority: normal severity: normal status: open title: warnings: get filename from frame.f_code.co_filename _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 12:39:44 2018 From: report at bugs.python.org (Thomas Kluyver) Date: Fri, 27 Apr 2018 16:39:44 +0000 Subject: [issue1692664] warnings.py gets filename wrong for eval/exec Message-ID: <1524847184.61.0.682650639539.issue1692664@psf.upfronthosting.co.za> Thomas Kluyver added the comment: Thanks Guido, the new issue is #33375. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 12:50:02 2018 From: report at bugs.python.org (Jakub Wilk) Date: Fri, 27 Apr 2018 16:50:02 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1524847802.75.0.682650639539.issue33337@psf.upfronthosting.co.za> Change by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 12:56:30 2018 From: report at bugs.python.org (=?utf-8?q?Peter_Bostr=C3=B6m?=) Date: Fri, 27 Apr 2018 16:56:30 +0000 Subject: [issue33369] Removing Popen log files in threads is racy on Windows In-Reply-To: <1524782456.24.0.682650639539.issue33369@psf.upfronthosting.co.za> Message-ID: <1524848190.46.0.682650639539.issue33369@psf.upfronthosting.co.za> Peter Bostr?m added the comment: Wow that's old, yeah that's fair (I wouldn't expect this to be backported to any old releases). Our current "workaround" is to try os.remove, sleep, repeat X times. This seems still racy and not something we'd like to have in our script if it can be resolved upstream. Retried on 2.7.15rc1: C:\src>del *.log Could Not Find C:\src\*.log C:\src>C:\Python2.7.15rc1\python.exe --version Python 2.7.15rc1 C:\src>C:\Python2.7.15rc1\python.exe racy_windows.py Logging to 5656.log Logging to 13068.log Logging to 27620.log Logging to 18384.log Removing 5656.log ERxception in thread Thread-1: Traceback (most recent call last): File "C:\Python2.7.15rc1\lib\threading.py", line 801, in __bootstrap_inner self.run() File "C:\Python2.7.15rc1\lib\threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "racy_windows.py", line 19, in __call__ os.remove(file_name) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '5656.log' emoving 13068.log R emoving 27620.log Exception in thread Thread-3: Traceback (most recent call last): File "C:\Python2.7.15rc1\lib\threading.py", line 801, in __bootstrap_inner self.run() File "C:\Python2.7.15rc1\lib\threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "racy_windows.py", line 19, in __call__ os.remove(file_name) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '27620.log' Exception in thread Thread-2: Traceback (most recent call last): File "C:\Python2.7.15rc1\lib\threading.py", line 801, in __bootstrap_inner self.run() File "C:\Python2.7.15rc1\lib\threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "racy_windows.py", line 19, in __call__ os.remove(file_name) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '13068.log' Removing 18384.log ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 13:07:56 2018 From: report at bugs.python.org (Zsolt Dollenstein) Date: Fri, 27 Apr 2018 17:07:56 +0000 Subject: [issue33363] async for statement is not a syntax error in sync context In-Reply-To: <1524719930.25.0.682650639539.issue33363@psf.upfronthosting.co.za> Message-ID: <1524848876.68.0.682650639539.issue33363@psf.upfronthosting.co.za> Change by Zsolt Dollenstein : ---------- pull_requests: +6315 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 13:56:46 2018 From: report at bugs.python.org (Michael Durso) Date: Fri, 27 Apr 2018 17:56:46 +0000 Subject: [issue32608] Incompatibilities with the socketserver and multiprocessing packages In-Reply-To: <1516539327.3.0.467229070634.issue32608@psf.upfronthosting.co.za> Message-ID: <1524851806.5.0.682650639539.issue32608@psf.upfronthosting.co.za> Michael Durso added the comment: Hi Antoine, were you able to check out the pull request? I'd like to get the issues resolved so the code can be merged into the next version. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:15:46 2018 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 27 Apr 2018 18:15:46 +0000 Subject: [issue24209] Allow IPv6 bind in http.server In-Reply-To: <1431784485.93.0.0140060801451.issue24209@psf.upfronthosting.co.za> Message-ID: <1524852946.29.0.682650639539.issue24209@psf.upfronthosting.co.za> Change by Jason R. Coombs : ---------- nosy: +jason.coombs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:20:02 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Apr 2018 18:20:02 +0000 Subject: [issue33327] Add a method to move messages to IMAPlib In-Reply-To: <1524337803.72.0.682650639539.issue33327@psf.upfronthosting.co.za> Message-ID: <1524853202.36.0.682650639539.issue33327@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- stage: -> test needed versions: -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:26:50 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 27 Apr 2018 18:26:50 +0000 Subject: [issue33370] Addition of mypy cache to gitignore In-Reply-To: <1524785260.87.0.682650639539.issue33370@psf.upfronthosting.co.za> Message-ID: <1524853610.52.0.682650639539.issue33370@psf.upfronthosting.co.za> Brett Cannon added the comment: Python's standard library isn't typed so running mypy on it isn't really beneficial at the moment. Plus you can add .mypy_cache to your global .gitignore file. I'm not saying we can't add it, I'm just saying it isn't a priority. ---------- nosy: +brett.cannon priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:27:08 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 27 Apr 2018 18:27:08 +0000 Subject: [issue33370] Addition of mypy cache to gitignore In-Reply-To: <1524785260.87.0.682650639539.issue33370@psf.upfronthosting.co.za> Message-ID: <1524853628.62.0.682650639539.issue33370@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:28:41 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Apr 2018 18:28:41 +0000 Subject: [issue33335] turtle.onkey doesn't pass key information when key is None In-Reply-To: <1524422076.99.0.682650639539.issue33335@psf.upfronthosting.co.za> Message-ID: <1524853721.67.0.682650639539.issue33335@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- components: +Library (Lib) -Tkinter nosy: +gregorlingl, willingc stage: -> test needed type: behavior -> enhancement versions: -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:30:13 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Apr 2018 18:30:13 +0000 Subject: [issue33336] [imaplib] MOVE is a legal command In-Reply-To: <1524436182.1.0.682650639539.issue33336@psf.upfronthosting.co.za> Message-ID: <1524853813.18.0.682650639539.issue33336@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- type: -> enhancement versions: -Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:35:04 2018 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 27 Apr 2018 18:35:04 +0000 Subject: [issue24209] Allow IPv6 bind in http.server In-Reply-To: <1431784485.93.0.0140060801451.issue24209@psf.upfronthosting.co.za> Message-ID: <1524854104.62.0.682650639539.issue24209@psf.upfronthosting.co.za> Jason R. Coombs added the comment: >From what I can tell, there's not currently any tests for the behavior of `http.server` as a script, and that sounds like a non-trivial behavior to test. I agree documentation updates for this change are essential, but I'd suggest a test is too high a burden to ask for a change like this when there aren't already tests exercising the related functionality. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:38:53 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Apr 2018 18:38:53 +0000 Subject: [issue33339] Using default encoding with `subprocess.run()` is not obvious In-Reply-To: <1524472712.16.0.682650639539.issue33339@psf.upfronthosting.co.za> Message-ID: <1524854333.47.0.682650639539.issue33339@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python stage: -> needs patch type: -> enhancement versions: +Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:52:07 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Apr 2018 18:52:07 +0000 Subject: [issue33341] python3 fails to build if directory or sysroot contains "*icc*" string In-Reply-To: <1524478342.39.0.682650639539.issue33341@psf.upfronthosting.co.za> Message-ID: <1524855127.99.0.682650639539.issue33341@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thank you. Yes, we require a signed CA for something this non-trivial. Victor, I don't know who maintains configure. If you don't, maybe you know who does. ---------- nosy: +terry.reedy, vstinner stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:55:34 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Apr 2018 18:55:34 +0000 Subject: [issue33343] [argparse] Add subcommand abbreviations In-Reply-To: <1524505578.79.0.682650639539.issue33343@psf.upfronthosting.co.za> Message-ID: <1524855334.07.0.682650639539.issue33343@psf.upfronthosting.co.za> Terry J. Reedy added the comment: I am closing this as a duplicate of #12713. Paul, if you think that also should be closed, say so there if you have not done so yet. ---------- nosy: +terry.reedy resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> argparse: allow abbreviation of sub commands by users versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 14:59:07 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Apr 2018 18:59:07 +0000 Subject: [issue33347] zlibmodule undefined reference In-Reply-To: <1524567960.98.0.682650639539.issue33347@psf.upfronthosting.co.za> Message-ID: <1524855547.65.0.682650639539.issue33347@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- nosy: +serhiy.storchaka, twouters versions: +Python 3.8 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 15:01:50 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Apr 2018 19:01:50 +0000 Subject: [issue33351] Support compiling with clang-cl on Windows In-Reply-To: <1524631004.17.0.682650639539.issue33351@psf.upfronthosting.co.za> Message-ID: <1524855710.34.0.682650639539.issue33351@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware stage: -> test needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 15:12:55 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Apr 2018 19:12:55 +0000 Subject: [issue33352] Windows: test_regrtest fails on installed Python In-Reply-To: <1524663997.77.0.682650639539.issue33352@psf.upfronthosting.co.za> Message-ID: <1524856375.25.0.682650639539.issue33352@psf.upfronthosting.co.za> Terry J. Reedy added the comment: On my system: py -3.n -m test.test_regrtest (or test test_regrtest) fails for n in {5, 6, 7}. 2.7 runs, but there are far fewer test methods. Repository builds work fine. ---------- nosy: +terry.reedy stage: -> needs patch type: -> behavior versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 15:42:06 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Fri, 27 Apr 2018 19:42:06 +0000 Subject: [issue32857] tkinter after_cancel does not behave correctly when called with id=None In-Reply-To: <1518787214.25.0.467229070634.issue32857@psf.upfronthosting.co.za> Message-ID: <1524858126.83.0.682650639539.issue32857@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- pull_requests: +6316 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 17:21:10 2018 From: report at bugs.python.org (Tom Grigg) Date: Fri, 27 Apr 2018 21:21:10 +0000 Subject: [issue33374] generate-posix-vars failed when building Python 2.7.14 on Linux In-Reply-To: <1524843947.56.0.682650639539.issue33374@psf.upfronthosting.co.za> Message-ID: <1524864070.06.0.682650639539.issue33374@psf.upfronthosting.co.za> Tom Grigg added the comment: I beleive this is caused by https://bugs.python.org/issue27987 in combination with GCC 8. Florian Weimer proposed a patch which is included in the Fedora build: https://src.fedoraproject.org/cgit/rpms/python2.git/tree/00293-fix-gc-alignment.patch It would be nice if this was fixed for 2.7.15 so that it would build out of the box with GCC 8 on x86_64-linux-gnu. ---------- nosy: +tgrigg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 17:24:16 2018 From: report at bugs.python.org (Tom Grigg) Date: Fri, 27 Apr 2018 21:24:16 +0000 Subject: [issue33374] generate-posix-vars failed when building Python 2.7.14 on Linux In-Reply-To: <1524843947.56.0.682650639539.issue33374@psf.upfronthosting.co.za> Message-ID: <1524864256.63.0.682650639539.issue33374@psf.upfronthosting.co.za> Change by Tom Grigg : ---------- nosy: +fweimer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 17:30:22 2018 From: report at bugs.python.org (Tom Grigg) Date: Fri, 27 Apr 2018 21:30:22 +0000 Subject: [issue27987] obmalloc's 8-byte alignment causes undefined behavior In-Reply-To: <1473207430.19.0.578630759123.issue27987@psf.upfronthosting.co.za> Message-ID: <1524864622.37.0.682650639539.issue27987@psf.upfronthosting.co.za> Change by Tom Grigg : ---------- nosy: +tgrigg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 17:47:09 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Apr 2018 21:47:09 +0000 Subject: [issue33373] Tkinter ttk Label background ignored on MacOS In-Reply-To: <1524839303.7.0.682650639539.issue33373@psf.upfronthosting.co.za> Message-ID: <1524865629.94.0.682650639539.issue33373@psf.upfronthosting.co.za> Terry J. Reedy added the comment: ttk Label backgrounds work fine on Windows and, possibly, Linux (Serhiy?), and even, possibly with tcl/tk 8.6 on macOS (Ned?). tk 8.6 for macOS has gotten several bug fixes. C.D., please download and try out the python.org 3.7.0b3 macOS installer. It included and will install for Python's use the current tcl/tk 8.6.x bugfix release. import tkinter as tk from tkinter import ttk r = tk.Tk() l = ttk.Label(r, text='colored label', background='red') l.pack() r.mainloop() # if not in IDLE We obviously should not remove something that works as intended on some systems. ---------- components: +macOS nosy: +ned.deily, ronaldoussoren, serhiy.storchaka, terry.reedy title: ttk modules Label class does not respect background config option -> Tkinter ttk Label background ignored on MacOS versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 18:33:44 2018 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 27 Apr 2018 22:33:44 +0000 Subject: [issue33363] async for statement is not a syntax error in sync context In-Reply-To: <1524719930.25.0.682650639539.issue33363@psf.upfronthosting.co.za> Message-ID: <1524868424.5.0.682650639539.issue33363@psf.upfronthosting.co.za> Yury Selivanov added the comment: New changeset a93a663d6c2fdfbddbda9729c96e2737c0012522 by Yury Selivanov (Zsolt Dollenstein) in branch '3.7': [3.7] bpo-33363: raise SyntaxError for async for/with outside async functions (GH-6616). (GH-6619) https://github.com/python/cpython/commit/a93a663d6c2fdfbddbda9729c96e2737c0012522 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 18:34:03 2018 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 27 Apr 2018 22:34:03 +0000 Subject: [issue33363] async for statement is not a syntax error in sync context In-Reply-To: <1524719930.25.0.682650639539.issue33363@psf.upfronthosting.co.za> Message-ID: <1524868443.6.0.682650639539.issue33363@psf.upfronthosting.co.za> Yury Selivanov added the comment: Thanks so much! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 18:35:45 2018 From: report at bugs.python.org (Yury Selivanov) Date: Fri, 27 Apr 2018 22:35:45 +0000 Subject: [issue33366] `contextvars` documentation incorrectly refers to "non-local state". In-Reply-To: <1524746872.41.0.682650639539.issue33366@psf.upfronthosting.co.za> Message-ID: <1524868545.06.0.682650639539.issue33366@psf.upfronthosting.co.za> Yury Selivanov added the comment: Thank you, Tom! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 18:36:35 2018 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Apr 2018 22:36:35 +0000 Subject: [issue33366] `contextvars` documentation incorrectly refers to "non-local state". In-Reply-To: <1524746872.41.0.682650639539.issue33366@psf.upfronthosting.co.za> Message-ID: <1524868595.98.0.682650639539.issue33366@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6317 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 18:50:06 2018 From: report at bugs.python.org (Brett Cannon) Date: Fri, 27 Apr 2018 22:50:06 +0000 Subject: [issue32718] Install PowerShell activation scripts for venv for all platforms In-Reply-To: <1517273696.22.0.467229070634.issue32718@psf.upfronthosting.co.za> Message-ID: <1524869406.92.0.682650639539.issue32718@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- assignee: -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 20:13:52 2018 From: report at bugs.python.org (Ned Deily) Date: Sat, 28 Apr 2018 00:13:52 +0000 Subject: [issue33374] generate-posix-vars failed when building Python 2.7.14 on Linux In-Reply-To: <1524843947.56.0.682650639539.issue33374@psf.upfronthosting.co.za> Message-ID: <1524874432.61.0.682650639539.issue33374@psf.upfronthosting.co.za> Change by Ned Deily : ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Apr 27 20:15:11 2018 From: report at bugs.python.org (cary) Date: Sat, 28 Apr 2018 00:15:11 +0000 Subject: [issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction Message-ID: <1524874511.54.0.682650639539.issue33376@psf.upfronthosting.co.za> New submission from cary : # Description Rolling back a transaction causes all statements associated with that transaction to be reset, which allows the statements to be used again from the pysqlite statement cache. This can interact with various methods on `Cursor` objects to cause these statements to be reset again, possibly when they are in use by a different cursor. This appears to be very similar to issue10513 and issue23129. # Impact Duplicate rows will be returned. Exceptions can be raised. # Repro steps - Cursor *A* executes query *X* - Rollback occurs - Cursor *B* executes query *X* - Any of the following (and there might be other cases too): - Cursor *A* is closed - Cursor *A* is deallocated - Cursor *A* executes any other query. - Result: Cursor *B* returns duplicate rows. - Furthermore: Executing query *X* again afterwards raises `sqlite3.InterfaceError` # Possible solutions - Similar to the solution for issue10513 and issue23129, we could remove `pysqlite_do_all_statements(self, ACTION_RESET, 1)` from `pysqlite_connection_rollback`. This fixes the given issue, but I'm not sure what the implications are for the rest of the system. - Do not reset `self->statement` in `Cursor` if `self->reset`. This is the fix we've adopted for now (through a local patch to our Python), but it's worth noting that this is rather brittle, and only works because `pysqlite_do_all_statements` is always called with `reset_cursors = 1`, and `self->reset` is not modified in too many places. # Example ``` import sqlite3 as sqlite if __name__ == '__main__': conn = sqlite.connect(":memory:") conn.executescript(""" CREATE TABLE t(c); INSERT INTO t VALUES(0); INSERT INTO t VALUES(1); INSERT INTO t VALUES(2); """) curs = conn.cursor() curs.execute("BEGIN TRANSACTION") curs.execute("SELECT c FROM t WHERE ?", (1,)) conn.rollback() # Reusing the same statement from the statement cache, which has been # reset by the rollback above. gen = conn.execute("SELECT c FROM t WHERE ?", (1,)) # Any of the following will cause a spurious reset of the statement. curs.close() # curs.execute("SELECT 1") # del curs # Expected output: [(0,), (1,), (2,)] # Observed output: [(0,), (0,), (1,), (2,)] print(list(gen)) # Raises `sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.` conn.execute("SELECT c FROM t WHERE ?", (1,)) ``` ---------- components: Extension Modules messages: 315862 nosy: cary priority: normal severity: normal status: open title: [pysqlite] Duplicate rows can be returned after rolling back a transaction 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 Sat Apr 28 02:06:28 2018 From: report at bugs.python.org (Thomas Kluyver) Date: Sat, 28 Apr 2018 06:06:28 +0000 Subject: [issue33375] warnings: get filename from frame.f_code.co_filename In-Reply-To: <1524847135.79.0.682650639539.issue33375@psf.upfronthosting.co.za> Message-ID: <1524895588.54.0.682650639539.issue33375@psf.upfronthosting.co.za> Change by Thomas Kluyver : ---------- keywords: +patch pull_requests: +6318 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 02:39:50 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 28 Apr 2018 06:39:50 +0000 Subject: [issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction In-Reply-To: <1524874511.54.0.682650639539.issue33376@psf.upfronthosting.co.za> Message-ID: <1524897590.09.0.682650639539.issue33376@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +berker.peksag, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 05:11:05 2018 From: report at bugs.python.org (Naman Sharma) Date: Sat, 28 Apr 2018 09:11:05 +0000 Subject: [issue33370] Addition of mypy cache to gitignore In-Reply-To: <1524785260.87.0.682650639539.issue33370@psf.upfronthosting.co.za> Message-ID: <1524906665.6.0.682650639539.issue33370@psf.upfronthosting.co.za> Change by Naman Sharma : ---------- pull_requests: +6319 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 05:13:49 2018 From: report at bugs.python.org (Bharat Chhabra) Date: Sat, 28 Apr 2018 09:13:49 +0000 Subject: [issue32790] Keep trailing zeros in precision for string format option g In-Reply-To: <1518055716.96.0.467229070634.issue32790@psf.upfronthosting.co.za> Message-ID: <1524906829.37.0.682650639539.issue32790@psf.upfronthosting.co.za> Change by Bharat Chhabra : ---------- keywords: +patch pull_requests: +6320 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 06:05:14 2018 From: report at bugs.python.org (Rahul Jha) Date: Sat, 28 Apr 2018 10:05:14 +0000 Subject: [issue33217] x in enum.Flag member is True when x is not a Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1524909914.88.0.682650639539.issue33217@psf.upfronthosting.co.za> Rahul Jha added the comment: Hi Ethan, The only thing which is left is to change the Deprecation Warning to raise a `TypeError` and alter the tests accordingly. Seeing that most of the work for the issue has already been done, can I take it forward from here on wards, please? ---------- nosy: +RJ722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 08:39:29 2018 From: report at bugs.python.org (Roundup Robot) Date: Sat, 28 Apr 2018 12:39:29 +0000 Subject: [issue33281] ctypes.util.find_library not working on macOS In-Reply-To: <1523769860.6.0.682650639539.issue33281@psf.upfronthosting.co.za> Message-ID: <1524919169.7.0.682650639539.issue33281@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +6321 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 11:15:30 2018 From: report at bugs.python.org (Roundup Robot) Date: Sat, 28 Apr 2018 15:15:30 +0000 Subject: [issue19213] platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux In-Reply-To: <1381353298.1.0.0482171871073.issue19213@psf.upfronthosting.co.za> Message-ID: <1524928530.1.0.682650639539.issue19213@psf.upfronthosting.co.za> Change by Roundup Robot : ---------- keywords: +patch pull_requests: +6322 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 11:45:46 2018 From: report at bugs.python.org (Matthias Klose) Date: Sat, 28 Apr 2018 15:45:46 +0000 Subject: [issue33377] add new triplets for mips r6 and riscv variants Message-ID: <1524930346.47.0.682650639539.issue33377@psf.upfronthosting.co.za> New submission from Matthias Klose : Late last year / early this year, Debian defined new triplets for some mips r6 and riscv variants. Please still consider these for the 3.7 release. These patches are in use in Debian for a while and show no regressions. The new variants are documented at https://wiki.debian.org/Multiarch/Tuples ---------- components: Build files: mips-r6.diff keywords: patch messages: 315864 nosy: doko, ned.deily priority: normal severity: normal status: open title: add new triplets for mips r6 and riscv variants versions: Python 3.7, Python 3.8 Added file: https://bugs.python.org/file47553/mips-r6.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 11:46:10 2018 From: report at bugs.python.org (Matthias Klose) Date: Sat, 28 Apr 2018 15:46:10 +0000 Subject: [issue33377] add new triplets for mips r6 and riscv variants In-Reply-To: <1524930346.47.0.682650639539.issue33377@psf.upfronthosting.co.za> Message-ID: <1524930370.3.0.682650639539.issue33377@psf.upfronthosting.co.za> Change by Matthias Klose : Added file: https://bugs.python.org/file47554/riscv64.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 13:28:16 2018 From: report at bugs.python.org (Julien Palard) Date: Sat, 28 Apr 2018 17:28:16 +0000 Subject: [issue33378] Add Korean to the language switcher Message-ID: <1524936496.16.0.682650639539.issue33378@psf.upfronthosting.co.za> Change by Julien Palard : ---------- assignee: mdk components: Documentation nosy: mdk priority: normal severity: normal status: open title: Add Korean to the language switcher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 14:50:33 2018 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 28 Apr 2018 18:50:33 +0000 Subject: [issue33378] Add Korean to the language switcher Message-ID: <1524941433.04.0.682650639539.issue33378@psf.upfronthosting.co.za> New submission from Dong-hee Na : looks great ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 15:04:59 2018 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 28 Apr 2018 19:04:59 +0000 Subject: [issue33378] Add Korean to the language switcher In-Reply-To: <1524941433.04.0.682650639539.issue33378@psf.upfronthosting.co.za> Message-ID: <1524942299.71.0.682650639539.issue33378@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +6323 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 16:08:32 2018 From: report at bugs.python.org (Julien Palard) Date: Sat, 28 Apr 2018 20:08:32 +0000 Subject: [issue33378] Add Korean to the language switcher In-Reply-To: <1524941433.04.0.682650639539.issue33378@psf.upfronthosting.co.za> Message-ID: <1524946112.77.0.682650639539.issue33378@psf.upfronthosting.co.za> Julien Palard added the comment: New changeset 577948329976985ea9bef23d9a6c3dd7108211bf by Julien Palard (Dong-hee Na) in branch 'master': bpo-33378: Add Korean to the language switcher. (GH-6627) https://github.com/python/cpython/commit/577948329976985ea9bef23d9a6c3dd7108211bf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 16:11:17 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Apr 2018 20:11:17 +0000 Subject: [issue33378] Add Korean to the language switcher In-Reply-To: <1524941433.04.0.682650639539.issue33378@psf.upfronthosting.co.za> Message-ID: <1524946277.77.0.682650639539.issue33378@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6324 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 16:11:50 2018 From: report at bugs.python.org (Julien Palard) Date: Sat, 28 Apr 2018 20:11:50 +0000 Subject: [issue33378] Add Korean to the language switcher In-Reply-To: <1524941433.04.0.682650639539.issue33378@psf.upfronthosting.co.za> Message-ID: <1524946310.59.0.682650639539.issue33378@psf.upfronthosting.co.za> Change by Julien Palard : ---------- resolution: -> fixed stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 16:23:47 2018 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Apr 2018 20:23:47 +0000 Subject: [issue33378] Add Korean to the language switcher In-Reply-To: <1524941433.04.0.682650639539.issue33378@psf.upfronthosting.co.za> Message-ID: <1524947027.57.0.682650639539.issue33378@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 1487c37e7e85e7221adc3030f0f7de023cc99ced by Miss Islington (bot) in branch '3.7': bpo-33378: Add Korean to the language switcher. (GH-6627) https://github.com/python/cpython/commit/1487c37e7e85e7221adc3030f0f7de023cc99ced ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 16:24:13 2018 From: report at bugs.python.org (Julien Palard) Date: Sat, 28 Apr 2018 20:24:13 +0000 Subject: [issue33378] Add Korean to the language switcher In-Reply-To: <1524941433.04.0.682650639539.issue33378@psf.upfronthosting.co.za> Message-ID: <1524947052.99.0.682650639539.issue33378@psf.upfronthosting.co.za> Change by Julien Palard : ---------- stage: backport needed -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 18:03:00 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 28 Apr 2018 22:03:00 +0000 Subject: [issue33379] PyImport_Cleanup is called with builtins_copy == NULL in test_embed Message-ID: <1524952980.52.0.682650639539.issue33379@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : PyImport_Cleanup is called with builtins_copy == NULL in run_embedded_interpreter() in Lib/test/test_embed.py. This error was silenced by calling PyErr_Clear(), but it still looks as error to me. It was exposed by PR 6606. ---------- components: Interpreter Core messages: 315868 nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka priority: normal severity: normal status: open title: PyImport_Cleanup is called with builtins_copy == NULL in test_embed type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 18:40:12 2018 From: report at bugs.python.org (Allan Feldman) Date: Sat, 28 Apr 2018 22:40:12 +0000 Subject: [issue33380] Update module attribute on namedtuple methods for introspection. Message-ID: <1524955212.89.0.682650639539.issue33380@psf.upfronthosting.co.za> New submission from Allan Feldman : Python 3.7 made several performance improvements to the namedtuple class as part of https://bugs.python.org/issue28638 Prior to the implementation of bpo-28638, the __module__ attribute for a namedtuple's methods (e.g. _asdict) would return the value 'namedtuple_%s' % typename (e.g. namedtuple_Point). Due to the optimizations made, the __module__ attribute for a namedtuple's methods now returns 'collections'. The proposed change as part of this issue is to report the more accurate derived module name for the namedtuple methods. Updating the __module__ attribute should help debug and introspection tools more accurately report the details of executing calls (in profilers for example). Example from Python 3.6: >>> from collections import namedtuple >>> Point = namedtuple('Point', ('x', 'y')) >>> p1 = Point(1,2) >>> p1._asdict.__module__ 'namedtuple_Point' Example from Python 3.7.0b3: >>> from collections import namedtuple >>> Point = namedtuple('Point', ('x', 'y')) >>> p1 = Point(1,2) >>> p1._asdict.__module__ 'collections' Desired behavior: >>> from collections import namedtuple >>> Point = namedtuple('Point', ('x', 'y')) >>> p1 = Point(1,2) >>> p1._asdict.__module__ '__main__' ---------- components: Library (Lib) messages: 315869 nosy: a-feld, rhettinger priority: normal severity: normal status: open title: Update module attribute on namedtuple methods for introspection. type: enhancement versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 19:05:54 2018 From: report at bugs.python.org (Allan Feldman) Date: Sat, 28 Apr 2018 23:05:54 +0000 Subject: [issue33380] Update module attribute on namedtuple methods for introspection. In-Reply-To: <1524955212.89.0.682650639539.issue33380@psf.upfronthosting.co.za> Message-ID: <1524956754.4.0.682650639539.issue33380@psf.upfronthosting.co.za> Allan Feldman added the comment: Attached is a proposed change. ---------- keywords: +patch Added file: https://bugs.python.org/file47555/0001-bpo-33380-Update-module-attribute-on-namedtuple-meth.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 19:46:36 2018 From: report at bugs.python.org (Ethan Furman) Date: Sat, 28 Apr 2018 23:46:36 +0000 Subject: [issue33217] x in enum.Flag member is True when x is not a Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1524959196.71.0.682650639539.issue33217@psf.upfronthosting.co.za> Ethan Furman added the comment: Rahul Jha, sure, go ahead! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 20:05:36 2018 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Apr 2018 00:05:36 +0000 Subject: [issue33378] Add Korean to the language switcher In-Reply-To: <1524941433.04.0.682650639539.issue33378@psf.upfronthosting.co.za> Message-ID: <1524960336.56.0.682650639539.issue33378@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- pull_requests: +6325 stage: resolved -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 20:30:31 2018 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Apr 2018 00:30:31 +0000 Subject: [issue33378] Add Korean to the language switcher In-Reply-To: <1524941433.04.0.682650639539.issue33378@psf.upfronthosting.co.za> Message-ID: <1524961831.85.0.682650639539.issue33378@psf.upfronthosting.co.za> Dong-hee Na added the comment: https://github.com/python/cpython/pull/6629 3.6 needs backport patch also. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 21:06:18 2018 From: report at bugs.python.org (Judy Wang) Date: Sun, 29 Apr 2018 01:06:18 +0000 Subject: [issue33381] Incorrect documentation for strftime()/strptime() format code %f Message-ID: <1524963978.65.0.682650639539.issue33381@psf.upfronthosting.co.za> New submission from Judy Wang : According to https://docs.python.org/3/library/datetime.html, %f is zero-padded on the left. But actual Python 3 behavior is puts the zero padding on the right. ---------- files: Bug description.py messages: 315873 nosy: jujuwoman priority: normal severity: normal status: open title: Incorrect documentation for strftime()/strptime() format code %f type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47556/Bug description.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 21:15:39 2018 From: report at bugs.python.org (janzert) Date: Sun, 29 Apr 2018 01:15:39 +0000 Subject: [issue29652] Fix evaluation order of keys/values in dict comprehensions In-Reply-To: <1488052483.04.0.021043093911.issue29652@psf.upfronthosting.co.za> Message-ID: <1524964539.71.0.682650639539.issue29652@psf.upfronthosting.co.za> janzert added the comment: Just as a note so the email discussion isn't forever lost to the void. In an unrelated thread on python-dev recently there was a short discussion on this topic in which both Guido van Rossum[1] and Tim Peters[2] gave the opinion that this should change should probably be made. 1: https://mail.python.org/pipermail/python-dev/2018-April/153122.html 2: https://mail.python.org/pipermail/python-dev/2018-April/153134.html ---------- nosy: +janzert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 21:22:21 2018 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Apr 2018 01:22:21 +0000 Subject: [issue31727] FTP_TLS errors when use certain subcommands In-Reply-To: <1507482521.5.0.213398074469.issue31727@psf.upfronthosting.co.za> Message-ID: <1524964941.46.0.682650639539.issue31727@psf.upfronthosting.co.za> Dong-hee Na added the comment: I can not reproduce this issue on Python 3.8.0a0 with OpenSSL 0.9.8zh 14 Jan 2016 and OpenSSL 1.0.2o 27 Mar 2018 import ssl import ftplib print(ssl.OPENSSL_VERSION) ftps = ftplib.FTP_TLS('test.rebex.net', timeout=2) ftps.ssl_version = ssl.PROTOCOL_TLS ftps.login('demo','password') ftps.prot_p() ftps.set_pasv(True) ftps.dir() ftps.nlst() ftps.retrlines('LIST') ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 22:13:31 2018 From: report at bugs.python.org (Patrick Young) Date: Sun, 29 Apr 2018 02:13:31 +0000 Subject: [issue33382] make [profile-opt] failde with --enable-optimizations Message-ID: <1524968011.46.0.682650639539.issue33382@psf.upfronthosting.co.za> New submission from Patrick Young : 0:14:07 load avg: 1.26 [406/406] test_zlib Total duration: 14 min 9 sec Tests result: SUCCESS make[1]: Leaving directory '/home/kmahyyg/Desktop/py36/Python-3.6.5' make build_all_merge_profile make[1]: Entering directory '/home/kmahyyg/Desktop/py36/Python-3.6.5' true /bin/true: 1: /bin/true: Syntax error: "(" unexpected Makefile:497: recipe for target 'build_all_merge_profile' failed make[1]: *** [build_all_merge_profile] Error 2 make[1]: Leaving directory '/home/kmahyyg/Desktop/py36/Python-3.6.5' Makefile:471: recipe for target 'profile-opt' failed make: *** [profile-opt] Error 2 ---------- components: Installation messages: 315876 nosy: kmahyyg priority: normal severity: normal status: open title: make [profile-opt] failde with --enable-optimizations versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 22:15:12 2018 From: report at bugs.python.org (Patrick Young) Date: Sun, 29 Apr 2018 02:15:12 +0000 Subject: [issue33382] make [profile-opt] failde with --enable-optimizations In-Reply-To: <1524968011.46.0.682650639539.issue33382@psf.upfronthosting.co.za> Message-ID: <1524968112.24.0.682650639539.issue33382@psf.upfronthosting.co.za> Patrick Young added the comment: $ uname -a Linux PatrickY 4.9.0-deepin13-amd64 #1 SMP PREEMPT Deepin 4.9.57-1 (2017-10-19) x86_64 GNU/Linux $ lsb_release -a Distributor ID: Deepin Description: Deepin 15.5 Release: 15.5 Based on Debian sid ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 22:24:49 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Sun, 29 Apr 2018 02:24:49 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1524968689.79.0.682650639539.issue33257@psf.upfronthosting.co.za> Ivan Pozdeev added the comment: Finally dug up the reason but unsure how to fix it. Here's the trace. The format is `$TID: $FUNCTION [some of the args]' 0x1A34: Tkapp_Call(_object *, _object *) 0x1A34: PythonCmd(void *, Tcl_Interp *, int, const char * *) 0x000000000230f430 0x0000000002d297d0 "47566760dummy_handler" 0x0000000003a28580 "5" 0x0000000003a29140 "??" 0x0000000003a29140 "??" 0x1D7C: Tkapp_Call(_object *, _object *) 0x1D7C: PythonCmd(void *, Tcl_Interp *, int, const char * *) 0x000000000230f430 0x0000000002d297d0 "47566760dummy_handler" 0x0000000003a28580 "5" 0x0000000003a29140 "??" 0x0000000003a29140 "??" 0x1A34: PythonCmd(void *, Tcl_Interp *, int, const char * *) setting result 0x1A34: PythonCmd(void *, Tcl_Interp *, int, const char * *) exit: 0 TclStackFree: incorrect freePtr (0000000002BA6430 != 0000000002BA6A20). Call out of sequence?python_d.exe has triggered a breakpoint. A second PythonCmd is started when the 1st one is still in progress, then the 1st one returns, the Tcl interpreter tries to unwind the topmost stack frame, and it's the wrong one. Denying other PythonCmd is out of question (a nested cmd deadlocks). Waiting for them to finish, either (would wait for potentially unlimited time). Look like the only way is to rearrange Tcl stack frames so that the right one is on top. (Since Tkinter's "interpreter calls" (sequences of Tcl calls done while holding the lock) are supposed to be independent from one another, it doesn't really matter which order the frames are in.) I seriously doubt that's possible with just the public interface though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 22:28:57 2018 From: report at bugs.python.org (Patrick Young) Date: Sun, 29 Apr 2018 02:28:57 +0000 Subject: [issue33382] make [profile-opt] failed with --enable-optimizations In-Reply-To: <1524968011.46.0.682650639539.issue33382@psf.upfronthosting.co.za> Message-ID: <1524968937.2.0.682650639539.issue33382@psf.upfronthosting.co.za> Change by Patrick Young : ---------- title: make [profile-opt] failde with --enable-optimizations -> make [profile-opt] failed with --enable-optimizations type: -> compile error _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 23:09:48 2018 From: report at bugs.python.org (Patrick Young) Date: Sun, 29 Apr 2018 03:09:48 +0000 Subject: [issue33382] make [profile-opt] failed with --enable-optimizations In-Reply-To: <1524968011.46.0.682650639539.issue33382@psf.upfronthosting.co.za> Message-ID: <1524971388.79.0.682650639539.issue33382@psf.upfronthosting.co.za> Change by Patrick Young : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 23:10:41 2018 From: report at bugs.python.org (Patrick Young) Date: Sun, 29 Apr 2018 03:10:41 +0000 Subject: [issue33382] make [profile-opt] failed with --enable-optimizations In-Reply-To: <1524968011.46.0.682650639539.issue33382@psf.upfronthosting.co.za> Message-ID: <1524971441.76.0.682650639539.issue33382@psf.upfronthosting.co.za> Patrick Young added the comment: modify build_all_merge_profile to absolutely: true then modify build running shell to: zsh ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Apr 28 23:41:09 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 03:41:09 +0000 Subject: [issue33380] Update module attribute on namedtuple methods for introspection. In-Reply-To: <1524955212.89.0.682650639539.issue33380@psf.upfronthosting.co.za> Message-ID: <1524973269.04.0.682650639539.issue33380@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- assignee: -> rhettinger nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 00:18:18 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 04:18:18 +0000 Subject: [issue33373] Tkinter ttk Label background ignored on MacOS In-Reply-To: <1524839303.7.0.682650639539.issue33373@psf.upfronthosting.co.za> Message-ID: <1524975498.46.0.682650639539.issue33373@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: ttk.Label is just a think wrapper around Tk's ttk::label. If there are problems with setting background on MacOS, it should be reported on the Tk bagtracker. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 00:29:01 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 04:29:01 +0000 Subject: [issue33379] PyImport_Cleanup is called with builtins_copy == NULL in test_embed In-Reply-To: <1524952980.52.0.682650639539.issue33379@psf.upfronthosting.co.za> Message-ID: <1524976141.02.0.682650639539.issue33379@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 01:56:26 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 05:56:26 +0000 Subject: [issue33379] PyImport_Cleanup is called with builtins_copy == NULL in test_embed In-Reply-To: <1524952980.52.0.682650639539.issue33379@psf.upfronthosting.co.za> Message-ID: <1524981386.47.0.682650639539.issue33379@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: PyImport_Cleanup() is called in Py_EndInterpreter(), but Py_NewInterpreter() doesn't call _PyImport_Init() which initializes builtins_copy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 02:46:21 2018 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Wirtel?=) Date: Sun, 29 Apr 2018 06:46:21 +0000 Subject: [issue33370] Addition of mypy cache to gitignore In-Reply-To: <1524785260.87.0.682650639539.issue33370@psf.upfronthosting.co.za> Message-ID: <1524984381.1.0.682650639539.issue33370@psf.upfronthosting.co.za> St?phane Wirtel added the comment: you could use a feature of git for the global .gitignore file git config --global core.excludesfile ~/.gitignore source: https://git-scm.com/docs/gitignore/2.17.0 ---------- nosy: +matrixise _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 04:09:38 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 08:09:38 +0000 Subject: [issue33383] Crash in the get() method a single argument in dbm.ndbm Message-ID: <1524989378.13.0.682650639539.issue33383@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : Calling the get() method of the dbm.ndbm database object with only single argument causes a crash because the default value is set to NULL. The regression was introduce in 3.5. The proposed patch fixes the crash and add tests for the get() method for all dbm implementations. ---------- components: Extension Modules messages: 315883 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Crash in the get() method a single argument in dbm.ndbm type: crash versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 04:10:08 2018 From: report at bugs.python.org (Kenneth Hoste) Date: Sun, 29 Apr 2018 08:10:08 +0000 Subject: [issue33174] error building the _sha3 module with Intel 2018 compilers In-Reply-To: <1522267262.01.0.467229070634.issue33174@psf.upfronthosting.co.za> Message-ID: <1524989408.38.0.682650639539.issue33174@psf.upfronthosting.co.za> Kenneth Hoste added the comment: Willian: on which OS and (Intel?) processor generation are you seeing this? We're not seeing this on CentOS 7.4.1708 with Python 3.6.4 and icc 18.0.1.163 on Intel Haswell or Intel Skylake. We have seen this with other software on Intel Skylake though... Have you tried with icc 18.0.2 (which was released March 21st 2018)? ---------- nosy: +boegel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 04:17:30 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 08:17:30 +0000 Subject: [issue33383] Crash in the get() method a single argument in dbm.ndbm In-Reply-To: <1524989378.13.0.682650639539.issue33383@psf.upfronthosting.co.za> Message-ID: <1524989850.65.0.682650639539.issue33383@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6326 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 05:38:12 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 09:38:12 +0000 Subject: [issue33383] Crash in the get() method a single argument in dbm.ndbm In-Reply-To: <1524989378.13.0.682650639539.issue33383@psf.upfronthosting.co.za> Message-ID: <1524994692.57.0.682650639539.issue33383@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 2e38cc39330bd7f3003652869b644110a97a78d8 by Serhiy Storchaka in branch 'master': bpo-33383: Fix crash in get() of the dbm.ndbm database object. (#6630) https://github.com/python/cpython/commit/2e38cc39330bd7f3003652869b644110a97a78d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 05:38:44 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 09:38:44 +0000 Subject: [issue33383] Crash in the get() method a single argument in dbm.ndbm In-Reply-To: <1524989378.13.0.682650639539.issue33383@psf.upfronthosting.co.za> Message-ID: <1524994724.18.0.682650639539.issue33383@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6327 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 06:16:35 2018 From: report at bugs.python.org (Martin Husemann) Date: Sun, 29 Apr 2018 10:16:35 +0000 Subject: [issue33384] Build does not work with closed stdin Message-ID: <1524996995.63.0.682650639539.issue33384@psf.upfronthosting.co.za> New submission from Martin Husemann : When building python extensions in the background w/o stdin (and stderr and stdout redirected to a log file), the invocation of setup.py fails. Normal build in a shell: Example from pyexpat: > /usr/pkg/bin/python3.6 setup.py build running build running build_ext building 'pyexpat' extension creating build creating build/temp.netbsd-8.99.14-amd64-3.6 creating build/temp.netbsd-8.99.14-amd64-3.6/Modules gcc -DNDEBUG -O2 -pipe -D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/pkg/include -O2 -pipe -D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/pkg/include/python3.6 -I/usr/include -I/usr/pkg/include/python3.6 -fPIC -DHAVE_EXPAT_H -I/work/pkgobj/textproc/py-expat/work/.buildlink/include -I/usr/pkg/include/python3.6 -c Modules/pyexpat.c -o build/temp.netbsd-8.99.14-amd64-3.6/Modules/pyexpat.o creating build/lib.netbsd-8.99.14-amd64-3.6 gcc -pthread -shared -L. -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -O2 -pipe -D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/pkg/include/python3.6 -I/usr/include -I/usr/pkg/include/python3.6 build/temp.netbsd-8.99.14-amd64-3.6/Modules/pyexpat.o -L/work/pkgobj/textproc/py-expat/work/.buildlink/lib -L/usr/pkg/lib -Wl,-R/work/pkgobj/textproc/py-expat/work/.buildlink/lib -lexpat -lpython3.6 -o build/lib.netbsd-8.99.14-amd64-3.6/pyexpat.so But if invoked as > ( sleep 15; /usr/pkg/bin/python3.6 setup.py build ) >/tmp/log 2>&1 & > ^D and then watching /tmp/log from another session: Fatal Python error: Py_Initialize: can't initialize sys standard streams OSError: [Errno 9] Bad file descriptor Current thread 0x000075b4e4cee800 (most recent call first): [1] Abort trap (core dumped) /usr/pkg/bin/pyt... ---------- components: Build messages: 315886 nosy: MartinHusemann priority: normal severity: normal status: open title: Build does not work with closed stdin type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 06:37:33 2018 From: report at bugs.python.org (Michael Romero) Date: Sun, 29 Apr 2018 10:37:33 +0000 Subject: [issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x In-Reply-To: <1516595654.84.0.467229070634.issue32616@psf.upfronthosting.co.za> Message-ID: <1524998253.72.0.682650639539.issue32616@psf.upfronthosting.co.za> Michael Romero added the comment: So is this now considered resolved for High Sierra users via 2.7.15rc1? ---------- nosy: +Michael Romero _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 06:51:01 2018 From: report at bugs.python.org (Thomas Klausner) Date: Sun, 29 Apr 2018 10:51:01 +0000 Subject: [issue33384] Build does not work with closed stdin In-Reply-To: <1524996995.63.0.682650639539.issue33384@psf.upfronthosting.co.za> Message-ID: <1524999061.33.0.682650639539.issue33384@psf.upfronthosting.co.za> Change by Thomas Klausner : ---------- nosy: +wiz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 07:48:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 11:48:20 +0000 Subject: [issue31026] test_dbm fails when run directly In-Reply-To: <1500984617.08.0.739686632306.issue31026@psf.upfronthosting.co.za> Message-ID: <1525002500.2.0.682650639539.issue31026@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: The same error is now occurred in Ubuntu 18.04 by default. The proposed patch moves the test for the empty value to separate methods and skips them if dbm.ndbm uses Berkeley DB. ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 07:49:19 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 11:49:19 +0000 Subject: [issue31026] test_dbm fails when run directly In-Reply-To: <1500984617.08.0.739686632306.issue31026@psf.upfronthosting.co.za> Message-ID: <1525002559.84.0.682650639539.issue31026@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +6328 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 07:50:28 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 11:50:28 +0000 Subject: [issue33383] Crash in the get() method a single argument in dbm.ndbm In-Reply-To: <1524989378.13.0.682650639539.issue33383@psf.upfronthosting.co.za> Message-ID: <1525002628.94.0.682650639539.issue33383@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset ee95feb69d937149bef3d245e87df1aef412b7fc by Serhiy Storchaka (Miss Islington (bot)) in branch '3.7': [3.7] bpo-33383: Fix crash in get() of the dbm.ndbm database object. (GH-6630) (GH-6631) https://github.com/python/cpython/commit/ee95feb69d937149bef3d245e87df1aef412b7fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 08:03:43 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 12:03:43 +0000 Subject: [issue33383] Crash in the get() method a single argument in dbm.ndbm In-Reply-To: <1524989378.13.0.682650639539.issue33383@psf.upfronthosting.co.za> Message-ID: <1525003423.53.0.682650639539.issue33383@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6329 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 08:08:30 2018 From: report at bugs.python.org (=?utf-8?q?Nicol=C3=A1s_Hatcher?=) Date: Sun, 29 Apr 2018 12:08:30 +0000 Subject: [issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8' In-Reply-To: <1523352074.24.0.682650639539.issue33255@psf.upfronthosting.co.za> Message-ID: <1525003710.55.0.682650639539.issue33255@psf.upfronthosting.co.za> Nicol?s Hatcher added the comment: Hi Sehriy, I am ok with that change. I think it makes much more sense, but I also think it will break people's codes. At least with the simplest fix in which: >>> json.dumps({"g"}, ensure_ascii=False) u'"g"' Which is again compatible with simplejson. Although the documentation is not clear in this point there might be code out there relaying on this behaviour. Is that acceptable? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 08:44:23 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 12:44:23 +0000 Subject: [issue33383] Crash in the get() method a single argument in dbm.ndbm In-Reply-To: <1524989378.13.0.682650639539.issue33383@psf.upfronthosting.co.za> Message-ID: <1525005863.19.0.682650639539.issue33383@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 1b27ec6e0b40f81bf276eefa6b5bdb773b2a8890 by Serhiy Storchaka in branch '3.6': [3.6] bpo-33383: Fix crash in get() of the dbm.ndbm database object. (GH-6630). (GH-6633) https://github.com/python/cpython/commit/1b27ec6e0b40f81bf276eefa6b5bdb773b2a8890 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 08:45:05 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 12:45:05 +0000 Subject: [issue31026] test_dbm fails when run directly In-Reply-To: <1500984617.08.0.739686632306.issue31026@psf.upfronthosting.co.za> Message-ID: <1525005905.81.0.682650639539.issue31026@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 70af06cdc4e8fbee0b9d7d46bdc193097d4bc71f by Serhiy Storchaka in branch 'master': bpo-31026: Fix test_dbm if dbm.ndbm is build with Berkeley DB. (GH-6632) https://github.com/python/cpython/commit/70af06cdc4e8fbee0b9d7d46bdc193097d4bc71f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 08:46:28 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 12:46:28 +0000 Subject: [issue31026] test_dbm fails when run directly In-Reply-To: <1500984617.08.0.739686632306.issue31026@psf.upfronthosting.co.za> Message-ID: <1525005988.93.0.682650639539.issue31026@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6330 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 08:48:15 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 12:48:15 +0000 Subject: [issue31026] test_dbm fails when run directly In-Reply-To: <1500984617.08.0.739686632306.issue31026@psf.upfronthosting.co.za> Message-ID: <1525006095.33.0.682650639539.issue31026@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6331 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 08:58:52 2018 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 29 Apr 2018 12:58:52 +0000 Subject: [issue33328] pdb error when stepping through generator In-Reply-To: <1524366233.1.0.682650639539.issue33328@psf.upfronthosting.co.za> Message-ID: <1525006732.83.0.682650639539.issue33328@psf.upfronthosting.co.za> Xavier de Gaye added the comment: This is a duplicate of issue 13044. > Why the code of the never used asynchronous generator is executed at all? The destructor of the asynchronous generator is called during python finalization while the trace is still active. Here is the backtrace where python is stopped just upon entering the debugger and before the exception is raised by bdb: #0 call_trace_protected (func=0x5555556c0a5b , obj=, tstate=tstate at entry=0x555555af5eb0, frame=frame at entry=Frame 0x7ffff6e63218, for file /home/xavier/src/python/master/Lib/types.py, line 27, in _ag (), what=what at entry=0, arg=None) at Python/ceval.c:4228 #1 0x00005555556757f9 in _PyEval_EvalFrameDefault ( f=Frame 0x7ffff6e63218, for file /home/xavier/src/python/master/Lib/types.py, line 27, in _ag (), throwflag=1) at Python/ceval.c:843 #2 0x000055555567445d in PyEval_EvalFrameEx ( f=f at entry=Frame 0x7ffff6e63218, for file /home/xavier/src/python/master/Lib/types.py, line 27, in _ag (), throwflag=throwflag at entry=1) at Python/ceval.c:536 #3 0x000055555575c0d2 in gen_send_ex (gen=gen at entry=0x7ffff6e27d48, arg=, exc=exc at entry=1, closing=closing at entry=1) at Objects/genobject.c:221 #4 0x000055555575c66b in gen_close (gen=gen at entry=0x7ffff6e27d48, args=args at entry=0x0) at Objects/genobject.c:371 #5 0x000055555575c7f1 in _PyGen_Finalize (self=) at Objects/genobject.c:84 #6 0x00005555555f7c7d in PyObject_CallFinalizer ( self=self at entry=) at Objects/object.c:286 #7 0x00005555555f89c0 in PyObject_CallFinalizerFromDealloc ( self=self at entry=) at Objects/object.c:303 #8 0x000055555575ba27 in gen_dealloc (gen=gen at entry=0x7ffff6e27d48) at Objects/genobject.c:127 #9 0x00005555555f8a7e in _Py_Dealloc (op=) at Objects/object.c:1933 #10 0x00005555555ea25b in insertdict (mp=mp at entry=0x7ffff6e53d00, key=key at entry='_ag', hash=-1842969574970988536, value=value at entry=None) at Objects/dictobject.c:1067 #11 0x00005555555eb8a0 in PyDict_SetItem ( op=op at entry=Python Exception Attempt to extract a component of a value that is not a struct/class/union.: , key='_ag', value=None) at Objects/dictobject.c:1454 #12 0x00005555555f764f in _PyModule_ClearDict ( d=Python Exception Attempt to extract a component of a value that is not a struct/class/union.: ) at Objects/moduleobject.c:606 #13 0x00005555555f793f in _PyModule_Clear (m=m at entry=) at Objects/moduleobject.c:577 #14 0x000055555569debe in PyImport_Cleanup () at Python/import.c:544 #15 0x00005555556ac463 in Py_FinalizeEx () at Python/pylifecycle.c:1094 #16 0x00005555555b2136 in pymain_main (pymain=pymain at entry=0x7fffffffe420) at Modules/main.c:2664 #17 0x00005555555b22c3 in _Py_UnixMain (argc=, argv=) at Modules/main.c:2697 #18 0x00005555555ad403 in main (argc=, argv=) at ./Programs/python.c:15 ---------- nosy: +xdegaye _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 09:04:47 2018 From: report at bugs.python.org (Xavier de Gaye) Date: Sun, 29 Apr 2018 13:04:47 +0000 Subject: [issue13044] pdb throws AttributeError at end of debugging session In-Reply-To: <1316968582.76.0.94343164649.issue13044@psf.upfronthosting.co.za> Message-ID: <1525007087.66.0.682650639539.issue13044@psf.upfronthosting.co.za> Xavier de Gaye added the comment: I can reproduce this bug with python 3.6.5 using akl's debug.py. The exception is now on 3.6.5: (Pdb) next --Call-- Exception ignored in: Traceback (most recent call last): File "/usr/lib/python3.6/types.py", line 27, in _ag File "/usr/lib/python3.6/bdb.py", line 53, in trace_dispatch File "/usr/lib/python3.6/bdb.py", line 85, in dispatch_call File "/usr/lib/python3.6/pdb.py", line 251, in user_call File "/usr/lib/python3.6/pdb.py", line 351, in interaction File "/usr/lib/python3.6/pdb.py", line 1453, in print_stack_entry File "/usr/lib/python3.6/bdb.py", line 394, in format_stack_entry TypeError: 'NoneType' object is not callable Issue 33328 is a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 09:36:39 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 13:36:39 +0000 Subject: [issue33255] json.dumps has different behaviour if encoding='utf-8' or encoding='utf8' In-Reply-To: <1523352074.24.0.682650639539.issue33255@psf.upfronthosting.co.za> Message-ID: <1525008999.78.0.682650639539.issue33255@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: You could decode only non-ascii strings. But I'm not sure that it is worth to change something in 2.7. This could be treated aa a new feature. Left this on to Benjamin, the release manager of 2.7. ---------- nosy: +benjamin.peterson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 09:37:23 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 13:37:23 +0000 Subject: [issue31026] test_dbm fails when run directly In-Reply-To: <1500984617.08.0.739686632306.issue31026@psf.upfronthosting.co.za> Message-ID: <1525009043.95.0.682650639539.issue31026@psf.upfronthosting.co.za> miss-islington added the comment: New changeset e57d3e3a13d1d4c6a057e47db8361695194bb5ab by Miss Islington (bot) in branch '3.7': bpo-31026: Fix test_dbm if dbm.ndbm is build with Berkeley DB. (GH-6632) https://github.com/python/cpython/commit/e57d3e3a13d1d4c6a057e47db8361695194bb5ab ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 09:47:42 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 13:47:42 +0000 Subject: [issue31026] test_dbm fails when run directly In-Reply-To: <1500984617.08.0.739686632306.issue31026@psf.upfronthosting.co.za> Message-ID: <1525009662.26.0.682650639539.issue31026@psf.upfronthosting.co.za> miss-islington added the comment: New changeset a26a297b4ba1b8fe6c97c25af71216935960b343 by Miss Islington (bot) in branch '3.6': bpo-31026: Fix test_dbm if dbm.ndbm is build with Berkeley DB. (GH-6632) https://github.com/python/cpython/commit/a26a297b4ba1b8fe6c97c25af71216935960b343 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 10:00:31 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 14:00:31 +0000 Subject: [issue33385] setdefault() with a single argument doesn't work for dbm.gdbm and dmb.ndbm objects Message-ID: <1525010431.96.0.682650639539.issue33385@psf.upfronthosting.co.za> New submission from Serhiy Storchaka : setdefault() is not implemented directly in dbm.gdbm and dmb.ndbm database classes. It is inherited from MutableMapping: def setdefault(self, key, default=None): try: return self[key] except KeyError: self[key] = default return default But since assigning is supported only for bytes and str, setdefault(key) fails if the key was not set before. It works only if the key was set or with the second argument. d.setdefault(key) is equivalent to d[key] except that it raises a weird TypeError instead of KeyError. There are two ways of solving this problem: 1. Reimplement setdefault() for dbm.gdbm and dmb.ndbm database classes with default=b'' by default. 2. Make the second argument mandatory. In both cases this violates the MutableMapping interface. ---------- components: Library (Lib) messages: 315898 nosy: serhiy.storchaka priority: normal severity: normal status: open title: setdefault() with a single argument doesn't work for dbm.gdbm and dmb.ndbm objects type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 10:08:20 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 14:08:20 +0000 Subject: [issue31026] test_dbm fails when run directly In-Reply-To: <1500984617.08.0.739686632306.issue31026@psf.upfronthosting.co.za> Message-ID: <1525010900.87.0.682650639539.issue31026@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 10:08:46 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 14:08:46 +0000 Subject: [issue33383] Crash in the get() method a single argument in dbm.ndbm In-Reply-To: <1524989378.13.0.682650639539.issue33383@psf.upfronthosting.co.za> Message-ID: <1525010926.98.0.682650639539.issue33383@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 10:25:41 2018 From: report at bugs.python.org (Ivan Pozdeev) Date: Sun, 29 Apr 2018 14:25:41 +0000 Subject: [issue33257] Race conditions in Tkinter with non-threaded Tcl In-Reply-To: <1523378469.47.0.682650639539.issue33257@psf.upfronthosting.co.za> Message-ID: <1525011941.97.0.682650639539.issue33257@psf.upfronthosting.co.za> Ivan Pozdeev added the comment: > Look like the only way is to rearrange Tcl stack frames so that the right one is on top. Scratch that. Tkinter allows to execute entire scripts where the order of the frames is important. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 10:37:18 2018 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Apr 2018 14:37:18 +0000 Subject: [issue33197] Confusing error message when constructing invalid inspect.Parameters In-Reply-To: <1522566872.11.0.467229070634.issue33197@psf.upfronthosting.co.za> Message-ID: <1525012638.72.0.682650639539.issue33197@psf.upfronthosting.co.za> Dong-hee Na added the comment: @Nitish I will take a look this issue. I agree with to use "{!s}" in the format string ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 11:00:57 2018 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Apr 2018 15:00:57 +0000 Subject: [issue33197] Confusing error message when constructing invalid inspect.Parameters In-Reply-To: <1522566872.11.0.467229070634.issue33197@psf.upfronthosting.co.za> Message-ID: <1525014057.94.0.682650639539.issue33197@psf.upfronthosting.co.za> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +6332 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 11:41:08 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 15:41:08 +0000 Subject: [issue33197] Confusing error message when constructing invalid inspect.Parameters In-Reply-To: <1522566872.11.0.467229070634.issue33197@psf.upfronthosting.co.za> Message-ID: <1525016468.99.0.682650639539.issue33197@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- nosy: +yselivanov type: -> behavior versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 12:46:31 2018 From: report at bugs.python.org (Dan Snider) Date: Sun, 29 Apr 2018 16:46:31 +0000 Subject: [issue33386] Double clicking to select an identifier in IDLE does not work with some unicode characters Message-ID: <1525020391.31.0.682650639539.issue33386@psf.upfronthosting.co.za> New submission from Dan Snider : https://i.imgur.com/61sHBRR.png At least with "?", it behaves as if it's one of the ascii characters for which id.isidentifier() returns False, as in https://i.imgur.com/XbEW0ZC.png. ---------- assignee: terry.reedy components: IDLE messages: 315901 nosy: bup, terry.reedy priority: normal severity: normal status: open title: Double clicking to select an identifier in IDLE does not work with some unicode characters type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 13:48:35 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 17:48:35 +0000 Subject: [issue33256] module is not displayed by cgitb.html In-Reply-To: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> Message-ID: <1525024115.6.0.682650639539.issue33256@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 7d68bfa82654ba01d860b8a772ff63bf0bd183ee by Serhiy Storchaka (sblondon) in branch 'master': bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442) https://github.com/python/cpython/commit/7d68bfa82654ba01d860b8a772ff63bf0bd183ee ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 13:49:52 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 17:49:52 +0000 Subject: [issue33256] module is not displayed by cgitb.html In-Reply-To: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> Message-ID: <1525024192.88.0.682650639539.issue33256@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6333 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 13:51:45 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 17:51:45 +0000 Subject: [issue33256] module is not displayed by cgitb.html In-Reply-To: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> Message-ID: <1525024305.16.0.682650639539.issue33256@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6334 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:01:22 2018 From: report at bugs.python.org (Rick Teachey) Date: Sun, 29 Apr 2018 18:01:22 +0000 Subject: [issue33328] pdb error when stepping through generator In-Reply-To: <1524366233.1.0.682650639539.issue33328@psf.upfronthosting.co.za> Message-ID: <1525024882.1.0.682650639539.issue33328@psf.upfronthosting.co.za> Rick Teachey added the comment: Closed as duplicate of issue 13044. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:03:07 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 18:03:07 +0000 Subject: [issue32362] multiprocessing.connection.Connection misdocumented as multiprocessing.Connection In-Reply-To: <1513592247.3.0.213398074469.issue32362@psf.upfronthosting.co.za> Message-ID: <1525024987.78.0.682650639539.issue32362@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 9f3535c9cde8813ce631d6ebe4d790682f594828 by Serhiy Storchaka (Bo Bayles) in branch 'master': bpo-32362: Fix references to non-existent multiprocessing.Connection() (GH-6223) https://github.com/python/cpython/commit/9f3535c9cde8813ce631d6ebe4d790682f594828 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:04:15 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 18:04:15 +0000 Subject: [issue32362] multiprocessing.connection.Connection misdocumented as multiprocessing.Connection In-Reply-To: <1513592247.3.0.213398074469.issue32362@psf.upfronthosting.co.za> Message-ID: <1525025055.87.0.682650639539.issue32362@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6335 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:06:16 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 18:06:16 +0000 Subject: [issue32362] multiprocessing.connection.Connection misdocumented as multiprocessing.Connection In-Reply-To: <1513592247.3.0.213398074469.issue32362@psf.upfronthosting.co.za> Message-ID: <1525025176.53.0.682650639539.issue32362@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6336 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:28:42 2018 From: report at bugs.python.org (Mark Shannon) Date: Sun, 29 Apr 2018 18:28:42 +0000 Subject: [issue33387] Simplify bytecodes for try-finally, try-except and with blocks. Message-ID: <1525026522.22.0.682650639539.issue33387@psf.upfronthosting.co.za> New submission from Mark Shannon : The six complex bytecodes currently used for implementing 'with' and 'try' statements can be replaced with just two simpler bytecodes. The six bytecodes are WITH_CLEANUP_START, WITH_CLEANUP_FINISH, BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY. They can be replaced with RERAISE and WITH_EXCEPT_FINISH. See https://bugs.python.org/issue32949 for more details of the new bytecodes and how they are used in the 'with' statement. The try-finally statement can be implemented broadly as SETUP_FINALLY except try-body POP_BLOCK finally-body JUMP exit except: finally-body exit: ---------- components: Interpreter Core messages: 315905 nosy: Mark.Shannon priority: normal severity: normal status: open title: Simplify bytecodes for try-finally, try-except and with blocks. versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:30:40 2018 From: report at bugs.python.org (Mark Shannon) Date: Sun, 29 Apr 2018 18:30:40 +0000 Subject: [issue33387] Simplify bytecodes for try-finally, try-except and with blocks. In-Reply-To: <1525026522.22.0.682650639539.issue33387@psf.upfronthosting.co.za> Message-ID: <1525026640.0.0.682650639539.issue33387@psf.upfronthosting.co.za> Mark Shannon added the comment: The six complex bytecodes currently used for implementing 'with' and 'try' statements can be replaced with just two simpler bytecodes. The six bytecodes are WITH_CLEANUP_START, WITH_CLEANUP_FINISH, BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY. They can be replaced with RERAISE and WITH_EXCEPT_FINISH. See https://bugs.python.org/issue32949 for more details of the new bytecodes and how they are used in the 'with' statement. The try-finally statement can be implemented broadly as SETUP_FINALLY except try-body POP_BLOCK finally-body JUMP exit except: finally-body exit: ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:31:10 2018 From: report at bugs.python.org (Mark Shannon) Date: Sun, 29 Apr 2018 18:31:10 +0000 Subject: [issue33387] Simplify bytecodes for try-finally, try-except and with blocks. In-Reply-To: <1525026522.22.0.682650639539.issue33387@psf.upfronthosting.co.za> Message-ID: <1525026670.91.0.682650639539.issue33387@psf.upfronthosting.co.za> Change by Mark Shannon : ---------- Removed message: https://bugs.python.org/msg315906 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:36:03 2018 From: report at bugs.python.org (Mark Shannon) Date: Sun, 29 Apr 2018 18:36:03 +0000 Subject: [issue33387] Simplify bytecodes for try-finally, try-except and with blocks. In-Reply-To: <1525026522.22.0.682650639539.issue33387@psf.upfronthosting.co.za> Message-ID: <1525026963.9.0.682650639539.issue33387@psf.upfronthosting.co.za> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +6337 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:39:48 2018 From: report at bugs.python.org (Mark Shannon) Date: Sun, 29 Apr 2018 18:39:48 +0000 Subject: [issue33318] Move folding tuples of constants into compiler.c from peephole.c In-Reply-To: <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za> Message-ID: <1525027188.75.0.682650639539.issue33318@psf.upfronthosting.co.za> Change by Mark Shannon : ---------- pull_requests: +6338 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:40:00 2018 From: report at bugs.python.org (Mark Shannon) Date: Sun, 29 Apr 2018 18:40:00 +0000 Subject: [issue33318] Move folding tuples of constants into compiler.c from peephole.c In-Reply-To: <1524229041.8.0.682650639539.issue33318@psf.upfronthosting.co.za> Message-ID: <1525027200.89.0.682650639539.issue33318@psf.upfronthosting.co.za> Change by Mark Shannon : ---------- pull_requests: -6338 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:51:59 2018 From: report at bugs.python.org (Robert Bricheno) Date: Sun, 29 Apr 2018 18:51:59 +0000 Subject: [issue33388] Support PEP 566 metadata in dist.py Message-ID: <1525027919.12.0.682650639539.issue33388@psf.upfronthosting.co.za> New submission from Robert Bricheno : PEP 566 added the metadata fields 'Description-Content-Type' and 'Provides-Extra': https://www.python.org/dev/peps/pep-0566/ http://setuptools.readthedocs.io/en/latest/setuptools.html#metadata Currently dist.py in CPython distutils will warn if they are set, e.g.: `dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'` The warnings are emitted when using setuptools to build a wheel (say) if either of the fields are defined. They seem spurious (I can still build wheels even if I see this warning...). But they looked a bit scary to me as a new user. There are a few possible ways to fix this. Long-term they should be fully supported by distutils I suppose. In the short term, there are a few different ways to make these warnings go away. My preferred option would be to simply declare fields for these variables in dist.py (as per setuptools). By declaring these variables, the warnings are no longer displayed. long_description_content_type, at least, is being used in the wild since: pypa/sampleproject at 5be0970 ---------- components: Distutils messages: 315907 nosy: dstufft, eric.araujo, rbricheno priority: normal severity: normal status: open title: Support PEP 566 metadata in dist.py type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:54:45 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 29 Apr 2018 18:54:45 +0000 Subject: [issue33386] IDLE: Double clicking only recognizes ascii chars as identifiers In-Reply-To: <1525020391.31.0.682650639539.issue33386@psf.upfronthosting.co.za> Message-ID: <1525028085.42.0.682650639539.issue33386@psf.upfronthosting.co.za> Terry J. Reedy added the comment: #21474 has the solution, which I plan to apply today. ---------- keywords: +pep3121 resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Idle: updata fixwordbreaks() for unicode identifiers title: Double clicking to select an identifier in IDLE does not work with some unicode characters -> IDLE: Double clicking only recognizes ascii chars as identifiers versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:54:54 2018 From: report at bugs.python.org (Robert Bricheno) Date: Sun, 29 Apr 2018 18:54:54 +0000 Subject: [issue33388] Support PEP 566 metadata in dist.py In-Reply-To: <1525027919.12.0.682650639539.issue33388@psf.upfronthosting.co.za> Message-ID: <1525028094.0.0.682650639539.issue33388@psf.upfronthosting.co.za> Change by Robert Bricheno : ---------- keywords: +patch pull_requests: +6339 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 14:59:35 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 18:59:35 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1525028375.71.0.682650639539.issue33012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 55edd0c185ad2d895b5d73e47d67049bc156b654 by Serhiy Storchaka (Siddhesh Poyarekar) in branch 'master': bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030) https://github.com/python/cpython/commit/55edd0c185ad2d895b5d73e47d67049bc156b654 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 15:09:37 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 19:09:37 +0000 Subject: [issue32362] multiprocessing.connection.Connection misdocumented as multiprocessing.Connection In-Reply-To: <1513592247.3.0.213398074469.issue32362@psf.upfronthosting.co.za> Message-ID: <1525028977.54.0.682650639539.issue32362@psf.upfronthosting.co.za> miss-islington added the comment: New changeset cebce2e8d15db101435194f79be31b5d80455bb0 by Miss Islington (bot) in branch '3.7': bpo-32362: Fix references to non-existent multiprocessing.Connection() (GH-6223) https://github.com/python/cpython/commit/cebce2e8d15db101435194f79be31b5d80455bb0 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 15:10:15 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 19:10:15 +0000 Subject: [issue33256] module is not displayed by cgitb.html In-Reply-To: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> Message-ID: <1525029015.52.0.682650639539.issue33256@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 736f17fb8d8b105567d56317f9c0b4c577ce4105 by Miss Islington (bot) in branch '3.7': bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442) https://github.com/python/cpython/commit/736f17fb8d8b105567d56317f9c0b4c577ce4105 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 15:10:42 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 19:10:42 +0000 Subject: [issue33256] module is not displayed by cgitb.html In-Reply-To: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> Message-ID: <1525029042.45.0.682650639539.issue33256@psf.upfronthosting.co.za> miss-islington added the comment: New changeset ef91552cfb4b45f75b415dd43fb6a21795c8dbee by Miss Islington (bot) in branch '3.6': bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442) https://github.com/python/cpython/commit/ef91552cfb4b45f75b415dd43fb6a21795c8dbee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 15:11:03 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 19:11:03 +0000 Subject: [issue32362] multiprocessing.connection.Connection misdocumented as multiprocessing.Connection In-Reply-To: <1513592247.3.0.213398074469.issue32362@psf.upfronthosting.co.za> Message-ID: <1525029063.72.0.682650639539.issue32362@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 9a039d5679a5838c876ff607ce2f5d8dc0fb307a by Miss Islington (bot) in branch '3.6': bpo-32362: Fix references to non-existent multiprocessing.Connection() (GH-6223) https://github.com/python/cpython/commit/9a039d5679a5838c876ff607ce2f5d8dc0fb307a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 15:16:09 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Sun, 29 Apr 2018 19:16:09 +0000 Subject: [issue32608] Incompatibilities with the socketserver and multiprocessing packages In-Reply-To: <1516539327.3.0.467229070634.issue32608@psf.upfronthosting.co.za> Message-ID: <1525029369.75.0.682650639539.issue32608@psf.upfronthosting.co.za> Antoine Pitrou added the comment: Hi Michael, sorry, I haven't had a chance yet. I'll try to make some time soon, I hope you don't mind the delay :-S ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 15:16:33 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Apr 2018 19:16:33 +0000 Subject: [issue33330] Better error handling in PyImport_Cleanup() In-Reply-To: <1524387390.7.0.682650639539.issue33330@psf.upfronthosting.co.za> Message-ID: <1525029393.37.0.682650639539.issue33330@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset c1a6832f50b36ffec299e6e6038535904e2b158d by Serhiy Storchaka in branch 'master': bpo-33330: Write exceptions occurred in PyImport_Cleanup() to stderr. (GH-6606) https://github.com/python/cpython/commit/c1a6832f50b36ffec299e6e6038535904e2b158d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 15:25:54 2018 From: report at bugs.python.org (Benjamin Peterson) Date: Sun, 29 Apr 2018 19:25:54 +0000 Subject: [issue33374] generate-posix-vars failed when building Python 2.7.14 on Linux In-Reply-To: <1524843947.56.0.682650639539.issue33374@psf.upfronthosting.co.za> Message-ID: <1525029954.16.0.682650639539.issue33374@psf.upfronthosting.co.za> Benjamin Peterson added the comment: New changeset 0b91f8a668201fc58fa732b8acc496caedfdbae0 by Benjamin Peterson (Florian Weimer) in branch '2.7': Indicate that _PyGC_Head is only 8-byte aligned. (closes bpo-33374) https://github.com/python/cpython/commit/0b91f8a668201fc58fa732b8acc496caedfdbae0 ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 15:38:21 2018 From: report at bugs.python.org (Stefan Seefeld) Date: Sun, 29 Apr 2018 19:38:21 +0000 Subject: [issue33389] argparse redundant help string Message-ID: <1525030701.58.0.682650639539.issue33389@psf.upfronthosting.co.za> New submission from Stefan Seefeld : I'm using Python's `argparse` module to define optional arguments. I'm calling the `argparse.add_argument` method to add both short and long arguments, but I notice that the generated help message lists some information twice. For example: ``` argparse.add_argument('-s', '--service',...) ``` will generate ``` -s SERVICE, --service SERVICE ``` and when I add a `choices` argument, even the choices list is repeated. I think it would be more useful to suppress the repetition to produce output such as ``` -s|--service SERVICE ... ``` instead with both the meta var as well as choices etc. printed only once. ---------- components: Library (Lib) messages: 315917 nosy: stefan priority: normal severity: normal status: open title: argparse redundant help string type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 15:49:56 2018 From: report at bugs.python.org (fabrice salvaire) Date: Sun, 29 Apr 2018 19:49:56 +0000 Subject: [issue33390] matmul @ operator precedence Message-ID: <1525031396.69.0.682650639539.issue33390@psf.upfronthosting.co.za> New submission from fabrice salvaire : I use the new matmul @ operator to implement units, for example 1 at u_s for 1 second ( see alpha state implementation at https://github.com/FabriceSalvaire/PySpice/tree/master/PySpice/Unit ). It looks cool, but unfortunately 10 at u_s / 2 at u_s is actually interpreted as (10 at u_s / 2)@u_s instead of (10 at u_s) / (2 at u_s) due to operator precedence + <<< - <<< * <<< @ <<< / <<< // <<< % https://docs.python.org/3/reference/expressions.html#operator-precedence Since Python is widely used for scientific applications, would it be possible to investigate this topic ? ---------- components: Interpreter Core messages: 315918 nosy: FabriceSalvaire priority: normal severity: normal status: open title: matmul @ operator precedence type: behavior versions: Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 16:07:45 2018 From: report at bugs.python.org (Alfred Krohmer) Date: Sun, 29 Apr 2018 20:07:45 +0000 Subject: [issue32533] SSLSocket read/write thread-unsafety In-Reply-To: <1515678068.63.0.467229070634.issue32533@psf.upfronthosting.co.za> Message-ID: <1525032465.58.0.682650639539.issue32533@psf.upfronthosting.co.za> Alfred Krohmer added the comment: Is there anything on the roadmap to fix this? This is a pretty severe bug given that this breaks multi-threaded OpenSSL while the documentation says it's thread-safe. ---------- nosy: +devkid _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 16:17:33 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 29 Apr 2018 20:17:33 +0000 Subject: [issue21474] Idle: updata fixwordbreaks() for unicode identifiers In-Reply-To: <1399858064.02.0.148903090644.issue21474@psf.upfronthosting.co.za> Message-ID: <1525033053.0.0.682650639539.issue21474@psf.upfronthosting.co.za> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +6341 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 16:52:34 2018 From: report at bugs.python.org (Antony Lee) Date: Sun, 29 Apr 2018 20:52:34 +0000 Subject: [issue33197] Confusing error message when constructing invalid inspect.Parameters In-Reply-To: <1522566872.11.0.467229070634.issue33197@psf.upfronthosting.co.za> Message-ID: <1525035154.62.0.682650639539.issue33197@psf.upfronthosting.co.za> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 17:13:03 2018 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Apr 2018 21:13:03 +0000 Subject: [issue33378] Add Korean to the language switcher In-Reply-To: <1524941433.04.0.682650639539.issue33378@psf.upfronthosting.co.za> Message-ID: <1525036383.18.0.682650639539.issue33378@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6342 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 17:58:15 2018 From: report at bugs.python.org (Steve Dower) Date: Sun, 29 Apr 2018 21:58:15 +0000 Subject: [issue33351] Support compiling with clang-cl on Windows In-Reply-To: <1524631004.17.0.682650639539.issue33351@psf.upfronthosting.co.za> Message-ID: <1525039095.2.0.682650639539.issue33351@psf.upfronthosting.co.za> Steve Dower added the comment: Feel free to start creating patches so we can get an idea of what the changes would look like. Hopefully it's not that dramatic. Be very careful making performance claims without benchmarks to back it up, and ideally against multiple sets of hardware (MSVC is designed and tested to perform well across a range of processors, often by engineers who work for the manufacturer - intuition would suggest that an open source compiler is probably not 30% better all the time). Don't focus on the number right now, but do try to collect the justification before you expect or encourage others to do the work. Since the ABI is compatible, there should be no problem enabling extensions to be built using this compiler (assuming someone is willing to become a distutils maintainer, as there are currently none). You don't need to ask here to create a third-party library that enables this. I haven't heard any complaints about access to the compilers being an issue recently, so the only reasons to switch the interpreter itself would be source compatibility (essentially, the clang clib is better than our custom Win32 code) or performance. But we need a positive reason to switch support, not just the ability. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 18:03:08 2018 From: report at bugs.python.org (Steve Dower) Date: Sun, 29 Apr 2018 22:03:08 +0000 Subject: [issue32533] SSLSocket read/write thread-unsafety In-Reply-To: <1515678068.63.0.467229070634.issue32533@psf.upfronthosting.co.za> Message-ID: <1525039388.41.0.682650639539.issue32533@psf.upfronthosting.co.za> Steve Dower added the comment: We don't have a roadmap, just volunteers. When someone is sufficiently motivated to work on it, it will happen. (You're welcome to try and motivate people with reason, pleading, money and/or abuse, though I don't recommend the last one :) Money doesn't work either on many of us who are really just time-poor.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 18:54:58 2018 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 29 Apr 2018 22:54:58 +0000 Subject: [issue33390] matmul @ operator precedence In-Reply-To: <1525031396.69.0.682650639539.issue33390@psf.upfronthosting.co.za> Message-ID: <1525042498.68.0.682650639539.issue33390@psf.upfronthosting.co.za> Eric V. Smith added the comment: Operator precedence cannot change without breaking existing code. ---------- nosy: +eric.smith type: behavior -> enhancement versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 19:00:55 2018 From: report at bugs.python.org (bbayles) Date: Sun, 29 Apr 2018 23:00:55 +0000 Subject: [issue32362] multiprocessing.connection.Connection misdocumented as multiprocessing.Connection In-Reply-To: <1513592247.3.0.213398074469.issue32362@psf.upfronthosting.co.za> Message-ID: <1525042855.89.0.682650639539.issue32362@psf.upfronthosting.co.za> Change by bbayles : ---------- pull_requests: +6343 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 20:10:13 2018 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 30 Apr 2018 00:10:13 +0000 Subject: [issue33390] matmul @ operator precedence In-Reply-To: <1525031396.69.0.682650639539.issue33390@psf.upfronthosting.co.za> Message-ID: <1525047013.41.0.682650639539.issue33390@psf.upfronthosting.co.za> Steven D'Aprano added the comment: Precedence issues when dealing with units is unavoidable, I think. The units program on Linux/Unix has similar issues, and they write their own parser and choose their own precedence. https://www.gnu.org/software/units/manual/html_node/Operators.html As Eric says, we can't change the precedence of the @ operator easily, if at all. It would likely require at least one full release (3.8) with a warning, or a future import, and frankly if the numpy community is against it you'll have zero chance of it happening. (On the other hand, if they're in favour of it, you'll have a good chance.) If you still want to pursue this idea further, please take the idea to the numpy and/or Python-Ideas mailing lists for further discussion: https://www.scipy.org/scipylib/mailing-lists.html https://mail.python.org/mailman/listinfo/python-ideas but for now I'm going to set the issue to pending. ---------- nosy: +steven.daprano resolution: -> postponed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Apr 29 22:16:02 2018 From: report at bugs.python.org (Ethan Smith) Date: Mon, 30 Apr 2018 02:16:02 +0000 Subject: [issue33351] Support compiling with clang-cl on Windows In-Reply-To: <1524631004.17.0.682650639539.issue33351@psf.upfronthosting.co.za> Message-ID: <1525054562.6.0.682650639539.issue33351@psf.upfronthosting.co.za> Ethan Smith added the comment: > Feel free to start creating patches so we can get an idea of what the changes would look like. Hopefully it's not that dramatic. Okay, will do. I have a few smaller patches to start with. Clang-cl tries to be as compatible as possible with cl, so I don't expect drastic changes. I'm currently trying to figure out an include issue with timeval, but so far the patches have been few and small. > Be very careful making performance claims without benchmarks to back it up, and ideally against multiple sets of hardware (MSVC is designed and tested to perform well across a range of processors, often by engineers who work for the manufacturer - intuition would suggest that an open source compiler is probably not 30% better all the time). Don't focus on the number right now, but do try to collect the justification before you expect or encourage others to do the work. I did not mean to say it would make Python 30% faster in all cases, I meant "up to 30% faster". This number is based on benchmarks of CPython with and without computed goto, and my own experiments of benchmarks comparing CPython in the WSL, and native Windows CPython releases on x86_64. But your point is well taken, and I will of course benchmark Python compiled with clang-cl once I have a complete working version. > Since the ABI is compatible, there should be no problem enabling extensions to be built using this compiler (assuming someone is willing to become a distutils maintainer, as there are currently none). You don't need to ask here to create a third-party library that enables this. When you say "someone to become a distutils maintainer" you mean for clang-cl specifically? If that is the case, I'm happy to add support and commit to continuing to work on clang-cl support in distutils, as I expect to use it a fair amount. > I haven't heard any complaints about access to the compilers being an issue recently, so the only reasons to switch the interpreter itself would be source compatibility (essentially, the clang clib is better than our custom Win32 code) or performance. But we need a positive reason to switch support, not just the ability. I agree there should be a good reason to move away from the MSVC compiler. The decision to move can be re-evaluated when there is a good argument to warrant it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 02:12:24 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 30 Apr 2018 06:12:24 +0000 Subject: [issue33385] setdefault() with a single argument doesn't work for dbm.gdbm and dmb.ndbm objects In-Reply-To: <1525010431.96.0.682650639539.issue33385@psf.upfronthosting.co.za> Message-ID: <1525068744.54.0.682650639539.issue33385@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Option 2 seems perfectly reasonable here as a way of preventing bugs (working, correct code wouldn't be using the existing default of None). Option 1 is problematic because of the variance from Mutable Mapping, because breaking symmetry with get(), and because the change in behavior is implicit. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 02:20:20 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 30 Apr 2018 06:20:20 +0000 Subject: [issue33380] Update module attribute on namedtuple methods for introspection. In-Reply-To: <1524955212.89.0.682650639539.issue33380@psf.upfronthosting.co.za> Message-ID: <1525069220.06.0.682650639539.issue33380@psf.upfronthosting.co.za> Raymond Hettinger added the comment: Am not sure I can see any value in pushing the __module__ attribute down into the methods and think it is reasonable for them to report their origin as being in the collections module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 02:33:16 2018 From: report at bugs.python.org (pmpp) Date: Mon, 30 Apr 2018 06:33:16 +0000 Subject: [issue33380] Update module attribute on namedtuple methods for introspection. In-Reply-To: <1524955212.89.0.682650639539.issue33380@psf.upfronthosting.co.za> Message-ID: <1525069996.19.0.682650639539.issue33380@psf.upfronthosting.co.za> pmpp added the comment: I see that as a good fix, obviously Point definition belongs to __main__ in the sample, like would any other subclass defined there eg if "some" class is defined in awe.py module : >>> import awe >>> class my(awe.some):pass ... >>> my.__module__ '__main__' ---------- nosy: +pmpp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:06:38 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 30 Apr 2018 07:06:38 +0000 Subject: [issue21474] Idle: updata fixwordbreaks() for unicode identifiers In-Reply-To: <1399858064.02.0.148903090644.issue21474@psf.upfronthosting.co.za> Message-ID: <1525071997.99.0.682650639539.issue21474@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Now-closed duplicate #33386 reported that ?, 0x3bc, is not selected as part of identifiers when double clicking. This prompted some research. The 'Windows' style imitates the behavior of Command Prompt, which I presume is a carryover from DOS days. PowerShell stuck with it, but Notepad, Notepad++, Microsoft Word, Firefox, Thunderbird, and ??? have not. I think Tcl should have switched long ago. In any case, I will go with whatever the tcl re engine defines as word chars, the 'Motif' style', rather than attempt to write a giant re, which would have to change as characters are added. Do we still need this line in fixwordbreaks? tk.call('tcl_wordBreakAfter', 'a b', 0) # make sure word.tcl is loaded I will leave it until you say we don't. After patching, 'abc???def' ('0x3bc'*3) is selected as one word instead of word, nonword, word. 'abc+efg' is still selected in 3 pieces, instead of the 1 word seen by Command Prompt. ---------- keywords: -patch stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:08:04 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 30 Apr 2018 07:08:04 +0000 Subject: [issue21474] Idle: updata fixwordbreaks() for unicode identifiers In-Reply-To: <1399858064.02.0.148903090644.issue21474@psf.upfronthosting.co.za> Message-ID: <1525072084.52.0.682650639539.issue21474@psf.upfronthosting.co.za> Terry J. Reedy added the comment: New changeset 5ff3a161c8a6b525c5e5b3e36e9c43f5a95bda60 by Terry Jan Reedy in branch 'master': bpo-21474: Update IDLE word/identifier definition from ascii to unicode. (GH-6643) https://github.com/python/cpython/commit/5ff3a161c8a6b525c5e5b3e36e9c43f5a95bda60 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:08:33 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Apr 2018 07:08:33 +0000 Subject: [issue21474] Idle: updata fixwordbreaks() for unicode identifiers In-Reply-To: <1399858064.02.0.148903090644.issue21474@psf.upfronthosting.co.za> Message-ID: <1525072113.16.0.682650639539.issue21474@psf.upfronthosting.co.za> Change by miss-islington : ---------- keywords: +patch pull_requests: +6344 stage: commit review -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:09:13 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Apr 2018 07:09:13 +0000 Subject: [issue21474] Idle: updata fixwordbreaks() for unicode identifiers In-Reply-To: <1399858064.02.0.148903090644.issue21474@psf.upfronthosting.co.za> Message-ID: <1525072153.7.0.682650639539.issue21474@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6345 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:15:46 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Apr 2018 07:15:46 +0000 Subject: [issue21474] Idle: updata fixwordbreaks() for unicode identifiers In-Reply-To: <1399858064.02.0.148903090644.issue21474@psf.upfronthosting.co.za> Message-ID: <1525072546.78.0.682650639539.issue21474@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: > Do we still need this line in fixwordbreaks? Yes. Loading word.tcl sets tcl_wordchars and tcl_nonwordchars. We should ensure that word.tcl is loaded and these variables are set before we change them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:21:47 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Apr 2018 07:21:47 +0000 Subject: [issue33385] setdefault() with a single argument doesn't work for dbm.gdbm and dmb.ndbm objects In-Reply-To: <1525010431.96.0.682650639539.issue33385@psf.upfronthosting.co.za> Message-ID: <1525072907.12.0.682650639539.issue33385@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Thank you Raymond. I hesitated to make a choose. Ned, is it good to add a deprecation warning in setdefault() methods of the dbm classes when they called with a single argument in 3.7? Their current behavior (no-op or error) is not useful in any case. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:27:53 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Apr 2018 07:27:53 +0000 Subject: [issue21474] Idle: updata fixwordbreaks() for unicode identifiers In-Reply-To: <1399858064.02.0.148903090644.issue21474@psf.upfronthosting.co.za> Message-ID: <1525073273.13.0.682650639539.issue21474@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 887b5f8fc622267e1fd48862ea9d0dfd4a0abdc6 by Miss Islington (bot) in branch '3.7': bpo-21474: Update IDLE word/identifier definition from ascii to unicode. (GH-6643) https://github.com/python/cpython/commit/887b5f8fc622267e1fd48862ea9d0dfd4a0abdc6 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:35:53 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Apr 2018 07:35:53 +0000 Subject: [issue33256] module is not displayed by cgitb.html In-Reply-To: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> Message-ID: <1525073753.07.0.682650639539.issue33256@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6346 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:42:23 2018 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 30 Apr 2018 07:42:23 +0000 Subject: [issue33390] matmul @ operator precedence In-Reply-To: <1525031396.69.0.682650639539.issue33390@psf.upfronthosting.co.za> Message-ID: <1525074143.59.0.682650639539.issue33390@psf.upfronthosting.co.za> Mark Dickinson added the comment: [Steven] > please take the idea to the numpy and/or Python-Ideas mailing lists for further discussion: But please do read through the previous discussions before starting a new one! See the links in PEP 465, and particularly https://mail.scipy.org/pipermail/numpy-discussion/2014-March/069444.html ---------- nosy: +mark.dickinson status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:43:24 2018 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 30 Apr 2018 07:43:24 +0000 Subject: [issue33390] matmul @ operator precedence In-Reply-To: <1525031396.69.0.682650639539.issue33390@psf.upfronthosting.co.za> Message-ID: <1525074204.64.0.682650639539.issue33390@psf.upfronthosting.co.za> Mark Dickinson added the comment: Gah! Forgot that my post would reset this issue to open. I'm going to close here, since this would be a sufficiently big and unlikely change that it's not going to happen without a python-ideas/python-dev discussion. ---------- resolution: postponed -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:45:57 2018 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 30 Apr 2018 07:45:57 +0000 Subject: [issue21474] Idle: updata fixwordbreaks() for unicode identifiers In-Reply-To: <1399858064.02.0.148903090644.issue21474@psf.upfronthosting.co.za> Message-ID: <1525074357.83.0.682650639539.issue21474@psf.upfronthosting.co.za> Terry J. Reedy added the comment: Thank you for the help. My immediate goal for IDLE is to fix unicode problems, to the extent allowed by tk, before 3.7.0. ---------- keywords: -patch nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 03:48:23 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Apr 2018 07:48:23 +0000 Subject: [issue21474] Idle: updata fixwordbreaks() for unicode identifiers In-Reply-To: <1399858064.02.0.148903090644.issue21474@psf.upfronthosting.co.za> Message-ID: <1525074503.41.0.682650639539.issue21474@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 3d11630ff401cfcdf094cf039cb575332ecaea20 by Miss Islington (bot) in branch '3.6': bpo-21474: Update IDLE word/identifier definition from ascii to unicode. (GH-6643) https://github.com/python/cpython/commit/3d11630ff401cfcdf094cf039cb575332ecaea20 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 04:02:20 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Apr 2018 08:02:20 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1525075340.0.0.682650639539.issue33012@psf.upfronthosting.co.za> STINNER Victor added the comment: The commit 55edd0c185ad2d895b5d73e47d67049bc156b654 introduced a new warning: gcc -pthread -c -Wno-unused-result -Wsign-compare -g -Og -Wall -Wstrict-prototypes -O0 -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -fPIC -DPy_BUILD_CORE -o Objects/longobject.o Objects/longobject.c Objects/longobject.c:5359:5: warning: initialisation depuis un type pointeur incompatible [-Wincompatible-pointer-types] long_long, /*nb_int*/ ^~~~~~~~~ Objects/longobject.c:5359:5: note: (pr?s de l'initialisation de ??long_as_number.nb_int??) Objects/longobject.c:5376:5: warning: initialisation depuis un type pointeur incompatible [-Wincompatible-pointer-types] long_long, /* nb_index */ ^~~~~~~~~ Objects/longobject.c:5376:5: note: (pr?s de l'initialisation de ??long_as_number.nb_index??) It seems like a conversion to (unaryfunc) is needed when passing long_long as nb_int in long_as_number. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 04:07:23 2018 From: report at bugs.python.org (Siddhesh Poyarekar) Date: Mon, 30 Apr 2018 08:07:23 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1525075643.35.0.682650639539.issue33012@psf.upfronthosting.co.za> Siddhesh Poyarekar added the comment: Yeah, there are multiple such uses that need wrappers to actually fix for gcc8, which will be released this week. I think I'll have more time for some more patches in this vein this weekend. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 04:23:56 2018 From: report at bugs.python.org (Rahul Jha) Date: Mon, 30 Apr 2018 08:23:56 +0000 Subject: [issue33217] x in enum.Flag member is True when x is not a Flag In-Reply-To: <1522786572.96.0.467229070634.issue33217@psf.upfronthosting.co.za> Message-ID: <1525076636.03.0.682650639539.issue33217@psf.upfronthosting.co.za> Change by Rahul Jha : ---------- pull_requests: +6347 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 04:24:09 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Apr 2018 08:24:09 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1525076649.14.0.682650639539.issue33012@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- pull_requests: +6348 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 04:34:52 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Apr 2018 08:34:52 +0000 Subject: [issue33256] module is not displayed by cgitb.html In-Reply-To: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> Message-ID: <1525077292.79.0.682650639539.issue33256@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 07ad02f62cc336772e12e3fd837579952b03ca57 by Serhiy Storchaka in branch '2.7': [2.7] bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442). (GH-6650) https://github.com/python/cpython/commit/07ad02f62cc336772e12e3fd837579952b03ca57 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 04:35:18 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Apr 2018 08:35:18 +0000 Subject: [issue33256] module is not displayed by cgitb.html In-Reply-To: <1523361579.44.0.682650639539.issue33256@psf.upfronthosting.co.za> Message-ID: <1525077318.82.0.682650639539.issue33256@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 04:39:36 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Apr 2018 08:39:36 +0000 Subject: [issue33234] Improve list() pre-sizing for inputs with known lengths In-Reply-To: <1522964813.15.0.682650639539.issue33234@psf.upfronthosting.co.za> Message-ID: <1525077576.11.0.682650639539.issue33234@psf.upfronthosting.co.za> STINNER Victor added the comment: See also http://bugs.python.org/issue26814#msg264003 and bpo-26828. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 04:46:25 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Apr 2018 08:46:25 +0000 Subject: [issue33234] Improve list() pre-sizing for inputs with known lengths In-Reply-To: <1522964813.15.0.682650639539.issue33234@psf.upfronthosting.co.za> Message-ID: <1525077985.77.0.682650639539.issue33234@psf.upfronthosting.co.za> STINNER Victor added the comment: Should we shrink the list of the length hint was way too big? For example, if the length hint was 100 but the final list of only 10. Should we shrink in that case? I'm asking because it seems like Pablo's PR doesn't shrink the list in that case. I wasn't sure so I checked, del shrinks the list if needed: >>> x=list(range(1000)) >>> import sys >>> sys.getsizeof(x) 9112 >>> del x[1:] >>> sys.getsizeof(x) 96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 04:50:40 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Apr 2018 08:50:40 +0000 Subject: [issue33352] [EASY] Windows: test_regrtest fails on installed Python In-Reply-To: <1524663997.77.0.682650639539.issue33352@psf.upfronthosting.co.za> Message-ID: <1525078240.71.0.682650639539.issue33352@psf.upfronthosting.co.za> STINNER Victor added the comment: The fix is simple, skip the test if the script doesn't exist at: def test_pcbuild_rt(self): # PCbuild\rt.bat script = os.path.join(ROOT_DIR, r'PCbuild\rt.bat') ---------- keywords: +easy title: Windows: test_regrtest fails on installed Python -> [EASY] Windows: test_regrtest fails on installed Python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 05:09:52 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Apr 2018 09:09:52 +0000 Subject: [issue33385] setdefault() with a single argument doesn't work for dbm.gdbm and dmb.ndbm objects In-Reply-To: <1525010431.96.0.682650639539.issue33385@psf.upfronthosting.co.za> Message-ID: <1525079392.15.0.682650639539.issue33385@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Actually dbm.ndbm already implements option 1. Only dbm.gnu and dbm.dumb have non-working with a single argument setdefault(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 05:11:07 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Apr 2018 09:11:07 +0000 Subject: [issue33385] setdefault() with a single argument doesn't work for dbm.gnu and dmb.dumb objects In-Reply-To: <1525010431.96.0.682650639539.issue33385@psf.upfronthosting.co.za> Message-ID: <1525079467.9.0.682650639539.issue33385@psf.upfronthosting.co.za> Change by Serhiy Storchaka : ---------- title: setdefault() with a single argument doesn't work for dbm.gdbm and dmb.ndbm objects -> setdefault() with a single argument doesn't work for dbm.gnu and dmb.dumb objects _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 05:27:58 2018 From: report at bugs.python.org (lekma) Date: Mon, 30 Apr 2018 09:27:58 +0000 Subject: [issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule' In-Reply-To: <1514022429.41.0.213398074469.issue32414@psf.upfronthosting.co.za> Message-ID: <1525080478.56.0.682650639539.issue32414@psf.upfronthosting.co.za> lekma added the comment: thinking out loud here: maybe both behavior can be exposed, i.e. a PyCapsule_Import that would expect a valid import statement and a Py_GetCapsule that would behave more like getattr? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 05:42:42 2018 From: report at bugs.python.org (lekma) Date: Mon, 30 Apr 2018 09:42:42 +0000 Subject: [issue33391] leak in set_symmetric_difference? Message-ID: <1525081362.63.0.682650639539.issue33391@psf.upfronthosting.co.za> New submission from lekma : shouldn't otherset be decrefed before returning on error in set_symmetric_difference? if not, what am I missing? ---------- components: Interpreter Core files: setobject.c.diff keywords: patch messages: 315945 nosy: lekma priority: normal severity: normal status: open title: leak in set_symmetric_difference? versions: Python 3.8 Added file: https://bugs.python.org/file47557/setobject.c.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 06:22:26 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Apr 2018 10:22:26 +0000 Subject: [issue27645] Supporting native backup facility of SQLite In-Reply-To: <1469728098.24.0.732586701981.issue27645@psf.upfronthosting.co.za> Message-ID: <1525083746.84.0.682650639539.issue27645@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset ca405017d5e776a2e3d9291236e62d2e09489dd2 by Victor Stinner in branch 'master': bpo-27645, sqlite: Fix integer overflow on sleep (#6594) https://github.com/python/cpython/commit/ca405017d5e776a2e3d9291236e62d2e09489dd2 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 07:20:48 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Apr 2018 11:20:48 +0000 Subject: [issue33391] leak in set_symmetric_difference? In-Reply-To: <1525081362.63.0.682650639539.issue33391@psf.upfronthosting.co.za> Message-ID: <1525087248.47.0.682650639539.issue33391@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: Good catch! Do you mind to create a pull request on GitHub? ---------- nosy: +rhettinger, serhiy.storchaka type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 08:35:16 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Apr 2018 12:35:16 +0000 Subject: [issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS In-Reply-To: <1520335093.04.0.467229070634.issue33012@psf.upfronthosting.co.za> Message-ID: <1525091716.82.0.682650639539.issue33012@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 6405feecda6a5d5dd7a4240eb3054a2676ed29b1 by Serhiy Storchaka in branch 'master': bpo-33012: Fix invalid function casts for long_long. (GH-6652) https://github.com/python/cpython/commit/6405feecda6a5d5dd7a4240eb3054a2676ed29b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 09:17:33 2018 From: report at bugs.python.org (robbuckley) Date: Mon, 30 Apr 2018 13:17:33 +0000 Subject: [issue33392] pathlib .glob('*/') returns files as well as directories Message-ID: <1525094253.43.0.682650639539.issue33392@psf.upfronthosting.co.za> New submission from robbuckley : Path.cwd().glob('/*') seems to yield all files and folders in cwd, the same as .glob('*'). I believe that glob('*/') should yield only directories, and glob('*') all files and directories. this behaviour isnt documented one way or the other. But it would be consistent with glob.glob() console dump follows: Python 3.6.5 |Anaconda custom (64-bit)| (default, Mar 29 2018, 13:14:23) Type 'copyright', 'credits' or 'license' for more information IPython 6.3.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: import os In [2]: from pathlib import Path In [6]: import glob In [13]: list(p.glob('*/')) Out[13]: [PosixPath('/Users/robertbuckley/python-scripts/pathlib_bug/f1.txt'), PosixPath('/Users/robertbuckley/python-scripts/pathlib_bug/f3.txt'), PosixPath('/Users/robertbuckley/python-scripts/pathlib_bug/d1'), PosixPath('/Users/robertbuckley/python-scripts/pathlib_bug/f2.txt'), PosixPath('/Users/robertbuckley/python-scripts/pathlib_bug/d2')] In [14]: list(p.glob('*')) Out[14]: [PosixPath('/Users/robertbuckley/python-scripts/pathlib_bug/f1.txt'), PosixPath('/Users/robertbuckley/python-scripts/pathlib_bug/f3.txt'), PosixPath('/Users/robertbuckley/python-scripts/pathlib_bug/d1'), PosixPath('/Users/robertbuckley/python-scripts/pathlib_bug/f2.txt'), PosixPath('/Users/robertbuckley/python-scripts/pathlib_bug/d2')] In [15]: glob.glob(os.path.join(str(p), '*/')) Out[15]: ['/Users/robertbuckley/python-scripts/pathlib_bug/d1/', '/Users/robertbuckley/python-scripts/pathlib_bug/d2/'] In [16]: glob.glob(os.path.join(str(p), '*')) Out[16]: ['/Users/robertbuckley/python-scripts/pathlib_bug/f1.txt', '/Users/robertbuckley/python-scripts/pathlib_bug/f3.txt', '/Users/robertbuckley/python-scripts/pathlib_bug/d1', '/Users/robertbuckley/python-scripts/pathlib_bug/f2.txt', '/Users/robertbuckley/python-scripts/pathlib_bug/d2'] ---------- messages: 315949 nosy: robbuckley priority: normal severity: normal status: open title: pathlib .glob('*/') returns files as well as directories type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 09:23:20 2018 From: report at bugs.python.org (robbuckley) Date: Mon, 30 Apr 2018 13:23:20 +0000 Subject: [issue33392] pathlib .glob('*/') returns files as well as directories In-Reply-To: <1525094253.43.0.682650639539.issue33392@psf.upfronthosting.co.za> Message-ID: <1525094600.39.0.682650639539.issue33392@psf.upfronthosting.co.za> robbuckley added the comment: this is workaroundable via constructions like: list(x for x in p.glob('*/') if x.is_dir()) but I think there's value in behaving like glob.glob(), and keystroke avoidance for what must be a fairly common use case ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 09:40:25 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Apr 2018 13:40:25 +0000 Subject: [issue33391] leak in set_symmetric_difference? In-Reply-To: <1525081362.63.0.682650639539.issue33391@psf.upfronthosting.co.za> Message-ID: <1525095625.75.0.682650639539.issue33391@psf.upfronthosting.co.za> STINNER Victor added the comment: I don't think that an unit test is needed, and I failed to write such test :-) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 10:09:11 2018 From: report at bugs.python.org (Mark Shannon) Date: Mon, 30 Apr 2018 14:09:11 +0000 Subject: [issue31802] 'import posixpath' fails if 'os.path' has not be imported already. In-Reply-To: <1508233521.36.0.213398074469.issue31802@psf.upfronthosting.co.za> Message-ID: <1525097351.88.0.682650639539.issue31802@psf.upfronthosting.co.za> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 11:02:31 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Mon, 30 Apr 2018 15:02:31 +0000 Subject: [issue32797] Tracebacks from Cython modules no longer work In-Reply-To: <1518090924.55.0.467229070634.issue32797@psf.upfronthosting.co.za> Message-ID: <1525100551.9.0.682650639539.issue32797@psf.upfronthosting.co.za> Change by Jeroen Demeyer : ---------- keywords: +patch pull_requests: +6349 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 11:21:47 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Mon, 30 Apr 2018 15:21:47 +0000 Subject: [issue33352] [EASY] Windows: test_regrtest fails on installed Python In-Reply-To: <1524663997.77.0.682650639539.issue33352@psf.upfronthosting.co.za> Message-ID: <1525101707.89.0.682650639539.issue33352@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- keywords: +patch pull_requests: +6350 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 11:32:47 2018 From: report at bugs.python.org (Matthias Klose) Date: Mon, 30 Apr 2018 15:32:47 +0000 Subject: [issue33377] add new triplets for mips r6 and riscv variants In-Reply-To: <1524930346.47.0.682650639539.issue33377@psf.upfronthosting.co.za> Message-ID: <1525102367.85.0.682650639539.issue33377@psf.upfronthosting.co.za> Change by Matthias Klose : ---------- pull_requests: +6351 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 12:30:56 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Apr 2018 16:30:56 +0000 Subject: [issue33352] [EASY] Windows: test_regrtest fails on installed Python In-Reply-To: <1524663997.77.0.682650639539.issue33352@psf.upfronthosting.co.za> Message-ID: <1525105856.23.0.682650639539.issue33352@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset c3b7a6dfb9c7e69093c9fe78ab587e14743e5152 by Victor Stinner (Andr?s Delfino) in branch 'master': bpo-33352: Skip test_regrtest test if rt.bat does not exist (GH-6654) https://github.com/python/cpython/commit/c3b7a6dfb9c7e69093c9fe78ab587e14743e5152 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 12:33:01 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Apr 2018 16:33:01 +0000 Subject: [issue33352] [EASY] Windows: test_regrtest fails on installed Python In-Reply-To: <1524663997.77.0.682650639539.issue33352@psf.upfronthosting.co.za> Message-ID: <1525105981.0.0.682650639539.issue33352@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6352 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 13:09:20 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Mon, 30 Apr 2018 17:09:20 +0000 Subject: [issue32769] Add 'annotations' to the glossary In-Reply-To: <1518019777.95.0.467229070634.issue32769@psf.upfronthosting.co.za> Message-ID: <1525108160.66.0.682650639539.issue32769@psf.upfronthosting.co.za> Change by Andr?s Delfino : ---------- keywords: +patch pull_requests: +6353 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 13:10:36 2018 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Mon, 30 Apr 2018 17:10:36 +0000 Subject: [issue32769] Add 'annotations' to the glossary In-Reply-To: <1518019777.95.0.467229070634.issue32769@psf.upfronthosting.co.za> Message-ID: <1525108236.0.0.682650639539.issue32769@psf.upfronthosting.co.za> Andr?s Delfino added the comment: I just made a PR to start working on the right wording. ---------- nosy: +adelfino _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 13:14:44 2018 From: report at bugs.python.org (Matthias Klose) Date: Mon, 30 Apr 2018 17:14:44 +0000 Subject: [issue33393] update config.guess and config.sub Message-ID: <1525108484.46.0.682650639539.issue33393@psf.upfronthosting.co.za> New submission from Matthias Klose : update config.guess and config.sub from http://git.savannah.gnu.org/ ---------- assignee: doko components: Build messages: 315954 nosy: doko priority: normal severity: normal status: open title: update config.guess and config.sub versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 13:22:19 2018 From: report at bugs.python.org (Matthias Klose) Date: Mon, 30 Apr 2018 17:22:19 +0000 Subject: [issue33377] add new triplets for mips r6 and riscv variants In-Reply-To: <1524930346.47.0.682650639539.issue33377@psf.upfronthosting.co.za> Message-ID: <1525108939.37.0.682650639539.issue33377@psf.upfronthosting.co.za> Matthias Klose added the comment: New changeset ddbe976964933cb943c6383a776e800cc7e0f47d by Matthias Klose in branch 'master': bpo-33377: add triplets for mips-r6 and riscv (#6655) https://github.com/python/cpython/commit/ddbe976964933cb943c6383a776e800cc7e0f47d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 13:23:35 2018 From: report at bugs.python.org (Matthias Klose) Date: Mon, 30 Apr 2018 17:23:35 +0000 Subject: [issue33393] update config.guess and config.sub In-Reply-To: <1525108484.46.0.682650639539.issue33393@psf.upfronthosting.co.za> Message-ID: <1525109015.08.0.682650639539.issue33393@psf.upfronthosting.co.za> Change by Matthias Klose : ---------- keywords: +patch pull_requests: +6354 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 13:29:31 2018 From: report at bugs.python.org (Matthias Klose) Date: Mon, 30 Apr 2018 17:29:31 +0000 Subject: [issue33394] the build of the shared modules is quiet/non-visible when GNU make gets passed macros Message-ID: <1525109371.22.0.682650639539.issue33394@psf.upfronthosting.co.za> New submission from Matthias Klose : the build of the shared modules is quiet/non-visible when GNU make gets passed macros. This is was introduced by the change to support BSD make. GNU make adds all make macros passed on the command line to MAKEFLAGS. If one of these macros contains -s, the build of the extensions get quiet. Also print out how setup.py is called. ---------- components: Build files: verbose.diff keywords: patch messages: 315956 nosy: doko priority: normal severity: normal status: open title: the build of the shared modules is quiet/non-visible when GNU make gets passed macros Added file: https://bugs.python.org/file47558/verbose.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 13:39:55 2018 From: report at bugs.python.org (Matthias Klose) Date: Mon, 30 Apr 2018 17:39:55 +0000 Subject: [issue33394] the build of the shared modules is quiet/non-visible when GNU make gets passed macros In-Reply-To: <1525109371.22.0.682650639539.issue33394@psf.upfronthosting.co.za> Message-ID: <1525109995.85.0.682650639539.issue33394@psf.upfronthosting.co.za> Change by Matthias Klose : ---------- pull_requests: +6355 stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 13:42:09 2018 From: report at bugs.python.org (Paul Moore) Date: Mon, 30 Apr 2018 17:42:09 +0000 Subject: [issue32797] Tracebacks from Cython modules no longer work In-Reply-To: <1518090924.55.0.467229070634.issue32797@psf.upfronthosting.co.za> Message-ID: <1525110129.96.0.682650639539.issue32797@psf.upfronthosting.co.za> Paul Moore added the comment: As I noted on python-ideas, continuing to search along sys.path if the loader returns None seems to match what the linecache docs say. If the issue had been phrased as "the implementation of linecache doesn't follow the docs" then I'd say fine, that's a reasonable report of something that we should fix. But Erik's points are valid - the fact that the documentation describes a certain behaviour doesn't mean that it can't be wrong - and the fact that no-one else has flagged up the discrepancy before now implies that it's a relatively rare case. IMO, debating whether a None return means there's absolutely no chance of there being source is silly - the best the loader can say is that it can't provide source. But that doesn't prove anything. On the other hand, what is Cython source code even doing on sys.path? The whole discussion here seems to be based on the premise that extension modules (machine code) will be shipped with source code that will get installed alongside the binary. That's not the case for C extensions, but appears to be for Cython. I sort of understand the benefit, but it does seem to be a practice peculiar to one scenario, and I'm not sure the standard library should deal with it. (There's a performance cost to that path search, and I'm struggling to see how a Python programmer would benefit from access to the source code of a compiled extension anyway). So I think that *either* we should fix the docs to be clearer that the path search is only done if the loader is not present or returns None, *or* we should implement the path search when the loader returns None. But I don't see that there's a strong argument here yet for changing the code - after all, it appears that the current behaviour has been round since Python 3.3, so it's not exactly an urgent issue. And unless someone is arguing that the change get backported, Cython still needs to work around the issue for users of older Pythons. ---------- nosy: +paul.moore _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 14:07:17 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Apr 2018 18:07:17 +0000 Subject: [issue33377] add new triplets for mips r6 and riscv variants In-Reply-To: <1524930346.47.0.682650639539.issue33377@psf.upfronthosting.co.za> Message-ID: <1525111637.3.0.682650639539.issue33377@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6356 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 14:07:37 2018 From: report at bugs.python.org (Matthias Klose) Date: Mon, 30 Apr 2018 18:07:37 +0000 Subject: [issue33393] update config.guess and config.sub In-Reply-To: <1525108484.46.0.682650639539.issue33393@psf.upfronthosting.co.za> Message-ID: <1525111657.63.0.682650639539.issue33393@psf.upfronthosting.co.za> Matthias Klose added the comment: New changeset 7e3545c70cdecd86ffa8fcbffd79b4f78560679f by Matthias Klose in branch 'master': bpo-33393: Update config.guess and config.sub files (#6658) https://github.com/python/cpython/commit/7e3545c70cdecd86ffa8fcbffd79b4f78560679f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 14:10:55 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Apr 2018 18:10:55 +0000 Subject: [issue33393] update config.guess and config.sub In-Reply-To: <1525108484.46.0.682650639539.issue33393@psf.upfronthosting.co.za> Message-ID: <1525111855.69.0.682650639539.issue33393@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6357 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 14:31:54 2018 From: report at bugs.python.org (Brett Cannon) Date: Mon, 30 Apr 2018 18:31:54 +0000 Subject: [issue33254] Have importlib.resources.contents() return an interable instead of an iterator In-Reply-To: <1523320022.42.0.682650639539.issue33254@psf.upfronthosting.co.za> Message-ID: <1525113114.86.0.682650639539.issue33254@psf.upfronthosting.co.za> Brett Cannon added the comment: New changeset 3ab9365dca8438f89b2060cd3eebe00606133dc4 by Brett Cannon in branch 'master': bpo-33254: do not return an empty list when asking for the contents of a namespace package (GH-6467) https://github.com/python/cpython/commit/3ab9365dca8438f89b2060cd3eebe00606133dc4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 14:32:55 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Apr 2018 18:32:55 +0000 Subject: [issue33254] Have importlib.resources.contents() return an interable instead of an iterator In-Reply-To: <1523320022.42.0.682650639539.issue33254@psf.upfronthosting.co.za> Message-ID: <1525113175.38.0.682650639539.issue33254@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6358 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 14:34:56 2018 From: report at bugs.python.org (Brett Cannon) Date: Mon, 30 Apr 2018 18:34:56 +0000 Subject: [issue33375] warnings: get filename from frame.f_code.co_filename In-Reply-To: <1524847135.79.0.682650639539.issue33375@psf.upfronthosting.co.za> Message-ID: <1525113296.25.0.682650639539.issue33375@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 14:38:23 2018 From: report at bugs.python.org (Jeroen Demeyer) Date: Mon, 30 Apr 2018 18:38:23 +0000 Subject: [issue32797] Tracebacks from Cython modules no longer work In-Reply-To: <1518090924.55.0.467229070634.issue32797@psf.upfronthosting.co.za> Message-ID: <1525113503.73.0.682650639539.issue32797@psf.upfronthosting.co.za> Jeroen Demeyer added the comment: > IMO, debating whether a None return means there's absolutely no chance of there being source is silly - the best the loader can say is that it can't provide source. I don't think it is silly: if "None" means that the loader cannot provide the source, then it makes sense to continue looking for the source. If "None" means that there is certainly no source, then it does not make sense to continue looking. > On the other hand, what is Cython source code even doing on sys.path? It's specifically installed for tracebacks (and other debugging). In a way, it's no different from installing both .py and .pyc files. Nobody questions that, even though the .pyc files are sufficient. > I sort of understand the benefit, but it does seem to be a practice peculiar to one scenario Sure, it's particular but it's a real existing scenario. > and I'm not sure the standard library should deal with it. Depends what you mean with "deal with it". Basically, all that I'm asking for is at least one officially supported way to enable finding sources for extension modules. There are many possible ways to fix this, that's why I made this post to python-ideas. > I'm struggling to see how a Python programmer would benefit from access to the source code of a compiled extension anyway. Cython code looks very much like Python. Very likely, a Python programmer would understand the Cython code. Anyway, this is besides the point: even if it just benefits the author of the Cython code, it's already useful. > it's not exactly an urgent issue. I never proposed to make it a release blocker :-) It's not urgent but it should still be fixed. > Cython still needs to work around the issue for users of older Pythons. No. Older versions already work because there is no ExtensionFileLoader. The changes in Python 3.x(?) actually broke this. Certainly in Python 2.7, those tracebacks work fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 15:11:15 2018 From: report at bugs.python.org (Brett Cannon) Date: Mon, 30 Apr 2018 19:11:15 +0000 Subject: [issue33370] Addition of mypy cache to gitignore In-Reply-To: <1524785260.87.0.682650639539.issue33370@psf.upfronthosting.co.za> Message-ID: <1525115475.01.0.682650639539.issue33370@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 15:30:33 2018 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Apr 2018 19:30:33 +0000 Subject: [issue33254] Have importlib.resources.contents() return an interable instead of an iterator In-Reply-To: <1523320022.42.0.682650639539.issue33254@psf.upfronthosting.co.za> Message-ID: <1525116633.68.0.682650639539.issue33254@psf.upfronthosting.co.za> miss-islington added the comment: New changeset 2e5fa38c5aaf7630c55ce6dfb8f79df6b3b86076 by Miss Islington (bot) in branch '3.7': bpo-33254: do not return an empty list when asking for the contents of a namespace package (GH-6467) https://github.com/python/cpython/commit/2e5fa38c5aaf7630c55ce6dfb8f79df6b3b86076 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 15:44:12 2018 From: report at bugs.python.org (Brett Cannon) Date: Mon, 30 Apr 2018 19:44:12 +0000 Subject: [issue33254] Have importlib.resources.contents() return an interable instead of an iterator In-Reply-To: <1523320022.42.0.682650639539.issue33254@psf.upfronthosting.co.za> Message-ID: <1525117452.81.0.682650639539.issue33254@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 16:36:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Apr 2018 20:36:59 +0000 Subject: [issue33352] [EASY] Windows: test_regrtest fails on installed Python In-Reply-To: <1524663997.77.0.682650639539.issue33352@psf.upfronthosting.co.za> Message-ID: <1525120619.01.0.682650639539.issue33352@psf.upfronthosting.co.za> STINNER Victor added the comment: New changeset 8075868f19967f291f123f17962a453b38dec8d2 by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-33352: Skip test_regrtest test if rt.bat does not exist (GH-6654) (#6656) https://github.com/python/cpython/commit/8075868f19967f291f123f17962a453b38dec8d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 16:38:53 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Apr 2018 20:38:53 +0000 Subject: [issue33352] [EASY] Windows: test_regrtest fails on installed Python In-Reply-To: <1524663997.77.0.682650639539.issue33352@psf.upfronthosting.co.za> Message-ID: <1525120733.63.0.682650639539.issue33352@psf.upfronthosting.co.za> STINNER Victor added the comment: I'm not sure that Python 3.6. In case of doubt, I prefer to skip it. The bug has been fixed in Python 3.7 and master. Thanks Andr?s Delfino for your nice contribution! ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 16:38:59 2018 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Apr 2018 20:38:59 +0000 Subject: [issue33352] [EASY] Windows: test_regrtest fails on installed Python In-Reply-To: <1524663997.77.0.682650639539.issue33352@psf.upfronthosting.co.za> Message-ID: <1525120739.88.0.682650639539.issue33352@psf.upfronthosting.co.za> Change by STINNER Victor : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 16:39:51 2018 From: report at bugs.python.org (Siming Yuan) Date: Mon, 30 Apr 2018 20:39:51 +0000 Subject: [issue33395] TypeError: unhashable type: 'instancemethod' Message-ID: <1525120791.11.0.682650639539.issue33395@psf.upfronthosting.co.za> New submission from Siming Yuan : in Python 3.5 it the pprint.PrettyPrinter mechanism got an overhaul, relying on PrettyPrinter._dispatch dict-lookup based on obj.__repr__ type. This breaks any Cythonized 3rd party libraries that used to be pretty-printable in Python3.4. type(object).__repr__ since instancemethod_hash function has been commented out: https://github.com/python/cpython/blob/c30098c8c6014f3340a369a31df9c74bdbacc269/Objects/classobject.c#L569 oddly the behavior is different between Linux and Mac. The same object in Linux returns cyfunction, and is hashable, where as under the same CPython version in Mac, it returns instancemethod, rendering it unhashable. (based on Cython 0.27.3) note that this isn't exactly something related directly to the implementation of Cython. the old logic in Python <3.4 pprint was not pretty (pun not intended), but relied solely on type checking, where as the new implementation depends on hashing, which introduces this bug. ---------- messages: 315964 nosy: siming85 priority: normal severity: normal status: open title: TypeError: unhashable type: 'instancemethod' type: crash versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 16:51:43 2018 From: report at bugs.python.org (Paul Moore) Date: Mon, 30 Apr 2018 20:51:43 +0000 Subject: [issue32797] Tracebacks from Cython modules no longer work In-Reply-To: <1518090924.55.0.467229070634.issue32797@psf.upfronthosting.co.za> Message-ID: <1525121503.53.0.682650639539.issue32797@psf.upfronthosting.co.za> Paul Moore added the comment: >> IMO, debating whether a None return means there's absolutely no chance of >> there being source is silly - the best the loader can say is that it can't >> provide source. > > I don't think it is silly: if "None" means that the loader cannot provide the > source, then it makes sense to continue looking for the source. If "None" > means that there is certainly no source, then it does not make sense to > continue looking. It's silly to think that the loader can *ever* say that there's "certainly" no source, so debating whether None means that is silly. The only thing None could *possibly* mean is that the loader can't give you the source. No more, no less. >> On the other hand, what is Cython source code even doing on sys.path? > > It's specifically installed for tracebacks (and other debugging). In a way, > it's no different from installing both .py and .pyc files. Nobody questions > that, even though the .pyc files are sufficient. The key difference is that Python source only needs Python to compile it. We have Python source on sys.path and Python automatically compiles it to bytecode as needed. You can't put Cython source on sys.path and have the Python interpreter compile it for you. Basically, sys.path is for code that the Python interpreter can (compile and) run, and it's at least arguable that non-Python source doesn't belong on there. I'm not trying to *make* that argument, though. All *I* am trying to say is that it's not exactly surprising if stdlib code doesn't expect to find non-Python source on sys.path. >> I sort of understand the benefit, but it does seem to be a practice peculiar >> to one scenario > > Sure, it's particular but it's a real existing scenario. ... that hasn't worked since Python 3.3, but no-one has noticed or complained until now. >> and I'm not sure the standard library should deal with it. > > Depends what you mean with "deal with it". Basically, all that I'm asking for > is at least one officially supported way to enable finding sources for > extension modules. There are many possible ways to fix this, that's why I > made this post to python-ideas. But the standard library has no need to ever find source for extension modules (unless I'm unaware of some detail of the Cython/IPython specific situation). So there's no need for the stdlib to be involved - Cython could define a protocol for finding source code independently, and IPython (and anything else that wants to display the source of a Cython extension) could use it. >> I'm struggling to see how a Python programmer would benefit from access to >> the source code of a compiled extension anyway. > > Cython code looks very much like Python. Very likely, a Python programmer > would understand the Cython code. Anyway, this is besides the point: even if > it just benefits the author of the Cython code, it's already useful. Point taken. >> it's not exactly an urgent issue. > > I never proposed to make it a release blocker :-) It's not urgent but it > should still be fixed. Note that I haven't said it shouldn't be fixed, merely that I'm not as convinced, having read this discussion, that having linecache do a path search if the loader returns None is *necessarily* the best solution here. I do still feel that if we don't make that change, then the linecache docs should be clarified, but I wouldn't say the linecache docs on the whole module_globals argument are very clear in the first place - I certainly wouldn't know how to use that argument based on the current docs. I'm going to leave the call on whether your proposed change to linecache is OK to someone who understands (or has the time to review and confirm) the impact on the 4 places in the stdlib where it's called with a module_global parameter - asyncio.base_tasks, bdb (twice) and pdb. What I will say is that the code in the PR looks fine to me as an implementation of the proposed change. I'm strongly against introducing any extra complexity into the loader get_source function signature. I think it's fine as it is, and trying to add nuances to the meaning behind None will only make life harder for people implementing loaders. Ideally, of course, there would be a CythonExtensionLoader that handled this in get_source. But it's hard to see how such a thing would work as "Cython extensions" don't look any different from extensions built with C, or Rust, or anything else. >> Cython still needs to work around the issue for users of older Pythons. > > No. Older versions already work because there is no ExtensionFileLoader. The > changes in Python 3.x(?) actually broke this. Certainly in Python 2.7, those > tracebacks work fine. By "older Pythons" I meant 3.3+. ExtensionFileLoader was introduced in 3.3, so presumably this issue exists in all versions of Python from 3.3 onwards. I don't consider 2.7 relevant here, as the import machinery was completely different then. Of course, it's up to Cython whether they choose to care about handling this for Python 3.x users earlier than 3.8 (or earlier, if it's agreed that this should be backported). And I should note that I'd be less worried about the potential impact on existing code if this were being proposed solely for 3.8+. But the way you're talking here, I'm assuming that you're hoping for a backport. Please correct me if that assumption is wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 17:16:25 2018 From: report at bugs.python.org (Paul Goins) Date: Mon, 30 Apr 2018 21:16:25 +0000 Subject: [issue21822] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1525122985.39.0.682650639539.issue21822@psf.upfronthosting.co.za> Paul Goins added the comment: Focusing on the Windows case specifically... One way to possibly make this work (although perhaps not as clean as may be desired) would be to add polling logic into the thread_nt.h version of PyThread_acquire_lock_timed. That would have the benefit of avoiding the complexity of the various "non recursive mutex" implementations (i.e. semaphores vs "emulated" condition variables vs native condition variables) and may be less code than setting up "alertable" WaitForObjectSignleObjectEx calls (plus whatever else needs to be done for the SRW-lock-based code path). Thoughts or feedback? (I've not done any mainline Python commits yet so I'm totally ready to be completely wrong or misguided here.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 17:21:49 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 30 Apr 2018 21:21:49 +0000 Subject: [issue21822] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1525123309.28.0.682650639539.issue21822@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > One way to possibly make this work (although perhaps not as clean as may be desired) would be to add polling logic into the thread_nt.h version of PyThread_acquire_lock_timed. I think adding polling to such a widely-used primitive is out of question. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 17:32:42 2018 From: report at bugs.python.org (Paul Goins) Date: Mon, 30 Apr 2018 21:32:42 +0000 Subject: [issue21822] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1525123962.86.0.682650639539.issue21822@psf.upfronthosting.co.za> Paul Goins added the comment: > I think adding polling to such a widely-used primitive is out of question. I'm guessing this is because of the perceived performance impact? (That's the main thought I have against polling in this case.) Or is it something else? I can certainly look at tweaking the 3 mutex implementations I mentioned previously, but I do expect that will be a bit more code; I at least wanted to put the "simpler" idea out there. Fully knowing that "simpler" isn't necessarily better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 17:39:14 2018 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 30 Apr 2018 21:39:14 +0000 Subject: [issue21822] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1525124354.84.0.682650639539.issue21822@psf.upfronthosting.co.za> Antoine Pitrou added the comment: > I'm guessing this is because of the perceived performance impact? The problem is polling is pretty detrimental to power saving on modern CPUs. There might also be a performance impact that makes things worse :-) More generally, we really would like locks to be interruptible under Windows, as it would be useful in many more situations than joining threads. Unfortunately, as you have discovered we have several lock implementations for Windows right now. The SRWLock one is probably difficult to make interruptible, but it's never enabled by default. The Semaphore one looks legacy, so could perhaps be removed. Remains the condition variable-based implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 17:47:24 2018 From: report at bugs.python.org (Paul Goins) Date: Mon, 30 Apr 2018 21:47:24 +0000 Subject: [issue21822] KeyboardInterrupt during Thread.join hangs that Thread In-Reply-To: <1403365475.16.0.757881205569.issue21822@psf.upfronthosting.co.za> Message-ID: <1525124844.37.0.682650639539.issue21822@psf.upfronthosting.co.za> Paul Goins added the comment: Ahh, thanks for the explanation. I didn't think about that. Let's *not* do that then. :) I'll see if I can squeeze in some time to play with the alternatives. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 17:51:05 2018 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Apr 2018 21:51:05 +0000 Subject: [issue30465] FormattedValue expressions have wrong lineno and col_offset information In-Reply-To: <1495666417.53.0.222363680661.issue30465@psf.upfronthosting.co.za> Message-ID: <1525125065.25.0.682650639539.issue30465@psf.upfronthosting.co.za> ?ukasz Langa added the comment: New changeset fb7e7992beec7f76cc2db77ab6ce1e86446bfccf by ?ukasz Langa (Victor Stinner) in branch 'master': bpo-30465: Fix C downcast warning on Windows in ast.c (#6593) https://github.com/python/cpython/commit/fb7e7992beec7f76cc2db77ab6ce1e86446bfccf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 18:05:57 2018 From: report at bugs.python.org (Anthony Flury) Date: Mon, 30 Apr 2018 22:05:57 +0000 Subject: [issue33006] docstring of filter function is incorrect In-Reply-To: <1520300191.48.0.467229070634.issue33006@psf.upfronthosting.co.za> Message-ID: <1525125957.39.0.682650639539.issue33006@psf.upfronthosting.co.za> Anthony Flury added the comment: Strictly speaking the official Python2 reference document isn't a great example - for instance: ' If function is None, the identity function is assumed, that is, all elements of iterable that are false are removed.' Implies that items are removed from the iterable are removed, but they aren't; they are simply not included in the sequence that is returned. Does the documentation need to be fixed too ? ---------- nosy: +anthony-flury _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 18:22:04 2018 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 30 Apr 2018 22:22:04 +0000 Subject: [issue33234] Improve list() pre-sizing for inputs with known lengths In-Reply-To: <1522964813.15.0.682650639539.issue33234@psf.upfronthosting.co.za> Message-ID: <1525126924.61.0.682650639539.issue33234@psf.upfronthosting.co.za> Pablo Galindo Salgado added the comment: @serhiy.storchaka @rhettinger @vstinner Should we better make the pre-allocation if the length of the iterable is known (so we call PyObject_Length and not PyObject_LengthHint)? This will keep the logic simpler (so not shrinking if PyObject_LengthHint gives more than the real length) and it will not be as expensive as calling PyObject_LengthHint. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 19:03:51 2018 From: report at bugs.python.org (Pierre Thibault) Date: Mon, 30 Apr 2018 23:03:51 +0000 Subject: [issue33006] docstring of filter function is incorrect In-Reply-To: <1525125957.39.0.682650639539.issue33006@psf.upfronthosting.co.za> Message-ID: Pierre Thibault added the comment: I guess it does since it gives false information. 2018-04-30 18:05 GMT-04:00 Anthony Flury : > > Anthony Flury added the comment: > > Strictly speaking the official Python2 reference document isn't a great > example - for instance: > > ' If function is None, the identity function is assumed, that is, all > elements of iterable that are false are removed.' > > Implies that items are removed from the iterable are removed, but they > aren't; they are simply not included in the sequence that is returned. > > Does the documentation need to be fixed too ? > > ---------- > nosy: +anthony-flury > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 19:31:04 2018 From: report at bugs.python.org (R. David Murray) Date: Mon, 30 Apr 2018 23:31:04 +0000 Subject: [issue33395] TypeError: unhashable type: 'instancemethod' In-Reply-To: <1525120791.11.0.682650639539.issue33395@psf.upfronthosting.co.za> Message-ID: <1525131064.28.0.682650639539.issue33395@psf.upfronthosting.co.za> R. David Murray added the comment: The non-hashable case should be handled by a default function, I would think. It should be fairly straightforward to come up with a reproducer that does not involve cython, which I think would be the first step. ---------- nosy: +r.david.murray _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 19:44:36 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 30 Apr 2018 23:44:36 +0000 Subject: [issue25198] Idle: improve idle.html help viewer. In-Reply-To: <1442794067.12.0.0580996406415.issue25198@psf.upfronthosting.co.za> Message-ID: <1525131876.1.0.682650639539.issue25198@psf.upfronthosting.co.za> Change by Cheryl Sabella : ---------- pull_requests: +6359 stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 19:45:57 2018 From: report at bugs.python.org (Cheryl Sabella) Date: Mon, 30 Apr 2018 23:45:57 +0000 Subject: [issue25198] Idle: improve idle.html help viewer. In-Reply-To: <1442794067.12.0.0580996406415.issue25198@psf.upfronthosting.co.za> Message-ID: <1525131957.49.0.682650639539.issue25198@psf.upfronthosting.co.za> Cheryl Sabella added the comment: I've created PR6665 for the first bullet item. * Font size should initially reflect user's size choice. Possibly change with control-mousewheel. ---------- nosy: +csabella stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 20:50:31 2018 From: report at bugs.python.org (Brett Cannon) Date: Tue, 01 May 2018 00:50:31 +0000 Subject: [issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule' In-Reply-To: <1514022429.41.0.213398074469.issue32414@psf.upfronthosting.co.za> Message-ID: <1525135831.55.0.682650639539.issue32414@psf.upfronthosting.co.za> Change by Brett Cannon : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 21:53:28 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 01 May 2018 01:53:28 +0000 Subject: [issue33380] Update module attribute on namedtuple methods for introspection. In-Reply-To: <1524955212.89.0.682650639539.issue33380@psf.upfronthosting.co.za> Message-ID: <1525139608.34.0.682650639539.issue33380@psf.upfronthosting.co.za> Raymond Hettinger added the comment: ISTM collections is the correct module reference because that is where the code is actually defined. A debugging tool should look there instead of in the calling code. This is the way other tools work in Python as well: >>> from collections.abc import Set >>> class S(Set): def __init__(self): pass def __iter__(self): yield 0 def __len__(self): return 0 def __contains__(self, key): return False >>> S.__or__.__module__ 'collections.abc' >>> from dataclasses import make_dataclass >>> P = make_dataclass('P', ['x', 'y']) >>> P.__repr__.__module__ 'dataclasses' Likewise, the various tools that use closures used to report the module where the closure was defined rather than the module of the caller's code (see functools.cmp_to_key or functools.lru_cache). I say "used to" because the pure Python code is now supplanted by C equivalents where the __module__ attribute__ is appropriately set to None: # Running from PyPy >>>> from functools import cmp_to_key >>>> c = cmp_to_key(lambda x, y: 0) >>>> c.__init__.__module__ '_functools' The Data Model section of the Language Reference defines __module__ as follows, "__module__: The name of the module the function was defined in, or None if unavailable." In the prior version of namedtuple(), the function was defined in a virtual module (an execed string). Now, that the methods are defined in a real module, the __module__ attribute should name that real module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 21:57:38 2018 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 01 May 2018 01:57:38 +0000 Subject: [issue33391] leak in set_symmetric_difference? In-Reply-To: <1525081362.63.0.682650639539.issue33391@psf.upfronthosting.co.za> Message-ID: <1525139858.71.0.682650639539.issue33391@psf.upfronthosting.co.za> Change by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 22:23:55 2018 From: report at bugs.python.org (Allan Feldman) Date: Tue, 01 May 2018 02:23:55 +0000 Subject: [issue33380] Update module attribute on namedtuple methods for introspection. In-Reply-To: <1524955212.89.0.682650639539.issue33380@psf.upfronthosting.co.za> Message-ID: <1525141435.54.0.682650639539.issue33380@psf.upfronthosting.co.za> Allan Feldman added the comment: That explanation makes sense to me. Thanks for taking the time to look into this! ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 23:17:25 2018 From: report at bugs.python.org (Siming Yuan) Date: Tue, 01 May 2018 03:17:25 +0000 Subject: [issue33395] TypeError: unhashable type: 'instancemethod' In-Reply-To: <1525120791.11.0.682650639539.issue33395@psf.upfronthosting.co.za> Message-ID: <1525144645.22.0.682650639539.issue33395@psf.upfronthosting.co.za> Siming Yuan added the comment: having a tough time trying to reproduce this issue in pure python. any clue as to how to create a __repr__ that's unhashable? class UnhashableRepr(dict): __repr__ = _testcapi.instancemethod(dict.__repr__) doesn't work because that turns into a which becomes hashable. i'd love to provide a patch, seems trivial to fix, but wouldn't want to do so without some tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 23:47:01 2018 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 May 2018 03:47:01 +0000 Subject: [issue31908] trace module cli does not write cover files In-Reply-To: <1509418506.94.0.213398074469.issue31908@psf.upfronthosting.co.za> Message-ID: <1525146421.96.0.682650639539.issue31908@psf.upfronthosting.co.za> Serhiy Storchaka added the comment: New changeset 47ab15470d72367694d7758004067313ae022f0e by Serhiy Storchaka (Michael Selik) in branch 'master': bpo-31908: Fix output of cover files for trace module command-line tool. (GH-4205) https://github.com/python/cpython/commit/47ab15470d72367694d7758004067313ae022f0e ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 23:48:09 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 01 May 2018 03:48:09 +0000 Subject: [issue31908] trace module cli does not write cover files In-Reply-To: <1509418506.94.0.213398074469.issue31908@psf.upfronthosting.co.za> Message-ID: <1525146489.53.0.682650639539.issue31908@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6360 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Apr 30 23:49:02 2018 From: report at bugs.python.org (miss-islington) Date: Tue, 01 May 2018 03:49:02 +0000 Subject: [issue31908] trace module cli does not write cover files In-Reply-To: <1509418506.94.0.213398074469.issue31908@psf.upfronthosting.co.za> Message-ID: <1525146542.36.0.682650639539.issue31908@psf.upfronthosting.co.za> Change by miss-islington : ---------- pull_requests: +6361 _______________________________________ Python tracker _______________________________________