From report at bugs.python.org Thu Oct 1 00:50:47 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 04:50:47 +0000 Subject: [issue41870] Use PEP 590 vectorcall to speed up calls to bool() In-Reply-To: <1601212858.37.0.301484827373.issue41870@roundup.psfhosted.org> Message-ID: <1601527847.93.0.380624843044.issue41870@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset fa7ce080175f65d678a7d5756c94f82887fc9803 by Dong-hee Na in branch 'master': bpo-41870: Avoid the test when nargs=0 (GH-22462) https://github.com/python/cpython/commit/fa7ce080175f65d678a7d5756c94f82887fc9803 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 00:52:35 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 04:52:35 +0000 Subject: [issue41870] Use PEP 590 vectorcall to speed up calls to bool() In-Reply-To: <1601212858.37.0.301484827373.issue41870@roundup.psfhosted.org> Message-ID: <1601527955.75.0.0913711071097.issue41870@roundup.psfhosted.org> Dong-hee Na added the comment: Now the suggestion is applied! Thank you Pablo and Victor!!! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 01:51:43 2020 From: report at bugs.python.org (Patricia Timmers) Date: Thu, 01 Oct 2020 05:51:43 +0000 Subject: [issue41859] Uncaught ValueError In-Reply-To: <1601007125.39.0.397372093674.issue41859@roundup.psfhosted.org> Message-ID: <1601531503.63.0.131740478309.issue41859@roundup.psfhosted.org> Patricia Timmers added the comment: JRequest Id: 74c342d8-c8af-46fe-a488-837736590d01 Correlation Id: 79fac27b-d04d-4597-9bfd-ee7624927c4e Timestamp: 2020-10-01T04:53:13Z Message: AADSTS750054: SAMLRequest or SAMLResponse must be present as query string parameters in HTTP request for SAML Redirect binding. ---------- nosy: +patanjalisutra666 Added file: https://bugs.python.org/file49480/debian-desktop.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 03:29:13 2020 From: report at bugs.python.org (DanilZ) Date: Thu, 01 Oct 2020 07:29:13 +0000 Subject: [issue37294] concurrent.futures.ProcessPoolExecutor state=finished raised error In-Reply-To: <1601511101.89.0.0203326077586.issue37294@roundup.psfhosted.org> Message-ID: <59581AED-C40A-4CE3-AAF9-C266523F75FF@me.com> DanilZ added the comment: . > On 1 Oct 2020, at 03:11, Kyle Stanley wrote: > > > Kyle Stanley added the comment: > > DanilZ, could you take a look at the superseding issue (https://bugs.python.org/issue37297) and see if your exception raised within the job is the same? > > If it's not, I would suggest opening a separate issue (and linking to it in a comment here), as I don't think it's necessarily related to this one. "state=finished raised error" doesn't indicate the specific exception that occurred. A good format for the name would be something along the lines of: > > "ProcessPoolExecutor.submit() while reading large object (4GB)" > > It'd also be helpful in the separate issue to paste the full exception stack trace, specify OS, and multiprocessing start method used (spawn, fork, or forkserver). This is necessary to know for replicating the issue on our end. > > In the meantime, I workaround I would suggest trying would be to use the *chunksize* parameter (or *Iterator*) in pandas.read_csv(), and split it across several jobs (at least 4+, more if you have additional cores) instead of within a single one. It'd also be generally helpful to see if that alleviates the problem, as it could possibly indicate an issue with running out of memory when the dataframe is converted to pickle format (which often increases the total size) within the process associated with the job. > > ---------- > nosy: +aeros > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 03:38:09 2020 From: report at bugs.python.org (DanilZ) Date: Thu, 01 Oct 2020 07:38:09 +0000 Subject: [issue37294] concurrent.futures.ProcessPoolExecutor state=finished raised error In-Reply-To: <1601511101.89.0.0203326077586.issue37294@roundup.psfhosted.org> Message-ID: <3B89D7EB-E61B-4AC2-B890-90B44C926B5A@me.com> DanilZ added the comment: I think you have correctly estimated the problem in the last part of your message: "as it could possibly indicate an issue with running out of memory when the dataframe is converted to pickle format (which often increases the total size) within the process associated with the job? The function pd.read_csv performs without any problems inside a process, the error appears only when I try to extract it from the finished process via: for f in concurrent.futures.as_completed(results): data = f.result() or data = results.result() It just does not pass a large file from the results object. I am sure that inside of a multiprocess everything works correctly for 2 reasons: 1. If I change in function inside a process to just save the file (that had been read in memory) to disk. 2. If I recuse the file size, then it gets extracted from results.result() without error. So I guess then that my question narrows down to: 1. Can I increase the memory allocated to a process? 2. Or at least understand what would is the limit. Regards, Danil > On 1 Oct 2020, at 03:11, Kyle Stanley wrote: > > > Kyle Stanley added the comment: > > DanilZ, could you take a look at the superseding issue (https://bugs.python.org/issue37297) and see if your exception raised within the job is the same? > > If it's not, I would suggest opening a separate issue (and linking to it in a comment here), as I don't think it's necessarily related to this one. "state=finished raised error" doesn't indicate the specific exception that occurred. A good format for the name would be something along the lines of: > > "ProcessPoolExecutor.submit() while reading large object (4GB)" > > It'd also be helpful in the separate issue to paste the full exception stack trace, specify OS, and multiprocessing start method used (spawn, fork, or forkserver). This is necessary to know for replicating the issue on our end. > > In the meantime, I workaround I would suggest trying would be to use the *chunksize* parameter (or *Iterator*) in pandas.read_csv(), and split it across several jobs (at least 4+, more if you have additional cores) instead of within a single one. It'd also be generally helpful to see if that alleviates the problem, as it could possibly indicate an issue with running out of memory when the dataframe is converted to pickle format (which often increases the total size) within the process associated with the job. > > ---------- > nosy: +aeros > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 04:00:16 2020 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 01 Oct 2020 08:00:16 +0000 Subject: [issue41899] Poor example for Element.remove() In-Reply-To: <1601510915.6.0.455772572055.issue41899@roundup.psfhosted.org> Message-ID: <1601539216.68.0.926634705735.issue41899@roundup.psfhosted.org> Stefan Behnel added the comment: Closing as duplicate of issue 41891. Let's keep the discussion there. ---------- nosy: +scoder resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 04:02:07 2020 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 01 Oct 2020 08:02:07 +0000 Subject: [issue41899] Poor example for Element.remove() In-Reply-To: <1601510915.6.0.455772572055.issue41899@roundup.psfhosted.org> Message-ID: <1601539327.87.0.594420622663.issue41899@roundup.psfhosted.org> Stefan Behnel added the comment: Closing as duplicate of issue 41892. Let's keep the discussion there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 04:01:41 2020 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 01 Oct 2020 08:01:41 +0000 Subject: [issue41899] Poor example for Element.remove() In-Reply-To: <1601510915.6.0.455772572055.issue41899@roundup.psfhosted.org> Message-ID: <1601539301.76.0.334885721611.issue41899@roundup.psfhosted.org> Change by Stefan Behnel : ---------- Removed message: https://bugs.python.org/msg377740 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 04:04:49 2020 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 01 Oct 2020 08:04:49 +0000 Subject: [issue31256] xml.etree.ElementTree: add support for doctype in tostring method In-Reply-To: <1503388868.57.0.0239596264981.issue31256@psf.upfronthosting.co.za> Message-ID: <1601539489.62.0.284797132073.issue31256@roundup.psfhosted.org> Stefan Behnel added the comment: Yes, it fixed already. Thanks! ---------- nosy: +scoder resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 04:09:31 2020 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 01 Oct 2020 08:09:31 +0000 Subject: [issue41900] XML C14N serialisation fails with default namespace Message-ID: <1601539771.76.0.649263421271.issue41900@roundup.psfhosted.org> New submission from Stefan Behnel : import xml.etree.ElementTree as ET xml=""" """ print(ET.canonicalize(xml)) Fails with: ValueError: Namespace "" is not declared in scope when trying to build the QName of the unnamespaced "targets" attribute. Originally reported for lxml here: https://bugs.launchpad.net/lxml/+bug/1869455 ---------- components: XML messages: 377743 nosy: scoder priority: normal severity: normal stage: needs patch status: open title: XML C14N serialisation fails with default namespace type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 04:47:29 2020 From: report at bugs.python.org (Stefan Behnel) Date: Thu, 01 Oct 2020 08:47:29 +0000 Subject: [issue41900] XML C14N serialisation fails with default namespace In-Reply-To: <1601539771.76.0.649263421271.issue41900@roundup.psfhosted.org> Message-ID: <1601542049.29.0.387355702827.issue41900@roundup.psfhosted.org> Change by Stefan Behnel : ---------- keywords: +patch pull_requests: +21493 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22474 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 06:28:57 2020 From: report at bugs.python.org (E. Paine) Date: Thu, 01 Oct 2020 10:28:57 +0000 Subject: [issue41896] Moving index with wordstart expression includes non-alphanumberic and underline characters if word is tagged and iat the edge of a text widget In-Reply-To: <1601490490.12.0.958872838055.issue41896@roundup.psfhosted.org> Message-ID: <1601548137.53.0.617153537386.issue41896@roundup.psfhosted.org> Change by E. Paine : ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 06:45:43 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 10:45:43 +0000 Subject: [issue41871] Add PyList_Remove() in listobject.c In-Reply-To: <1601213406.91.0.754630281807.issue41871@roundup.psfhosted.org> Message-ID: <1601549143.68.0.476978985633.issue41871@roundup.psfhosted.org> STINNER Victor added the comment: > it is more convenient to just call the method Calling a Python method in Python is not convenient nor efficient. For example, PyObject_CallMethod() has to decode a name from UTF-8 and then needs a lookup into the type dictionary. The list.remove() raises a exception if the item is not found, whereas PyCodec_Unregister() does nothing if the codec search function is not found: the exception is ignored. It's also about correctness, looking for an item in a list can be tricky if the list size changes during the lookup, or Python can crash if it uses a borrowed reference whereas a list item is destroyed. There were tons of such bugs in the dict implementation. list.remove() doesn't look safe, but I would prefer to avoid having to fix the same bugs in copies of similar functions. If a public function is not justified, what about an internal function? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 07:23:56 2020 From: report at bugs.python.org (E. Paine) Date: Thu, 01 Oct 2020 11:23:56 +0000 Subject: [issue41896] Moving index with wordstart expression includes non-alphanumberic and underline characters if word is tagged and iat the edge of a text widget In-Reply-To: <1601490490.12.0.958872838055.issue41896@roundup.psfhosted.org> Message-ID: <1601551436.44.0.171595146698.issue41896@roundup.psfhosted.org> E. Paine added the comment: Thank you for reporting this issue, however it is ultimately a Tk issue as shown by running the attached script in wish. I assume the Tk version was updated in Python 3.6, though I don't know which platform you are on so don't know which of Ned or Steve to nosy to verify this theory (you can check yourself by calling `tkinter.test.support.get_tk_patchlevel()` in both 3.5 & 3.6). I am currently in the process of digging through the Tk source looking for the cause of the problem (so I can decide whether to report it to the Tk team - you can do so yourself if you prefer). This issue should be closed as third party, but I will link the Tk issue here if I decide to create one. ---------- Added file: https://bugs.python.org/file49481/wordstart with tag.tcl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 08:06:16 2020 From: report at bugs.python.org (Christian Leichsenring) Date: Thu, 01 Oct 2020 12:06:16 +0000 Subject: [issue22864] Add filter to multiprocessing.Pool In-Reply-To: <1415900127.9.0.960876191139.issue22864@psf.upfronthosting.co.za> Message-ID: <1601553976.36.0.716083151274.issue22864@roundup.psfhosted.org> Christian Leichsenring added the comment: The main point the OP didn't make is exactly the issue that Pool.map returns a list which is potentially very large given that multiprocessing is used to process large amounts of data. So IMHO either there should be the possibility to exclude elements from being saved in memory (i.e. Pool.filter) or Pool.map shouldn't return a list but just an iterable. ---------- nosy: +christian.leichsenring _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 08:07:50 2020 From: report at bugs.python.org (Marco Sulla) Date: Thu, 01 Oct 2020 12:07:50 +0000 Subject: [issue41901] Added some explaining to pickle errors. Message-ID: <1601554070.38.0.74604376475.issue41901@roundup.psfhosted.org> New submission from Marco Sulla : All pickle error messages in typeobject.c was a generic "cannot pickle 'type' object". Added some explaining for every individual error. ---------- components: Interpreter Core messages: 377747 nosy: Marco Sulla priority: normal pull_requests: 21494 severity: normal status: open title: Added some explaining to pickle errors. type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 08:34:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 12:34:14 +0000 Subject: [issue41804] test_epoll fails test_control_and_wait() randomly on aarch64 RHEL8 Refleaks 3.9 In-Reply-To: <1600360940.95.0.528440416873.issue41804@roundup.psfhosted.org> Message-ID: <1601555654.33.0.897264278805.issue41804@roundup.psfhosted.org> STINNER Victor added the comment: The test also fails on aarch64 RHEL7 Refleaks 3.x: https://buildbot.python.org/all/#/builders/131/builds/46 FAIL: test_control_and_wait (test.test_epoll.TestEPoll) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 08:36:08 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 12:36:08 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1601555768.3.0.957742507038.issue37224@roundup.psfhosted.org> STINNER Victor added the comment: The test still fails randomly: AMD64 Windows8.1 Refleaks 3.8 https://buildbot.python.org/all/#/builders/200/builds/48 test_subinterpreter failed twice on Refleaks which runs tests 6 times in a row. First run: 0:33:58 load avg: 4.78 [204/423/1] test__xxsubinterpreters failed -- running: test_multiprocessing_spawn (12 min 42 sec), test_io (7 min 28 sec), test_tarfile (39.2 sec) beginning 6 repetitions 123456 ...Exception in thread Thread-38: Traceback (most recent call last): File "D:\buildarea\3.8.ware-win81-release.refleak\build\lib\threading.py", line 932, in _bootstrap_inner self.run() File "D:\buildarea\3.8.ware-win81-release.refleak\build\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "D:\buildarea\3.8.ware-win81-release.refleak\build\lib\test\test__xxsubinterpreters.py", line 51, in run interpreters.run_string(interp, dedent(f""" RuntimeError: unrecognized interpreter ID 250 test test__xxsubinterpreters failed -- Traceback (most recent call last): File "D:\buildarea\3.8.ware-win81-release.refleak\build\lib\test\test__xxsubinterpreters.py", line 495, in test_subinterpreter self.assertTrue(interpreters.is_running(interp)) AssertionError: False is not true Second run: FAIL: test_subinterpreter (test.test__xxsubinterpreters.IsRunningTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.8.ware-win81-release.refleak\build\lib\test\test__xxsubinterpreters.py", line 495, in test_subinterpreter self.assertTrue(interpreters.is_running(interp)) AssertionError: False is not true ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 09:24:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 13:24:47 +0000 Subject: [issue41861] Convert sqlite3 to PEP 384 In-Reply-To: <1601036291.36.0.740279655223.issue41861@roundup.psfhosted.org> Message-ID: <1601558687.01.0.816258427069.issue41861@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9031bd4fa42dbb0f25aee9286154ad4bf60df3f8 by Erlend Egeberg Aasland in branch 'master': bpo-41861: Convert _sqlite3 RowType and StatementType to heap types (GH-22444) https://github.com/python/cpython/commit/9031bd4fa42dbb0f25aee9286154ad4bf60df3f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 09:26:40 2020 From: report at bugs.python.org (pyTama) Date: Thu, 01 Oct 2020 13:26:40 +0000 Subject: [issue41896] Moving index with wordstart expression includes non-alphanumberic and underline characters if word is tagged and iat the edge of a text widget In-Reply-To: <1601490490.12.0.958872838055.issue41896@roundup.psfhosted.org> Message-ID: <1601558800.81.0.188198505199.issue41896@roundup.psfhosted.org> pyTama added the comment: I'm running on windows. The patch level on python 3.6 is (8, 6, 6, 'final', 0), while on python 3.5 is (8, 6, 4, 'final', 0). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 09:34:41 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 01 Oct 2020 13:34:41 +0000 Subject: [issue41861] Convert sqlite3 to PEP 384 In-Reply-To: <1601036291.36.0.740279655223.issue41861@roundup.psfhosted.org> Message-ID: <1601559281.78.0.174890818199.issue41861@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +21495 pull_request: https://github.com/python/cpython/pull/22478 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 09:42:45 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 13:42:45 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 Message-ID: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> New submission from Dong-hee Na : if we declare range without setting step, we don't have to process divide operation. here is the benchmark result both setting step and without step, With my patch, there is no performance degrade with range.index when the step is not one and showing 19% enhancement when the step is the default value (1) . Mean +- std dev: [range_master] 1.11 us +- 0.01 us -> [range_opt] 896 ns +- 23 ns: 1.24x faster (-19%) Mean +- std dev: [range_step_master] 1.12 us +- 0.02 us -> [range_step_opt] 1.11 us +- 0.01 us: 1.01x faster (-1%) ---------- assignee: corona10 components: Interpreter Core files: bench_range_index.py messages: 377752 nosy: corona10, pablogsal, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Micro optimization for range.index if step is 1 type: performance versions: Python 3.10 Added file: https://bugs.python.org/file49482/bench_range_index.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 09:43:05 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 13:43:05 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601559785.6.0.0571362833829.issue41902@roundup.psfhosted.org> Change by Dong-hee Na : Added file: https://bugs.python.org/file49483/bench_range_step.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 09:49:07 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 13:49:07 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601560147.64.0.920083331903.issue41902@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +21496 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22479 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 09:49:49 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 13:49:49 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601560189.52.0.124333479041.issue41902@roundup.psfhosted.org> Dong-hee Na added the comment: For optimization case, >>> a = range(0, 11111) >>> a.index(3) 3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 10:03:42 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 14:03:42 +0000 Subject: [issue41861] Convert sqlite3 to PEP 384 In-Reply-To: <1601036291.36.0.740279655223.issue41861@roundup.psfhosted.org> Message-ID: <1601561022.34.0.472754711797.issue41861@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 256e54acdbdb26745d4bbb5cf366454151e42773 by Erlend Egeberg Aasland in branch 'master': bpo-41861: Convert _sqlite3 CursorType and ConnectionType to heap types (GH-22478) https://github.com/python/cpython/commit/256e54acdbdb26745d4bbb5cf366454151e42773 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 10:55:35 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 14:55:35 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601564135.0.0.359677849173.issue41902@roundup.psfhosted.org> STINNER Victor added the comment: PR 22479 avoids calling PyNumber_FloorDivide(a, b) if b == 1 (if b == _PyLong_One): it makes range.index(a, 1) call 214 ns faster. I'm surprised that PyNumber_FloorDivide(a, 1) takes 214 ns. Does it spend most time in binary_op1()? Or PyNumber_FloorDivide()? long_div(a, 1) is quite simple: CHECK_BINOP(a, b); if (Py_ABS(Py_SIZE(a)) == 1 && Py_ABS(Py_SIZE(b)) == 1) { return fast_floor_div((PyLongObject*)a, (PyLongObject*)b); with: static PyObject * fast_floor_div(PyLongObject *a, PyLongObject *b) { sdigit left = a->ob_digit[0]; sdigit right = b->ob_digit[0]; sdigit div; if (Py_SIZE(a) == Py_SIZE(b)) { div = left / right; } else { div = -1 - (left - 1) / right; } return PyLong_FromLong(div); } Do we need another fast-path in long_div(a, b) when b == _PyLong_One? Just return a in this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 10:56:12 2020 From: report at bugs.python.org (WoodyWoo) Date: Thu, 01 Oct 2020 14:56:12 +0000 Subject: [issue41892] use both "for in" and "ElementTree.remove" has a index bug In-Reply-To: <1601475625.07.0.195514916094.issue41892@roundup.psfhosted.org> Message-ID: <1601564172.78.0.329069559868.issue41892@roundup.psfhosted.org> WoodyWoo added the comment: Could I say the mutable sequence containing not the object but the pointer like C++. So they can changed in def functions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:03:04 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 15:03:04 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601564584.37.0.299780958242.issue41902@roundup.psfhosted.org> Dong-hee Na added the comment: For practical use case >>> a = range(-2, 10) >>> a.index(2) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:08:15 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 01 Oct 2020 15:08:15 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1601564895.93.0.935293215897.issue1635741@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- nosy: +erlendaasland nosy_count: 17.0 -> 18.0 pull_requests: +21497 pull_request: https://github.com/python/cpython/pull/22478 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:10:02 2020 From: report at bugs.python.org (Simon Cross) Date: Thu, 01 Oct 2020 15:10:02 +0000 Subject: [issue41903] PyNumber_InPlacePower ignores o3 if o1 implements __ipow__ Message-ID: <1601565002.5.0.364385542307.issue41903@roundup.psfhosted.org> New submission from Simon Cross : The documentation for PyNumber_InPlacePower [1] reads: This is the equivalent of the Python statement o1 **= o2 when o3 is Py_None, or an in-place variant of pow(o1, o2, o3) otherwise. If o3 is to be ignored, pass Py_None in its place (passing NULL for o3 would cause an illegal memory access). However, if a class A implements __ipow__ then PyNumber_InPlacePower(o1, o2, o3) ALWAYS ignores o3 if o1 is an instance of A. This happens because if A implements __ipow__ then PyNumber_InPlacePower always calls the nb_inplace_power slot [2] and the slot always drops the third argument [3]. This appears to have always been the case in Python, so likely a small documentation patch is all that is required. If people agree, I will open a documentation pull request. [1] https://docs.python.org/3/c-api/number.html?highlight=pynumber_inplacepower#c.PyNumber_InPlacePower [2] https://github.com/python/cpython/blob/master/Objects/abstract.c#L1164 [3] https://github.com/python/cpython/blob/master/Objects/typeobject.c#L6631-L6636 ---------- components: C API messages: 377758 nosy: hodgestar priority: normal severity: normal status: open title: PyNumber_InPlacePower ignores o3 if o1 implements __ipow__ type: behavior versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:10:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 15:10:33 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601565033.15.0.942305418471.issue41902@roundup.psfhosted.org> STINNER Victor added the comment: About your benchmark, do you build Python with PGO+LTO optimizations? What is your OS and CPU? Do you use CPU isolation on Linux? It would be good to use PGO+LTO optimizations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:14:53 2020 From: report at bugs.python.org (Simon Cross) Date: Thu, 01 Oct 2020 15:14:53 +0000 Subject: [issue41903] PyNumber_InPlacePower ignores o3 if o1 implements __ipow__ In-Reply-To: <1601565002.5.0.364385542307.issue41903@roundup.psfhosted.org> Message-ID: <1601565293.01.0.809559094065.issue41903@roundup.psfhosted.org> Simon Cross added the comment: The documentation for __ipow__ [4] suggests that the intention was to support the modulus argument, so perhaps that argues for fixing the behaviour of PyNumber_InPlacePower. [4] https://docs.python.org/3/reference/datamodel.html#object.__ipow__ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:20:21 2020 From: report at bugs.python.org (Ammar Askar) Date: Thu, 01 Oct 2020 15:20:21 +0000 Subject: [issue41903] PyNumber_InPlacePower ignores o3 if o1 implements __ipow__ In-Reply-To: <1601565002.5.0.364385542307.issue41903@roundup.psfhosted.org> Message-ID: <1601565621.5.0.925243435419.issue41903@roundup.psfhosted.org> Ammar Askar added the comment: Huh, this is weird. I wonder why the data model provides the signature object.__ipow__(self, other[, modulo]) if the slot always seems to drop the third argument. Adding Brett to the nosy who found another issue around the special casing of pow/** recently. See also issue38302 ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:20:28 2020 From: report at bugs.python.org (Ammar Askar) Date: Thu, 01 Oct 2020 15:20:28 +0000 Subject: [issue41903] PyNumber_InPlacePower ignores o3 if o1 implements __ipow__ In-Reply-To: <1601565002.5.0.364385542307.issue41903@roundup.psfhosted.org> Message-ID: <1601565628.36.0.859486248368.issue41903@roundup.psfhosted.org> Change by Ammar Askar : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:25:42 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Oct 2020 15:25:42 +0000 Subject: [issue41901] Added some explaining to pickle errors. In-Reply-To: <1601554070.38.0.74604376475.issue41901@roundup.psfhosted.org> Message-ID: <1601565942.84.0.592951683976.issue41901@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was intentionally left a generic "cannot pickle 'type' object". Because there are many ways to make an object pickleable, and it is non-pickleable in all other cases. * "missing `__getstate__()` on variable-length object" It creates false impression that implementing __getstate__() is the only way to solve the problem. Actually you can make that object pickleable by: - implementing __reduce__() or __reduce_ex__() - implementing __getnewargs__() or __getnewargs_ex__() - implementing __getstate__() - make it a subclass of list or dict So more correct error message should contain "missing __reduce__(), __reduce_ex__(), __getnewargs__(), __getnewargs_ex__() and __getstate__() on variable-length object which is not a list or dict". And even this is not completely correct, because it has __reduce__() and __reduce_ex__() inherited from class object, but it is not enough. Completely correct error message can be hundreds characters long. And this still may be misleading error message, because the root cause is not that some object is not pickleable, but that you try to pickle an object which has an unexpected non-pickleable component. * "basic size greater than expected" Basic size is an implementation detail, and the end user can have no guess what is it. Actually it means that an object implemented in C likely has some inner state and the pickle module does not have access to it because the object does not implement __reduce__(), __reduce_ex__(), __getnewargs__(), __getnewargs_ex__() or __getstate__(). * "object has no `__new__()`" Every object has __new__ at Python level, even if its tp_new slot is NULL. tp_new is the C implementation detail and should not be mentioned in the error message. And the object without tp_new still can be pickleable, if it implements __reduce__() or __reduce_ex__(). It is all too complicated. It is better to omit details in error messages than provide not correct and direct user in wrong way. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:34:14 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 01 Oct 2020 15:34:14 +0000 Subject: [issue41892] use both "for in" and "ElementTree.remove" has a index bug In-Reply-To: <1601475625.07.0.195514916094.issue41892@roundup.psfhosted.org> Message-ID: <1601566454.06.0.427697921166.issue41892@roundup.psfhosted.org> Eric V. Smith added the comment: I can't say how ElementTree works without more checking, but this solution cannot work in general. Given a pointer to an object that's in a list, how would you get to the next item? Say the parent list-like object has a C array of pointers to the objects it contains, and removing one of the objects re-shuffles that list. How would keeping a pointer to the current object help you? In any event, I don't think this behavior is going to change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:20:24 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 15:20:24 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601565624.88.0.81511632755.issue41902@roundup.psfhosted.org> Dong-hee Na added the comment: > do you build Python with PGO+LTO optimizations Nope, but I will try to run the benchmark > What is your OS and CPU? Do you use CPU isolation on Linux? macOS, intel i9 with 8 cores ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:39:18 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 15:39:18 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601566758.03.0.203599888584.issue41902@roundup.psfhosted.org> Dong-hee Na added the comment: For the record with optimization Mean +- std dev: [range_master] 112 ns +- 3 ns -> [range_opt] 99.3 ns +- 1.8 ns: 1.13x faster (-12%) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:46:29 2020 From: report at bugs.python.org (Ammar Askar) Date: Thu, 01 Oct 2020 15:46:29 +0000 Subject: [issue41903] PyNumber_InPlacePower ignores o3 if o1 implements __ipow__ In-Reply-To: <1601565002.5.0.364385542307.issue41903@roundup.psfhosted.org> Message-ID: <1601567189.61.0.292893652018.issue41903@roundup.psfhosted.org> Ammar Askar added the comment: Also of note, there is actually no way to call `PyNumber_InPlacePower` from pure python from what I can tell. Even libraries like numpy don't implement the three-argument version of the nb_inplace_power slot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:48:52 2020 From: report at bugs.python.org (Ammar Askar) Date: Thu, 01 Oct 2020 15:48:52 +0000 Subject: [issue41903] PyNumber_InPlacePower ignores o3 if o1 implements __ipow__ In-Reply-To: <1601565002.5.0.364385542307.issue41903@roundup.psfhosted.org> Message-ID: <1601567332.1.0.676221940382.issue41903@roundup.psfhosted.org> Ammar Askar added the comment: Whoops, forgot the numpy link: https://github.com/numpy/numpy/blob/33e1dbee8d9e11a3e96efaae822ff6f3c44e3cef/numpy/core/src/multiarray/number.c#L729-L741 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:54:18 2020 From: report at bugs.python.org (Damian Yurzola) Date: Thu, 01 Oct 2020 15:54:18 +0000 Subject: [issue41904] datetime.datetime.today makes no sense and should be removed Message-ID: <1601567658.27.0.420109981563.issue41904@roundup.psfhosted.org> New submission from Damian Yurzola : Last night I discovered we have datetime.datetime.today alongside datetime.datetime.now and datetime.date.today. - datetime.now - date.today Both make semantic sense. datetime.datetime.today returns a datetime, which make no semantic sense and causes confusion. On further inspection of the code, this is due to the fact that datetime inherits from date. so datetime.today is practically an implementation of datetime.now minus the "tz". I think we should implement a datetime.today only to rise an AttributeError or some other way to stop people from using the wrong semantic mental model. We'd also need to remove the documentation entry: https://docs.python.org/3/library/datetime.html#datetime.datetime.today >From this inspection we also find that: datetime.hour/minute/second are unnecessarily redefined. lines Lib/datetime.py#L1606 to datetime.py#L1620 could be removed without any ill effect. date.today: https://github.com/python/cpython/blob/256e54acdbdb26745d4bbb5cf366454151e42773/Lib/datetime.py#L833 https://docs.python.org/3/library/datetime.html#datetime.datetime.today ---------- components: Library (Lib) messages: 377768 nosy: yurzo priority: normal severity: normal status: open title: datetime.datetime.today makes no sense and should be removed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:54:22 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 15:54:22 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601567662.74.0.715701079452.issue41902@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +21498 pull_request: https://github.com/python/cpython/pull/22480 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 11:54:52 2020 From: report at bugs.python.org (Ben Avrahami) Date: Thu, 01 Oct 2020 15:54:52 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods Message-ID: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> New submission from Ben Avrahami : python-ideas discussion: https://mail.python.org/archives/list/python-ideas at python.org/thread/6BNJ3YSEBPHEPGXSAZGBW3TJ64ZGZIHE/ In order to allow "decorator mixins" (most notably dataclass and total_ordering) to implement ABCs, new functionality is needed. I propose a new python function in `abc.py` called `update_abstractmethods`. The function will accept a class and, if the class is an instance of ABCMeta, will update the class's `__abstractmethods__` attribute to not include implemented attributes, and to include new abstractmethods (proposed implementation in thread). Both dataclass and total_ordering will be modified to call this function on the subject class before returning it, and 3rd-party libraries which implement mixin decorators (like attrs) will be to do the same. Also, the function can be used as a decorator individually, this is especially useful in cases where 3rd party decorators do not call the function. ---------- components: Library (Lib) messages: 377769 nosy: avrahami.ben priority: normal severity: normal status: open title: add update_abstractmethods function to update an ABC's abstract methods type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:03:05 2020 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 01 Oct 2020 16:03:05 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601568185.59.0.797955107452.issue41905@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:21:43 2020 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Oct 2020 16:21:43 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601569303.06.0.577250978276.issue41902@roundup.psfhosted.org> Dong-hee Na added the comment: PR 22479 and PR 22480 are different approaches. I (and Victor) want to check which approach might be better. PR 22480 would affect overall long division performance PR 22479 assumes that step=1 case is very often (e.g range(100), range(-100, 100)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:22:39 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 01 Oct 2020 16:22:39 +0000 Subject: [issue41904] datetime.datetime.today makes no sense and should be removed In-Reply-To: <1601567658.27.0.420109981563.issue41904@roundup.psfhosted.org> Message-ID: <1601569359.78.0.591823205606.issue41904@roundup.psfhosted.org> Steven D'Aprano added the comment: Even if I agreed that this method "makes no sense", and I don't, removing it would be gratuitous breakage. Why should we break potentially thousands of people's code who are happily using this method, merely because you say that people who use it have "the wrong semantic mental model"? Considered as a datetime, having `today` return the date and time *now* makes good sense to me. Obviously the date components must be today's date, not yesterday or tomorrow; and the time component could be any arbitrary time, with the current time an obvious choice. And since datetime inherits from date, it would be very odd if it didn't inherit the `today` method. It would also violate the Liskov Substitution Principle. But even if you disagree with my opinions, you still have to justify breaking backwards compatibility. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:22:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 16:22:44 +0000 Subject: [issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them In-Reply-To: <1579038882.16.0.589810918272.issue39337@roundup.psfhosted.org> Message-ID: <1601569364.79.0.392868243197.issue39337@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-37751 and my PR 17997. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:23:20 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 16:23:20 +0000 Subject: [issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them In-Reply-To: <1579038882.16.0.589810918272.issue39337@roundup.psfhosted.org> Message-ID: <1601569400.61.0.00609261923612.issue39337@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +21499 pull_request: https://github.com/python/cpython/pull/17997 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:26:44 2020 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 01 Oct 2020 16:26:44 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601569604.6.0.641123320205.issue41902@roundup.psfhosted.org> Mark Dickinson added the comment: > Do we need another fast-path in long_div(a, b) when b == _PyLong_One? Just return a in this case. I'd much prefer not. Every extra fast path check costs time for the general case, and there's no strong reason to expect people to be dividing by one. The range code seems like the right place for this optimization, not the long-divide code. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:30:18 2020 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 01 Oct 2020 16:30:18 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601569818.05.0.674184810173.issue26680@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 58a7da9e125422323f79c4ee95ac5549989d8162 by Robert Smallshire in branch 'master': bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121) https://github.com/python/cpython/commit/58a7da9e125422323f79c4ee95ac5549989d8162 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:31:55 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 16:31:55 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601569915.16.0.888413418947.issue41902@roundup.psfhosted.org> STINNER Victor added the comment: Mark: "I'd much prefer not. Every extra fast path check costs time for the general case, and there's no strong reason to expect people to be dividing by one. The range code seems like the right place for this optimization, not the long-divide code." In this case, I suggest to add a comment in long_div() to explain why there is no fast-path in long_div(). Otherwise, I am likely to suggest the exact same optimization in 6 months :-D I'm thinking at something similar to my comment in ceval.c: case TARGET(BINARY_ADD): { PyObject *right = POP(); PyObject *left = TOP(); PyObject *sum; /* NOTE(haypo): Please don't try to micro-optimize int+int on CPython using bytecode, it is simply worthless. See http://bugs.python.org/issue21955 and http://bugs.python.org/issue10044 for the discussion. In short, no patch shown any impact on a realistic benchmark, only a minor speedup on microbenchmarks. */ This comment is the outcome of 2 years of hard work by many developers :-D See bpo-21955. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:34:12 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 16:34:12 +0000 Subject: [issue21955] ceval.c: implement fast path for integers with a single digit In-Reply-To: <1405069827.92.0.324101531394.issue21955@psf.upfronthosting.co.za> Message-ID: <1601570052.41.0.484236749321.issue21955@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +21500 pull_request: https://github.com/python/cpython/pull/22481 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:37:28 2020 From: report at bugs.python.org (Damian Yurzola) Date: Thu, 01 Oct 2020 16:37:28 +0000 Subject: [issue41904] datetime.datetime.today makes no sense and should be removed In-Reply-To: <1601567658.27.0.420109981563.issue41904@roundup.psfhosted.org> Message-ID: <1601570248.43.0.143406560443.issue41904@roundup.psfhosted.org> Damian Yurzola added the comment: Thanks for your prompt answer Steven. I was inspired to file this bug after reading through a multiplicity of bugs introduced by folks confused by the library's behavior. So there's good precedent. While granted, the documentation is explicit and the inheritance chain substantiates it. There's nothing more explicit than the function/type names and saying datetime.today() brings, as you say, arbitrary time to the conversation. Which I claim, subjectively, that it should not. Gratuitous breakage, is debatable. It would not be the first or last. It could be a chance to remove a lot of code that works around potentially incorrect mental models. But since both points are to some extent subjective. I'm OK to have left this on the record and move on. What do you say about the unnecessarily redefined properties? Lines Lib/datetime.py#L1606 to datetime.py#L1620 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:57:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 16:57:44 +0000 Subject: [issue21955] ceval.c: implement fast path for integers with a single digit In-Reply-To: <1405069827.92.0.324101531394.issue21955@psf.upfronthosting.co.za> Message-ID: <1601571464.69.0.709066166451.issue21955@roundup.psfhosted.org> STINNER Victor added the comment: New changeset bd0a08ea90e4c7a2ebf29697937e9786d4d8e5ee by Victor Stinner in branch 'master': bpo-21955: Change my nickname in BINARY_ADD comment (GH-22481) https://github.com/python/cpython/commit/bd0a08ea90e4c7a2ebf29697937e9786d4d8e5ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 12:59:20 2020 From: report at bugs.python.org (Marco Sulla) Date: Thu, 01 Oct 2020 16:59:20 +0000 Subject: [issue41901] Added some explaining to pickle errors. In-Reply-To: <1601554070.38.0.74604376475.issue41901@roundup.psfhosted.org> Message-ID: <1601571560.01.0.221923447421.issue41901@roundup.psfhosted.org> Marco Sulla added the comment: I do not remember the problem I had, but when I experimented with frozendict I get one of these errors. I failed to understand the problem so I added the additional info. Maybe adding an assert in debug mode? It will be visible only to devs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 14:24:11 2020 From: report at bugs.python.org (Carl Bordum Hansen) Date: Thu, 01 Oct 2020 18:24:11 +0000 Subject: [issue29893] create_subprocess_exec doc doesn't match software In-Reply-To: <1490332817.83.0.92510042207.issue29893@psf.upfronthosting.co.za> Message-ID: <1601576651.61.0.144529526541.issue29893@roundup.psfhosted.org> Carl Bordum Hansen added the comment: This was fixed in https://github.com/python/cpython/pull/12598 ---------- nosy: +carlbordum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 14:38:14 2020 From: report at bugs.python.org (Carl Bordum Hansen) Date: Thu, 01 Oct 2020 18:38:14 +0000 Subject: [issue29127] Incorrect reference names in asyncio.subprocess documentation In-Reply-To: <1483238654.05.0.408550900872.issue29127@psf.upfronthosting.co.za> Message-ID: <1601577494.9.0.836836603307.issue29127@roundup.psfhosted.org> Carl Bordum Hansen added the comment: I do not think this is the case any longer ---------- nosy: +carlbordum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 15:37:51 2020 From: report at bugs.python.org (Erlend Egeberg Aasland) Date: Thu, 01 Oct 2020 19:37:51 +0000 Subject: [issue40956] Use Argument Clinic in sqlite3 In-Reply-To: <1591956335.72.0.553737405887.issue40956@roundup.psfhosted.org> Message-ID: <1601581071.03.0.59741994622.issue40956@roundup.psfhosted.org> Change by Erlend Egeberg Aasland : ---------- pull_requests: +21501 pull_request: https://github.com/python/cpython/pull/22484 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 16:58:01 2020 From: report at bugs.python.org (Roundup Robot) Date: Thu, 01 Oct 2020 20:58:01 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601585881.32.0.443585329749.issue41905@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +21502 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22485 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 17:16:16 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 21:16:16 +0000 Subject: [issue29893] create_subprocess_exec doc doesn't match software In-Reply-To: <1490332817.83.0.92510042207.issue29893@psf.upfronthosting.co.za> Message-ID: <1601586976.43.0.586633104326.issue29893@roundup.psfhosted.org> STINNER Victor added the comment: > This was fixed in https://github.com/python/cpython/pull/12598 Right, thanks. I close the issue. commit 1328375ad1c91f25a1500945a67b0ef36e387527 Author: Dima Tisnek Date: Fri Apr 5 23:02:28 2019 +0900 Fix doc for create_subprocess_exec (GH-12598) Add missing `program` argument to asyncio.create_subprocess_exec documentation. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 17:57:39 2020 From: report at bugs.python.org (Ben Avrahami) Date: Thu, 01 Oct 2020 21:57:39 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601589459.45.0.708209403316.issue41905@roundup.psfhosted.org> Ben Avrahami added the comment: for the functionality to work, `total_ordering` needs to change to also override abstract methods. I believe this is an OK change since total_ordering implicitly dictates that the comparison methods are interchangable. Thus, implementing some comparison operators, but leaving others unchanged is undesired behaviour. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 18:36:47 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 22:36:47 +0000 Subject: [issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10 In-Reply-To: <1572192430.43.0.755831692199.issue38605@roundup.psfhosted.org> Message-ID: <1601591807.24.0.889399034862.issue38605@roundup.psfhosted.org> STINNER Victor added the comment: > Issue 41314 changed the __future__ annotations default version to 3.10. 3.10.0a1 is scheduled for next Oct 5, less than 2 months from now. It would be good if PR 20434 were merged before that. Python 3.9.0 final is also around the corner. Any update on this issue? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 18:45:53 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 22:45:53 +0000 Subject: [issue41834] Remove _Py_CheckRecursionLimit variable In-Reply-To: <1600778367.51.0.464121227135.issue41834@roundup.psfhosted.org> Message-ID: <1601592353.41.0.430864457706.issue41834@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 18:58:56 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 22:58:56 +0000 Subject: [issue41692] Deprecate immortal interned strings: PyUnicode_InternImmortal() In-Reply-To: <1599055165.93.0.874786911809.issue41692@roundup.psfhosted.org> Message-ID: <1601593136.07.0.708325419323.issue41692@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +21503 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22486 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:00:06 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 23:00:06 +0000 Subject: [issue41692] Deprecate immortal interned strings: PyUnicode_InternImmortal() In-Reply-To: <1599055165.93.0.874786911809.issue41692@roundup.psfhosted.org> Message-ID: <1601593206.25.0.613140576811.issue41692@roundup.psfhosted.org> STINNER Victor added the comment: I proposed PR 22486 to deprecate the function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:08:20 2020 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 01 Oct 2020 23:08:20 +0000 Subject: [issue17490] Improve ast.literal_eval test suite coverage In-Reply-To: <1363746875.32.0.0832947039866.issue17490@psf.upfronthosting.co.za> Message-ID: <1601593700.26.0.0586709091494.issue17490@roundup.psfhosted.org> Guido van Rossum added the comment: I agree that it's better to just close this issue, the patch is 7 years old. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:10:22 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 01 Oct 2020 23:10:22 +0000 Subject: [issue17490] Improve ast.literal_eval test suite coverage In-Reply-To: <1363746875.32.0.0832947039866.issue17490@psf.upfronthosting.co.za> Message-ID: <1601593822.99.0.991523178728.issue17490@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +21504 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22469 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:17:11 2020 From: report at bugs.python.org (Ammar Askar) Date: Thu, 01 Oct 2020 23:17:11 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601594231.29.0.612489957035.issue41902@roundup.psfhosted.org> Ammar Askar added the comment: Out of curiosity, what is the motivation for this optimization? Is there reason to believe that range.index is performed often enough that it's worth the extra code and maintenance cost here? ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:19:29 2020 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Oct 2020 23:19:29 +0000 Subject: [issue40455] GCC 10 compiler warnings In-Reply-To: <1588279868.77.0.13865368461.issue40455@roundup.psfhosted.org> Message-ID: <1601594369.07.0.953335674062.issue40455@roundup.psfhosted.org> STINNER Victor added the comment: There are still warnings on compile.c: https://buildbot.python.org/all/#/builders/448/builds/130 Python/compile.c:5660:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] Python/compile.c:5660: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] Python/compile.c:5660: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:22:24 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Oct 2020 23:22:24 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601594544.69.0.711716290413.issue41905@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:22:37 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Oct 2020 23:22:37 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601594557.21.0.165656895023.issue41905@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:26:19 2020 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 01 Oct 2020 23:26:19 +0000 Subject: [issue17490] Improve ast.literal_eval test suite coverage In-Reply-To: <1363746875.32.0.0832947039866.issue17490@psf.upfronthosting.co.za> Message-ID: <1601594779.82.0.0209637742523.issue17490@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, I don't think PR 22469 is relevant to this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:31:29 2020 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 01 Oct 2020 23:31:29 +0000 Subject: [issue41613] get_type_hints regression for 3.9 and 3.10 In-Reply-To: <1598088602.53.0.71167650591.issue41613@roundup.psfhosted.org> Message-ID: <1601595089.16.0.341626771326.issue41613@roundup.psfhosted.org> Batuhan Taskaya added the comment: Commit 3ff51d425ecd98b7ba5a12ca9f77eda73fbf9f53 set the __builtins__ to None in namedtuple's creation, but the problem is that it is causing harm when the point came to the point of getting type hints on typing.NamedTuple.__new__ (we had a test about it), I'm changing that test (in the PR 20434) to work directly with the namedtuple itself instead of __new__ (since the annotations get proxied). ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:34:28 2020 From: report at bugs.python.org (Ethan Furman) Date: Thu, 01 Oct 2020 23:34:28 +0000 Subject: [issue41889] enum: Mixin and int base class regression in 3.8.6 In-Reply-To: <1601439696.58.0.28102514399.issue41889@roundup.psfhosted.org> Message-ID: <1601595268.76.0.466051455768.issue41889@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +21505 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22487 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:35:19 2020 From: report at bugs.python.org (Ethan Furman) Date: Thu, 01 Oct 2020 23:35:19 +0000 Subject: [issue41889] enum: Mixin and int base class regression in 3.8.6 In-Reply-To: <1601439696.58.0.28102514399.issue41889@roundup.psfhosted.org> Message-ID: <1601595319.75.0.780663090455.issue41889@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: -> ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 19:58:37 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 01 Oct 2020 23:58:37 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601596717.62.0.606999704601.issue41905@roundup.psfhosted.org> Raymond Hettinger added the comment: The downside of this proposal is that it is tightly coupled with class creation process. It requires all existing class decorators, metaclasses, and code generators to start caring about something that isn't part of their core functionality (very few tools are ABC aware). I'm usually dubious about proposed solutions to problems that 1) rarely occur in practice and 2) require everyone else to change their code. Am not sure why total_ordering was mentioned? No current collections ABC requires the ordering methods and hand-rolled numeric classes typically don't use total_ordering because it is simpler, faster, and cleaner to implement the methods directly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 20:10:28 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Oct 2020 00:10:28 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1601597428.98.0.470539445355.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : Removed file: https://bugs.python.org/file49435/best_frac.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 20:19:15 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Oct 2020 00:19:15 +0000 Subject: [issue41513] High accuracy math.hypot() In-Reply-To: <1597022054.77.0.549983904563.issue41513@roundup.psfhosted.org> Message-ID: <1601597955.84.0.832392949111.issue41513@roundup.psfhosted.org> Change by Raymond Hettinger : Added file: https://bugs.python.org/file49484/best_frac.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 20:43:26 2020 From: report at bugs.python.org (raybb) Date: Fri, 02 Oct 2020 00:43:26 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters Message-ID: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> New submission from raybb : According to the docs here (https://docs.python.org/3/library/logging.html): "You don?t need to create specialized Filter classes, or use other classes with a filter method: you can use a function (or other callable) as a filter. The filtering logic will check to see if the filter object has a filter attribute: if it does, it?s assumed to be a Filter and its filter() method is called. Otherwise, it?s assumed to be a callable and called with the record as the single parameter." If I use this code: def noErrorLogs(param): return 1 if param.levelno < 40 else 0 logconfig_dict = { 'filters': { 'myfilter': { '()': noErrorLogs, } }, "handlers": { "console": { "class": "logging.StreamHandler", "level": "DEBUG", "stream": "ext://sys.stdout", "filters": ["myfilter"] } }, "root": {"level": "DEBUG", "handlers": ["console"]}, "version": 1, } dictConfig(logconfig_dict) I get the error "Unable to configure filter 'myfilter'" because "noErrorLogs() missing 1 required positional argument: 'param'" However, If I use this code: def noErrorLogs(param): return 1 if param.levelno < 40 else 0 logconfig_dict = { "handlers": { "console": { "class": "logging.StreamHandler", "level": "DEBUG", "stream": "ext://sys.stdout", } }, "root": {"level": "DEBUG", "handlers": ["console"]}, "version": 1, } logging.basicConfig() dictConfig(logconfig_dict) l = logging.getLogger() l.handlers[0].addFilter(noErrorLogs) Then the filter works correctly. The bug I am reporting is that when using logging.config.dictConfig you cannot pass in a callable that acts a filter. You can only pass in a class with a filter method or a function that returns a callable filter. If this is the expected behavior perhaps the docs should make it clear that callables cannot be used with dictConfig. ---------- messages: 377791 nosy: raybb priority: normal severity: normal status: open title: logging.config.dictConfig does not work with callable filters type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 21:00:11 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 02 Oct 2020 01:00:11 +0000 Subject: [issue41904] datetime.datetime.today makes no sense and should be removed In-Reply-To: <1601570248.43.0.143406560443.issue41904@roundup.psfhosted.org> Message-ID: <20201002005958.GO2186@ando.pearwood.info> Steven D'Aprano added the comment: On Thu, Oct 01, 2020 at 04:37:28PM +0000, Damian Yurzola wrote: > I was inspired to file this bug after reading through a multiplicity > of bugs introduced by folks confused by the library's behavior. Are these public bug reports or private anecdotes? I'm not saying that the method cannot be deprecated or removed, but it needs to be justified. We don't break people's code gratuitiously, at least not intentionally. If you make a good enough case for deprecating the method, we can do so. > What do you say about the unnecessarily redefined properties? > > Lines Lib/datetime.py#L1606 to datetime.py#L1620 I don't know. Do all the tests still pass if you take them out? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 21:56:15 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Oct 2020 01:56:15 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1601603775.71.0.243690295504.issue41906@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 21:57:11 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Oct 2020 01:57:11 +0000 Subject: [issue41904] datetime.datetime.today makes no sense and should be removed In-Reply-To: <1601567658.27.0.420109981563.issue41904@roundup.psfhosted.org> Message-ID: <1601603831.62.0.181198961878.issue41904@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +belopolsky, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 22:38:10 2020 From: report at bugs.python.org (Roger Taylor) Date: Fri, 02 Oct 2020 02:38:10 +0000 Subject: [issue41907] Regression in IntFlag behaviour in f-string Message-ID: <1601606290.92.0.604621625655.issue41907@roundup.psfhosted.org> New submission from Roger Taylor : An IntFlag member before 3.8.6 was converted to an integer in an f-string. After 3.8.6, the textual IntFlag class and member name are placed in the interpolated f-string instead of the integer. 3.8.3: f"... {X.F} ..." where X.F = 1 << 4 will give "... 16 ..." 3.8.5: Same 3.8.6: f"... {X.F} ..." where X.F = 1 << 4 will give "... X.F ..." I have reproduced this on Linux using the version compiled and installed by pyenv, and on Windows using the 32-bit versions from the downloadable standalone installer. Now I have to locate and go through all my SQL statements and verify that they explicitly convert IntFlag values to integer to avoid the errors introduced by this regression. ---------- components: Interpreter Core messages: 377793 nosy: rt121212121 priority: normal severity: normal status: open title: Regression in IntFlag behaviour in f-string type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 22:48:15 2020 From: report at bugs.python.org (mohamed koubaa) Date: Fri, 02 Oct 2020 02:48:15 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1601606895.65.0.94813080512.issue1635741@roundup.psfhosted.org> Change by mohamed koubaa : ---------- pull_requests: +21506 pull_request: https://github.com/python/cpython/pull/22489 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 23:06:24 2020 From: report at bugs.python.org (mohamed koubaa) Date: Fri, 02 Oct 2020 03:06:24 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1601607984.59.0.438724522551.issue1635741@roundup.psfhosted.org> Change by mohamed koubaa : ---------- pull_requests: +21507 pull_request: https://github.com/python/cpython/pull/22490 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Oct 1 23:50:52 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Oct 2020 03:50:52 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601610652.05.0.593917881258.issue41902@roundup.psfhosted.org> Dong-hee Na added the comment: > s there reason to believe that range.index is performed often enough that it's worth the extra code and maintenance cost here? There are at least 3 reasons 1. pointer comparaition optimization quite common usecase in CPython codebase. e.x) list.count 2. if you create the range object, step = 1 which is singleton object is quite high percentage use case. - range(100) -> step = 1 - range(-100, 100) -> step =1 - range(-100, 100, 2) -> step != 1 3. fast path code does not cost high difficulty maintainence for this case but can bring 12% performance enhancement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 00:10:30 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Oct 2020 04:10:30 +0000 Subject: [issue41907] Regression in IntFlag behaviour in f-string In-Reply-To: <1601606290.92.0.604621625655.issue41907@roundup.psfhosted.org> Message-ID: <1601611830.52.0.818439394072.issue41907@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +barry, eli.bendersky, ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 00:23:54 2020 From: report at bugs.python.org (Justin Arthur) Date: Fri, 02 Oct 2020 04:23:54 +0000 Subject: [issue33533] Provide an async-generator version of as_completed In-Reply-To: <1526453333.0.0.682650639539.issue33533@psf.upfronthosting.co.za> Message-ID: <1601612634.29.0.599835723193.issue33533@roundup.psfhosted.org> Change by Justin Arthur : ---------- nosy: +JustinTArthur nosy_count: 5.0 -> 6.0 pull_requests: +21508 pull_request: https://github.com/python/cpython/pull/22491 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 00:27:17 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Oct 2020 04:27:17 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601612837.7.0.791104970863.issue41902@roundup.psfhosted.org> Dong-hee Na added the comment: I found another optimal case and this looks more practical usecase than range.index ---------- Added file: https://bugs.python.org/file49485/bench_range_compute_item.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 00:27:31 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Oct 2020 04:27:31 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601612851.96.0.203191153438.issue41902@roundup.psfhosted.org> Dong-hee Na added the comment: Mean +- std dev: [master-compute] 317 ns +- 3 ns -> [bpo-41902-compute] 287 ns +- 6 ns: 1.11x faster (-10%) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 00:33:45 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Oct 2020 04:33:45 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601613225.17.0.998086348748.issue41902@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +21509 pull_request: https://github.com/python/cpython/pull/22492 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 00:36:27 2020 From: report at bugs.python.org (Justin Arthur) Date: Fri, 02 Oct 2020 04:36:27 +0000 Subject: [issue33533] Provide an async-generator version of as_completed In-Reply-To: <1526453333.0.0.682650639539.issue33533@psf.upfronthosting.co.za> Message-ID: <1601613387.49.0.976088889713.issue33533@roundup.psfhosted.org> Justin Arthur added the comment: I've added a new PR, PR 22491. This one has as_completed returning an iterator and includes tests for both the old and new style. I see a trivial amount of latency added in extra call stack over Guido's original implementation. Should we decide to deprecate the plain-iterator-of-awaitables form, we can possibly regain that latency in refactoring this as an asynchronous generator. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 00:52:07 2020 From: report at bugs.python.org (Justin Arthur) Date: Fri, 02 Oct 2020 04:52:07 +0000 Subject: [issue38032] lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks In-Reply-To: <1567639302.72.0.55214965787.issue38032@roundup.psfhosted.org> Message-ID: <1601614327.74.0.921085262348.issue38032@roundup.psfhosted.org> Justin Arthur added the comment: Not sure if there is consensus on how to fix, but fixing #12731 will fix this for most of the cases I've seen complaints about as a side effect. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 02:55:18 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Oct 2020 06:55:18 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601621718.06.0.62278450135.issue41902@roundup.psfhosted.org> Dong-hee Na added the comment: @vstinner @pablo @mark On my local machine (without cpu isolation), PR 22480 does not affect performance issues. import pyperf runner = pyperf.Runner() runner.timeit(name="bench long divide", stmt=""" for i in range(1, 256): a = 10000 // i """) but I think that my benchmark does not cover the worst case. I need to set up the CPU isolation environment but my resource is limited. (I need a Linux machine with sufficient permission but not) PR 22479 and PR 22480 has two sides of assumption. PR 22479: PyNumber_FloorDivide is a heavy operation if the user thinks that this is an unnecessary operation it should be avoided. (In this case divide by one) PR 22480: PyNumber_FloorDivide should process handle unnecessary operations smartly. In conclusion, I'd like to +1 on mark's decision. - PR 22480: even though the divisor value is one, if the dividend is not qualified from PyLong_CheckExact it will not get an optimization path. So it will not cover all the 'divide by one' case and it can cause performance issues. - PR 22480: Always optimized if the user does not set a specific step value and this will be same effect on PR 22492. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 02:56:53 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Oct 2020 06:56:53 +0000 Subject: [issue17490] Improve ast.literal_eval test suite coverage In-Reply-To: <1363746875.32.0.0832947039866.issue17490@psf.upfronthosting.co.za> Message-ID: <1601621813.43.0.0704351660802.issue17490@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: -21504 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 02:57:20 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Oct 2020 06:57:20 +0000 Subject: [issue17490] Improve ast.literal_eval test suite coverage In-Reply-To: <1363746875.32.0.0832947039866.issue17490@psf.upfronthosting.co.za> Message-ID: <1601621840.16.0.721871442352.issue17490@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 03:19:22 2020 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 02 Oct 2020 07:19:22 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1601623162.75.0.198575736701.issue41906@roundup.psfhosted.org> Vinay Sajip added the comment: The value of the '()' key should be a factory - something that returns a filter (either something that has a filter method or a callable). That returned callable, or the filter method, will be called with a LogRecord and its return value used to determine whether the event should be processed. An example of using factories is here: https://docs.python.org/3/library/logging.config.html#user-defined-objects In your first example, you're passing the filter where you need to pass the factory. If you change it to e.g. return a lambda that does the filtering, it should work as expected. At the moment you can't directly pass a filter callable in the config dictionary - only a factory that returns a filter. I'll look at this as a possible enhancement. ---------- type: behavior -> enhancement versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 03:26:47 2020 From: report at bugs.python.org (Kyle Stanley) Date: Fri, 02 Oct 2020 07:26:47 +0000 Subject: [issue29127] Incorrect reference names in asyncio.subprocess documentation In-Reply-To: <1483238654.05.0.408550900872.issue29127@psf.upfronthosting.co.za> Message-ID: <1601623607.25.0.107813167135.issue29127@roundup.psfhosted.org> Kyle Stanley added the comment: I can confirm that both on the latest version of the docs (for 3.8) and for the version mentioned in the issue (3.6), the issue mentioned with asyncio.subprocess.PIPE is no longer present. (It was likely fixed in the asyncio documentation overhaul that happened within the last couple of years). As a result, I'll proceed with closing this issue. Thanks for checking, Carl. ---------- nosy: +aeros resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 03:55:44 2020 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 02 Oct 2020 07:55:44 +0000 Subject: [issue41907] Regression in IntFlag behaviour in f-string In-Reply-To: <1601606290.92.0.604621625655.issue41907@roundup.psfhosted.org> Message-ID: <1601625344.67.0.158923777752.issue41907@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 04:04:15 2020 From: report at bugs.python.org (Ben Avrahami) Date: Fri, 02 Oct 2020 08:04:15 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601625855.15.0.293911522345.issue41905@roundup.psfhosted.org> Ben Avrahami added the comment: Good points all, that I will try to address one by one: Firstly, this function is by no means mandatory for "post-creation mixins". Such tools can still be used without calling it (and remain ABC unaware), with absolutely no change in functionality. Indeed, the function itself can be used as a decorator for just such cases, where a tool is ABC unaware (either from deciding that ABC aren't a use case for them, or from simply not considering that possibility), but the user wants to also subclass an ABC. The problem is that, right now, post-creation tools simply can't be ABC aware. The thought that few tools are ABC aware is not, I think, a good reason to neglect tools that would like to be. Just as dispatch and type-routing tools might not be ABC aware to use `abc.get_cache_token()`, but it is still added for tools that want to be ABC aware and sidestep this confusing behavior. As for not occurring in practice: a simple github search reveals many instances of comparison operators being abstract, and while likely few of them likely use dataclasses, that is a possibility that I believe should be addressed (of course, we could decide that this is desired behavior, and scrap this whole issue). Finally, total_ordering: I originally added it to the issue because it was the other decorator mixin in the standard library, after I rand into this behavior using dataclasses. If total_ordering proves to be a barrier, we can remove it from the PR (and perhaps re-introduce it later if that is deemed necessary). I will only remark that I find total_ordering used in many hand-rolled classes where users would sacrifice some performance for cleaner code and an assertion that total order is enforced. Sorry for the scroll and thanks for the scrutiny :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 04:14:04 2020 From: report at bugs.python.org (=?utf-8?b?SHJ2b2plIE5pa8WhacSH?=) Date: Fri, 02 Oct 2020 08:14:04 +0000 Subject: [issue33533] Provide an async-generator version of as_completed In-Reply-To: <1526453333.0.0.682650639539.issue33533@psf.upfronthosting.co.za> Message-ID: <1601626444.8.0.534158867978.issue33533@roundup.psfhosted.org> Hrvoje Nik?i? added the comment: Hi, thanks for providing a PR. One thing I noticed is that the implementation in the PR yields results of the futures from the generator. This issue proposes a generator that instead yields the futures passed to as_completed. This is needed not just for consistency with concurrent.futures.as_completed, but also to allow associating results with the requests that produced them, which is an important use case for as_completed. An example of how this is useful is the snippet at https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor-example which you cannot implement with an as_completed that doesn't yield the original futures. The StackOverflow question at [1] inquires about that issue, and would be easily resolved by yielding the futures as concurrent.futures.as_completed does. As far as I can tell, the needed change is simple: just yield `f` instead of `f.result()` from `_wait_for_one` when invoked from __anext__. (It must still return f.result() when called from __next__ for backward compatibility.) [1] https://stackoverflow.com/questions/50028465/python-get-reference-to-original-task-after-ordering-tasks-by-completion ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 04:46:48 2020 From: report at bugs.python.org (Dominic Davis-Foster) Date: Fri, 02 Oct 2020 08:46:48 +0000 Subject: [issue41907] Regression in IntFlag behaviour in f-string In-Reply-To: <1601606290.92.0.604621625655.issue41907@roundup.psfhosted.org> Message-ID: <1601628408.68.0.607597676952.issue41907@roundup.psfhosted.org> Dominic Davis-Foster added the comment: I believe the regression is due to GH-14545 which "fixed" bpo-37479. The news entry states: "When `Enum.__str__` is overridden in a derived class, the override will be used by `Enum.__format__` regardless of whether mixin classes are present." . The change is in the __format__ method of Enum. It now checks if type(self).__str__ != Enum.__str__ and if True calls str(self). Because Flag defines its own __str__ method, the expression evaluates to True. I do not think this is the indented behaviour. In 3.8.5 str(self) was only called if _member_type_ is object. ---------- nosy: +dom1310df _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 05:56:26 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Oct 2020 09:56:26 +0000 Subject: [issue41908] Make IDLE Start Menu entry more descriptive Message-ID: <1601632586.45.0.38147245228.issue41908@roundup.psfhosted.org> New submission from Terry J. Reedy : A current python-list thread "Problem" is about the difficulties beginners have getting started immediately after installation. I believe it started with another beginner asking about getting the modify/repair note. One other thing that came up is that "IDLE", by itself, means nothing to someone who does not know what it is. So one suggestion was to replace the current IDLE (Python 3.9 64 bit) with something more descriptive. The current longest entry is Python 3.9 Module Docs (64-bit) which appears to be about as long as possible that fits in the space allowed without being truncated with ... (like "Microsoft Visual Studio 2010 Express"). (The font is proportional, I believe, so a char count does not give an exact measure.) I propose a new entry for IDLE that is slightly shorter that the apparent maximum. IDLE Shell-Editor (3.9 64-bit) The menu entry is also the initial filename for a desktop shortcut. For me, after editing is complete, it displays as either IDLE Shell-Edit... (inactive, 2 lines only) or IDLE Shell-Editor (3.9 64-bit) (active, full 3 lines) I checked that the future '3.10' will not cause a problem. The popup shortcut comment "Launches IDLE, the interactive environment for Python 3.9." nicely complements the proposed title, tying 'IDLE' to 'Python'. For a taskbar icon, the menu entry is the popup description. --- macOS: The equivalent of 'Python 3.9' on the start menu is the 'Python 3.9' folder in Finder. The equivalent of the 'IDLE (Python 3.9 64 bit)' entry is the Python app icon labelled simply 'IDLE' for the IDLE.app startup file. Ned, what would you think of the longer name "IDLE Shell-Editor.app'? (And maybe add 3.9 somewhere -- I have 3.8 and 3.9 loaded and on the (taskbar) I only know which is which by position.) ---------- assignee: terry.reedy components: IDLE, Installation, Windows messages: 377805 nosy: ned.deily, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Make IDLE Start Menu entry more descriptive type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 06:19:34 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 02 Oct 2020 10:19:34 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601633974.31.0.885155620296.issue41902@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I would need to carefully look at the PRs to estimate the maintenance cost, but it seems to me initially that all these operations happen very rarely in regular code and probably will have no impact on macro benchmarks. In general, I dislike branches because they quickly can become the source of slight different semantics. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 06:49:51 2020 From: report at bugs.python.org (Ran Benita) Date: Fri, 02 Oct 2020 10:49:51 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses Message-ID: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> New submission from Ran Benita : The following program crashes with a segfault: class Segfault: def __getattr__(self, name): self.unknown_attribute instance = Segfault() issubclass(instance, int) # int doesn't matter Tested with Python 3.7, 3.8, 3.9rc2, and master in debug mode (commit 497126f7ea955ee005e78f2cdd61f175d4fcdbb2). The program is odd, but this affects pytest (see https://github.com/pytest-dev/pytest/issues/2330). The class is buggy user code, pytest does the issubclass check. In pytest there are other code paths which trigger it besides issubclass, but that's the one I am able to quickly reproduce standalone. Here is the backtrace with python master: ran at ran:~/src/cpython$ gdb --args ./python segfault.py Reading symbols from ./python... (gdb) r Starting program: /home/ran/src/cpython/python segfault.py Program received signal SIGSEGV, Segmentation fault. 0x00005555556bc55e in PyGILState_Check () at Python/pystate.c:1353 1353 if (!PyThread_tss_is_created(&gilstate->autoTSSkey)) { (gdb) bt 29 #0 0x00005555556bc55e in PyGILState_Check () at Python/pystate.c:1353 #1 0x00005555555fc117 in _PyMem_DebugCheckGIL (func=0x55555581b330 <__func__.10> "_PyMem_DebugMalloc") at Objects/obmalloc.c:2329 #2 _PyMem_DebugMalloc (ctx=0x55555593b140 <_PyMem_Debug+96>, nbytes=185) at Objects/obmalloc.c:2329 #3 0x00005555555fcee8 in PyObject_Malloc (size=) at Objects/obmalloc.c:685 #4 0x000055555562d6f3 in PyUnicode_New (size=136, maxchar=) at Objects/unicodeobject.c:1455 #5 0x00005555556556e7 in _PyUnicodeWriter_PrepareInternal (writer=writer at entry=0x7fffff7ff0c0, length=length at entry=1, maxchar=, maxchar at entry=127) at Objects/unicodeobject.c:14004 #6 0x0000555555658439 in _PyUnicodeWriter_WriteASCIIString (writer=writer at entry=0x7fffff7ff0c0, ascii=ascii at entry=0x5555558196c8 "'%.50s' object has no attribute '%U'", len=1) at Objects/unicodeobject.c:14174 #7 0x000055555565a18d in PyUnicode_FromFormatV (format=format at entry=0x5555558196c8 "'%.50s' object has no attribute '%U'", vargs=vargs at entry=0x7fffff7ff170) at Objects/unicodeobject.c:3114 #8 0x000055555569646b in _PyErr_FormatV (tstate=0x5555559aa300, exception=, format=format at entry=0x5555558196c8 "'%.50s' object has no attribute '%U'", vargs=vargs at entry=0x7fffff7ff170) at Python/errors.c:1029 #9 0x0000555555696ff3 in PyErr_Format (exception=, format=format at entry=0x5555558196c8 "'%.50s' object has no attribute '%U'") at Python/errors.c:1071 #10 0x00005555555fa4a5 in _PyObject_GenericGetAttrWithDict (obj=obj at entry=, name=name at entry='unknown_attribute', dict=, dict at entry=0x0, suppress=suppress at entry=0) at Objects/object.c:1268 #11 0x00005555555fa96f in PyObject_GenericGetAttr (obj=obj at entry=, name=name at entry='unknown_attribute') at Objects/object.c:1281 #12 0x000055555561c3f8 in slot_tp_getattr_hook (self=, name='unknown_attribute') at Objects/typeobject.c:6805 #13 0x00005555555f68c2 in PyObject_GetAttr (v=v at entry=, name=) at Objects/object.c:891 #14 0x000055555567c254 in _PyEval_EvalFrameDefault (tstate=0x5555559aa300, f=Frame 0x7ffff71cc3b0, for file /home/ran/src/cpython/segfault.py, line 3, in __getattr__ (self=, name='unknown_attribute'), throwflag=) at Python/ceval.c:3036 #15 0x00005555555b9d1d in _PyEval_EvalFrame (throwflag=0, f=Frame 0x7ffff71cc3b0, for file /home/ran/src/cpython/segfault.py, line 3, in __getattr__ (self=, name='unknown_attribute'), tstate=0x5555559aa300) at ./Include/internal/pycore_ceval.h:40 #16 function_code_fastcall (tstate=0x5555559aa300, co=, args=0x7fffff7ff590, nargs=2, globals=) at Objects/call.c:329 #17 0x00005555555ba67b in _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:366 #18 0x000055555576c2d4 in _PyObject_VectorcallTstate (tstate=0x5555559aa300, callable=, args=0x7fffff7ff580, nargsf=2, kwnames=0x0) at ./Include/cpython/abstract.h:114 #19 0x000055555576cb87 in method_vectorcall (method=, args=0x7fffff7ff588, nargsf=, kwnames=0x0) at Objects/classobject.c:53 #20 0x00005555556109ac in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=9223372036854775809, args=0x7fffff7ff588, callable=, tstate=0x5555559aa300) at ./Include/cpython/abstract.h:114 #21 PyObject_CallOneArg (arg='unknown_attribute', func=) at ./Include/cpython/abstract.h:184 #22 call_attribute (self=self at entry=, attr=, attr at entry=, name=name at entry='unknown_attribute') at Objects/typeobject.c:6771 #23 0x000055555561c44a in slot_tp_getattr_hook (self=, name='unknown_attribute') at Objects/typeobject.c:6813 #24 0x00005555555f68c2 in PyObject_GetAttr (v=v at entry=, name=) at Objects/object.c:891 #25 0x000055555567c254 in _PyEval_EvalFrameDefault (tstate=0x5555559aa300, f=Frame 0x7ffff71cc200, for file /home/ran/src/cpython/segfault.py, line 3, in __getattr__ (self=, name='unknown_attribute'), throwflag=) at Python/ceval.c:3036 #26 0x00005555555b9d1d in _PyEval_EvalFrame (throwflag=0, f=Frame 0x7ffff71cc200, for file /home/ran/src/cpython/segfault.py, line 3, in __getattr__ (self=, name='unknown_attribute'), tstate=0x5555559aa300) at ./Include/internal/pycore_ceval.h:40 #27 function_code_fastcall (tstate=0x5555559aa300, co=, args=0x7fffff7ff8b0, nargs=2, globals=) at Objects/call.c:329 #28 0x00005555555ba67b in _PyFunction_Vectorcall (func=, stack=, nargsf=, kwnames=) at Objects/call.c:366 (More stack frames follow...) (gdb) py-bt Traceback (most recent call first): File "/home/ran/src/cpython/segfault.py", line 3, in __getattr__ self.unknown_attribute File "/home/ran/src/cpython/segfault.py", line 3, in __getattr__ self.unknown_attribute File "/home/ran/src/cpython/segfault.py", line 3, in __getattr__ self.unknown_attribute File "/home/ran/src/cpython/segfault.py", line 3, in __getattr__ self.unknown_attribute File "/home/ran/src/cpython/segfault.py", line 3, in __getattr__ self.unknown_attribute File "/home/ran/src/cpython/segfault.py", line 3, in __getattr__ self.unknown_attribute File "/home/ran/src/cpython/segfault.py", line 3, in __getattr__ self.unknown_attribute File "/home/ran/src/cpython/segfault.py", line 3, in __getattr__ self.unknown_attribute --Type for more, q to quit, c to continue without paging--q ---------- components: Interpreter Core messages: 377807 nosy: bluetech priority: normal severity: normal status: open title: Segfault on __getattr__ infinite recursion on certain attribute accesses _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 06:58:24 2020 From: report at bugs.python.org (Ran Benita) Date: Fri, 02 Oct 2020 10:58:24 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601636304.33.0.746312922568.issue41909@roundup.psfhosted.org> Change by Ran Benita : ---------- type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 08:49:08 2020 From: report at bugs.python.org (Roundup Robot) Date: Fri, 02 Oct 2020 12:49:08 +0000 Subject: [issue40643] Improve doc-strings for datetime.strftime & strptime In-Reply-To: <1589628564.12.0.439754688359.issue40643@roundup.psfhosted.org> Message-ID: <1601642948.26.0.839665978108.issue40643@roundup.psfhosted.org> Change by Roundup Robot : ---------- pull_requests: +21510 pull_request: https://github.com/python/cpython/pull/22477 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 08:49:08 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Oct 2020 12:49:08 +0000 Subject: [issue41692] Deprecate immortal interned strings: PyUnicode_InternImmortal() In-Reply-To: <1599055165.93.0.874786911809.issue41692@roundup.psfhosted.org> Message-ID: <1601642948.43.0.516064645638.issue41692@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 583ee5a5b1971a18ebeb877948ce6264da0cc8aa by Victor Stinner in branch 'master': bpo-41692: Deprecate PyUnicode_InternImmortal() (GH-22486) https://github.com/python/cpython/commit/583ee5a5b1971a18ebeb877948ce6264da0cc8aa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 08:49:27 2020 From: report at bugs.python.org (Florian Bruhin) Date: Fri, 02 Oct 2020 12:49:27 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601642967.78.0.203337503845.issue41909@roundup.psfhosted.org> Change by Florian Bruhin : ---------- nosy: +The Compiler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 08:49:46 2020 From: report at bugs.python.org (STINNER Victor) Date: Fri, 02 Oct 2020 12:49:46 +0000 Subject: [issue41692] Deprecate immortal interned strings: PyUnicode_InternImmortal() In-Reply-To: <1599055165.93.0.874786911809.issue41692@roundup.psfhosted.org> Message-ID: <1601642986.9.0.353293366207.issue41692@roundup.psfhosted.org> STINNER Victor added the comment: The function is now deprecated. Thanks for the review INADA-san, I close the issue. Let's meet in Python 3.12 to remove it ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 09:56:19 2020 From: report at bugs.python.org (Ethan Furman) Date: Fri, 02 Oct 2020 13:56:19 +0000 Subject: [issue41907] Regression in IntFlag behaviour in f-string In-Reply-To: <1601606290.92.0.604621625655.issue41907@roundup.psfhosted.org> Message-ID: <1601646979.07.0.193114236405.issue41907@roundup.psfhosted.org> Ethan Furman added the comment: Thank you for the bug report. Another solution would be to subclass IntFlag and specify the `__format__` method: from enum import IntFlag as _IntFlag class IntFlag(_IntFlag): def __format__(self, spec): return format(self.value, spec) ---------- assignee: -> ethan.furman stage: -> needs patch versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 10:05:36 2020 From: report at bugs.python.org (Tal Einat) Date: Fri, 02 Oct 2020 14:05:36 +0000 Subject: [issue41894] UnicodeDecodeError during load failure in non-UTF-8 locale In-Reply-To: <1601486783.26.0.906458411993.issue41894@roundup.psfhosted.org> Message-ID: <1601647536.61.0.0600527346783.issue41894@roundup.psfhosted.org> Change by Tal Einat : ---------- versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 10:19:40 2020 From: report at bugs.python.org (Joshua Bronson) Date: Fri, 02 Oct 2020 14:19:40 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1601648380.23.0.462866375064.issue7946@roundup.psfhosted.org> Change by Joshua Bronson : ---------- nosy: +jab _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 10:34:37 2020 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgS2lzcyBLb2xsw6Fy?=) Date: Fri, 02 Oct 2020 14:34:37 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601649277.84.0.666739491467.issue41490@roundup.psfhosted.org> L?szl? Kiss Koll?r added the comment: pip 20.2.1 contains a regression which breaks `--system-site-package` integration: https://github.com/pypa/pip/issues/8695. It would be nice to include the latest patch version (20.2.3 at the moment) which fixes this and a few other issues. ---------- nosy: +lkollar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 10:42:46 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 02 Oct 2020 14:42:46 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601649766.64.0.74479063775.issue41490@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I think that the backport to 3.8 may have some unintended consequences in the last patch release as venv created with 3.8 now exhibit the pip regression (https://github.com/pypa/pip/issues/8695.). Steve, would you be ok if we bump all branches (master, 3.9 and 3.8) to 20.2.3? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 10:55:50 2020 From: report at bugs.python.org (raybb) Date: Fri, 02 Oct 2020 14:55:50 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1601650550.8.0.148674676307.issue41906@roundup.psfhosted.org> raybb added the comment: Thank you for the clarification. I think I was most confused by the docs on this page (which I should have included in my initial post): https://docs.python.org/3/howto/logging.html It says: "In Python 3.2, a new means of configuring logging has been introduced, using dictionaries to hold configuration information. This provides a superset of the functionality of the config-file-based approach outlined above, and is the recommended configuration method for new applications and deployments." Since it is the recommended configuration method I had naively assumed that it would be compatible with the feature of just using callables instead which was mentioned here https://docs.python.org/3/library/logging.html. I think it would be a nice enhancement long term to be able too support callables in dictconfigs. In the short term do you think it is reasonable to update the first page mentioned in this comment to clarify that even though dictConfig is recommended it is not a feature parity with the object oriented api? It would also be nice to clarify this on the second page to say that callables don't work if using dictConfig. I understand it does say a factory is required on the page you linked. I think anyone who reads the docs as well as they should will find it. But I think adding information about this too other parts of the docs will make it much easier for newer folks to catch the difference early on. Thanks for your work on the logging parts of the api in python. I've read many of your docs and they are very helpful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 11:19:55 2020 From: report at bugs.python.org (Marco Sulla) Date: Fri, 02 Oct 2020 15:19:55 +0000 Subject: [issue41901] Added some explaining to pickle errors. In-Reply-To: <1601554070.38.0.74604376475.issue41901@roundup.psfhosted.org> Message-ID: <1601651995.07.0.913019881989.issue41901@roundup.psfhosted.org> Marco Sulla added the comment: I closed it for this reason: https://github.com/python/cpython/pull/22438#issuecomment-702794261 ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 11:21:18 2020 From: report at bugs.python.org (hai shi) Date: Fri, 02 Oct 2020 15:21:18 +0000 Subject: [issue41902] Micro optimization for range.index if step is 1 In-Reply-To: <1601559765.96.0.883895901539.issue41902@roundup.psfhosted.org> Message-ID: <1601652078.16.0.907758277671.issue41902@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 11:22:02 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 02 Oct 2020 15:22:02 +0000 Subject: [issue41910] Document that object.__eq__ implements `a is b` Message-ID: <1601652122.88.0.984647748564.issue41910@roundup.psfhosted.org> New submission from Brett Cannon : If you look at the data model `for object.__eq__` (https://docs.python.org/3.8/reference/datamodel.html#object.__eq__) you will see that it doesn't mention any actual implementation (unlike for __ne__). But https://github.com/python/cpython/blob/v3.8.3/Objects/typeobject.c#L3834-L3880 shows that object.__eq__ actually does have an implementation of `a is b`/`id(a) == id(b)`. ---------- assignee: docs at python components: Documentation messages: 377816 nosy: brett.cannon, docs at python priority: low severity: normal status: open title: Document that object.__eq__ implements `a is b` versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 11:22:14 2020 From: report at bugs.python.org (hai shi) Date: Fri, 02 Oct 2020 15:22:14 +0000 Subject: [issue40455] GCC 10 compiler warnings In-Reply-To: <1588279868.77.0.13865368461.issue40455@roundup.psfhosted.org> Message-ID: <1601652134.12.0.132381296317.issue40455@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 11:22:29 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 02 Oct 2020 15:22:29 +0000 Subject: [issue41910] Document that object.__eq__ implements `a is b` In-Reply-To: <1601652122.88.0.984647748564.issue41910@roundup.psfhosted.org> Message-ID: <1601652149.48.0.223106463948.issue41910@roundup.psfhosted.org> Change by Brett Cannon : ---------- assignee: docs at python -> brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 11:27:33 2020 From: report at bugs.python.org (Brett Cannon) Date: Fri, 02 Oct 2020 15:27:33 +0000 Subject: [issue41911] Language reference incorrectly says comparison expressions return boolean values Message-ID: <1601652453.05.0.89373160388.issue41911@roundup.psfhosted.org> New submission from Brett Cannon : https://docs.python.org/3/reference/expressions.html#comparisons claims that "Comparisons yield boolean values: True or False." But that's not necessarily true: ```python >>> class Spam: ... def __eq__(self, _): return 42 ... >>> Spam() == object() 42 ``` That really only happens when an expressions is used in a boolean context like an `if` statements guard expression. ---------- assignee: brett.cannon components: Documentation messages: 377817 nosy: brett.cannon priority: low severity: normal status: open title: Language reference incorrectly says comparison expressions return boolean values versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 12:05:44 2020 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Oct 2020 16:05:44 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1601654744.38.0.148401800646.issue7946@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 12:07:28 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Oct 2020 16:07:28 +0000 Subject: [issue41802] Missing documentation for 'PyDict_DelItem' behavior In-Reply-To: <1600340753.64.0.782309837767.issue41802@roundup.psfhosted.org> Message-ID: <1601654848.32.0.128415640127.issue41802@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 1.0 -> 2.0 pull_requests: +21512 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22291 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 12:15:28 2020 From: report at bugs.python.org (E. Paine) Date: Fri, 02 Oct 2020 16:15:28 +0000 Subject: [issue41908] Make IDLE Start Menu entry more descriptive In-Reply-To: <1601632586.45.0.38147245228.issue41908@roundup.psfhosted.org> Message-ID: <1601655328.09.0.0234613689213.issue41908@roundup.psfhosted.org> E. Paine added the comment: Do we need to include the bitness (IDLE doesn't care)? On Windows, it will also be included in the Python start-menu folder, so maybe we should consider moving the bitness to the folder title (so the folder becomes "Python 3.8 64-bit")? However, I also want to propose something a little more controversial: do we really need to have the word "IDLE" in the entry? The example that comes to mind immediately is Nautilus (a GNOME application), which in all graphical places (like the menu) is referred to simply as "Files". Internally and on the CLI it is known by Nautilus but, similar to "IDLE", seeing a menu entry for Nautilus wouldn't mean anything to a beginner. On Windows, we could go for something, like Shell-Editor (3.9 64-bit) Once in IDLE, we can use that name (and obviously internally), but from the outside I propose we avoid using it (this would also affect the right-click entry, for example). I think this could cause more confusion than it avoids, but wanted to put the idea out there. ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 12:18:11 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Oct 2020 16:18:11 +0000 Subject: [issue41802] Missing documentation for 'PyDict_DelItem' behavior In-Reply-To: <1600340753.64.0.782309837767.issue41802@roundup.psfhosted.org> Message-ID: <1601655491.75.0.0995780174501.issue41802@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 20ce62f00957d11f24f6449cd5c0ef5dd67174d4 by Campbell Barton in branch 'master': bpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291) https://github.com/python/cpython/commit/20ce62f00957d11f24f6449cd5c0ef5dd67174d4 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 12:18:33 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Oct 2020 16:18:33 +0000 Subject: [issue41802] Missing documentation for 'PyDict_DelItem' behavior In-Reply-To: <1600340753.64.0.782309837767.issue41802@roundup.psfhosted.org> Message-ID: <1601655513.65.0.524090939565.issue41802@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +21513 pull_request: https://github.com/python/cpython/pull/22493 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 12:18:41 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Oct 2020 16:18:41 +0000 Subject: [issue41802] Missing documentation for 'PyDict_DelItem' behavior In-Reply-To: <1600340753.64.0.782309837767.issue41802@roundup.psfhosted.org> Message-ID: <1601655521.49.0.877128953217.issue41802@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21514 pull_request: https://github.com/python/cpython/pull/22494 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 12:27:58 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 02 Oct 2020 16:27:58 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601656078.88.0.536344543869.issue41905@roundup.psfhosted.org> Raymond Hettinger added the comment: You might be misunderstanding what @total_ordering does. It can't be used by subclasses to override abstract methods. >>> from abc import abstractmethod, ABC >>> from functools import total_ordering >>> class X(ABC): @abstractmethod def __lt__(self, other): raise RuntimeError('abstract called') >>> @total_ordering class Y(X): def __le__(self, other): return True >>> sorted(vars(Y)) # note that __lt__ is missing and Y() won't instantiate ['__abstractmethods__', '__doc__', '__ge__', '__gt__', '__le__', '__module__', '_abc_impl'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 12:28:04 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Oct 2020 16:28:04 +0000 Subject: [issue41802] Missing documentation for 'PyDict_DelItem' behavior In-Reply-To: <1600340753.64.0.782309837767.issue41802@roundup.psfhosted.org> Message-ID: <1601656084.17.0.83044663962.issue41802@roundup.psfhosted.org> miss-islington added the comment: New changeset ab32ea8d79d6bfb6580d35bfc4aa42d2729c0bcf by Miss Islington (bot) in branch '3.8': bpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291) https://github.com/python/cpython/commit/ab32ea8d79d6bfb6580d35bfc4aa42d2729c0bcf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 12:38:18 2020 From: report at bugs.python.org (Ben Avrahami) Date: Fri, 02 Oct 2020 16:38:18 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601656698.68.0.865934239091.issue41905@roundup.psfhosted.org> Ben Avrahami added the comment: This is a behavior that the PR changes. total_ordering should be able to override/implement abstract methods (in my opinion). If this ends up a strickling point then we can exclude total_ordering from this issue. Regardless, I think that this behavior is extremely unintuitive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 12:39:24 2020 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Oct 2020 16:39:24 +0000 Subject: [issue41802] Missing documentation for 'PyDict_DelItem' behavior In-Reply-To: <1600340753.64.0.782309837767.issue41802@roundup.psfhosted.org> Message-ID: <1601656764.17.0.284075790497.issue41802@roundup.psfhosted.org> miss-islington added the comment: New changeset 6dc8e0eb9b471f6665f841216a6b2d83741b3973 by Miss Islington (bot) in branch '3.9': bpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291) https://github.com/python/cpython/commit/6dc8e0eb9b471f6665f841216a6b2d83741b3973 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 13:19:20 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Oct 2020 17:19:20 +0000 Subject: [issue40391] io.FileIO.mode doesn't comply with the docs In-Reply-To: <1587862256.98.0.383192510406.issue40391@roundup.psfhosted.org> Message-ID: <1601659160.82.0.144299693004.issue40391@roundup.psfhosted.org> Irit Katriel added the comment: The mode string is calculated here: https://github.com/python/cpython/blob/master/Modules/_io/fileio.c#L1055 and is based on these four values in the fileio struct: unsigned int created : 1; unsigned int readable : 1; unsigned int writable : 1; unsigned int appending : 1; This is not enough information to distinguish between r+ and w+. That distinction was lost in _io_FileIO___init___impl, where it specified the flags that went into creating fd, but these flags are not saved. The bit fields in this struct add up to 7 bits, so it seems possible to fix this if another bit is allocated for this purpose. If it's not worth it, then the documentation needs to change a little. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 13:21:22 2020 From: report at bugs.python.org (Ethan Furman) Date: Fri, 02 Oct 2020 17:21:22 +0000 Subject: [issue41907] Regression in IntFlag behaviour in f-string In-Reply-To: <1601606290.92.0.604621625655.issue41907@roundup.psfhosted.org> Message-ID: <1601659282.39.0.669682808821.issue41907@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +21515 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22497 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 13:31:11 2020 From: report at bugs.python.org (Ethan Furman) Date: Fri, 02 Oct 2020 17:31:11 +0000 Subject: [issue41907] Regression in IntFlag behaviour in f-string In-Reply-To: <1601606290.92.0.604621625655.issue41907@roundup.psfhosted.org> Message-ID: <1601659870.99.0.78149349547.issue41907@roundup.psfhosted.org> Change by Ethan Furman : ---------- components: +Library (Lib) -Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 13:46:15 2020 From: report at bugs.python.org (Larry Hastings) Date: Fri, 02 Oct 2020 17:46:15 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1601660775.01.0.132258506437.issue7946@roundup.psfhosted.org> Larry Hastings added the comment: FWIW: I think David's cited behavior proves that the GIL is de facto a scheduler. And, in case you missed it, scheduling is a hard problem, and not a solved problem. There are increasingly complicated schedulers with new approaches and heuristics. They're getting better and better... as well as more and more complex. BFS is an example of that trend from ten years ago. But the Linux kernel has been shy about merging it, not sure why (technical deficiency? licensing problem? personality conflict? the name?). I think Python's current thread scheduling approach is almost certainly too simple. My suspicion is that we should have a much more elaborate scheduler--which hopefully would fix most (but not all!) of these sorts of pathological performance regressions. But that's going to be a big patch, and it's going to need a champion, and that champion would have to be more educated about it than I am, so I don't think it's gonna be me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 13:53:58 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Oct 2020 17:53:58 +0000 Subject: [issue41802] Missing documentation for 'PyDict_DelItem' behavior In-Reply-To: <1600340753.64.0.782309837767.issue41802@roundup.psfhosted.org> Message-ID: <1601661238.4.0.419078790165.issue41802@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 14:01:25 2020 From: report at bugs.python.org (Tom Karzes) Date: Fri, 02 Oct 2020 18:01:25 +0000 Subject: [issue41912] Long generator chain causes segmentation fault Message-ID: <1601661685.77.0.221830308398.issue41912@roundup.psfhosted.org> New submission from Tom Karzes : If I create a sufficiently long chain of generators, I encounter a segmentation fault. For example, the following works as expected: % ./gen_bug3.py 10000 10000 % But for sufficiently larger chain lengths, it seg faults: % ./gen_bug3.py 20000 Segmentation fault (core dumped) % and: % ./gen_bug3.py 100000 Segmentation fault (core dumped) % The exact point where it seg faults seems to vary slightly between different invocations of Python, but the range is very narrow for a given Python installation. I believe the difference is due to slight variations in used memory upon startup. I can't see any reason why this should happen, and in any case, if there is some limit that I'm exceeding, it should raise an exception rather than core dump. I'm using: 3.6.9 (default, Jul 17 2020, 12:50:27) [GCC 8.4.0] on a 64-bit Ubuntu Linux system. Additional info: A friend of mine is running 3.7.9 on a Windows system. In his case, the symptom is that the program produces no output for a sufficiently long generator chain (presumably it's silently crashing). Additionally, he encounters the problem with much shorter generator chains than I do. I suspect it's the same underlying problem. ---------- components: Interpreter Core files: gen_bug3.py messages: 377826 nosy: karzes priority: normal severity: normal status: open title: Long generator chain causes segmentation fault type: crash versions: Python 3.6 Added file: https://bugs.python.org/file49486/gen_bug3.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 14:56:35 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Oct 2020 18:56:35 +0000 Subject: [issue40391] io.FileIO.mode doesn't comply with the docs In-Reply-To: <1587862256.98.0.383192510406.issue40391@roundup.psfhosted.org> Message-ID: <1601664995.23.0.0390386444635.issue40391@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a duplicate of issue25341. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> File mode wb+ appears as rb+ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 14:57:46 2020 From: report at bugs.python.org (Frederik Rietdijk) Date: Fri, 02 Oct 2020 18:57:46 +0000 Subject: [issue41913] EnvBuilder.install_scripts should use explicit permissions Message-ID: <1601665066.98.0.447364183883.issue41913@roundup.psfhosted.org> New submission from Frederik Rietdijk : Creating a venv with `python3 -m venv foo` and then reinitializing it with `python3 -m venv foo` fails with a `Error: [Errno 13] Permission denied: '/path/to/cwd/foo/bin/activate.fish'` with the CPython interpreters from Nixpkgs. The method `EnvBuilder.install_scripts` that is responsible for copying the files, copies the permissions, instead of explicitly stating what permissions are needed. This fails with the Nixpkgs builds of CPython because in Nixpkgs the entire store is made read-only. Files that need to be copied from the installation during run-time should be explicit about the permissions they require, instead of depending on their current permissions. ---------- messages: 377828 nosy: Frederik Rietdijk priority: normal severity: normal status: open title: EnvBuilder.install_scripts should use explicit permissions type: behavior versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 14:58:45 2020 From: report at bugs.python.org (Frederik Rietdijk) Date: Fri, 02 Oct 2020 18:58:45 +0000 Subject: [issue41913] EnvBuilder.install_scripts should use explicit permissions In-Reply-To: <1601665066.98.0.447364183883.issue41913@roundup.psfhosted.org> Message-ID: <1601665125.25.0.0582929858246.issue41913@roundup.psfhosted.org> Frederik Rietdijk added the comment: Nixpkgs issue https://github.com/NixOS/nixpkgs/issues/99156. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 15:21:09 2020 From: report at bugs.python.org (Sumagna Das) Date: Fri, 02 Oct 2020 19:21:09 +0000 Subject: [issue39710] "will be returned as unicode" reminiscent from Python 2 In-Reply-To: <1582300708.21.0.335550003251.issue39710@roundup.psfhosted.org> Message-ID: <1601666469.99.0.894101639162.issue39710@roundup.psfhosted.org> Sumagna Das added the comment: Can i take on this issue? If yes, what am I supposed to do except for removing those lines which are mentioned? ---------- nosy: +sumagnadas _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 15:43:02 2020 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 02 Oct 2020 19:43:02 +0000 Subject: [issue41906] logging.config.dictConfig does not work with callable filters In-Reply-To: <1601599406.74.0.279190575587.issue41906@roundup.psfhosted.org> Message-ID: <1601667782.8.0.15521056682.issue41906@roundup.psfhosted.org> Vinay Sajip added the comment: You make reasonable points. I won't close this issue, and get to those updates when I can/as time allows. Meanwhile, if you or someone else proposes specific changes by way of a pull request, I'll look at that too. And thanks for your kind words about the logging docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 16:01:37 2020 From: report at bugs.python.org (Tim Peters) Date: Fri, 02 Oct 2020 20:01:37 +0000 Subject: [issue41912] Long generator chain causes segmentation fault In-Reply-To: <1601661685.77.0.221830308398.issue41912@roundup.psfhosted.org> Message-ID: <1601668897.19.0.735470715735.issue41912@roundup.psfhosted.org> Tim Peters added the comment: The docs are already clear about that you play with `setrecursionlimit()` at your own risk: """ Set the maximum depth of the Python interpreter stack to limit. This limit prevents infinite recursion from causing an overflow of the C stack and crashing Python. The highest possible limit is platform-dependent. A user may need to set the limit higher when they have a program that requires deep recursion and a platform that supports a higher limit. This should be done with care, because a too-high limit can lead to a crash. """ If you see a crash instead of a `RecursionError` exception when you _don't_ shoot yourself in the foot this way, that might be interesting. But, as is, you're deliberately overriding a mechanism designed to prevent these kinds of crashes. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 16:11:40 2020 From: report at bugs.python.org (Alice Bevan-McGregor) Date: Fri, 02 Oct 2020 20:11:40 +0000 Subject: [issue36094] When using an SMTP SSL connection,, get ValueError. In-Reply-To: <1550943841.97.0.129283187576.issue36094@roundup.psfhosted.org> Message-ID: <1601669500.4.0.695038817911.issue36094@roundup.psfhosted.org> Alice Bevan-McGregor added the comment: Howdy! One of my projects, Marrow Mailer (formerly TurboMail) has received a bit of a flood of reports and erroneous pull requests attempting to correct this bug in the invocation of smtplib by Mailer. https://github.com/marrow/mailer/issues/83 is our own tracking issue, with https://github.com/marrow/mailer/pull/91 as the most "successful" pull request with more detailed (contextualized) traceback, comparison, and links to official documentation. (Also, yay, worked around the problem here by recovering my "native" issue tracker account rather than trying to sign in with GitHub.) This appears to be a clear regression. The particular reason why I'm unwilling to accept these patches to Mailer is that passing a hostname at SMTP_SSL instantiation time will cause the connection to be initiated from within __init__ itself, prior to any ability to set the diagnostic logging level, which is boo, hiss. Initializers actually doing things is un-good, beyond diagnostic logging not being an optional keyword argument. (Instantiation != procedural invocation.) ---------- nosy: +amcgregor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 16:22:14 2020 From: report at bugs.python.org (Tom Karzes) Date: Fri, 02 Oct 2020 20:22:14 +0000 Subject: [issue41912] Long generator chain causes segmentation fault In-Reply-To: <1601661685.77.0.221830308398.issue41912@roundup.psfhosted.org> Message-ID: <1601670134.55.0.446378576555.issue41912@roundup.psfhosted.org> Tom Karzes added the comment: That is a good point, except I don't believe the value needed to expose this bug is a "too-high limit" (as the documentation calls it). I set it to 100100 for convenience, but in practice even a value of 17000 is more than enough to expose the bug on my system (it occurs at around 16500). For my friend using Windows, a value as low as 4000 suffices, which I don't think anyone would argue is unreasonably high. The default value of 1000 is extremely low, and is intended to catch recursion bugs in programs that are not expected to recurse very deeply. For a program that genuinely needs recursion, I don't think a value of 20000, or even 100000, is unreasonable given today's typical memory sizes (and when I run my failing case, the memory usage is so low as to be inconsequential). By my interpretation, these limits should be well within the range that Python can handle. It seems likely to me that in this case, the problem isn't due to any kind of system limit, but is rather the result of a logical error in the implementation which is somehow exposed by this test. Hopefully a developer will take advantage of this test case to fix what I believe is a serious bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 16:39:36 2020 From: report at bugs.python.org (Sumagna Das) Date: Fri, 02 Oct 2020 20:39:36 +0000 Subject: [issue41914] test_pdb fails wit Message-ID: <1601671175.99.0.383994267715.issue41914@roundup.psfhosted.org> New submission from Sumagna Das : I was thinking about contributing to cpython so i cloned it and followed the tests mentioned on devguide.python.org. When i ran my tests, it failed on two of them: test_pdb and test_ssl. test_ssl had an issue already as i found here. test_pdb failure was the one which i didn't find here. It failed with the following message: == CPython 3.10.0a0 (heads/master:a937ab45d6, Oct 3 2020, 00:16:29) [GCC 9.3.0] == Linux-5.4.0-48-generic-x86_64-with-glibc2.31 little-endian == cwd: /mnt/sda2/github/cpython/build/test_python_21809? == CPU count: 4 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 1.52 Run tests in parallel using 2 child processes 0:00:06 load avg: 1.48 [1/1/1] test_pdb failed test_blocks_at_first_code_line (test.test_pdb.PdbTestCase) ... ok test_breakpoint (test.test_pdb.PdbTestCase) ... ok test_errors_in_command (test.test_pdb.PdbTestCase) ... FAIL test_find_function_empty_file (test.test_pdb.PdbTestCase) ... ok test_find_function_found (test.test_pdb.PdbTestCase) ... ok test_find_function_found_with_bom (test.test_pdb.PdbTestCase) ... ok test_find_function_found_with_encoding_cookie (test.test_pdb.PdbTestCase) ... ok test_header (test.test_pdb.PdbTestCase) ... ok test_issue13120 (test.test_pdb.PdbTestCase) ... ok test_issue13183 (test.test_pdb.PdbTestCase) ... ok test_issue16180 (test.test_pdb.PdbTestCase) ... ok test_issue36250 (test.test_pdb.PdbTestCase) ... ok test_issue7964 (test.test_pdb.PdbTestCase) ... ok test_module_is_run_as_main (test.test_pdb.PdbTestCase) ... ok test_module_without_a_main (test.test_pdb.PdbTestCase) ... ok test_readrc_homedir (test.test_pdb.PdbTestCase) ... ok test_readrc_kwarg (test.test_pdb.PdbTestCase) ... ok test_relative_imports (test.test_pdb.PdbTestCase) ... ok test_relative_imports_on_plain_module (test.test_pdb.PdbTestCase) ... ok test_run_module (test.test_pdb.PdbTestCase) ... ok test_run_pdb_with_pdb (test.test_pdb.PdbTestCase) ... ok test_list_commands (test.test_pdb) Doctest: test.test_pdb.test_list_commands ... ok test_next_until_return_at_return_event (test.test_pdb) Doctest: test.test_pdb.test_next_until_return_at_return_event ... ok test_pdb_basic_commands (test.test_pdb) Doctest: test.test_pdb.test_pdb_basic_commands ... ok test_pdb_breakpoint_commands (test.test_pdb) Doctest: test.test_pdb.test_pdb_breakpoint_commands ... ok test_pdb_continue_in_bottomframe (test.test_pdb) Doctest: test.test_pdb.test_pdb_continue_in_bottomframe ... ok test_pdb_displayhook (test.test_pdb) Doctest: test.test_pdb.test_pdb_displayhook ... ok test_pdb_issue_20766 (test.test_pdb) Doctest: test.test_pdb.test_pdb_issue_20766 ... ok test_pdb_next_command_for_asyncgen (test.test_pdb) Doctest: test.test_pdb.test_pdb_next_command_for_asyncgen ... ok test_pdb_next_command_for_coroutine (test.test_pdb) Doctest: test.test_pdb.test_pdb_next_command_for_coroutine ... ok test_pdb_next_command_for_generator (test.test_pdb) Doctest: test.test_pdb.test_pdb_next_command_for_generator ... ok test_pdb_next_command_in_generator_for_loop (test.test_pdb) Doctest: test.test_pdb.test_pdb_next_command_in_generator_for_loop ... ok test_pdb_next_command_subiterator (test.test_pdb) Doctest: test.test_pdb.test_pdb_next_command_subiterator ... ok test_pdb_return_command_for_coroutine (test.test_pdb) Doctest: test.test_pdb.test_pdb_return_command_for_coroutine ... ok test_pdb_return_command_for_generator (test.test_pdb) Doctest: test.test_pdb.test_pdb_return_command_for_generator ... ok test_pdb_run_with_code_object (test.test_pdb) Doctest: test.test_pdb.test_pdb_run_with_code_object ... ok test_pdb_run_with_incorrect_argument (test.test_pdb) Doctest: test.test_pdb.test_pdb_run_with_incorrect_argument ... ok test_pdb_skip_modules (test.test_pdb) Doctest: test.test_pdb.test_pdb_skip_modules ... ok test_pdb_skip_modules_with_callback (test.test_pdb) Doctest: test.test_pdb.test_pdb_skip_modules_with_callback ... ok test_pdb_until_command_for_coroutine (test.test_pdb) Doctest: test.test_pdb.test_pdb_until_command_for_coroutine ... ok test_pdb_until_command_for_generator (test.test_pdb) Doctest: test.test_pdb.test_pdb_until_command_for_generator ... ok test_pdb_whatis_command (test.test_pdb) Doctest: test.test_pdb.test_pdb_whatis_command ... ok test_post_mortem (test.test_pdb) Doctest: test.test_pdb.test_post_mortem ... ok ====================================================================== FAIL: test_errors_in_command (test.test_pdb.PdbTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/mnt/sda2/github/cpython/Lib/test/test_pdb.py", line 1650, in test_errors_in_command self.assertEqual(stdout.splitlines()[1:], [ AssertionError: Lists differ: ['(Pd[283 chars]efined", 'LEAVING RECURSIVE DEBUGGER', '(Pdb) ', '\x1b[?1034h'] != ['(Pd[283 chars]efined", 'LEAVING RECURSIVE DEBUGGER', '(Pdb) '] First list contains 1 additional elements. First extra element 9: '\x1b[?1034h' ['(Pdb) *** SyntaxError: unexpected EOF while parsing', '(Pdb) ENTERING RECURSIVE DEBUGGER', '*** SyntaxError: unexpected EOF while parsing', 'LEAVING RECURSIVE DEBUGGER', '(Pdb) ENTERING RECURSIVE DEBUGGER', '> (1)()', "((Pdb)) *** NameError: name 'doesnotexist' is not defined", 'LEAVING RECURSIVE DEBUGGER', - '(Pdb) ', ? ^ + '(Pdb) '] ? ^ - '\x1b[?1034h'] ---------------------------------------------------------------------- Ran 43 tests in 5.143s FAILED (failures=1) test test_pdb failed == Tests result: FAILURE == 1 test failed: test_pdb Total duration: 6.8 sec Tests result: FAILURE Is this happening only with me? ---------- components: Tests messages: 377835 nosy: sumagnadas priority: normal severity: normal status: open title: test_pdb fails wit versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 16:43:28 2020 From: report at bugs.python.org (Sumagna Das) Date: Fri, 02 Oct 2020 20:43:28 +0000 Subject: [issue41914] test_pdb fails In-Reply-To: <1601671175.99.0.383994267715.issue41914@roundup.psfhosted.org> Message-ID: <1601671408.72.0.424688781322.issue41914@roundup.psfhosted.org> Change by Sumagna Das : ---------- title: test_pdb fails wit -> test_pdb fails _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 16:48:44 2020 From: report at bugs.python.org (Tim Peters) Date: Fri, 02 Oct 2020 20:48:44 +0000 Subject: [issue41912] Long generator chain causes segmentation fault In-Reply-To: <1601661685.77.0.221830308398.issue41912@roundup.psfhosted.org> Message-ID: <1601671724.3.0.662344614789.issue41912@roundup.psfhosted.org> Tim Peters added the comment: There is no way in portable ANSI C to deduce a "safe" limit. The limits that exist were picked by hand across platforms, to be conservative guesses at what would "never" break. You're allowed to increase the limit if you think you know better - and you may! No two platforms are the same. But - again - you do so at your own risk. There is no bug here unless you can provoke a crash _without_ overriding the default limit. I was there when the limit was introduced. It was introduced precisely to avoid the vast array of strange system failures that can occur when the C stack overflows - and, again, there is no portable way to detect that "it's getting close" in ANSI C. Stack sizes provided by platform C implementations are all over the place, from kilobytes to megabytes, and can also be different yet again for threads, and there is no portable way in C to find out what they are. """ For my friend using Windows, a value as low as 4000 suffices, which I don't think anyone would argue is unreasonably high. """ For the defaults provided by Microsoft's Visual C compiler (which CPython uses), it is unreasonably high - the C stack overflows. In fact, under the released Python 3.8.5 on my 64-bit Windows, the largest value for which your program isn't obviously broken is about 2512. If I don't override the default recursion limit on Windows, I cannot provoke a problem with your program on Windows (instead it dies - as designed and intended - with a `RecursionError` exception instead). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 17:09:58 2020 From: report at bugs.python.org (Tom Karzes) Date: Fri, 02 Oct 2020 21:09:58 +0000 Subject: [issue41912] Long generator chain causes segmentation fault In-Reply-To: <1601661685.77.0.221830308398.issue41912@roundup.psfhosted.org> Message-ID: <1601672998.86.0.852605748915.issue41912@roundup.psfhosted.org> Tom Karzes added the comment: I tested this some more, and one thing became clear that I hadn't realized before: This bug has nothing to do specifically with generators (as I had thought), but is in fact due purely to the recursion limit. I created a recursive test program that doesn't use generators at all, and ran into the exact same problem (at only a slightly higher recursion level). I am attaching that test case as recurse_bug4.py. Here's a sample failing invocation: % ./recurse_bug4.py 20000 Segmentation fault (core dumped) % On my system, the cutoff point for this one seems to be around 17600, roughly 1100 higher than for the generator example. What surprises me about this is the Python implementation uses recursion to implement recursion in Python apps. I would have thought that it would use heap memory for something like this, and as a result only require a fixed amount of stack. That would clearly have major advantages, since it would decouple recursion limits in Python code from stack limits on the platform. On the other hand, now that I understand that this is in fact the result of a system limit, I was *very* easily able to work around the problem! I simply disabled the stack limit. From csh: % unlimit stacksize % Then: % ./gen_bug3.py 100000 100000 % and: % ./recurse_bug4.py 100000 100000 % So you were right, this was due solely to the default stack limit on my system, and not a bug in the Python implementation. And it was also very easy to remove that limit. Hopefully something similar can be done on Windows (which I know very little about). Thank you for your help! ---------- Added file: https://bugs.python.org/file49487/recurse_bug4.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 17:59:50 2020 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Oct 2020 21:59:50 +0000 Subject: [issue18228] AIX locale parsing failure In-Reply-To: <1371355395.07.0.213079327558.issue18228@psf.upfronthosting.co.za> Message-ID: <1601675990.91.0.556061132146.issue18228@roundup.psfhosted.org> Irit Katriel added the comment: Looks like this can be closed. ---------- nosy: +iritkatriel status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 19:15:27 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Oct 2020 23:15:27 +0000 Subject: [issue41866] Document error in chinese version of contextlib. In-Reply-To: <1601137438.19.0.414392303646.issue41866@roundup.psfhosted.org> Message-ID: <1601680527.44.0.338247662395.issue41866@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 19:20:27 2020 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Oct 2020 23:20:27 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601680827.34.0.680098779667.issue41905@roundup.psfhosted.org> Guido van Rossum added the comment: I'm going to ignore this issue until you two have reached agreement. I recommend using some example code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 19:28:10 2020 From: report at bugs.python.org (Justin Arthur) Date: Fri, 02 Oct 2020 23:28:10 +0000 Subject: [issue33533] Provide an async-generator version of as_completed In-Reply-To: <1526453333.0.0.682650639539.issue33533@psf.upfronthosting.co.za> Message-ID: <1601681290.43.0.736088696164.issue33533@roundup.psfhosted.org> Justin Arthur added the comment: Thanks, Hrvoje. I've updated the patch to match this bug's suggested format and have updated the documentation and What's New. The one quirk that comes with the benefit of getting the same futures back is that we still allow both coroutines and futures to be passed in. Coroutines will not be yielded back in their original form, but instead a new task. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 19:43:15 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Oct 2020 23:43:15 +0000 Subject: [issue41877] Check against misspellings of assert etc. in mock In-Reply-To: <1601317157.88.0.730935461305.issue41877@roundup.psfhosted.org> Message-ID: <1601682195.13.0.740296954019.issue41877@roundup.psfhosted.org> Terry J. Reedy added the comment: Vedran, you explained why many use pytest instead of unittest. But we have the latter and a stability policy. I am not familiar with the existing mock code, but one already invented solution for misspelling tolerance without enumeration is the soundex algorithm. I have not read the details for over a decade, but I belive soundex() = 'asrt' for all examples given here. Perhaps it could be used to broaden the test. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 19:47:13 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 02 Oct 2020 23:47:13 +0000 Subject: [issue41878] python3 fails to use custom mapping object as symbols in eval() In-Reply-To: <1601320340.36.0.581578891193.issue41878@roundup.psfhosted.org> Message-ID: <1601682433.95.0.571213640024.issue41878@roundup.psfhosted.org> Terry J. Reedy added the comment: Robert, this tracker is for patching CPython, not for debugging user code. If, as it appears, you are not suggesting the former, please close this. For the latter, python-list and stackoverflow.com are appropriate forums. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 20:17:07 2020 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Oct 2020 00:17:07 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1601684227.42.0.0551456524859.issue41584@roundup.psfhosted.org> Change by Brett Cannon : ---------- keywords: +patch pull_requests: +21516 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22505 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 20:17:11 2020 From: report at bugs.python.org (Justin Arthur) Date: Sat, 03 Oct 2020 00:17:11 +0000 Subject: [issue33533] Provide an async iterator version of as_completed In-Reply-To: <1526453333.0.0.682650639539.issue33533@psf.upfronthosting.co.za> Message-ID: <1601684231.12.0.800427314122.issue33533@roundup.psfhosted.org> Change by Justin Arthur : ---------- title: Provide an async-generator version of as_completed -> Provide an async iterator version of as_completed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 20:17:58 2020 From: report at bugs.python.org (Brett Cannon) Date: Sat, 03 Oct 2020 00:17:58 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1601684278.32.0.137708396226.issue41584@roundup.psfhosted.org> Change by Brett Cannon : ---------- stage: patch review -> commit review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 20:25:02 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Oct 2020 00:25:02 +0000 Subject: [issue41887] ast.literal_eval does not accept strings with leading whitespaces In-Reply-To: <1601430417.52.0.930336195437.issue41887@roundup.psfhosted.org> Message-ID: <1601684701.99.0.208243999334.issue41887@roundup.psfhosted.org> Terry J. Reedy added the comment: The doc for literal_eval says "evaluate ... a string containing a Python literal or container display." To me, ' 1' qualifies, just as it does as an expression for eval(). The exception comes from parsing raising IndentationError with leading whitespace even when the mode is 'eval' rather than 'exec'. This surprised me. Eval() gets strips the beginning of the string before it is parsed. If parsing remains as is, I agree that doing the same for literal_eval strings. But why should not parsing remove indents for 'eval' mode? ---------- nosy: +terry.reedy versions: +Python 3.10 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 20:34:52 2020 From: report at bugs.python.org (Eryk Sun) Date: Sat, 03 Oct 2020 00:34:52 +0000 Subject: [issue41908] Make IDLE Start Menu entry more descriptive In-Reply-To: <1601632586.45.0.38147245228.issue41908@roundup.psfhosted.org> Message-ID: <1601685292.44.0.491364527591.issue41908@roundup.psfhosted.org> Eryk Sun added the comment: > maybe we should consider moving the bitness to the folder title > (so the folder becomes "Python 3.8 64-bit")? Splitting up the start-menu entries into separate "Python 3.9 (32-bit)" and "Python 3.9 (64-bit)" folders would reduce clutter in the folder when browsing the start menu. But the link names have to retain the bitness. If you type "idle" in the start menu, all you get is the link name, not the folder context, so the link name has to distinguish 32-bit vs 64-bit. Also, link names without bitness are already used by the Python store app distribution. > On Windows, we could go for something, like > Shell-Editor (3.9 64-bit) Then searching for "idle" no longer works, which may be a practical trade-off considering novices are probably unfamiliar with IDLE. With or without "IDLE" in the name, this only works well for novices that browse the start menu. It's not discoverable if the user just taps the WIN key and types "python". That search will return links to python.exe, which uses a system console session instead of the IDLE shell. If IDLE should be preferred, then maybe the name should be "Python 3.9 Shell+Editor (64-bit)". ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 21:10:11 2020 From: report at bugs.python.org (Johan Herland) Date: Sat, 03 Oct 2020 01:10:11 +0000 Subject: [issue41913] EnvBuilder.install_scripts should use explicit permissions In-Reply-To: <1601665066.98.0.447364183883.issue41913@roundup.psfhosted.org> Message-ID: <1601687411.73.0.873005050332.issue41913@roundup.psfhosted.org> Change by Johan Herland : ---------- nosy: +jherland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 21:13:56 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Oct 2020 01:13:56 +0000 Subject: [issue41910] Document that object.__eq__ implements `a is b` In-Reply-To: <1601652122.88.0.984647748564.issue41910@roundup.psfhosted.org> Message-ID: <1601687636.17.0.0883480334158.issue41910@roundup.psfhosted.org> Terry J. Reedy added the comment: The word 'object' in this section is a bit confusing because it refers to any Python object, not to base class 'object' or an instance thereof. I suspect that this usage predates the introduction of the latter in 2.2. This interpretation is required for sentences like "By default, __ne__() delegates to __eq__() and inverts the result unless it is NotImplemented." and "If a class does not define an __eq__() method ..." (in the __hash__ entry) to make sense. I think that the meaning of 'object' should be stipulated at the top of the section and mention the existence of base class 'object', and maybe list which of the following methods it has, and that they are inherited by subclasses. The base class __eq__ implementation is implied in this paragraph in the __hash__ entry. "User-defined classes have __eq__() and __hash__() methods by default; with them, all objects compare unequal (except with themselves) and x.__hash__() returns an appropriate value such that x == y implies both that x is y and hash(x) == hash(y)." I think it worthwhile explaining that user classes get these defaults by inheriting them (and others) from 'object', and that the implication follows from inheriting a particular base class implementation of __eq__. To put it another way, I believe the quoted paragraph makes the definition a Python requirement rather than just a CPython implementation detail. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 21:23:47 2020 From: report at bugs.python.org (Ethan Tang US) Date: Sat, 03 Oct 2020 01:23:47 +0000 Subject: [issue41915] unittest.mock.create_autospec(Obj, instance=True) has self keyword in _spec_signature if Obj implements __call__ Message-ID: <1601688227.96.0.0965935424623.issue41915@roundup.psfhosted.org> New submission from Ethan Tang US : When an `unittest.mock.create_autospec(Obj, instance=True)` is used, and said Obj implements the `__call__(self, ...)` function, the mocked instance of it will take the full function signature including the `self` argument. This will then cause an issue when `assert_called_once_with()` or `assert_called_with()` is used. Those two assertions will fail regardless if the arguments used were correct or not. The error message will contain the error: `TypeError: missing a required argument: 'self'` Here an example of this issue happening ``` from unittest import mock def Foo(object): def __call__(self, a): pass def bar(self, b): ```This is to just compare it with a regular function.``` pass foo_mock = mock.create_autospec(Foo, instance=True) foo_mock(a=1) foo_mock.assert_called_once_with(a=1) ``` In the example above, the assertion will then fail and raise an error even though the assertion should be correct. upon inspecting further to understand the issue, this is because `foo_mock._spec_signature` will be ``. The existence of `self` in `foo_mock._spec_signature` will cause this error. As compared to the method `foo_mock.bar._spec_signature`, it will only be ``. The reason for me posting this issue is that development with the Keras library heavily uses __call__ in their API and therefore it is hard to mock the APIs if such issue exists. One work around would be iterating through its `called_args_list`. ---------- components: Library (Lib) messages: 377846 nosy: ettang priority: normal severity: normal status: open title: unittest.mock.create_autospec(Obj, instance=True) has self keyword in _spec_signature if Obj implements __call__ versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 21:43:58 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Oct 2020 01:43:58 +0000 Subject: [issue41911] Language reference incorrectly says comparison expressions return boolean values In-Reply-To: <1601652453.05.0.89373160388.issue41911@roundup.psfhosted.org> Message-ID: <1601689438.59.0.230854251145.issue41911@roundup.psfhosted.org> Terry J. Reedy added the comment: For rich comparisons, a proper explanation is given in the rich comparison entry in the datamodel section ( #41910) "A rich comparison method may return the singleton NotImplemented if it does not implement the operation for a given pair of arguments. By convention, False and True are returned for a successful comparison. However, these methods can return any value, so if the comparison operator is used in a Boolean context (e.g., in the condition of an if statement), Python will call bool() on the value to determine if the result is true or false." bool(x) calls x.__bool__ and requires that the latter return False or True. As for the other two comparisons, x is y always returns False or True for a proper implementation because int == int always does. If y.__contains__(x) does not raise, x in y returns bool(y.__contains__(x)), clamping aberrant implementations of __contains__. A replacement text might be "Comparisons normally yield boolean values: True or False. But rich comparisons not in a Boolean context may yield anything." Possibly link 'rich comparisons' to the datamodel section. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 22:05:02 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 03 Oct 2020 02:05:02 +0000 Subject: [issue41912] Long generator chain causes segmentation fault In-Reply-To: <1601661685.77.0.221830308398.issue41912@roundup.psfhosted.org> Message-ID: <1601690702.82.0.739514178907.issue41912@roundup.psfhosted.org> Terry J. Reedy added the comment: Another "We are not responsible, proceed at your own risk" operation is importing ctypes, which allows one to overwrite bytes in the running python. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 23:31:29 2020 From: report at bugs.python.org (Tim Peters) Date: Sat, 03 Oct 2020 03:31:29 +0000 Subject: [issue41912] Long generator chain causes segmentation fault In-Reply-To: <1601661685.77.0.221830308398.issue41912@roundup.psfhosted.org> Message-ID: <1601695889.96.0.760111587774.issue41912@roundup.psfhosted.org> Tim Peters added the comment: Right, generators played no essential role here. Just one way of piling up a tall tower of C stack frames. Search the web for "stackless Python" for the history of attempts to divorce the CPython implementation from the platform C stack. There are ways to increase the main thread's stack size on Windows too using MSVC, but unless someone is extremely knowledgeable and willing to write some assembler to help out, they need to change it via a Windows linker option when the .exe is built, or via the EDITBIN developer tool (to modify the .exe file). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Oct 2 23:49:00 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Oct 2020 03:49:00 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601696940.22.0.808099181589.issue41905@roundup.psfhosted.org> Raymond Hettinger added the comment: > I'm going to ignore this issue until you two have reached agreement. > I recommend using some example code. That won't be necessary. I now understand what the OP is trying to do and am going to recommend against it. Guido, this really a decision for you to make. Formerly ABC logic existed independent of any other class logic. Nothing else in the standard library or in third-party tooling was required to take it into account. A developer could leave or take it if they pleased. The OP is proposing much tighter coupling and interdependence. Effectively, he wants two new general rules to apply pervasively to existing tooling that previously had no reason to interact with ABCs at all. 1) When checking to see if a method exists, perhaps by using hasattr(), it should exclude abstract methods as determined by a follow-up getattr() call. 2) If a tool dynamically adds a method, it has duty to call update_abstractmethods() if even a slim possibility exists that ABCs are being used. Presumably, none of this is unique to the total_ordering() decorator and it would apply to anything that dynamically inspects or updates classes whether by direct call, by class decorator, or by metaclass. My recommendation is to not go down this path. In the particular case of total_ordering(), the value add is slightly above zero. In the decade long history of ABCs and the total_ordering() decorator, the need for this has arisen zero times. P.S. In the standard library, only the numbers module has ABCs with abstract rich comparison methods. Typically, these would be used by registering the ABC rather than by inheriting from it. That may be one reason why this hasn't come up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 00:55:04 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 03 Oct 2020 04:55:04 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601700904.2.0.475360456827.issue41905@roundup.psfhosted.org> Guido van Rossum added the comment: I still like to have a helper that recalculates the abstractness status of a class after adding some new methods (or deleting some). I would prefer the isinstance(cls, ABCMeta) check to be inside that helper, so that you could call it unconditionally after adding/deleting methods: abc.update_abstractmethods(cls). (It doesn't really need a comment saying "Update abstract methods" either. :-) In fact, its signature makes the helper feasible as a class decorator itself, so that users who are using a mixin class decorator that doesn't update abstractness can add it conveniently themselvs. E.g. suppose @total_ordering didn't make this call itself, then the user could write @abc.update_abstractmethods @functools.total_ordering class MyClass(SomeAbstractBaseClass): def __lt__(self, other): whatever But I think it would be nice if @total_ordering and @dataclass did include this call. However, I don't see why @total_ordering needs to be changed to also override abstract methods *defined in the decorated class*. If I write @functools.total_ordering class MyAbstractClass(abc.ABC): @abc.abstractmethod def __lt__(self, other): return NotImplemented it's totally clear to me what @total_ordering should do -- it should define __le__, __gt__ and __ge__ in terms of __lt__, and leave __lt__ alone, for some subclass to implement. With these two amendments, the changes to dataclasses.py and functools.py are limited to two lines (adding the call to abc.update_abstractmethod(cls)), plus an import change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 01:10:32 2020 From: report at bugs.python.org (Tom Karzes) Date: Sat, 03 Oct 2020 05:10:32 +0000 Subject: [issue41912] Long generator chain causes segmentation fault In-Reply-To: <1601661685.77.0.221830308398.issue41912@roundup.psfhosted.org> Message-ID: <1601701832.84.0.677291103701.issue41912@roundup.psfhosted.org> Tom Karzes added the comment: Thanks Tim and Terry. Stackless Python sounds interesting. It's nice to know that others had the same idea I did, although I tend to shy away from exotic variants since they tend to be less well-supported. Any chance that CPython will go stackless at some point in the future? By the way, I saw that I can increase the process stack limit from within a Python app: resource.setrlimit(resource.RLIMIT_STACK, (resource.RLIM_INFINITY, resource.RLIM_INFINITY)) I tried it, and it works (on my Linux system), but of course is unavailable on Windows systems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 01:10:35 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 03 Oct 2020 05:10:35 +0000 Subject: [issue41887] ast.literal_eval does not accept strings with leading whitespaces In-Reply-To: <1601430417.52.0.930336195437.issue41887@roundup.psfhosted.org> Message-ID: <1601701835.08.0.281420068919.issue41887@roundup.psfhosted.org> Guido van Rossum added the comment: [Terry] > But why should not parsing remove indents for 'eval' mode? I dunno, but it's been doing this since 1992, so I think it would be fragile to change. The best thing therefore is to make ast.literal_eval() match it exactly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 01:50:29 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 03 Oct 2020 05:50:29 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601704229.51.0.600302118474.issue41905@roundup.psfhosted.org> Raymond Hettinger added the comment: > it's totally clear to me what @total_ordering should do > -- it should define __le__, __gt__ and __ge__ in terms > of __lt__, and leave __lt__ alone, for some subclass to > implement. +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 01:59:01 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 05:59:01 +0000 Subject: [issue41892] use both "for in" and "ElementTree.remove" has a index bug In-Reply-To: <1601475625.07.0.195514916094.issue41892@roundup.psfhosted.org> Message-ID: <1601704741.96.0.985715468766.issue41892@roundup.psfhosted.org> Change by Stefan Behnel : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 02:07:25 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Oct 2020 06:07:25 +0000 Subject: [issue41900] XML C14N serialisation fails with default namespace In-Reply-To: <1601539771.76.0.649263421271.issue41900@roundup.psfhosted.org> Message-ID: <1601705245.94.0.822678597348.issue41900@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +21517 pull_request: https://github.com/python/cpython/pull/22507 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 02:07:33 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Oct 2020 06:07:33 +0000 Subject: [issue41900] XML C14N serialisation fails with default namespace In-Reply-To: <1601539771.76.0.649263421271.issue41900@roundup.psfhosted.org> Message-ID: <1601705253.67.0.274678998346.issue41900@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21518 pull_request: https://github.com/python/cpython/pull/22508 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 02:07:20 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 06:07:20 +0000 Subject: [issue41900] XML C14N serialisation fails with default namespace In-Reply-To: <1601539771.76.0.649263421271.issue41900@roundup.psfhosted.org> Message-ID: <1601705240.15.0.462371933589.issue41900@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset 6a412c94b6b68e7e3632562dc7358a12ffd1447f by scoder in branch 'master': bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) https://github.com/python/cpython/commit/6a412c94b6b68e7e3632562dc7358a12ffd1447f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 02:41:38 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 06:41:38 +0000 Subject: [issue41900] XML C14N serialisation fails with default namespace In-Reply-To: <1601539771.76.0.649263421271.issue41900@roundup.psfhosted.org> Message-ID: <1601707298.94.0.649288462612.issue41900@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset a0f2b664335eb689abdecc677e09a193f503af59 by Miss Skeleton (bot) in branch '3.9': bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) (GH-22507) https://github.com/python/cpython/commit/a0f2b664335eb689abdecc677e09a193f503af59 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 02:42:41 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 06:42:41 +0000 Subject: [issue41900] XML C14N serialisation fails with default namespace In-Reply-To: <1601539771.76.0.649263421271.issue41900@roundup.psfhosted.org> Message-ID: <1601707361.25.0.544722249254.issue41900@roundup.psfhosted.org> Stefan Behnel added the comment: New changeset cfed5343331350c5737b464970a31f7588319e8b by Miss Skeleton (bot) in branch '3.8': bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) (GH-22508) https://github.com/python/cpython/commit/cfed5343331350c5737b464970a31f7588319e8b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 02:44:34 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 06:44:34 +0000 Subject: [issue41900] XML C14N serialisation fails with default namespace In-Reply-To: <1601539771.76.0.649263421271.issue41900@roundup.psfhosted.org> Message-ID: <1601707474.59.0.607443493489.issue41900@roundup.psfhosted.org> Change by Stefan Behnel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 02:56:08 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 06:56:08 +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: <1601708168.13.0.560599055899.issue6721@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: +scoder nosy_count: 29.0 -> 30.0 pull_requests: +21519 pull_request: https://github.com/python/cpython/pull/22474 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 02:56:08 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 06:56:08 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1601708168.39.0.930670024937.issue36533@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: +scoder nosy_count: 9.0 -> 10.0 pull_requests: +21520 pull_request: https://github.com/python/cpython/pull/22474 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 02:56:08 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 06:56:08 +0000 Subject: [issue33802] Regression in logging configuration In-Reply-To: <1528412435.4.0.592728768989.issue33802@psf.upfronthosting.co.za> Message-ID: <1601708168.75.0.343986504159.issue33802@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: +scoder nosy_count: 9.0 -> 10.0 pull_requests: +21521 pull_request: https://github.com/python/cpython/pull/22474 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 03:07:34 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 07:07:34 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1601708854.22.0.192327741844.issue36533@roundup.psfhosted.org> Change by Stefan Behnel : ---------- pull_requests: -21520 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 03:08:03 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 07:08:03 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1601708883.02.0.991271268335.issue36533@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: -scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 03:08:30 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 07:08:30 +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: <1601708910.72.0.626187590012.issue6721@roundup.psfhosted.org> Change by Stefan Behnel : ---------- pull_requests: -21519 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 03:08:56 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 07:08:56 +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: <1601708936.28.0.937821461048.issue6721@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: -scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 03:09:21 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 07:09:21 +0000 Subject: [issue33802] Regression in logging configuration In-Reply-To: <1528412435.4.0.592728768989.issue33802@psf.upfronthosting.co.za> Message-ID: <1601708961.34.0.29115114888.issue33802@roundup.psfhosted.org> Change by Stefan Behnel : ---------- pull_requests: -21521 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 03:09:33 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sat, 03 Oct 2020 07:09:33 +0000 Subject: [issue33802] Regression in logging configuration In-Reply-To: <1528412435.4.0.592728768989.issue33802@psf.upfronthosting.co.za> Message-ID: <1601708973.95.0.813191851371.issue33802@roundup.psfhosted.org> Change by Stefan Behnel : ---------- nosy: -scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 03:20:28 2020 From: report at bugs.python.org (Dustin Spicuzza) Date: Sat, 03 Oct 2020 07:20:28 +0000 Subject: [issue41916] cxx pthread check is not overrideable Message-ID: <1601709628.96.0.95457003563.issue41916@roundup.psfhosted.org> New submission from Dustin Spicuzza : I'm cross-compiling python to ARM, following instructions from the crossenv project @ https://crossenv.readthedocs.io/en/latest/quickstart.html#build-or-obtain-host-python I was getting pthread related errors when using cross-built extension modules. I realized the issue was that distutils wasn't passing -pthread to gcc. On my native python (Fedora 32 Python 3.8): >>> import pprint, distutils.sysconfig >>> pprint.pprint({i: distutils.sysconfig.get_config_vars(i)[0] for i in ('CC', 'CXX', 'LDSHARED')}) {'CC': 'gcc -pthread', 'CXX': 'g++ -pthread', 'LDSHARED': 'gcc -pthread -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now ' '-g -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -g'} In my cross-compiled python environment: >>> import pprint, distutils.sysconfig >>> pprint.pprint({i: distutils.sysconfig.get_config_vars(i)[0] for i in ('CC', 'CXX', 'LDSHARED')}) {'CC': 'arm-frc2020-linux-gnueabi-gcc', 'CXX': 'arm-frc2020-linux-gnueabi-c++', 'LDSHARED': 'arm-frc2020-linux-gnueabi-gcc -shared'} As you can see, no -pthread flag. I went digging in the configure script and found this comment in configure.ac:2110: # Some compilers won't report that they do not support -pthread, # so we need to run a program to see whether it really made the # function available. ... well, that doesn't work when cross-compiling. I looked at some other variables set to override things for cross compiling, and tried adding "ac_cv_pthread_is_default=no ac_cv_pthread=yes ac_cv_cxx_thread=yes" to my cross-compile ./configure, and it's closer: >>> import pprint, distutils.sysconfig >>> pprint.pprint({i: distutils.sysconfig.get_config_vars(i)[0] for i in ('CC', 'CXX', 'LDSHARED')}) {'CC': 'arm-frc2020-linux-gnueabi-gcc -pthread', 'CXX': 'arm-frc2020-linux-gnueabi-c++', 'LDSHARED': 'arm-frc2020-linux-gnueabi-gcc -pthread -shared'} Closer, but not there yet! It appears that the $ac_cv_cxx_thread is not externally settable (unlike ac_cv_pthread), which I guess is because it's not wrapped in a AC_CACHE_VAL macro? It seems that the right fix would be for someone to use AC_CACHE_VAL to allow $ac_cv_cxx_thread to be set externally? I'm happy to cargo cult some code from other parts of configure.ac and make a PR for it, but it's not immediately clear (a) what bad side effects this could cause and (b) what the best mechanism to use to regenerate configure et al is? ---------- components: Cross-Build messages: 377858 nosy: Alex.Willmer, virtuald priority: normal severity: normal status: open title: cxx pthread check is not overrideable versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 03:49:25 2020 From: report at bugs.python.org (ullix) Date: Sat, 03 Oct 2020 07:49:25 +0000 Subject: [issue41917] Python 3.9rc2 fails to install matplotlib Message-ID: <1601711365.63.0.761607861812.issue41917@roundup.psfhosted.org> New submission from ullix : Installing matplotlib via: python3 -m pip install -U matplotlib fails because kiwisolver cannot be installed. Among a lot of error output is: WARNING: The wheel package is not available. Not having matplotlib is a MAJOR hurdle for many! Sstem: Ubuntu 16.04 with Python 3.9rc2 installed from deadsnakes repository (http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/) ---------- components: Installation messages: 377859 nosy: ullix priority: normal severity: normal status: open title: Python 3.9rc2 fails to install matplotlib type: resource usage versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 04:08:54 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Oct 2020 08:08:54 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601712534.87.0.55387824907.issue41909@roundup.psfhosted.org> Serhiy Storchaka added the comment: Interesting, when lookup any attribute you will get a RecursionError, but this is one of only two places where the recursion check is disabled (the other one is in interning strings). You get a crash also when call isinstance(1, instance) or issubclass(int, instance). This is the same bug. The implementation of issubclass() calls PyObject_IsSubclass() which calls object_issubclass() which calls recursive_issubclass() which calls check_class() which calls abstract_get_bases() which looks up attribute "__bases__" which leads to infinite recursion in __getattr__(). #125278 0x000055555576116d in abstract_get_bases (cls=cls at entry=0x7fffeabcee10) at Objects/abstract.c:2340 #125279 0x00005555557611f1 in check_class (cls=cls at entry=0x7fffeabcee10, error=error at entry=0x55555585c828 "issubclass() arg 1 must be a class") at Objects/abstract.c:2396 #125280 0x00005555557619bf in recursive_issubclass (derived=derived at entry=0x7fffeabcee10, cls=cls at entry=0x555555946220 ) at Objects/abstract.c:2524 #125281 0x0000555555761daf in object_issubclass (tstate=, derived=0x7fffeabcee10, cls=0x555555946220 ) at Objects/abstract.c:2550 #125282 0x0000555555765ea1 in PyObject_IsSubclass (derived=, cls=) at Objects/abstract.c:2600 #125283 0x00005555557b78f3 in builtin_issubclass_impl (module=module at entry=0x7fffeae21d70, cls=, class_or_tuple=) at Python/bltinmodule.c:2511 #125284 0x00005555557b794d in builtin_issubclass (module=0x7fffeae21d70, args=0x7fffead0e388, nargs=) at Python/clinic/bltinmodule.c.h:828 The problem is that in abstract_get_bases() the recursion check is disabled by using macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION (added in 5b222135f8d2492713994f2cb003980e87ce6a72). I do not know why it was necessary. Currently tests are passed if enable recursion check, and this fixes this issue. It is worth to mention that attribute __bases__ is looked up to support non-types in issubclass() and isinstance(). Originally it was added in issue464992 to support Zope extension ExtensionClass. I tested that the current code of ExtensionClass does not need it. So we could simplify the code and avoid recursion by just using tp_bases. But this needs wider discussion. ---------- nosy: +gvanrossum, loewis, nascheme, serhiy.storchaka versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 04:17:58 2020 From: report at bugs.python.org (Ben Avrahami) Date: Sat, 03 Oct 2020 08:17:58 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601713078.93.0.168590040801.issue41905@roundup.psfhosted.org> Ben Avrahami added the comment: > I would prefer the isinstance(cls, ABCMeta) check to be inside that helper I had a little debate about this in my mind, I'll change it. > it's totally clear to me what @total_ordering should do -- it should define __le__, __gt__ and __ge__ in terms of __lt__, and leave __lt__ alone, for some subclass to implement. Implementing this logic would require more than two lines. I will add it to the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 05:06:44 2020 From: report at bugs.python.org (Quentin Peter) Date: Sat, 03 Oct 2020 09:06:44 +0000 Subject: [issue41918] exec fails to take locals into account when running list comprehensions Message-ID: <1601716004.0.0.802801393199.issue41918@roundup.psfhosted.org> New submission from Quentin Peter : The exec function fails to take locals into account when executing a list comprehension: ``` Python 3.7.7 (default, Mar 10 2020, 15:43:33) [Clang 11.0.0 (clang-1100.0.33.17)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> exec(compile('[my_var for i in range(1)]\n', '', 'single'), {**globals(), "my_var": 0}, None) [0] >>> exec(compile('[my_var for i in range(1)]\n', '', 'single'), globals(), {"my_var": 0}) Traceback (most recent call last): File "", line 1, in File "", line 1, in File "", line 1, in NameError: name 'my_var' is not defined >>> ``` This is the cause of https://bugs.python.org/issue21161 ---------- messages: 377862 nosy: qpeter priority: normal severity: normal status: open title: exec fails to take locals into account when running list comprehensions type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 05:37:07 2020 From: report at bugs.python.org (hai shi) Date: Sat, 03 Oct 2020 09:37:07 +0000 Subject: [issue41919] Move the codecs' register operation to testcases Message-ID: <1601717827.7.0.637294336769.issue41919@roundup.psfhosted.org> New submission from hai shi : After PR22360 merged, we can move the codecs' register operation to testcases. ---------- components: Tests messages: 377863 nosy: shihai1991, vstinner priority: normal severity: normal status: open title: Move the codecs' register operation to testcases type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 05:39:36 2020 From: report at bugs.python.org (hai shi) Date: Sat, 03 Oct 2020 09:39:36 +0000 Subject: [issue41919] Move the codecs' register operation to testcases In-Reply-To: <1601717827.7.0.637294336769.issue41919@roundup.psfhosted.org> Message-ID: <1601717976.78.0.7822904364.issue41919@roundup.psfhosted.org> Change by hai shi : ---------- keywords: +patch pull_requests: +21522 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22513 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 05:40:12 2020 From: report at bugs.python.org (hai shi) Date: Sat, 03 Oct 2020 09:40:12 +0000 Subject: [issue41919] Move the codecs.register operation to testcases In-Reply-To: <1601717827.7.0.637294336769.issue41919@roundup.psfhosted.org> Message-ID: <1601718012.31.0.427663754347.issue41919@roundup.psfhosted.org> Change by hai shi : ---------- title: Move the codecs' register operation to testcases -> Move the codecs.register operation to testcases _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 05:52:17 2020 From: report at bugs.python.org (Tal Einat) Date: Sat, 03 Oct 2020 09:52:17 +0000 Subject: [issue40833] Clarify docstring of Path.rename In-Reply-To: <1590933048.45.0.441602956173.issue40833@roundup.psfhosted.org> Message-ID: <1601718737.39.0.923532798743.issue40833@roundup.psfhosted.org> Tal Einat added the comment: New changeset f97e42ef4d97dee64f45ed65170a6e77c8e46fdf by Ram Rachum in branch 'master': bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554) https://github.com/python/cpython/commit/f97e42ef4d97dee64f45ed65170a6e77c8e46fdf ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 05:52:29 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Oct 2020 09:52:29 +0000 Subject: [issue40833] Clarify docstring of Path.rename In-Reply-To: <1590933048.45.0.441602956173.issue40833@roundup.psfhosted.org> Message-ID: <1601718749.16.0.413175462136.issue40833@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +21523 pull_request: https://github.com/python/cpython/pull/22514 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 05:52:37 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Oct 2020 09:52:37 +0000 Subject: [issue40833] Clarify docstring of Path.rename In-Reply-To: <1590933048.45.0.441602956173.issue40833@roundup.psfhosted.org> Message-ID: <1601718757.74.0.882319501605.issue40833@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21524 pull_request: https://github.com/python/cpython/pull/22515 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 06:02:35 2020 From: report at bugs.python.org (David Beazley) Date: Sat, 03 Oct 2020 10:02:35 +0000 Subject: [issue7946] Convoy effect with I/O bound threads and New GIL In-Reply-To: <1266353325.38.0.278549753357.issue7946@psf.upfronthosting.co.za> Message-ID: <1601719355.58.0.651111116056.issue7946@roundup.psfhosted.org> David Beazley added the comment: About nine years ago, I stood in front of a room of Python developers, including many core developers, and gave a talk about the problem described in this issue. It included some live demos and discussion of a possible fix. https://www.youtube.com/watch?v=fwzPF2JLoeU Based on subsequent interest, I think it's safe to say that this issue will never be fixed. Probably best to close this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 06:11:43 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Oct 2020 10:11:43 +0000 Subject: [issue40833] Clarify docstring of Path.rename In-Reply-To: <1590933048.45.0.441602956173.issue40833@roundup.psfhosted.org> Message-ID: <1601719903.31.0.938954645104.issue40833@roundup.psfhosted.org> miss-islington added the comment: New changeset 4b982e0dd7354c9103a0cae8e6e78b5e57794e77 by Miss Skeleton (bot) in branch '3.8': bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554) https://github.com/python/cpython/commit/4b982e0dd7354c9103a0cae8e6e78b5e57794e77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 06:17:18 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Oct 2020 10:17:18 +0000 Subject: [issue40833] Clarify docstring of Path.rename In-Reply-To: <1590933048.45.0.441602956173.issue40833@roundup.psfhosted.org> Message-ID: <1601720238.37.0.584478634029.issue40833@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21525 pull_request: https://github.com/python/cpython/pull/22516 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 06:29:27 2020 From: report at bugs.python.org (Ken Jin) Date: Sat, 03 Oct 2020 10:29:27 +0000 Subject: [issue41428] PEP 604 -- Allow writing union types as X | Y In-Reply-To: <1595975550.94.0.895278514403.issue41428@roundup.psfhosted.org> Message-ID: <1601720967.06.0.850715903907.issue41428@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 4.0 -> 5.0 pull_requests: +21526 pull_request: https://github.com/python/cpython/pull/22517 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 06:43:50 2020 From: report at bugs.python.org (Tal Einat) Date: Sat, 03 Oct 2020 10:43:50 +0000 Subject: [issue41867] Include options for timespec in docstrings of isoformat In-Reply-To: <1601138683.03.0.777121692912.issue41867@roundup.psfhosted.org> Message-ID: <1601721830.26.0.166995065854.issue41867@roundup.psfhosted.org> Tal Einat added the comment: New changeset 52301312bb9de2299b0c42468fd1936d869e651c by Ram Rachum in branch 'master': bpo-41867: List options for timespec in docstrings of isoformat methods (GH-22418) https://github.com/python/cpython/commit/52301312bb9de2299b0c42468fd1936d869e651c ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 06:44:01 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Oct 2020 10:44:01 +0000 Subject: [issue41867] Include options for timespec in docstrings of isoformat In-Reply-To: <1601138683.03.0.777121692912.issue41867@roundup.psfhosted.org> Message-ID: <1601721841.55.0.541991779072.issue41867@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +21527 pull_request: https://github.com/python/cpython/pull/22518 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 06:44:17 2020 From: report at bugs.python.org (Tal Einat) Date: Sat, 03 Oct 2020 10:44:17 +0000 Subject: [issue40833] Clarify docstring of Path.rename In-Reply-To: <1590933048.45.0.441602956173.issue40833@roundup.psfhosted.org> Message-ID: <1601721857.8.0.972478362292.issue40833@roundup.psfhosted.org> Tal Einat added the comment: New changeset ef7b937b8fe94f4c59dfcbe7567c3ca76097a41d by Miss Skeleton (bot) in branch '3.9': [3.9] bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554) https://github.com/python/cpython/commit/ef7b937b8fe94f4c59dfcbe7567c3ca76097a41d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 06:44:10 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Oct 2020 10:44:10 +0000 Subject: [issue41867] Include options for timespec in docstrings of isoformat In-Reply-To: <1601138683.03.0.777121692912.issue41867@roundup.psfhosted.org> Message-ID: <1601721850.19.0.678084562659.issue41867@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21528 pull_request: https://github.com/python/cpython/pull/22519 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 06:45:03 2020 From: report at bugs.python.org (Tal Einat) Date: Sat, 03 Oct 2020 10:45:03 +0000 Subject: [issue40833] Clarify docstring of Path.rename In-Reply-To: <1590933048.45.0.441602956173.issue40833@roundup.psfhosted.org> Message-ID: <1601721903.61.0.860127641076.issue40833@roundup.psfhosted.org> Tal Einat added the comment: Thanks, Ram! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 07:01:51 2020 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Oct 2020 11:01:51 +0000 Subject: [issue41867] Include options for timespec in docstrings of isoformat In-Reply-To: <1601138683.03.0.777121692912.issue41867@roundup.psfhosted.org> Message-ID: <1601722911.27.0.375993541761.issue41867@roundup.psfhosted.org> miss-islington added the comment: New changeset 9aa34f1bbbe1ca6376539f9ba436ff75d2141888 by Miss Skeleton (bot) in branch '3.8': bpo-41867: List options for timespec in docstrings of isoformat methods (GH-22418) https://github.com/python/cpython/commit/9aa34f1bbbe1ca6376539f9ba436ff75d2141888 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 07:39:41 2020 From: report at bugs.python.org (Leonard Schwennesen) Date: Sat, 03 Oct 2020 11:39:41 +0000 Subject: [issue41920] Weird add operation of "0.2222 + 0.1111" Message-ID: <1601725181.53.0.727469935565.issue41920@roundup.psfhosted.org> New submission from Leonard Schwennesen : If I add 0.2222 + 0.1111 in the python cli I get the value 0.33330000000000004 and not 0.3333. Also the other way around. But if I enter for example 0.22222+0.11111 I get 0.33333 so that's right. Here are a few examples I tested that working properly: >>> 0.22+0.11 0.33 >>> 0.222+0.111 0.333 >>> 0.22222+0.11111 0.33333 >>> 0.3333+0.7777 1.111 >>> 0.3333+0.6666 0.9999 >>> 0.3333+0.3333 0.6666 >>> 0.6666+0.1111 0.7777 >>> 0.2222+0.3333 0.5555 Python 3.8.5 [GCC 10.2.0] on linux I also tested that in a newly setup VM, same issue ---------- messages: 377871 nosy: ungedummt priority: normal severity: normal status: open title: Weird add operation of "0.2222 + 0.1111" type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 07:42:31 2020 From: report at bugs.python.org (Tal Einat) Date: Sat, 03 Oct 2020 11:42:31 +0000 Subject: [issue41867] Include options for timespec in docstrings of isoformat In-Reply-To: <1601138683.03.0.777121692912.issue41867@roundup.psfhosted.org> Message-ID: <1601725351.73.0.763998497706.issue41867@roundup.psfhosted.org> Tal Einat added the comment: New changeset 8ca08310a882b7db6469fe732465610b92f4665e by Miss Skeleton (bot) in branch '3.9': [3.9] bpo-41867: List options for timespec in docstrings of isoformat methods (GH-22418) https://github.com/python/cpython/commit/8ca08310a882b7db6469fe732465610b92f4665e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 07:43:06 2020 From: report at bugs.python.org (Tal Einat) Date: Sat, 03 Oct 2020 11:43:06 +0000 Subject: [issue41867] Include options for timespec in docstrings of isoformat In-Reply-To: <1601138683.03.0.777121692912.issue41867@roundup.psfhosted.org> Message-ID: <1601725386.22.0.0832431131813.issue41867@roundup.psfhosted.org> Tal Einat added the comment: Thanks for this, Ram! ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 07:50:13 2020 From: report at bugs.python.org (Leonard Schwennesen) Date: Sat, 03 Oct 2020 11:50:13 +0000 Subject: [issue41920] Weird add operation of "0.2222 + 0.1111" In-Reply-To: <1601725181.53.0.727469935565.issue41920@roundup.psfhosted.org> Message-ID: <1601725813.78.0.99170368432.issue41920@roundup.psfhosted.org> Leonard Schwennesen added the comment: Same problem with 0.3333-0.1111 python returns 0.22219999999999998 and not 0.2222 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 08:04:34 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 03 Oct 2020 12:04:34 +0000 Subject: [issue41920] Weird add operation of "0.2222 + 0.1111" In-Reply-To: <1601725181.53.0.727469935565.issue41920@roundup.psfhosted.org> Message-ID: <1601726674.23.0.799944204492.issue41920@roundup.psfhosted.org> Steven D'Aprano added the comment: Please forgive me if my answer is a little bit brusque, but we get essentially this same bug report regularly, only the numbers are different. This is not a bug in Python, it is an unavoidable consequence of how floating point arithmetic works in every single programming language that does floating point arithmetic. There's a FAQ about it: https://docs.python.org/3/faq/design.html#why-am-i-getting-strange-results-with-simple-arithmetic-operations it's discussed in the tutorial: https://docs.python.org/3/tutorial/floatingpoint.html#tut-fp-issues there's probably a million websites, blog posts, Stackoverflow questions etc about it, and computer scientists write papers about it: https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 08:15:03 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 03 Oct 2020 12:15:03 +0000 Subject: [issue41920] Weird add operation of "0.2222 + 0.1111" In-Reply-To: <1601725181.53.0.727469935565.issue41920@roundup.psfhosted.org> Message-ID: <1601727303.11.0.467428285029.issue41920@roundup.psfhosted.org> Steven D'Aprano added the comment: Some further resources: https://stackoverflow.com/questions/8215437/floating-point-accuracy-in-python https://stackoverflow.com/questions/21895756/why-are-floating-point-numbers-inaccurate https://stackoverflow.com/questions/1089018/why-cant-decimal-numbers-be-represented-exactly-in-binary?noredirect=1&lq=1 https://randomascii.wordpress.com/category/floating-point/page/1/ If you google a bit you will find many other places that discuss this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 08:23:07 2020 From: report at bugs.python.org (Leonard Schwennesen) Date: Sat, 03 Oct 2020 12:23:07 +0000 Subject: [issue41920] Weird add operation of "0.2222 + 0.1111" In-Reply-To: <1601725181.53.0.727469935565.issue41920@roundup.psfhosted.org> Message-ID: <1601727787.62.0.177662759567.issue41920@roundup.psfhosted.org> Leonard Schwennesen added the comment: Ok thank you for these resources. I didn't know that before. (; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 08:27:17 2020 From: report at bugs.python.org (Leonard Schwennesen) Date: Sat, 03 Oct 2020 12:27:17 +0000 Subject: [issue41920] Weird add operation of "0.2222 + 0.1111" In-Reply-To: <1601725181.53.0.727469935565.issue41920@roundup.psfhosted.org> Message-ID: <1601728037.28.0.248685032247.issue41920@roundup.psfhosted.org> Leonard Schwennesen added the comment: But this "bug" only affects floating numbers? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 08:31:05 2020 From: report at bugs.python.org (Pradyun Gedam) Date: Sat, 03 Oct 2020 12:31:05 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1601649766.64.0.74479063775.issue41490@roundup.psfhosted.org> Message-ID: Pradyun Gedam added the comment: +1 for bumping to 20.2.3, in case an upstream voice is helpful. :) On Fri, Oct 2, 2020 at 8:12 PM Pablo Galindo Salgado wrote: > > Pablo Galindo Salgado added the comment: > > I think that the backport to 3.8 may have some unintended consequences in > the last patch release as venv created with 3.8 now exhibit the pip > regression (https://github.com/pypa/pip/issues/8695.). > > Steve, would you be ok if we bump all branches (master, 3.9 and 3.8) to > 20.2.3? > > ---------- > nosy: +pablogsal > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 09:00:20 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Oct 2020 13:00:20 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601730020.45.0.817488236494.issue41898@roundup.psfhosted.org> Irit Katriel added the comment: You didn't specify the logger in the assertLogs() call. The documentation says that "The default is the root logger, which will catch all messages." https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertLogs This is behaving as expected. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 09:38:21 2020 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 03 Oct 2020 13:38:21 +0000 Subject: [issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential) In-Reply-To: <1554452151.49.0.211568667786.issue36533@roundup.psfhosted.org> Message-ID: <1601732301.45.0.998861434844.issue36533@roundup.psfhosted.org> Change by Andr?s Delfino : ---------- nosy: -adelfino _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 09:38:34 2020 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 03 Oct 2020 13:38:34 +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: <1601732314.49.0.969804357913.issue6721@roundup.psfhosted.org> Change by Andr?s Delfino : ---------- nosy: -adelfino _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 09:38:41 2020 From: report at bugs.python.org (=?utf-8?q?Andr=C3=A9s_Delfino?=) Date: Sat, 03 Oct 2020 13:38:41 +0000 Subject: [issue33802] Regression in logging configuration In-Reply-To: <1528412435.4.0.592728768989.issue33802@psf.upfronthosting.co.za> Message-ID: <1601732321.87.0.410244720503.issue33802@roundup.psfhosted.org> Change by Andr?s Delfino : ---------- nosy: -adelfino _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 10:28:59 2020 From: report at bugs.python.org (Lysandros Nikolaou) Date: Sat, 03 Oct 2020 14:28:59 +0000 Subject: [issue41826] test_peg_generator compilation warnings In-Reply-To: <1600710972.69.0.778161141813.issue41826@roundup.psfhosted.org> Message-ID: <1601735339.56.0.805135892864.issue41826@roundup.psfhosted.org> Lysandros Nikolaou added the comment: New changeset c111355480ff51b50a671679c5099f534cb01cae by Pablo Galindo in branch 'master': bpo-41826: Fix compiler warnings in test_peg_generator (GH-22455) https://github.com/python/cpython/commit/c111355480ff51b50a671679c5099f534cb01cae ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 10:32:49 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Oct 2020 14:32:49 +0000 Subject: [issue41887] ast.literal_eval does not accept strings with leading whitespaces In-Reply-To: <1601430417.52.0.930336195437.issue41887@roundup.psfhosted.org> Message-ID: <1601735569.95.0.639398669239.issue41887@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I dunno, but it's been doing this since 1992, so I think it would be fragile to change. The best thing therefore is to make ast.literal_eval() match it exactly. +1 We had considerable finicky behaviour in the parser related to new lines and whitespace so I would recommend to strive for stability. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 10:33:07 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Oct 2020 14:33:07 +0000 Subject: [issue41826] test_peg_generator compilation warnings In-Reply-To: <1600710972.69.0.778161141813.issue41826@roundup.psfhosted.org> Message-ID: <1601735587.27.0.707794844813.issue41826@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 10:58:43 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 03 Oct 2020 14:58:43 +0000 Subject: [issue40564] Using zipfile.Path with several files prematurely closes zip In-Reply-To: <1588952821.29.0.991302590341.issue40564@roundup.psfhosted.org> Message-ID: <1601737123.76.0.581795147688.issue40564@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset ebbe8033b1c61854c4b623aaf9c3e170d179f875 by Jason R. Coombs in branch 'master': bpo-40564: Avoid copying state from extant ZipFile. (GH-22371) https://github.com/python/cpython/commit/ebbe8033b1c61854c4b623aaf9c3e170d179f875 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 10:59:40 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 03 Oct 2020 14:59:40 +0000 Subject: [issue40564] Using zipfile.Path with several files prematurely closes zip In-Reply-To: <1588952821.29.0.991302590341.issue40564@roundup.psfhosted.org> Message-ID: <1601737180.9.0.725403238188.issue40564@roundup.psfhosted.org> Jason R. Coombs added the comment: Fix merged into master. Please use zipp 3.2.0 on Python 3.9 and earlier for the improved behavior or report back here if a backport is needed (and why). ---------- stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 10:59:58 2020 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 03 Oct 2020 14:59:58 +0000 Subject: [issue40564] Using zipfile.Path with several files prematurely closes zip In-Reply-To: <1588952821.29.0.991302590341.issue40564@roundup.psfhosted.org> Message-ID: <1601737198.36.0.266184201747.issue40564@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 11:12:49 2020 From: report at bugs.python.org (yeting li) Date: Sat, 03 Oct 2020 15:12:49 +0000 Subject: [issue41921] REDoS in parseentities Message-ID: <1601737969.46.0.495788645161.issue41921@roundup.psfhosted.org> New submission from yeting li : Hi, I find this regex '' may be stucked by input. The vulnerable regex is located in https://github.com/python/cpython/blob/8d21aa21f2cbc6d50aab3f420bb23be1d081dac4/Tools/scripts/parseentities.py#L18 The ReDOS vulnerability of the regex is mainly due to the sub-pattern ' +((?:.|\n)+?) *' and can be exploited with the following string ' _______________________________________ From report at bugs.python.org Sat Oct 3 11:19:19 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 03 Oct 2020 15:19:19 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601738359.48.0.0293677080183.issue41905@roundup.psfhosted.org> Guido van Rossum added the comment: Why would that require more code? That?s already how it worked. Maybe you misunderstand what I tried to say? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 11:29:55 2020 From: report at bugs.python.org (Ben Avrahami) Date: Sat, 03 Oct 2020 15:29:55 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601738995.61.0.526442189939.issue41905@roundup.psfhosted.org> Ben Avrahami added the comment: > Maybe you misunderstand what I tried to say? Possibly, right now, total_ordering avoids overriding any method that is declared, either in the class or its superclasses (except for object), regardless of whether or not it is abstract. For it to be ABC-aware, it would need the ability to override abstract methods defined in superclasses, so we need to check whether an exisitng method is abstract. Additionally we want to not override abstract methods defined in the subject class, so we also need to check whether the method is defined in the class __dict__ (that's the extra logic I was referring to). An argument could be made that total_ordering should override any method not defined in the subject class, abstract or no (implementing this logic would also speed up total_ordering, but that's beside the point). Is this what you meant? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 11:43:43 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 03 Oct 2020 15:43:43 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601739823.92.0.120040049784.issue41905@roundup.psfhosted.org> Guido van Rossum added the comment: Ah, okay. I wasn't familiar with @total_ordering so I assumed differently. Sorry for the continued misunderstanding. Perhaps we should just leave it alone completely then, since ISTM that any change to its implementation may cause subtle bugs in currently working code. The problem you see only occurs when there are abstract ordering methods present. The cure is simple, just implement all four comparison functions (and do away with @total_ordering). This is not a great burden. Instead we should probably add a line or two to the docs explaining how it interacts with ABCs defining abstract ordering methods. @dataclass uses a different approach ("is it defined in the current class?"). That is perfectly ready for a call to abc.update_abstractmethods(). (I checked, and dataclasses already depends on abc, indirectly via functools, so the extra import is free.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 12:00:56 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 03 Oct 2020 16:00:56 +0000 Subject: [issue41922] Use PEP 590 vectorcall to speed up calls to reversed() Message-ID: <1601740856.71.0.650184607578.issue41922@roundup.psfhosted.org> New submission from Dong-hee Na : reversed is also a very well-used type. if shows 10+ percent performance improvement from baseline and this metric. And this improvement looks acceptable from viewing builtin types which are applied PEP 590 (frozenset, list, set, dict) reversed creation + for loop Mean +- std dev: [reversed_master] 157 ns +- 4 ns -> [reversed_opt] 139 ns +- 2 ns: 1.13x faster (-11%) reversed creation Mean +- std dev: [reversed2_master] 118 ns +- 2 ns -> [reversed2_opt] 101 ns +- 2 ns: 1.18x faster (-15%) ---------- components: Interpreter Core files: bench_reversed.py messages: 377889 nosy: corona10, pablogsal, vstinner priority: normal severity: normal status: open title: Use PEP 590 vectorcall to speed up calls to reversed() type: performance versions: Python 3.10 Added file: https://bugs.python.org/file49488/bench_reversed.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 12:01:02 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 03 Oct 2020 16:01:02 +0000 Subject: [issue41922] Use PEP 590 vectorcall to speed up calls to reversed() In-Reply-To: <1601740856.71.0.650184607578.issue41922@roundup.psfhosted.org> Message-ID: <1601740862.38.0.214554819858.issue41922@roundup.psfhosted.org> Change by Dong-hee Na : ---------- assignee: -> corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 12:06:34 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 03 Oct 2020 16:06:34 +0000 Subject: [issue41922] Use PEP 590 vectorcall to speed up calls to reversed() In-Reply-To: <1601740856.71.0.650184607578.issue41922@roundup.psfhosted.org> Message-ID: <1601741194.98.0.914370215604.issue41922@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +21529 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22523 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 12:16:30 2020 From: report at bugs.python.org (Mikhail Golubev) Date: Sat, 03 Oct 2020 16:16:30 +0000 Subject: [issue41923] Add PEP 613 typing.TypeAlias to the standard library Message-ID: <1601741790.03.0.822782590759.issue41923@roundup.psfhosted.org> New submission from Mikhail Golubev : TypeAlias is already included in typing_extensions package, making it available for pre-3.10 versions of Python. I'd like port this implementation to the upstream version of typing. ---------- components: Library (Lib) messages: 377890 nosy: mikhail.golubev priority: normal severity: normal status: open title: Add PEP 613 typing.TypeAlias to the standard library type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 12:37:11 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Oct 2020 16:37:11 +0000 Subject: [issue41921] REDoS in parseentities In-Reply-To: <1601737969.46.0.495788645161.issue41921@roundup.psfhosted.org> Message-ID: <1601743031.04.0.995243927491.issue41921@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 12:41:50 2020 From: report at bugs.python.org (Emmanuel Arias) Date: Sat, 03 Oct 2020 16:41:50 +0000 Subject: [issue40455] GCC 10 compiler warnings In-Reply-To: <1588279868.77.0.13865368461.issue40455@roundup.psfhosted.org> Message-ID: <1601743310.14.0.413177316393.issue40455@roundup.psfhosted.org> Emmanuel Arias added the comment: Hi, I've on my Debian (testing) the reported warning: In function ?assemble_lnotab?, inlined from ?assemble_emit? at Python/compile.c:5706:25, inlined from ?assemble? at Python/compile.c:6048:18: Python/compile.c:5660:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 5660 | *lnotab++ = k; | gcc --version gcc (Debian 10.2.0-5) 10.2.0 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 12:54:27 2020 From: report at bugs.python.org (Dustin Spicuzza) Date: Sat, 03 Oct 2020 16:54:27 +0000 Subject: [issue41916] cxx pthread check is not overrideable In-Reply-To: <1601709628.96.0.95457003563.issue41916@roundup.psfhosted.org> Message-ID: <1601744067.2.0.218106321101.issue41916@roundup.psfhosted.org> Change by Dustin Spicuzza : ---------- keywords: +patch pull_requests: +21530 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22525 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 12:57:41 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Oct 2020 16:57:41 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601744261.17.0.304416978571.issue41898@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +21531 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22526 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 13:03:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Oct 2020 17:03:33 +0000 Subject: [issue41919] Modify test_codecs to use the new codecs.unregister() function In-Reply-To: <1601717827.7.0.637294336769.issue41919@roundup.psfhosted.org> Message-ID: <1601744613.28.0.895415777002.issue41919@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Move the codecs.register operation to testcases -> Modify test_codecs to use the new codecs.unregister() function _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 13:06:27 2020 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Oct 2020 17:06:27 +0000 Subject: [issue18228] AIX locale parsing failure In-Reply-To: <1371355395.07.0.213079327558.issue18228@psf.upfronthosting.co.za> Message-ID: <1601744787.12.0.682625970821.issue18228@roundup.psfhosted.org> STINNER Victor added the comment: Sorry, I forgot to close it 7 years ago. Done ;-) ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 13:09:34 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Oct 2020 17:09:34 +0000 Subject: [issue32192] Provide importlib.util.lazy_import helper function In-Reply-To: <1512118241.83.0.213398074469.issue32192@psf.upfronthosting.co.za> Message-ID: <1601744974.01.0.0389419232193.issue32192@roundup.psfhosted.org> Irit Katriel added the comment: This seems complete. Can is be closed? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 13:17:03 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 03 Oct 2020 17:17:03 +0000 Subject: [issue41922] Use PEP 590 vectorcall to speed up calls to reversed() In-Reply-To: <1601740856.71.0.650184607578.issue41922@roundup.psfhosted.org> Message-ID: <1601745423.15.0.807300365386.issue41922@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset d646e91f5c4f4b76f96494103d440ed0b6257425 by Dong-hee Na in branch 'master': bpo-41922: Use PEP 590 vectorcall to speed up reversed() (GH-22523) https://github.com/python/cpython/commit/d646e91f5c4f4b76f96494103d440ed0b6257425 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 13:17:15 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 03 Oct 2020 17:17:15 +0000 Subject: [issue41922] Use PEP 590 vectorcall to speed up calls to reversed() In-Reply-To: <1601740856.71.0.650184607578.issue41922@roundup.psfhosted.org> Message-ID: <1601745435.17.0.0484246919551.issue41922@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 13:19:09 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 03 Oct 2020 17:19:09 +0000 Subject: [issue41922] Use PEP 590 vectorcall to speed up calls to reversed() In-Reply-To: <1601740856.71.0.650184607578.issue41922@roundup.psfhosted.org> Message-ID: <1601745549.53.0.416502801066.issue41922@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 13:18:54 2020 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 03 Oct 2020 17:18:54 +0000 Subject: [issue41922] Use PEP 590 vectorcall to speed up calls to reversed() In-Reply-To: <1601740856.71.0.650184607578.issue41922@roundup.psfhosted.org> Message-ID: <1601745534.09.0.041321384683.issue41922@roundup.psfhosted.org> Dong-hee Na added the comment: Thank you Victor! ---------- resolution: fixed -> stage: resolved -> patch review status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 13:27:45 2020 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Oct 2020 17:27:45 +0000 Subject: [issue41923] Add PEP 613 typing.TypeAlias to the standard library In-Reply-To: <1601741790.03.0.822782590759.issue41923@roundup.psfhosted.org> Message-ID: <1601746065.09.0.880607267336.issue41923@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +gvanrossum, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 14:01:23 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Oct 2020 18:01:23 +0000 Subject: [issue33235] Better help text for dict.setdefault In-Reply-To: <1523009627.66.0.682650639539.issue33235@psf.upfronthosting.co.za> Message-ID: <1601748083.97.0.525618401031.issue33235@roundup.psfhosted.org> Irit Katriel added the comment: The help message is now: Help on method_descriptor: setdefault(self, key, default=None, /) Insert key with a value of default if key is not in the dictionary. Return the value for key if key is in the dictionary, else default. This issue should be closed as out of date. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 14:21:03 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Oct 2020 18:21:03 +0000 Subject: [issue36568] Typo in socket.CAN_RAW_FD_FRAMES library documentation In-Reply-To: <1554776259.35.0.774393301329.issue36568@roundup.psfhosted.org> Message-ID: <1601749263.27.0.365287844531.issue36568@roundup.psfhosted.org> Irit Katriel added the comment: This issue can be closed. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 14:22:46 2020 From: report at bugs.python.org (Inada Naoki) Date: Sat, 03 Oct 2020 18:22:46 +0000 Subject: [issue33235] Better help text for dict.setdefault In-Reply-To: <1523009627.66.0.682650639539.issue33235@psf.upfronthosting.co.za> Message-ID: <1601749366.87.0.101877340371.issue33235@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 14:25:02 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Oct 2020 18:25:02 +0000 Subject: [issue29986] Documentation recommends raising TypeError from tp_richcompare In-Reply-To: <1491346313.99.0.131506773991.issue29986@psf.upfronthosting.co.za> Message-ID: <1601749502.65.0.533242602398.issue29986@roundup.psfhosted.org> Irit Katriel added the comment: Looks like this issue can be closed. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 14:54:43 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 03 Oct 2020 18:54:43 +0000 Subject: [issue41923] Add PEP 613 typing.TypeAlias to the standard library In-Reply-To: <1601741790.03.0.822782590759.issue41923@roundup.psfhosted.org> Message-ID: <1601751283.9.0.978900926521.issue41923@roundup.psfhosted.org> Guido van Rossum added the comment: Sure go right ahead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 15:05:27 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Oct 2020 19:05:27 +0000 Subject: [issue40202] Misleading grammatically of ValueError Message? In-Reply-To: <1586160974.41.0.711704681431.issue40202@roundup.psfhosted.org> Message-ID: <1601751927.4.0.80783670487.issue40202@roundup.psfhosted.org> Irit Katriel added the comment: I think this can be closed as a duplicate of 39816. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 15:09:37 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Oct 2020 19:09:37 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601752177.87.0.61691745873.issue41490@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +21532 pull_request: https://github.com/python/cpython/pull/22527 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 15:12:51 2020 From: report at bugs.python.org (Ammar Askar) Date: Sat, 03 Oct 2020 19:12:51 +0000 Subject: [issue40202] Misleading grammatically of ValueError Message? In-Reply-To: <1586160974.41.0.711704681431.issue40202@roundup.psfhosted.org> Message-ID: <1601752371.15.0.657713227574.issue40202@roundup.psfhosted.org> Change by Ammar Askar : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> More descriptive error message than "too many values to unpack" _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 15:45:59 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Oct 2020 19:45:59 +0000 Subject: [issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols In-Reply-To: <1600863724.98.0.825702411391.issue41840@roundup.psfhosted.org> Message-ID: <1601754359.36.0.965865188163.issue41840@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset fb0a4651f1be4ad936f8277478f73f262d8eeb72 by Pablo Galindo in branch 'master': bpo-41840: Report module-level globals as both local and global in the symtable module (GH-22391) https://github.com/python/cpython/commit/fb0a4651f1be4ad936f8277478f73f262d8eeb72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 15:48:02 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Oct 2020 19:48:02 +0000 Subject: [issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols In-Reply-To: <1600863724.98.0.825702411391.issue41840@roundup.psfhosted.org> Message-ID: <1601754482.8.0.897378315944.issue41840@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +21533 pull_request: https://github.com/python/cpython/pull/22528 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 15:48:51 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Oct 2020 19:48:51 +0000 Subject: [issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols In-Reply-To: <1600863724.98.0.825702411391.issue41840@roundup.psfhosted.org> Message-ID: <1601754531.33.0.932008624252.issue41840@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +21534 pull_request: https://github.com/python/cpython/pull/22529 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 16:01:32 2020 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Oct 2020 20:01:32 +0000 Subject: [issue40348] Programming FAQ about "What is delegation?": Fix typos In-Reply-To: <1587419868.54.0.356271490131.issue40348@roundup.psfhosted.org> Message-ID: <1601755292.28.0.666191279666.issue40348@roundup.psfhosted.org> Irit Katriel added the comment: This issue can be closed. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 16:23:06 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Oct 2020 20:23:06 +0000 Subject: [issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols In-Reply-To: <1600863724.98.0.825702411391.issue41840@roundup.psfhosted.org> Message-ID: <1601756586.19.0.948726536941.issue41840@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7b7aa94e51a396365df41f86b7b64a3b74481a6c by Pablo Galindo in branch '3.9': [3.9] bpo-41840: Report module-level globals as both local and global in the symtable module (GH-22391). (GH-22528) https://github.com/python/cpython/commit/7b7aa94e51a396365df41f86b7b64a3b74481a6c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 17:49:56 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Oct 2020 21:49:56 +0000 Subject: [issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols In-Reply-To: <1600863724.98.0.825702411391.issue41840@roundup.psfhosted.org> Message-ID: <1601761796.51.0.532587688127.issue41840@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 17:50:03 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Oct 2020 21:50:03 +0000 Subject: [issue41840] [regression] symtable.Symbol.is_local() is no longer True for bound global symbols In-Reply-To: <1600863724.98.0.825702411391.issue41840@roundup.psfhosted.org> Message-ID: <1601761803.3.0.168134703694.issue41840@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset fd22823991380de2a309221748fc41cf0ba6ed40 by Pablo Galindo in branch '3.8': [3.8] bpo-41840: Report module-level globals as both local and global in the symtable module (GH-22391). (GH-22529) https://github.com/python/cpython/commit/fd22823991380de2a309221748fc41cf0ba6ed40 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 18:21:15 2020 From: report at bugs.python.org (Mikhail Golubev) Date: Sat, 03 Oct 2020 22:21:15 +0000 Subject: [issue41923] Add PEP 613 typing.TypeAlias to the standard library In-Reply-To: <1601741790.03.0.822782590759.issue41923@roundup.psfhosted.org> Message-ID: <1601763675.98.0.58215373309.issue41923@roundup.psfhosted.org> Change by Mikhail Golubev : ---------- keywords: +patch nosy: +east825 nosy_count: 3.0 -> 4.0 pull_requests: +21535 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22532 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 18:30:01 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 03 Oct 2020 22:30:01 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601764201.61.0.486639063177.issue41909@roundup.psfhosted.org> Guido van Rossum added the comment: I don't think I remember what's so special about abstract_get_bases() to disable the recursion check. Maybe this macro is always just a micro-optimization? Then again it's hard to be sure, the behavior may depend on the platform. Pulling in Antoine, who showed up in the email https://mail.python.org/pipermail/python-dev/2008-August/082106.html is mentioned in a long comment in ceval.h about the recursion protection. Possibly the Py_ALLOW_RECURSION macro is intended to ensure that some handler code for first-order recursion errors doesn't get interrupted by second-order recursion errors? There's a limit of 50 stack frames which feels a bit dodgy. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 19:24:10 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 03 Oct 2020 23:24:10 +0000 Subject: [issue41920] Weird add operation of "0.2222 + 0.1111" In-Reply-To: <1601728037.28.0.248685032247.issue41920@roundup.psfhosted.org> Message-ID: <20201003232404.GH10971@ando.pearwood.info> Steven D'Aprano added the comment: Hi Leonard, Any number which has only fixed precision will experience similar issues. It might affect different calculations. In Python, float, complex and Decimal have fixed precision, so they can experience this issue. But for simple calculations, Decimal may be better for you, as it uses base-10 floats, not base-2, so many numbers which are rounded off in binary floats are not rounded in Decimal: py> from decimal import Decimal py> 0.1111 + 0.2222 # binary floats 0.33330000000000004 py> Decimal('0.1111') + Decimal('0.2222') # decimal floats Decimal('0.3333') But with Decimal, you have other numbers which are rounded off and so are not exact: py> one_third = 1/Decimal(3) py> 3*one_third # should be exactly 1 Decimal('0.9999999999999999999999999999') py> (1/Decimal(6)) * 3 Decimal('0.5000000000000000000000000001') ints are always exact, but you can only do whole numbers with ints. Fractions are also exact: py> from fractions import Fraction py> Fraction(1111, 10000) + Fraction(2222, 10000) Fraction(3333, 10000) Using Fraction is a good way to see what number a binary float really is: py> Fraction(0.1111) Fraction(4002799348806897, 36028797018963968) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 20:16:09 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Oct 2020 00:16:09 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601770569.08.0.547369017006.issue41905@roundup.psfhosted.org> Raymond Hettinger added the comment: Guido, can the method update be made automatic? When instantiation fails, recheck to see the missing abstract methods had been defined? >>> from abc import * >>> class P(ABC): @abstractmethod def m(self): pass >>> class C(P): pass >>> C.m = lambda self: None >>> C() Traceback (most recent call last): File "", line 1, in C() TypeError: Can't instantiate abstract class C with abstract method m The latter message doesn't make sense that it should occur at all. Roughly, the existing instantiation logic is: if cls.__abstractmethods__: raise TypeError(f"TypeError: Can't instantiate abstract class {cls.__name} with abstract method {methname}") Could that be changed to something like this: if cls.__abstractmethods__: for methname is cls.__abstractmethods__.copy(): if getattr(cls, methname).__isabstractmethod__: raise TypeError(f"TypeError: Can't instantiate abstract class {cls.__name} with abstract method {methname}") cls.__abstractmethods__.remove(methname) I haven't thought this through. Was just thinking that it would nice to have automatic updates rather than transferring the responsibility outside of the core ABC logic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 20:17:04 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Oct 2020 00:17:04 +0000 Subject: [issue40348] Programming FAQ about "What is delegation?": Fix typos In-Reply-To: <1587419868.54.0.356271490131.issue40348@roundup.psfhosted.org> Message-ID: <1601770624.57.0.549298500921.issue40348@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 20:43:54 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 04 Oct 2020 00:43:54 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601772234.47.0.0633762458425.issue41905@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, you're effectively proposing to compute (or update) __abstractmethods__ lazily. There are a number of subtleties with that, e.g. __abstractmethods__ is currently a frozenset, and a base class's __abstractmethods__ is used when computing the __abstractmethods__ of new subclasses. Moreover, the instantiation check is in object_new(), in typeobject.c. The good news is that when you assign an empty iterable to cls.__abstractmethod__ the bit that object_new() checks is cleared, so other approaches are still open. I think adding the API currently proposed is a reasonable compromise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 20:46:47 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 04 Oct 2020 00:46:47 +0000 Subject: [issue41887] ast.literal_eval does not accept strings with leading whitespaces In-Reply-To: <1601430417.52.0.930336195437.issue41887@roundup.psfhosted.org> Message-ID: <1601772407.73.0.990739777186.issue41887@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset e799aa8b92c195735f379940acd9925961ad04ec by Batuhan Taskaya in branch 'master': bpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469) https://github.com/python/cpython/commit/e799aa8b92c195735f379940acd9925961ad04ec ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 20:49:00 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Oct 2020 00:49:00 +0000 Subject: [issue41887] ast.literal_eval does not accept strings with leading whitespaces In-Reply-To: <1601430417.52.0.930336195437.issue41887@roundup.psfhosted.org> Message-ID: <1601772540.57.0.262876617262.issue41887@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +21536 pull_request: https://github.com/python/cpython/pull/22533 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 20:54:49 2020 From: report at bugs.python.org (ThePokestarFan) Date: Sun, 04 Oct 2020 00:54:49 +0000 Subject: [issue41924] TextWrap's wrap method throws unhelpful error on bytes object Message-ID: <1601772889.68.0.485991506579.issue41924@roundup.psfhosted.org> New submission from ThePokestarFan : The wrap() method of the TextWrapper class (and the module-level wrap method) throws an unhelpful TypeError upon getting a bytes object. ---------- components: Library (Lib) files: traceback.txt messages: 377910 nosy: ThePokestarFan priority: normal severity: normal status: open title: TextWrap's wrap method throws unhelpful error on bytes object type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49489/traceback.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 20:56:32 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 04 Oct 2020 00:56:32 +0000 Subject: [issue41887] ast.literal_eval does not accept strings with leading whitespaces In-Reply-To: <1601430417.52.0.930336195437.issue41887@roundup.psfhosted.org> Message-ID: <1601772992.25.0.389982155361.issue41887@roundup.psfhosted.org> Guido van Rossum added the comment: Closing. Let?s not backport. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 21:02:33 2020 From: report at bugs.python.org (ThePokestarFan) Date: Sun, 04 Oct 2020 01:02:33 +0000 Subject: [issue41924] TextWrap's wrap method throws unhelpful error on bytes object In-Reply-To: <1601772889.68.0.485991506579.issue41924@roundup.psfhosted.org> Message-ID: <1601773353.99.0.881270789928.issue41924@roundup.psfhosted.org> Change by ThePokestarFan : ---------- keywords: +patch pull_requests: +21537 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22534 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 21:05:22 2020 From: report at bugs.python.org (Josh Rosenberg) Date: Sun, 04 Oct 2020 01:05:22 +0000 Subject: [issue41924] TextWrap's wrap method throws unhelpful error on bytes object In-Reply-To: <1601772889.68.0.485991506579.issue41924@roundup.psfhosted.org> Message-ID: <1601773522.92.0.212079957024.issue41924@roundup.psfhosted.org> Josh Rosenberg added the comment: It's not textwrap that's doing it, which is why the error is so unhelpful; the input is assumed to be a str, and the translate method is called on it with a dict argument, which is valid for str.translate, but not for bytes.translate. You'll get other "unhelpful" error messages for other arguments (e.g. most other built-in types die because they lack an expandtabs method). Is it necessary to provide specific error messages when an API is given a type it never claimed to support? I could see issues with a "check for str" check if someone is implementing their own str-like type that matches the API but gets rejected for not being str. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 21:15:20 2020 From: report at bugs.python.org (ThePokestarFan) Date: Sun, 04 Oct 2020 01:15:20 +0000 Subject: [issue41924] TextWrap's wrap method throws unhelpful error on bytes object In-Reply-To: <1601772889.68.0.485991506579.issue41924@roundup.psfhosted.org> Message-ID: <1601774120.94.0.254090666814.issue41924@roundup.psfhosted.org> ThePokestarFan added the comment: You're most likely right, so I'll close it. The lesson is most likely to not use weird arguments, but modules such as datetime warn against it, so I was surprised. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 21:15:37 2020 From: report at bugs.python.org (ThePokestarFan) Date: Sun, 04 Oct 2020 01:15:37 +0000 Subject: [issue41924] TextWrap's wrap method throws unhelpful error on bytes object In-Reply-To: <1601772889.68.0.485991506579.issue41924@roundup.psfhosted.org> Message-ID: <1601774137.96.0.737801191212.issue41924@roundup.psfhosted.org> Change by ThePokestarFan : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 21:16:20 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Oct 2020 01:16:20 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601774180.32.0.206457112658.issue41905@roundup.psfhosted.org> Raymond Hettinger added the comment: > you're effectively proposing to compute (or update) > __abstractmethods__ lazily. Would it be possible to do the update whenever the class dictionary is modified, in PyType_Modified() perhaps (using logic similar to __mro__ updates__)? I not pushing for this; am just asking whether it is possible to make sure that __abstractmethods__ is always in sync with reality. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 21:39:19 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 04 Oct 2020 01:39:19 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601774180.32.0.206457112658.issue41905@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Yes, we could override ABCMeta.__setattr__ to do that. Though it seems this class is considered performance sensitive (else why have Modules/_abc.c) we would probably have to write it in C.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 23:28:41 2020 From: report at bugs.python.org (Chris Tse) Date: Sun, 04 Oct 2020 03:28:41 +0000 Subject: [issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error Message-ID: <1601782121.26.0.581028489128.issue41925@roundup.psfhosted.org> New submission from Chris Tse : Following up on https://bugs.python.org/issue37369 as it was advised to open a new issue regarding case sensitivity. I am on Windows 10 running Version 10.0.19041 Build 19041. I am experiencing the same problem in that issue when using venv on Powershell. The path to python.exe in the pip.exe generated by venv is all lowercase, which is the source of this error. After activating the venv with Activate.ps1 and attempting to use pip, I get the following error, while activate.bat on cmd works fine: Fatal error in launcher: Unable to create process using '"c:\users\chris\code\project\myenv\scripts\python.exe" "C:\Users\chris\code\project\myenv\Scripts\pip.exe" ': The system cannot find the file specified. Full steps to reproduce: 1. Install Python 3.8.6 from python.org (ticking add to PATH option in installer) 2. Open Powershell (via both native Powershell app or the new Windows Terminal) and verify that `python` is bound to the correct Version 3. Run `python -m venv myenv` 4. Run `.\myenv\Scripts\Activate.ps1` 5. Run `pip` Expected behavior: Get the pip usage commands list Actual behavior: Get the above Fatal error Notes: I did not explicitly set case sensitivity on my machine. All my drives are formatted as NTFS, but should not be case sensitive, which can be confirmed by fsutils: > fsutil.exe file queryCaseSensitiveInfo C:\ Case sensitive attribute on directory C:\ is disabled. Attempting to actually call that python.exe using the full lowercase path throws a similar error. Someone I know who has been helping with debugging this ran the Scripts\activate script successfully on the same version of Powershell as mine (5.1.19041.1) which should be meant for use on bash. I however was not able to do so. ---------- components: Windows messages: 377916 nosy: chris-tse, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Lowercase path to python.exe in pip.exe from venv is throwing error versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Oct 3 23:28:50 2020 From: report at bugs.python.org (Chris Tse) Date: Sun, 04 Oct 2020 03:28:50 +0000 Subject: [issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error In-Reply-To: <1601782121.26.0.581028489128.issue41925@roundup.psfhosted.org> Message-ID: <1601782130.45.0.127748076702.issue41925@roundup.psfhosted.org> Change by Chris Tse : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 00:14:19 2020 From: report at bugs.python.org (Chris Tse) Date: Sun, 04 Oct 2020 04:14:19 +0000 Subject: [issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error In-Reply-To: <1601782121.26.0.581028489128.issue41925@roundup.psfhosted.org> Message-ID: <1601784859.79.0.339683481153.issue41925@roundup.psfhosted.org> Chris Tse added the comment: UPDATE: After some further investigation, it seems like even on cmd and seeing the (myenv) indicator, it actually seems to be falling back to system pip and installing packages globally. Running `.\myenv\Scripts\pip.exe` actually throws that same error. CMD just seems to fallback to system pip and silently fails the desired venv pip, unlike Powershell. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 00:45:08 2020 From: report at bugs.python.org (Eryk Sun) Date: Sun, 04 Oct 2020 04:45:08 +0000 Subject: [issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error In-Reply-To: <1601782121.26.0.581028489128.issue41925@roundup.psfhosted.org> Message-ID: <1601786708.98.0.961071812879.issue41925@roundup.psfhosted.org> Eryk Sun added the comment: > "C:\Users\chris\code\project\myenv\Scripts\pip.exe" Have you tried different case combinations for "Users" and "Scripts"? * C:\users\chris\code\project\myenv\scripts\pip.exe * C:\users\chris\code\project\myenv\Scripts\pip.exe * C:\Users\chris\code\project\myenv\scripts\pip.exe * C:\Users\chris\code\project\myenv\Scripts\pip.exe > fsutil.exe file queryCaseSensitiveInfo C:\ Have you checked "C:\Users\chris\code\project\myenv"? --- Off Topic > Open Powershell (via both native Powershell app or the new > Windows Terminal) FYI, "native PowerShell app" is not the right way to think of this. Both cases run the same command-line interface (CLI) shell (i.e. pwsh.exe or powershell.exe), which is a console application that either inherits or allocates a console session (i.e. an instance of conhost.exe or openconsole.exe). When run from a graphical desktop application (e.g. explorer.exe), a console application usually has to allocate a new console session since there's none to inherit. Currently there's no way to set a default terminal for console applications, so a regular console session is allocated, which creates its own window. When run from a terminal in Windows 10 (e.g. Windows Terminal), a console application inherits a headless console session (i.e. pseudoconsole mode), and the user interface is provided by the terminal. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 00:48:50 2020 From: report at bugs.python.org (Eryk Sun) Date: Sun, 04 Oct 2020 04:48:50 +0000 Subject: [issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error In-Reply-To: <1601782121.26.0.581028489128.issue41925@roundup.psfhosted.org> Message-ID: <1601786930.67.0.338876094459.issue41925@roundup.psfhosted.org> Change by Eryk Sun : ---------- Removed message: https://bugs.python.org/msg377918 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 00:49:49 2020 From: report at bugs.python.org (Eryk Sun) Date: Sun, 04 Oct 2020 04:49:49 +0000 Subject: [issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error In-Reply-To: <1601782121.26.0.581028489128.issue41925@roundup.psfhosted.org> Message-ID: <1601786989.26.0.391484483927.issue41925@roundup.psfhosted.org> Eryk Sun added the comment: > "C:\Users\chris\code\project\myenv\Scripts\python.exe" Have you tried different case combinations for "Users" and "Scripts"? * C:\users\chris\code\project\myenv\scripts\python.exe * C:\users\chris\code\project\myenv\Scripts\python.exe * C:\Users\chris\code\project\myenv\scripts\python.exe * C:\Users\chris\code\project\myenv\Scripts\python.exe > fsutil.exe file queryCaseSensitiveInfo C:\ Have you checked "C:\Users\chris\code\project\myenv"? --- Off Topic > Open Powershell (via both native Powershell app or the new > Windows Terminal) FYI, "native PowerShell app" is not the right way to think of this. Both cases run the same command-line interface (CLI) shell (i.e. pwsh.exe or powershell.exe), which is a console application that either inherits or allocates a console session (i.e. an instance of conhost.exe or openconsole.exe). When run from a graphical desktop application (e.g. explorer.exe), a console application usually has to allocate a new console session since there's none to inherit. Currently there's no way to set a default terminal for console applications, so a regular console session is allocated, which creates its own window. When run from a terminal in Windows 10 (e.g. Windows Terminal), a console application inherits a headless console session (i.e. pseudoconsole mode), and the user interface is provided by the terminal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 01:34:56 2020 From: report at bugs.python.org (Debojyoti Chakraborty) Date: Sun, 04 Oct 2020 05:34:56 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601789696.41.0.0205214395048.issue41909@roundup.psfhosted.org> Debojyoti Chakraborty added the comment: Is it open Then give the process to reproduce the issue. ---------- nosy: +sparkingdark _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 01:40:33 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Oct 2020 05:40:33 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601790033.08.0.49905987268.issue26680@roundup.psfhosted.org> Raymond Hettinger added the comment: Mark, why did this get merged with is_integer() still in the numeric tower? I thought we had agreed not to do that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 01:50:57 2020 From: report at bugs.python.org (Zackery Spytz) Date: Sun, 04 Oct 2020 05:50:57 +0000 Subject: [issue35928] socket makefile read-write discards received data In-Reply-To: <1549542632.16.0.548779418887.issue35928@roundup.psfhosted.org> Message-ID: <1601790657.99.0.493356638899.issue35928@roundup.psfhosted.org> Change by Zackery Spytz : ---------- nosy: +ZackerySpytz nosy_count: 5.0 -> 6.0 pull_requests: +21538 pull_request: https://github.com/python/cpython/pull/22535 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 03:42:44 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 07:42:44 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601797364.87.0.952495778828.issue41909@roundup.psfhosted.org> Serhiy Storchaka added the comment: Antoine give me a hint. The problem seems related to using PyDict_GetItem() when look up an attribute in the instance dict. It silences all exceptions (including RecursionError) and this results in silent "no such key in a dict". But since 3.8 it was replaced with PyDict_GetItemWithError() which preserves RecursionError (see issue35459). I think we can remove Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION now. As for other case in interning string, Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION was used to guard PyDict_GetItem(). But the current code uses PyDict_SetDefault() (added in 3.4) which does not silence errors. So Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION can be removed in that place too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 03:46:35 2020 From: report at bugs.python.org (Ben Avrahami) Date: Sun, 04 Oct 2020 07:46:35 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601797595.3.0.512285347781.issue41905@roundup.psfhosted.org> Ben Avrahami added the comment: Implementing this behavior automatically would be more complicated since you would also have to take subclasses into account. Current implementation enforces that the class is unused (as much as can be reasonably done) when its abstraction status is re-calculated, such checks cannot be done in an automatic implementation. The question becomes whether or not we think its reasonable that an abstract class would change its abstraction status throughout its lifetime. I'd argue "not implicitly". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 04:05:52 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 08:05:52 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601798752.83.0.514291510897.issue41909@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +21539 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22536 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 04:13:54 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 04 Oct 2020 08:13:54 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601799234.82.0.859262937759.issue26680@roundup.psfhosted.org> Mark Dickinson added the comment: I interpreted "in the numeric tower" as meaning declared as an abstract method that all those registering with the class would have to implement. As you point out in msg350173, that would be problematic - adding new methods to published interfaces is pretty much a no-no for backwards compatibility reasons. But that's not what happened here. Robert's original patch *did* add is_integer as an abstract method. The PR that was merged did not - it was added as a concrete method, as a convenience for those using the ABCs via direct subclassing rather than registering. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 04:35:25 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Oct 2020 08:35:25 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601800525.84.0.638388516916.issue26680@roundup.psfhosted.org> Raymond Hettinger added the comment: > it was added as a concrete method, That still amounts to making it a requirement for all numeric classes, even ones that predate this patch. So existing classes that are registered will no longer comply with the ABC. In general, it's hard to add methods to ABCs because an ABC makes a promise about what methods are available in any class registered to that ABC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 04:57:41 2020 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 04 Oct 2020 08:57:41 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601801861.91.0.37180147759.issue26680@roundup.psfhosted.org> Mark Dickinson added the comment: > That still amounts to making it a requirement for all numeric classes How so? I don't follow the reasoning here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 05:00:37 2020 From: report at bugs.python.org (=?utf-8?b?SHJ2b2plIE5pa8WhacSH?=) Date: Sun, 04 Oct 2020 09:00:37 +0000 Subject: [issue33533] Provide an async iterator version of as_completed In-Reply-To: <1526453333.0.0.682650639539.issue33533@psf.upfronthosting.co.za> Message-ID: <1601802037.88.0.31845879688.issue33533@roundup.psfhosted.org> Hrvoje Nik?i? added the comment: Justin, thanks for updating the PR! I'll take another look at the code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 07:03:56 2020 From: report at bugs.python.org (=?utf-8?b?0JTQttC+0L0g0KHQvNC40YI=?=) Date: Sun, 04 Oct 2020 11:03:56 +0000 Subject: [issue41926] Unpredictable behavior when parsing xml. (xml.etree.ElementTree.iterparse) Message-ID: <1601809436.34.0.291596574869.issue41926@roundup.psfhosted.org> New submission from ???? ???? : Data is lost when parsing large files. I have prepared 5 test files for different cases. With their help, I learned that losses are not accidental. In example.xml, when going to iteration 717 (i = 717), the data is lost. In the rest of the files, I learned that data loss occurs when the number of characters changes. It looks like some kind of buffer overflow. In example5.xml I am using randomly generated data using a generator.py. Several xml files have been prepared to show that this is not an error in the input data, but a problem in the library itself. I tried to trace the cause of the occurrence, and came to the conclusion that the bug lies in the compiled file. In the ElementTree.py library file, the line "events = self._events_queue" returns an empty list. This can be seen at iteration 717 in example.xml. ---------- components: XML messages: 377928 nosy: kibertitan priority: normal severity: normal status: open title: Unpredictable behavior when parsing xml. (xml.etree.ElementTree.iterparse) type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 07:06:30 2020 From: report at bugs.python.org (=?utf-8?b?0JTQttC+0L0g0KHQvNC40YI=?=) Date: Sun, 04 Oct 2020 11:06:30 +0000 Subject: [issue41926] Unpredictable behavior when parsing xml. (xml.etree.ElementTree.iterparse) In-Reply-To: <1601809436.34.0.291596574869.issue41926@roundup.psfhosted.org> Message-ID: <1601809590.37.0.304815596927.issue41926@roundup.psfhosted.org> Change by ???? ???? : Added file: https://bugs.python.org/file49490/app.rar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 07:07:41 2020 From: report at bugs.python.org (=?utf-8?b?0JTQttC+0L0g0KHQvNC40YI=?=) Date: Sun, 04 Oct 2020 11:07:41 +0000 Subject: [issue41926] Unpredictable behavior when parsing xml. (xml.etree.ElementTree.iterparse) In-Reply-To: <1601809436.34.0.291596574869.issue41926@roundup.psfhosted.org> Message-ID: <1601809661.36.0.0254340851728.issue41926@roundup.psfhosted.org> ???? ???? added the comment: The file example5.xml could not be loaded, so to generate it, run the generator.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 07:11:57 2020 From: report at bugs.python.org (=?utf-8?b?0JHQvtGA0LjRgSDQm9Cw0LrQtdC10LI=?=) Date: Sun, 04 Oct 2020 11:11:57 +0000 Subject: [issue41927] Why is there no documentation in Russian? Message-ID: <1601809917.86.0.842552109928.issue41927@roundup.psfhosted.org> New submission from ????? ?????? : Is this a racist policy of the site management? For so much time, not even for 2.7. I'm sure there were a lot of suggestions to add. Aren't you ashamed? ---------- assignee: docs at python components: Documentation messages: 377930 nosy: docs at python, lakeevboris priority: normal severity: normal status: open title: Why is there no documentation in Russian? type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 07:21:41 2020 From: report at bugs.python.org (Ivan Sorokin) Date: Sun, 04 Oct 2020 11:21:41 +0000 Subject: [issue41928] ZipFile does not supports Unicode Path Extra Field (0x7075) zip header field Message-ID: <1601810501.41.0.603959888811.issue41928@roundup.psfhosted.org> New submission from Ivan Sorokin : See attached sample. Well-known unzip command line tool lists its contents correctly: $ unzip -l 23.zip Archive: 23.zip Length Date Time Name --------- ---------- ----- ---- 81408 2012-10-23 19:03 ?' ???? ??06 ??????? ???? (???).xls --------- ------- 81408 1 file But ZipFile lists the same file inside this archive as ?' ???? ??06 ??????? ???? (???).xls It's because ZipFile completely ignores Unicode Path Extra Field (0x7075) zip header field. See .ZIP specification for details on this field meaning and usage: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT ---------- components: Library (Lib) files: 23.zip messages: 377931 nosy: ivan.sorokin.tech priority: normal severity: normal status: open title: ZipFile does not supports Unicode Path Extra Field (0x7075) zip header field type: enhancement versions: Python 3.10 Added file: https://bugs.python.org/file49491/23.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 07:36:22 2020 From: report at bugs.python.org (Ivan Sorokin) Date: Sun, 04 Oct 2020 11:36:22 +0000 Subject: [issue41929] Detect OEM code page for zip archives in ZipFile based on system locale Message-ID: <1601811382.76.0.398158982461.issue41929@roundup.psfhosted.org> New submission from Ivan Sorokin : ZipFile has problems with filename charset in .zip archives having filenames charset encoded in OEM code page. ZipFile assumes that OEM code page always means "cp437". Actually many popular .zip packers (for example, Windows internal "zip folders" tool) use OEM code page corresponding to system locale to write file names in .zip files. To read such files correctly we should detect correct OEM code page from system locale instead of sticking to cp437. Here is locale-to-oem-code-page conversion table, generated from Wine source code: https://github.com/unxed/oemcp/blob/master/oemcp.txt Sample archive is attached. The file inside should be extracted as "????? ????????? ????????.txt" when ru_RU system locale is set. ---------- components: Library (Lib) files: windows_cyrillic.zip messages: 377932 nosy: ivan.sorokin.tech priority: normal severity: normal status: open title: Detect OEM code page for zip archives in ZipFile based on system locale versions: Python 3.10 Added file: https://bugs.python.org/file49492/windows_cyrillic.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 07:42:28 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 04 Oct 2020 11:42:28 +0000 Subject: [issue41927] Why is there no documentation in Russian? In-Reply-To: <1601809917.86.0.842552109928.issue41927@roundup.psfhosted.org> Message-ID: <1601811748.31.0.283174910724.issue41927@roundup.psfhosted.org> Steven D'Aprano added the comment: Oh no, you have discovered our dirty secret! Python is racist against Russia! /sarcasm Python is created by volunteers, including the documentation. If you want a Russian translation, feel free to start working on one. You could start here: https://wiki.python.org/moin/Languages ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 07:52:33 2020 From: report at bugs.python.org (Andrew Svetlov) Date: Sun, 04 Oct 2020 11:52:33 +0000 Subject: [issue41927] Why is there no documentation in Russian? In-Reply-To: <1601809917.86.0.842552109928.issue41927@roundup.psfhosted.org> Message-ID: <1601812353.09.0.164990412606.issue41927@roundup.psfhosted.org> Andrew Svetlov added the comment: Python is a volunteer-driven project. The documentation translation is provided by champions who does this hard work for free. You can join the team and maintain the Python Russian Translation :) Sorry, to keep the discussion productive I should remind our community rules: * Please keep calm and provide a polite attitude in conversations on this bug tracker. * Otherwise, you must understand that the rude mood can be considered as the reason for the ban. ---------- nosy: +asvetlov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 08:05:11 2020 From: report at bugs.python.org (Kerrick Staley) Date: Sun, 04 Oct 2020 12:05:11 +0000 Subject: [issue41930] Wrap sqlite3_serialize API in sqlite3 module Message-ID: <1601813111.02.0.183059099502.issue41930@roundup.psfhosted.org> New submission from Kerrick Staley : It would be useful to provide a wrapper (in the Python sqlite3 stdlib module) for the sqlite3_serialize API. This API allows you to get a database's content as a byte string, as if you had called open('foo.sqlite3', 'rb').read(). sqlite3_serialize can even be used for :memory: databases, which I think is the most interesting use-case. Concretely, I'd propose adding a .serialize() method on sqlite3.Connection objects that returns a bytes object representing the serialized database. It would be similar to the .iterdump() method except that it would use the binary format instead of the text format, and it would return all the data at once instead of an iterator (because that's how the underlying sqlite API works). ---------- components: Library (Lib) messages: 377935 nosy: Kerrick Staley priority: normal severity: normal status: open title: Wrap sqlite3_serialize API in sqlite3 module type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 08:29:50 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 12:29:50 +0000 Subject: [issue41927] Why is there no documentation in Russian? In-Reply-To: <1601809917.86.0.842552109928.issue41927@roundup.psfhosted.org> Message-ID: <1601814590.09.0.613695512535.issue41927@roundup.psfhosted.org> Serhiy Storchaka added the comment: Closed as an obvious trolling. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 08:44:34 2020 From: report at bugs.python.org (Carl Bordum Hansen) Date: Sun, 04 Oct 2020 12:44:34 +0000 Subject: [issue30578] Misleading example in sys.set_coroutine_wrapper docs In-Reply-To: <1496717073.05.0.260137843936.issue30578@psf.upfronthosting.co.za> Message-ID: <1601815474.83.0.444291540168.issue30578@roundup.psfhosted.org> Carl Bordum Hansen added the comment: I think this can be closed as `sys.set_coroutine_wrapper` was removed in https://bugs.python.org/issue36933 ---------- nosy: +carlbordum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 09:16:21 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Oct 2020 13:16:21 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601817381.7.0.306360576006.issue41898@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +21540 pull_request: https://github.com/python/cpython/pull/22537 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 09:16:30 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Oct 2020 13:16:30 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601817390.18.0.55609920607.issue41898@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21541 pull_request: https://github.com/python/cpython/pull/22538 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 09:16:16 2020 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 04 Oct 2020 13:16:16 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601817376.03.0.536549317787.issue41898@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 1ed54435268b285964141fb74d47ceaa33ea79ab by Irit Katriel in branch 'master': bpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526) https://github.com/python/cpython/commit/1ed54435268b285964141fb74d47ceaa33ea79ab ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 09:23:03 2020 From: report at bugs.python.org (Carl Bordum Hansen) Date: Sun, 04 Oct 2020 13:23:03 +0000 Subject: [issue29394] Cannot tunnel TLS connection through TLS connection In-Reply-To: <1485847183.69.0.499542154053.issue29394@psf.upfronthosting.co.za> Message-ID: <1601817783.75.0.191823284054.issue29394@roundup.psfhosted.org> Change by Carl Bordum Hansen : ---------- keywords: +patch nosy: +carlbordum nosy_count: 4.0 -> 5.0 pull_requests: +21542 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22539 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 09:27:21 2020 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 04 Oct 2020 13:27:21 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601818041.78.0.427758157081.issue41898@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset b2611fac05ed391d68f09781903aae7394fab832 by Miss Skeleton (bot) in branch '3.8': bpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526) (GH-22537) https://github.com/python/cpython/commit/b2611fac05ed391d68f09781903aae7394fab832 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 09:28:49 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Oct 2020 13:28:49 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601818129.95.0.139123301704.issue41898@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21543 pull_request: https://github.com/python/cpython/pull/22540 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 09:44:57 2020 From: report at bugs.python.org (=?utf-8?b?4K6u4K6p4K+L4K6c4K+N4K6V4K+B4K6u4K6+4K6w4K+NIOCuquCutOCuqQ==?= =?utf-8?b?4K6/4K6a4K+N4K6a4K6+4K6u4K6/?=) Date: Sun, 04 Oct 2020 13:44:57 +0000 Subject: [issue41931] Make dict(object) return its attribute __dict__ Message-ID: <1601819097.88.0.92979678916.issue41931@roundup.psfhosted.org> Change by ??????????? ?????????? : ---------- nosy: SmartManoj priority: normal severity: normal status: open title: Make dict(object) return its attribute __dict__ type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 10:09:02 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 04 Oct 2020 14:09:02 +0000 Subject: [issue41183] [3.5] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures In-Reply-To: <1593614146.46.0.384684767233.issue41183@roundup.psfhosted.org> Message-ID: <1601820542.76.0.093437083397.issue41183@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 10:17:27 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 14:17:27 +0000 Subject: [issue41931] Make dict(object) return its attribute __dict__ Message-ID: <1601821047.33.0.238039916415.issue41931@roundup.psfhosted.org> New submission from Irit Katriel : dict is not a function, it's a class and the purpose of a dict() call is to create a new instance of that class. The change you are proposing is also breaking for iterators: >>> class Pairs(list): pass ... >>> pairs = Pairs([('a', 1), ('b', 2)]) >>> pairs.__dict__ {} >>> dict(pairs) {'a': 1, 'b': 2} A change of this magnitude will need to be discussed on python-ideas and will require a PEP explaining why the benefits of the change outweigh its costs. I very much doubt that they do. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 10:29:04 2020 From: report at bugs.python.org (=?utf-8?b?4K6u4K6p4K+L4K6c4K+N4K6V4K+B4K6u4K6+4K6w4K+NIOCuquCutOCuqQ==?= =?utf-8?b?4K6/4K6a4K+N4K6a4K6+4K6u4K6/?=) Date: Sun, 04 Oct 2020 14:29:04 +0000 Subject: [issue41931] Make dict(object) return its attribute __dict__ In-Reply-To: <1601821047.33.0.238039916415.issue41931@roundup.psfhosted.org> Message-ID: <1601821744.92.0.288270885771.issue41931@roundup.psfhosted.org> ??????????? ?????????? added the comment: Will return only if it is not an iterator ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 10:35:52 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 14:35:52 +0000 Subject: [issue32922] dbm.open() encodes filename with default encoding rather than the filesystem encoding In-Reply-To: <1519398668.71.0.467229070634.issue32922@psf.upfronthosting.co.za> Message-ID: <1601822152.58.0.717951901258.issue32922@roundup.psfhosted.org> Irit Katriel added the comment: This seems resolved, can it be closed? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 10:46:20 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 14:46:20 +0000 Subject: [issue32222] pygettext doesn't extract docstrings for functions with type annotated params In-Reply-To: <1512470175.69.0.213398074469.issue32222@psf.upfronthosting.co.za> Message-ID: <1601822780.66.0.718143830021.issue32222@roundup.psfhosted.org> Irit Katriel added the comment: I think this is resolved and can be closed. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 10:51:05 2020 From: report at bugs.python.org (Carl Bordum Hansen) Date: Sun, 04 Oct 2020 14:51:05 +0000 Subject: [issue25292] ssl socket gets into broken state when client exits during handshake In-Reply-To: <1443729972.18.0.386386409576.issue25292@psf.upfronthosting.co.za> Message-ID: <1601823065.49.0.357438962362.issue25292@roundup.psfhosted.org> Change by Carl Bordum Hansen : ---------- keywords: +patch nosy: +carlbordum nosy_count: 5.0 -> 6.0 pull_requests: +21544 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22541 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 10:57:39 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 14:57:39 +0000 Subject: [issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined In-Reply-To: <1596607573.95.0.247308930011.issue41483@roundup.psfhosted.org> Message-ID: <1601823459.6.0.0299177294258.issue41483@roundup.psfhosted.org> Irit Katriel added the comment: I think this issue should be closed - Kostis doesn't seem keen to discuss the merits of this change, and as I've said I don't think it's worth pursuing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:24:54 2020 From: report at bugs.python.org (Ivan Sorokin) Date: Sun, 04 Oct 2020 15:24:54 +0000 Subject: [issue41928] ZipFile does not supports Unicode Path Extra Field (0x7075) zip header field In-Reply-To: <1601810501.41.0.603959888811.issue41928@roundup.psfhosted.org> Message-ID: <1601825094.51.0.960614764386.issue41928@roundup.psfhosted.org> Ivan Sorokin added the comment: Grand unified algorithm to read filenames from zip files correctly: 1. Do zip entry have ?Unicode Path Extra Field? (0x7075)? Use it for file name. 2. Is Unicode flag (0x800) set in ?Flags? Field of zip entry? Assume ?Filename? Field is in UTF-8. 3. Do ?HostOS? Field of zip entry have values of 0 (FAT) or 11 (NTFS)? Assume ?Filename? Field is in OEM charset corresponding to system locale. 4. Assume ?Filename? Field is in UTF-8. p7zip with oemcp patch (https://github.com/unxed/oemcp/) uses exactly this method, and is able to process all zip files in my test set correctly (my test set contains several zips generated by different packers on windows, macos, linux, and by online services). The same algorithm should be used in any zip unpacker wishing to process non-latin filenames as gently as possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:38:09 2020 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 04 Oct 2020 15:38:09 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601825889.97.0.725761533225.issue41898@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset faa8c6a8f1fe9c3bac31061e8a59a686b983ebb8 by Miss Skeleton (bot) in branch '3.9': bpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526) (GH-22540) https://github.com/python/cpython/commit/faa8c6a8f1fe9c3bac31061e8a59a686b983ebb8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:38:47 2020 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 04 Oct 2020 15:38:47 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601825927.34.0.683204373987.issue41898@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:42:16 2020 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 04 Oct 2020 15:42:16 +0000 Subject: [issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined In-Reply-To: <1596607573.95.0.247308930011.issue41483@roundup.psfhosted.org> Message-ID: <1601826136.99.0.985817742641.issue41483@roundup.psfhosted.org> Vinay Sajip added the comment: OK, I'll mark as pending and close in a few days if nothing more is heard from Kostis. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:42:42 2020 From: report at bugs.python.org (Eryk Sun) Date: Sun, 04 Oct 2020 15:42:42 +0000 Subject: [issue41929] Detect OEM code page for zip archives in ZipFile based on system locale In-Reply-To: <1601811382.76.0.398158982461.issue41929@roundup.psfhosted.org> Message-ID: <1601826162.51.0.159122516773.issue41929@roundup.psfhosted.org> Eryk Sun added the comment: This is already addressed in bpo-28080, which adds an `encoding` parameter -- e.g. `encoding="oem"` ("oem" is only available in Windows). Unfortunately bpo-28080 has languished without resolution for four years. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:42:55 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 15:42:55 +0000 Subject: [issue32112] Should uuid.UUID() accept another UUID() instance? In-Reply-To: <1511347956.68.0.213398074469.issue32112@psf.upfronthosting.co.za> Message-ID: <1601826175.03.0.267421469793.issue32112@roundup.psfhosted.org> Irit Katriel added the comment: I agree with Serhiy that there needs to be a reason for adding this to a class constructor. In the case of int, this is to implement conversion - it's not accepting int, it's accepting any number (it would be weird of int(3.4) worked and int(3) didn't). Similarly, complex constructor accepts numbers. In the case of tuple, bytes, bytearray - the constructor accepts any iterable, again in order to implement type conversion. So it's not random - these constructors accept objects of the same type because they accept params of a more generic type, in order to provide type conversion functionality. What functionality would we gain from increasing the API surface of the UUID constructor as you suggest? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:46:19 2020 From: report at bugs.python.org (Tal Einat) Date: Sun, 04 Oct 2020 15:46:19 +0000 Subject: [issue21756] IDLE - ParenMatch fails to find closing paren of multi-line statements In-Reply-To: <1402739295.59.0.675144010232.issue21756@psf.upfronthosting.co.za> Message-ID: <1601826379.73.0.296749760101.issue21756@roundup.psfhosted.org> Tal Einat added the comment: As noted on the PR GH-20753, an incremental change to the current logic doesn't seem like a promising approach. It seems to me that this will require refactoring the code parsing logic to allow it to incrementally parse lines backwards and forwards in order to find the beginning and end of a code block. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:51:13 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 15:51:13 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601826673.74.0.182250157017.issue41898@roundup.psfhosted.org> Irit Katriel added the comment: I'm not sure my patch completely resolved this issue. I'm adding Antoine re the OP's question about the assertLogs API. > Doing so would make the test over-specific and fragile. The requirement is > that a warning be logged, not that a specific logger issue the warning. My view is that your test is fragile because it just asks "was anything logged" without checking the log message. The docs show how to verify that the log message is what you expect it to be. ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:53:19 2020 From: report at bugs.python.org (Carl Bordum Hansen) Date: Sun, 04 Oct 2020 15:53:19 +0000 Subject: [issue25292] ssl socket gets into broken state when client exits during handshake In-Reply-To: <1443729972.18.0.386386409576.issue25292@psf.upfronthosting.co.za> Message-ID: <1601826799.29.0.48138468939.issue25292@roundup.psfhosted.org> Carl Bordum Hansen added the comment: I have submitted a proposed solution Just found this similar issue https://bugs.python.org/issue35840 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:56:06 2020 From: report at bugs.python.org (Kostis Anagnostopoulos) Date: Sun, 04 Oct 2020 15:56:06 +0000 Subject: [issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined In-Reply-To: <1596607573.95.0.247308930011.issue41483@roundup.psfhosted.org> Message-ID: <1601826966.77.0.518662492581.issue41483@roundup.psfhosted.org> Kostis Anagnostopoulos added the comment: Have nothing else to say on top of what iritkatriel discovered, a double-check would be needed, but may be a pointless speed up, if MemoryHandler is impossible to work without a `target`. Fixing the no-target error is more important. Actually that's how i came to notice this optimization. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 11:56:03 2020 From: report at bugs.python.org (berthin) Date: Sun, 04 Oct 2020 15:56:03 +0000 Subject: [issue41932] Incorrect struct definition with bitfields Message-ID: <1601826963.62.0.914106725495.issue41932@roundup.psfhosted.org> New submission from berthin : Hi all, I found one issue related to bitfields and ctypes, and although there is a similar issue already opened (https://bugs.python.org/issue29753), that only covers the case with pragmas. Please, consider the following scenario: >>> from ctypes import * >>> class X(Structure): ... _fields_ = [("a", c_uint8, 8), ("b", c_uint8, 8), ("c", c_uint32, 16)] ... >>> sizeof(X) 5 Which seems to be incorrect, because what natively C does is to generate a 4bytes struct. root at 0bc6a647abaa:/target/cpython-fix# cat sample.c #include #include struct X { uint8_t a; uint8_t b; uint32_t c:16; } X; int main() { printf("%u\n", sizeof(X)); } root at 0bc6a647abaa:/target/cpython-fix# gcc sample.c -o a && ./a 4 Also, if I use different databtypes I get what I expect (a struct of 4 bytes). >>> X = type('X', (Structure,), {'_fields_': [('a', c_uint32, 8), ('b', c_uint32, 8), ('c', c_uint32, 16)]}) >>> sizeof(X) 4 >>> X = type('X', (Structure,), {'_fields_': [('a', c_uint16, 8), ('b', c_uint16, 8), ('c', c_uint16, 16)]}) >>> sizeof(X) 4 >>> X = type('X', (Structure,), {'_fields_': [('a', c_uint8, 8), ('b', c_uint8, 8), ('c', c_uint16, 16)]}) >>> sizeof(X) 4 I tried to debug a little bit, adding some prints before and after calling *PyCField_FromDesc* in *Modules/_ctypes/stgdict.c:L603*.=, if someone wants to look at it, the logs are attached / one log file per each test, using the following gdb init: # before break stgdict.c:601 commands p field_size p bitofs p size p align p *dict continue end # after break stgdict.c:617 commands p field_size p bitofs p size p align p *(CFieldObject*) prop continue end Hope someone could spot the issue, I will also try to investigate it by my own. Best, P.S. For the tests, I worked on top of bpo-29753 (https://github.com/python/cpython/pull/19850) ---------- components: ctypes files: bitfields.zip messages: 377953 nosy: FFY00, berthin priority: normal severity: normal status: open title: Incorrect struct definition with bitfields type: behavior versions: Python 3.10, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49493/bitfields.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 12:03:05 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 16:03:05 +0000 Subject: [issue41483] Do not acquire lock in MemoryHandler.flush() if no target defined In-Reply-To: <1596607573.95.0.247308930011.issue41483@roundup.psfhosted.org> Message-ID: <1601827385.88.0.339224485844.issue41483@roundup.psfhosted.org> Irit Katriel added the comment: The missing target error was fixed under issue41503 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 12:15:22 2020 From: report at bugs.python.org (Bar Harel) Date: Sun, 04 Oct 2020 16:15:22 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601828122.22.0.782289334338.issue41905@roundup.psfhosted.org> Bar Harel added the comment: > When instantiation fails, recheck to see the missing abstract methods had been defined? I've written about it in the python-ideas discussion as well, and completely agree. There is no other approach that would guarantee correctness across all APIs, both internal and 3rd party. Adding a function to recalculate will require everyone to use it, and worse, know that it even exists. The overhead should be quite low as this case is probably rare and the recalculation can happen only on failure. I'm not sure however, what are the implications of changing Py_TPFLAGS_IS_ABSTRACT during type creation. ---------- nosy: +bar.harel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 12:16:07 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 16:16:07 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601828167.22.0.718092244126.issue41898@roundup.psfhosted.org> Irit Katriel added the comment: Troy, I'm also confused about how you would have liked assertLogs to behave you say: 1. I don't want to specify the logger because I don't care which logger the message comes from. 2. I don't want it to catch messages from other loggers (whatever other means here). But -- see 1 -- you didn't specify the logger because you don't care which logger. What do you expect assertLogs to do when you don't specify a logger? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 12:20:21 2020 From: report at bugs.python.org (Julien Palard) Date: Sun, 04 Oct 2020 16:20:21 +0000 Subject: [issue41933] Wording of s * n in Common Sequence Operations is not optimal Message-ID: <1601828421.16.0.497838866676.issue41933@roundup.psfhosted.org> New submission from Julien Palard : As reported by Graham Ewart on docs@, in https://docs.python.org/3/library/stdtypes.html#common-sequence-operations: s * n or n * s | equivalent to adding s to itself n times is badly worded. In fact it's more like n-1 times, but yet it's not adding s to itself. I'd go for "n times the s sequence" or "n copies of the s sequence" instead, which both avoid the "n-1" and the "to itself" parts. ---------- assignee: docs at python components: Documentation keywords: easy messages: 377958 nosy: docs at python, mdk priority: normal severity: normal status: open title: Wording of s * n in Common Sequence Operations is not optimal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 12:21:07 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 04 Oct 2020 16:21:07 +0000 Subject: [issue41875] __builtin_unreachable error in gcc 4.4.5 In-Reply-To: <1601291751.72.0.463788017117.issue41875@roundup.psfhosted.org> Message-ID: <1601828467.38.0.708977964967.issue41875@roundup.psfhosted.org> ?ukasz Langa added the comment: Done. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 12:24:13 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 04 Oct 2020 16:24:13 +0000 Subject: [issue38302] [3.10] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **= In-Reply-To: <1569621315.69.0.377751123288.issue38302@roundup.psfhosted.org> Message-ID: <1601828653.37.0.175487042173.issue38302@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- title: __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **= -> [3.10] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **= _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 12:29:39 2020 From: report at bugs.python.org (Josh Friend) Date: Sun, 04 Oct 2020 16:29:39 +0000 Subject: [issue32922] dbm.open() encodes filename with default encoding rather than the filesystem encoding In-Reply-To: <1519398668.71.0.467229070634.issue32922@psf.upfronthosting.co.za> Message-ID: <1601828979.37.0.687833145985.issue32922@roundup.psfhosted.org> Josh Friend added the comment: yes it should be closed, can i do that? (ill try...) ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 12:45:38 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 04 Oct 2020 16:45:38 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601829938.62.0.754697700935.issue41490@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2cc6dc9896771ef3615abbb5ba80939a2f644a08 by Pablo Galindo in branch 'master': bpo-41490: Bump vendored pip to version 20.2.3 (#22527) https://github.com/python/cpython/commit/2cc6dc9896771ef3615abbb5ba80939a2f644a08 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 12:49:31 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Oct 2020 16:49:31 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601830171.57.0.741611265658.issue41490@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +21545 pull_request: https://github.com/python/cpython/pull/22544 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 12:51:52 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Oct 2020 16:51:52 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601830312.0.0.506008435992.issue41490@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +21546 pull_request: https://github.com/python/cpython/pull/22545 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 13:11:13 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 04 Oct 2020 17:11:13 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601831473.2.0.074947218805.issue41490@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4b4d60f9287e0e52c2569876456f40efc11529b4 by Pablo Galindo in branch '3.9': [3.9] bpo-41490: Bump vendored pip to version 20.2.3 (GH-22527). (GH-22544) https://github.com/python/cpython/commit/4b4d60f9287e0e52c2569876456f40efc11529b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 13:11:34 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 04 Oct 2020 17:11:34 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601831494.12.0.342072974446.issue41490@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 28cd96f2e5cfb16566a75dca8473b71889746f10 by Pablo Galindo in branch '3.8': [3.8] bpo-41490: Bump vendored pip to version 20.2.3 (GH-22527). (GH-22545) https://github.com/python/cpython/commit/28cd96f2e5cfb16566a75dca8473b71889746f10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 13:13:29 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 04 Oct 2020 17:13:29 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601831609.91.0.0515997536487.issue41490@roundup.psfhosted.org> ?ukasz Langa added the comment: This change goes into 3.9.0 with Pablo's fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 13:18:40 2020 From: report at bugs.python.org (Stefan Behnel) Date: Sun, 04 Oct 2020 17:18:40 +0000 Subject: [issue41892] use both "for in" and "ElementTree.remove" has a index bug In-Reply-To: <1601475625.07.0.195514916094.issue41892@roundup.psfhosted.org> Message-ID: <1601831920.12.0.0877159897361.issue41892@roundup.psfhosted.org> Change by Stefan Behnel : ---------- pull_requests: +21547 pull_request: https://github.com/python/cpython/pull/22546 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 13:38:53 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 17:38:53 +0000 Subject: [issue41931] Make dict(object) return its attribute __dict__ In-Reply-To: <1601821047.33.0.238039916415.issue41931@roundup.psfhosted.org> Message-ID: <1601833133.58.0.484913696093.issue41931@roundup.psfhosted.org> Irit Katriel added the comment: You ignored the other point I made: dict is not a function, it is a class. dict() calls the function dict.__init__() which should create a new instance of dict (not return some field of its parameter). You also didn't justify your suggestion in any way. Why should this change be made? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 13:57:00 2020 From: report at bugs.python.org (Chris Tse) Date: Sun, 04 Oct 2020 17:57:00 +0000 Subject: [issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error In-Reply-To: <1601782121.26.0.581028489128.issue41925@roundup.psfhosted.org> Message-ID: <1601834220.74.0.775332098145.issue41925@roundup.psfhosted.org> Chris Tse added the comment: Another update: After a full shutdown from yesterday and trying again today, everything seems to be working now, including activating the venv via: 1. python -m venv myenv 2. .\myenv\Scripts\activate (not Activate.ps1, though that work too, is this intended?) The only thing I can think of that changed since I opened the report was that I changed my system locale back to English (United States) from Japan (Japan). I did a system restart to make the changes take effect, but it didn't seem to fix the issue at the time. It could possibly be a difference between a shutdown vs a restart. Odd, either way. I wouldn't think that changing locales would have an effect on Windows paths being case sensitive or not, otherwise folks from other countries would be experiencing this error. Perhaps the mixing of locale and system language? I had locale set to Japan but system language set to English Thank you for taking the time to reply. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 14:06:21 2020 From: report at bugs.python.org (=?utf-8?b?4K6u4K6p4K+L4K6c4K+N4K6V4K+B4K6u4K6+4K6w4K+NIOCuquCutOCuqQ==?= =?utf-8?b?4K6/4K6a4K+N4K6a4K6+4K6u4K6/?=) Date: Sun, 04 Oct 2020 18:06:21 +0000 Subject: [issue41931] Make dict(object) return its attribute __dict__ In-Reply-To: <1601821047.33.0.238039916415.issue41931@roundup.psfhosted.org> Message-ID: <1601834781.16.0.8070509155.issue41931@roundup.psfhosted.org> ??????????? ?????????? added the comment: Your point makes sense as it takes space to allocate for the new instance to just return another dict object. Then the attribute name at least should be meaningful. Instead of __dict__ , __attr__ is more appropriate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 14:17:08 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Oct 2020 18:17:08 +0000 Subject: [issue41931] Make dict(object) return its attribute __dict__ In-Reply-To: <1601821047.33.0.238039916415.issue41931@roundup.psfhosted.org> Message-ID: <1601835428.34.0.374448967943.issue41931@roundup.psfhosted.org> Raymond Hettinger added the comment: The vars() function already does this. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 14:22:03 2020 From: report at bugs.python.org (Ben Avrahami) Date: Sun, 04 Oct 2020 18:22:03 +0000 Subject: [issue41905] add update_abstractmethods function to update an ABC's abstract methods In-Reply-To: <1601567692.16.0.144251091539.issue41905@roundup.psfhosted.org> Message-ID: <1601835723.97.0.696067886646.issue41905@roundup.psfhosted.org> Ben Avrahami added the comment: > Adding a function to recalculate will require everyone to use it I'd argue that this is akin to `functools.update_wrapper`. It too is a function that must be called in virtually every function decorator (the only function decorators that don't/needn't call it are the built-in method decorators and, appropriately enough, @abstractmethod), and if not called, certain functionality won't work. > and worse, know that it even exists I think that knowing about such a function is a fair requirement. Mixin tools already has nuances and edge cases, such that it should only be done (and especially distributed) by advanced users. Furthermore, not all class mixin tools have/need to be ABC-aware. Just as `total_ordering` is ABC-agnostic (indeed, it is also subclass-agnostic), any other mixin tool can decide that implementing abstract classes is simply not a use case for them. The upshot of the `update_abstractmethods` implementation is that, as long as their implementation isn't afraid to override methods that are already defined (like attrs does), the function can be slotted above ABC-agnostic wrappers and it suddenly becomes ABC-aware. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 14:25:44 2020 From: report at bugs.python.org (=?utf-8?b?4K6u4K6p4K+L4K6c4K+N4K6V4K+B4K6u4K6+4K6w4K+NIOCuquCutOCuqQ==?= =?utf-8?b?4K6/4K6a4K+N4K6a4K6+4K6u4K6/?=) Date: Sun, 04 Oct 2020 18:25:44 +0000 Subject: [issue41931] Make dict(object) return its attribute __dict__ In-Reply-To: <1601821047.33.0.238039916415.issue41931@roundup.psfhosted.org> Message-ID: <1601835944.8.0.687554832735.issue41931@roundup.psfhosted.org> ??????????? ?????????? added the comment: Changing '__dict__' to __vars__ will be much better. Like len() calling __len__() Can we change the title? Why Github Issue Tracker is not issued? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 14:43:39 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 04 Oct 2020 18:43:39 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601837019.52.0.878408411694.issue26680@roundup.psfhosted.org> Raymond Hettinger added the comment: > How so? When a concrete class registers with an ABC, it is making a promise that it implements everything in the ABC so that client code can count on all the methods being present. That is the raison d'etre for abstract base classes. In general, we restrict ABCs to a minimal useful subset of the capabilities of concrete classes. That makes the ABC more broadly applicable and it makes life easier for implementers of concrete classes. That's why collections.abc.Set doesn't include most of the named methods present in the concrete set/frozenset types. Likewise, we don't want to add methods to already published ABCs because existing user classes registered to the ABC stop being compliant. If an additional method is deemed essential, the technically correct way to do is to make a new ABC that subclasses from the old. For example, that's why Python 2 had to have both UserDict and IterableUserDict when we needed to add a __iter__() method. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 15:16:05 2020 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 04 Oct 2020 19:16:05 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601838965.92.0.774534057581.issue26680@roundup.psfhosted.org> Guido van Rossum added the comment: Possibly at some point in the future we can switch to using typing.Protocol, which requires neither registration nor explicit subclassing (it's like Hashable). This makes it easy for user code to define custom protocols as needed. So if you need something that has .keys() and .items() but you don't care about .values() you can just write class KeysAndItems(typing.Protocol): def keys(self): ... def items(self): ... def my_func(x: KeysAndItems): ... This can be statically checked using e.g. mypy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 16:55:49 2020 From: report at bugs.python.org (Hadi Alqattan) Date: Sun, 04 Oct 2020 20:55:49 +0000 Subject: [issue41934] Add `has` method to `pathlib.Path` class. Message-ID: <1601844949.96.0.502154484119.issue41934@roundup.psfhosted.org> New submission from Hadi Alqattan : Adding a new method to `pathlib.Path` class, `has` method is a method that can determine if the `Path` object has a specific file/dir or not. Assume that we have a `Path` object for this `project/` directory: ``` project/ main.py __init__.py utils/ ``` and we want to know if the project directory has `main.py` or not, after adding this method we will be able to do this: ``` from pathlib import Path project_path = Path("./project") if project_path.has("main.py"): pass # do something. ``` ---------- components: Library (Lib) messages: 377973 nosy: hadialqattan priority: normal severity: normal status: open title: Add `has` method to `pathlib.Path` class. type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 17:02:53 2020 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 04 Oct 2020 21:02:53 +0000 Subject: [issue41934] Add `has` method to `pathlib.Path` class. In-Reply-To: <1601844949.96.0.502154484119.issue41934@roundup.psfhosted.org> Message-ID: <1601845373.26.0.303724732485.issue41934@roundup.psfhosted.org> Eric V. Smith added the comment: Isn't this just: (project_path / "main.py").exists() ? I don't think .has would be any more efficient. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 17:13:11 2020 From: report at bugs.python.org (Hadi Alqattan) Date: Sun, 04 Oct 2020 21:13:11 +0000 Subject: [issue41934] Add `has` method to `pathlib.Path` class. In-Reply-To: <1601844949.96.0.502154484119.issue41934@roundup.psfhosted.org> Message-ID: <1601845991.0.0.357557495831.issue41934@roundup.psfhosted.org> Hadi Alqattan added the comment: You're right, I'm sorry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 17:13:22 2020 From: report at bugs.python.org (Hadi Alqattan) Date: Sun, 04 Oct 2020 21:13:22 +0000 Subject: [issue41934] Add `has` method to `pathlib.Path` class. In-Reply-To: <1601844949.96.0.502154484119.issue41934@roundup.psfhosted.org> Message-ID: <1601846002.37.0.494683285823.issue41934@roundup.psfhosted.org> Change by Hadi Alqattan : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 17:22:09 2020 From: report at bugs.python.org (Hadi Alqattan) Date: Sun, 04 Oct 2020 21:22:09 +0000 Subject: [issue41935] Add binary operator! Message-ID: <1601846529.24.0.0764932773138.issue41935@roundup.psfhosted.org> New submission from Hadi Alqattan : What are your opinions about adding a binary operator to Python in order to make this code possible? ``` my_counter = 0 for i in rage(1000): my_counter += 1 if (i % 2) == 0 ``` ---------- components: Interpreter Core messages: 377976 nosy: hadialqattan priority: normal severity: normal status: open title: Add binary operator! type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 17:56:01 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 21:56:01 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601848561.58.0.894591148999.issue41909@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 9ece9cd65cdeb0a1f6e60475bbd0219161c348ac by Serhiy Storchaka in branch 'master': bpo-41909: Enable previously disabled recursion checks. (GH-22536) https://github.com/python/cpython/commit/9ece9cd65cdeb0a1f6e60475bbd0219161c348ac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 17:57:34 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 21:57:34 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601848654.14.0.912440629054.issue41909@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +21548 pull_request: https://github.com/python/cpython/pull/22550 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 18:03:39 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 22:03:39 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601849019.55.0.882442547256.issue41909@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +21549 pull_request: https://github.com/python/cpython/pull/22551 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 18:20:31 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 22:20:31 +0000 Subject: [issue41936] Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION Message-ID: <1601850031.67.0.853880469279.issue41936@roundup.psfhosted.org> New submission from Serhiy Storchaka : Macros Py_ALLOW_RECURSION and Py_END_ALLOW_RECURSION together with field recursion_critical of the PyInterpreterState structure were added in 5b222135f8d2492713994f2cb003980e87ce6a72 but were never documented. It seems that the reason of adding them was to work around the fact that PyDict_GetItem() can silence any exception including recursion error. But PyDict_GetItem() no longer used in that code and the macros are also no longer used (see issue41909). GvR proposed to remove these macros. I think that recursion_critical can be removed too. ---------- components: C API messages: 377978 nosy: gvanrossum, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 18:27:43 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 22:27:43 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601850463.85.0.28215741389.issue41909@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 7aa22ba923509af1dbf115c090964f503c84ca8d by Serhiy Storchaka in branch '3.9': [3.9] bpo-41909: Enable previously disabled recursion checks. (GH-22536) (GH-22550) https://github.com/python/cpython/commit/7aa22ba923509af1dbf115c090964f503c84ca8d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 18:28:03 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 22:28:03 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601850483.82.0.697390186322.issue41909@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 09a7b3b618cd02694a0bc8abfa24c75f0e659407 by Serhiy Storchaka in branch '3.8': [3.8] bpo-41909: Enable previously disabled recursion checks. (GH-22536) (GH-22551) https://github.com/python/cpython/commit/09a7b3b618cd02694a0bc8abfa24c75f0e659407 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 18:30:25 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 22:30:25 +0000 Subject: [issue41936] Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION In-Reply-To: <1601850031.67.0.853880469279.issue41936@roundup.psfhosted.org> Message-ID: <1601850625.05.0.647392945318.issue41936@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +21550 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22552 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 18:34:17 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 22:34:17 +0000 Subject: [issue40640] Tutorial for Continue missing ... line In-Reply-To: <1589608941.53.0.91951505263.issue40640@roundup.psfhosted.org> Message-ID: <1601850857.2.0.704031284708.issue40640@roundup.psfhosted.org> Irit Katriel added the comment: ping ---------- nosy: +iritkatriel versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 18:38:01 2020 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Oct 2020 22:38:01 +0000 Subject: [issue40640] Tutorial for Continue missing ... line In-Reply-To: <1589608941.53.0.91951505263.issue40640@roundup.psfhosted.org> Message-ID: <1601851081.23.0.695734845062.issue40640@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 18:44:32 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Oct 2020 22:44:32 +0000 Subject: [issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses In-Reply-To: <1601635791.4.0.685475277421.issue41909@roundup.psfhosted.org> Message-ID: <1601851472.05.0.988896064512.issue41909@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 19:14:03 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Oct 2020 23:14:03 +0000 Subject: [issue41892] use both "for in" and "ElementTree.remove" has a index bug In-Reply-To: <1601475625.07.0.195514916094.issue41892@roundup.psfhosted.org> Message-ID: <1601853243.16.0.270879951039.issue41892@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +21551 pull_request: https://github.com/python/cpython/pull/22553 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 19:13:53 2020 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Oct 2020 23:13:53 +0000 Subject: [issue41892] use both "for in" and "ElementTree.remove" has a index bug In-Reply-To: <1601475625.07.0.195514916094.issue41892@roundup.psfhosted.org> Message-ID: <1601853233.01.0.537925771339.issue41892@roundup.psfhosted.org> Ned Deily added the comment: New changeset 40db798692ca783fc2163656f196ac77e8b9e792 by scoder in branch 'master': bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids modifying an XML tree while iterating over it. (GH-22464) https://github.com/python/cpython/commit/40db798692ca783fc2163656f196ac77e8b9e792 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 19:14:07 2020 From: report at bugs.python.org (twoone3) Date: Sun, 04 Oct 2020 23:14:07 +0000 Subject: [issue41937] how to use cpython O& Message-ID: <1601853247.59.0.581530220045.issue41937@roundup.psfhosted.org> New submission from twoone3 <3197653242 at qq.com>: When I use'O&' to parse the parameters, I have never succeeded, I hope I can give a demo ---------- files: Screenshot_2020_1005_070639.png messages: 377983 nosy: twoone3 priority: normal severity: normal status: open title: how to use cpython O& type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file49494/Screenshot_2020_1005_070639.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 19:22:22 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Oct 2020 23:22:22 +0000 Subject: [issue41892] use both "for in" and "ElementTree.remove" has a index bug In-Reply-To: <1601475625.07.0.195514916094.issue41892@roundup.psfhosted.org> Message-ID: <1601853742.38.0.425633205402.issue41892@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21552 pull_request: https://github.com/python/cpython/pull/22554 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 19:23:51 2020 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Oct 2020 23:23:51 +0000 Subject: [issue41892] use both "for in" and "ElementTree.remove" has a index bug In-Reply-To: <1601475625.07.0.195514916094.issue41892@roundup.psfhosted.org> Message-ID: <1601853831.49.0.828537895912.issue41892@roundup.psfhosted.org> miss-islington added the comment: New changeset 6bd058e0ff5d4a63fb35f6d45161cdf51cb68c58 by Miss Skeleton (bot) in branch '3.8': bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids modifying an XML tree while iterating over it. (GH-22464) https://github.com/python/cpython/commit/6bd058e0ff5d4a63fb35f6d45161cdf51cb68c58 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 19:41:08 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Oct 2020 23:41:08 +0000 Subject: [issue41935] Add binary operator! In-Reply-To: <1601846529.24.0.0764932773138.issue41935@roundup.psfhosted.org> Message-ID: <1601854868.97.0.0494850073105.issue41935@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: You can already do: my_counter = 0 for i in rage(1000): my_counter += (1 if (i % 2) == 0 else 0) ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 19:42:02 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Oct 2020 23:42:02 +0000 Subject: [issue41935] Add binary operator! In-Reply-To: <1601846529.24.0.0764932773138.issue41935@roundup.psfhosted.org> Message-ID: <1601854922.23.0.852420707276.issue41935@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: In any case, for modifications about the Python syntax, please, open first some debate in the python-ideas mailing list. ---------- resolution: -> postponed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 19:51:46 2020 From: report at bugs.python.org (Eryk Sun) Date: Sun, 04 Oct 2020 23:51:46 +0000 Subject: [issue41925] Lowercase path to python.exe in pip.exe from venv is throwing error In-Reply-To: <1601782121.26.0.581028489128.issue41925@roundup.psfhosted.org> Message-ID: <1601855506.12.0.607244104073.issue41925@roundup.psfhosted.org> Eryk Sun added the comment: > I wouldn't think that changing locales would have an effect on Windows > paths being case sensitive or not, otherwise folks from other countries > would be experiencing this error. Perhaps the mixing of locale and system > language? I had locale set to Japan but system language set to English It shouldn't make a difference. Filenames are Unicode, the NTFS case table is set on disk when the filesystem is formatted, and the launcher uses wide-character strings and calls CreateProcessW. I wish I could offer up a reasonable explanation, but I think this one stays in the category of strange problems fixed by turning it off and on again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 19:56:45 2020 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 04 Oct 2020 23:56:45 +0000 Subject: [issue41937] how to use cpython O& In-Reply-To: <1601853247.59.0.581530220045.issue41937@roundup.psfhosted.org> Message-ID: <1601855805.44.0.28416723948.issue41937@roundup.psfhosted.org> Steven D'Aprano added the comment: Please don't post screen shots of text when you can post a direct link to the page. Are you talking about this? https://docs.python.org/3/c-api/arg.html?highlight=py_cleanup#other-objects This is a bug tracker, for reporting bugs in the Python interpreter and standard library, not a help desk for asking for help with your code. There are many other places where you can ask for help, such as: - Stackoverflow - Reddit's /r/learnpython - https://python-forum.io/ - the Python-List mailing list https://mail.python.org/mailman/listinfo/python-list - IRC https://www.python.org/community/irc/ and probably many more. For help getting your code to work, see the above forums. I'm going to close this as "Not A Bug", if you have an actual bug to report, you can re-open this with a demonstration of the bug. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 19:57:06 2020 From: report at bugs.python.org (Ned Deily) Date: Sun, 04 Oct 2020 23:57:06 +0000 Subject: [issue41892] use both "for in" and "ElementTree.remove" has a index bug In-Reply-To: <1601475625.07.0.195514916094.issue41892@roundup.psfhosted.org> Message-ID: <1601855826.0.0.821246611146.issue41892@roundup.psfhosted.org> Ned Deily added the comment: New changeset d5719247ba32b3ac700454bad9a9e2cc7edeac6a by Miss Skeleton (bot) in branch '3.9': bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids modifying an XML tree while iterating over it. (GH-22464) (GH-22554) https://github.com/python/cpython/commit/d5719247ba32b3ac700454bad9a9e2cc7edeac6a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 22:01:18 2020 From: report at bugs.python.org (Tim Peters) Date: Mon, 05 Oct 2020 02:01:18 +0000 Subject: [issue41912] Long generator chain causes segmentation fault In-Reply-To: <1601661685.77.0.221830308398.issue41912@roundup.psfhosted.org> Message-ID: <1601863278.13.0.330230275257.issue41912@roundup.psfhosted.org> Tim Peters added the comment: "Stackless" is a large topic with a convoluted history. Do the web search. In short, no, it will never go in the core - too disruptive to too many things. Parts have lived on in other ways, watered down versions. The PyPy project captured most of what remains, as optional features. CPython's generators captured the easiest part: after a yield, the C stack space the generator consumed is released, while the Python VM stack space lives on in the heap awaiting possible resumption (but, if/when it's resumed, C stack space is required again). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 22:02:57 2020 From: report at bugs.python.org (Kaushal Rohit) Date: Mon, 05 Oct 2020 02:02:57 +0000 Subject: [issue41938] concurrent.futures.wait calls len() on an possible iterable Message-ID: <1601863377.27.0.411836826133.issue41938@roundup.psfhosted.org> New submission from Kaushal Rohit : `fs` argument could be an iterable, and calling len on it would raise an Exception. We are converting `fs` into a set anyways for set difference, and that too twice. we can just put an `fs = set(fs)`. Let me know if we choose to go with that and I will make a PR ASAP. Thanks. ---------- components: Library (Lib) messages: 377991 nosy: rohitkg98 priority: normal severity: normal status: open title: concurrent.futures.wait calls len() on an possible iterable type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Oct 4 22:35:35 2020 From: report at bugs.python.org (Kaushal Rohit) Date: Mon, 05 Oct 2020 02:35:35 +0000 Subject: [issue41938] concurrent.futures.wait calls len() on an possible iterable In-Reply-To: <1601863377.27.0.411836826133.issue41938@roundup.psfhosted.org> Message-ID: <1601865335.44.0.921481373115.issue41938@roundup.psfhosted.org> Change by Kaushal Rohit : ---------- keywords: +patch pull_requests: +21553 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22555 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 00:22:13 2020 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 05 Oct 2020 04:22:13 +0000 Subject: [issue41892] use both "for in" and "ElementTree.remove" has a index bug In-Reply-To: <1601475625.07.0.195514916094.issue41892@roundup.psfhosted.org> Message-ID: <1601871733.4.0.988910048925.issue41892@roundup.psfhosted.org> Stefan Behnel added the comment: Closing since this works as designed. Users are responsible for avoiding concurrent tree modifications during iteration. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 00:40:55 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Oct 2020 04:40:55 +0000 Subject: [issue41428] PEP 604 -- Allow writing union types as X | Y In-Reply-To: <1595975550.94.0.895278514403.issue41428@roundup.psfhosted.org> Message-ID: <1601872855.56.0.257502122553.issue41428@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 8e1dd55e63d18d40e78d941fc9233d2c77bcd3de by Fidget-Spinner in branch 'master': bpo-41428: Documentation for PEP 604 (gh-22517) https://github.com/python/cpython/commit/8e1dd55e63d18d40e78d941fc9233d2c77bcd3de ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 00:41:51 2020 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Oct 2020 04:41:51 +0000 Subject: [issue41428] PEP 604 -- Allow writing union types as X | Y In-Reply-To: <1595975550.94.0.895278514403.issue41428@roundup.psfhosted.org> Message-ID: <1601872911.59.0.830517532753.issue41428@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 00:59:29 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Oct 2020 04:59:29 +0000 Subject: [issue41931] Make dict(object) return its attribute __dict__ In-Reply-To: <1601821047.33.0.238039916415.issue41931@roundup.psfhosted.org> Message-ID: <1601873969.06.0.165227341213.issue41931@roundup.psfhosted.org> Raymond Hettinger added the comment: Sorry, but I think there is a near zero chance that the language will be revised as you suggest. Marking this as closed. If you want to have more discussion, please take it to the python-ideas maillist. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 01:34:21 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Oct 2020 05:34:21 +0000 Subject: [issue41774] While removing element from list using for and remove(), which has same items output is not right In-Reply-To: <1599927635.78.0.618314187509.issue41774@roundup.psfhosted.org> Message-ID: <1601876061.67.0.632813046538.issue41774@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 03:01:03 2020 From: report at bugs.python.org (Ned Deily) Date: Mon, 05 Oct 2020 07:01:03 +0000 Subject: [issue41939] 3.9.0 test_site warning: "urllib.requests._opener was modified by test_site" Message-ID: <1601881263.18.0.474767166198.issue41939@roundup.psfhosted.org> New submission from Ned Deily : For 3.9.0, test_site fails with an env changed warning: Warning -- urllib.requests._opener was modified by test_site Before: None After: test_site failed (env changed) == Tests result: SUCCESS == 1 test altered the execution environment: test_site The problem occurs in test_site's test_license_exists_at_url test and was introduced by the changes in Issue37421: "Some tests leak temporary files". This failure has not been noticed up to now because test_license_exists_at_url is skipped unless the build being tested is for a released branch, which is about to happen for 3.9 with the 3.9.0 release. The test failure can be reproduced on any build by commenting out Lib/test_site.py lines 503-504: @unittest.skipUnless(sys.version_info[3] == 'final', 'only for released versions') Setting to "deferred blocker" status for release manager evaluation. ---------- components: Tests messages: 377995 nosy: lukasz.langa, ned.deily, vstinner priority: deferred blocker severity: normal status: open title: 3.9.0 test_site warning: "urllib.requests._opener was modified by test_site" type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 03:25:22 2020 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 05 Oct 2020 07:25:22 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601882722.32.0.284121833427.issue26680@roundup.psfhosted.org> Mark Dickinson added the comment: > When a concrete class registers with an ABC, it is making a promise that it implements everything in the ABC. Ah, interesting. I would have assumed that it's only making a promise that it registers all the methods and properties marked *abstract* in the ABC. Do you have references to back up the stronger statement? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 03:29:14 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 07:29:14 +0000 Subject: [issue41939] 3.9.0 test_site warning: "urllib.requests._opener was modified by test_site" In-Reply-To: <1601881263.18.0.474767166198.issue41939@roundup.psfhosted.org> Message-ID: <1601882954.17.0.920689462707.issue41939@roundup.psfhosted.org> STINNER Victor added the comment: It's a minor issue in the test itself, not in urllib. Such bug should not block a release. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 03:38:17 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 07:38:17 +0000 Subject: [issue41939] 3.9.0 test_site warning: "urllib.requests._opener was modified by test_site" In-Reply-To: <1601881263.18.0.474767166198.issue41939@roundup.psfhosted.org> Message-ID: <1601883497.1.0.124824454455.issue41939@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +21554 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22559 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 03:39:00 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 07:39:00 +0000 Subject: [issue41939] 3.9.0 test_site warning: "urllib.requests._opener was modified by test_site" In-Reply-To: <1601881263.18.0.474767166198.issue41939@roundup.psfhosted.org> Message-ID: <1601883540.47.0.359976214655.issue41939@roundup.psfhosted.org> STINNER Victor added the comment: I proposed PR 22559 to fix the issue. See also bpo-37475: "What is urllib.request.urlcleanup() function?". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 03:45:47 2020 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 05 Oct 2020 07:45:47 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601883947.52.0.789875104462.issue26680@roundup.psfhosted.org> Mark Dickinson added the comment: Ok, so we need to either (a) revert PR 6121 and then re-do the changes, without the changes to numbers.py, or (b) make a second PR to undo the numbers.py changes. I think there's (calendar) time available for option (b), but I'm not going to have bandwidth to do it any time soon, so there's a risk that the current changes make it into Python 3.10 purely through inertia. What's the best approach here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 04:09:33 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 08:09:33 +0000 Subject: [issue41557] Upgrade Windows and macOS builds to use SQLite 3.33 In-Reply-To: <1597485864.38.0.170390742774.issue41557@roundup.psfhosted.org> Message-ID: <1601885373.33.0.494413246352.issue41557@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +21555 pull_request: https://github.com/python/cpython/pull/22560 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 04:09:40 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 08:09:40 +0000 Subject: [issue41557] Upgrade Windows and macOS builds to use SQLite 3.33 In-Reply-To: <1597485864.38.0.170390742774.issue41557@roundup.psfhosted.org> Message-ID: <1601885380.9.0.144191075624.issue41557@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21556 pull_request: https://github.com/python/cpython/pull/22561 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 04:09:44 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 08:09:44 +0000 Subject: [issue41557] Upgrade Windows and macOS builds to use SQLite 3.33 In-Reply-To: <1597485864.38.0.170390742774.issue41557@roundup.psfhosted.org> Message-ID: <1601885384.14.0.94451691193.issue41557@roundup.psfhosted.org> miss-islington added the comment: New changeset 9a7642667a71a27b38b96eb63df45f17f48b3467 by Erlend Egeberg Aasland in branch 'master': bpo-41557: Update macOS installer to use SQLite 3.33.0 (GH-21959) https://github.com/python/cpython/commit/9a7642667a71a27b38b96eb63df45f17f48b3467 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 04:27:57 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 08:27:57 +0000 Subject: [issue41557] Upgrade Windows and macOS builds to use SQLite 3.33 In-Reply-To: <1597485864.38.0.170390742774.issue41557@roundup.psfhosted.org> Message-ID: <1601886477.46.0.66124114772.issue41557@roundup.psfhosted.org> miss-islington added the comment: New changeset a859680a5bef0bced197454f4b67080694979252 by Miss Skeleton (bot) in branch '3.8': bpo-41557: Update macOS installer to use SQLite 3.33.0 (GH-21959) https://github.com/python/cpython/commit/a859680a5bef0bced197454f4b67080694979252 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 04:38:23 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 08:38:23 +0000 Subject: [issue41936] Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION In-Reply-To: <1601850031.67.0.853880469279.issue41936@roundup.psfhosted.org> Message-ID: <1601887103.23.0.21690245045.issue41936@roundup.psfhosted.org> STINNER Victor added the comment: I failed to find users of these macros outside the CPython code base, so it sounds safe to remove it, especially if it's documented in What's New in Python 3.10. If someone reports the removal as a regression and describes a legit use case, we can reconsider to revert the removal. Until that, I'm fine with removing them. -- I ran grep on Cython and numpy code base: I cannot find "Py_ALLOW_RECURSION", "Py_END_ALLOW_RECURSION" or "recursion_critical". On GitHub, I only found copies of Include/ceval.h (I looked at the first 5 pages of result): https://github.com/search?l=C&q=Py_ALLOW_RECURSION&type=Code ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 04:48:07 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 08:48:07 +0000 Subject: [issue41940] AMD64 Debian root 3.x: tests fail because downloaded files start with: New submission from STINNER Victor : Why do downloaded files start with ", line 1 _______________________________________ From report at bugs.python.org Mon Oct 5 04:51:42 2020 From: report at bugs.python.org (twoone3) Date: Mon, 05 Oct 2020 08:51:42 +0000 Subject: [issue41941] Py_Initialize affects the console Message-ID: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> New submission from twoone3 <3197653242 at qq.com>: When I set Py_LegacyWindowsStdioFlag to 0, after Py_Initialize, the console will forcibly change what encoding is displayed. At this time, my standard stream output is utf-8, py's print is utf-8, chcp 65001 is useless, and still garbled. When I set Py_LegacyWindowsStdioFlag to 1, the console encoding is mbcs, the standard stream output is UTF-8 and not garbled, but the print of py is gbk encoding, and my system is Windows server 2016. I hope that Py_Initialize will not affect the console in subsequent versions. Do any behavior, I suggest you test the coding problem in Chinese ---------- components: C API messages: 378004 nosy: twoone3 priority: normal severity: normal status: open title: Py_Initialize affects the console type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:00:29 2020 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 05 Oct 2020 09:00:29 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601888429.08.0.113280510381.issue26680@roundup.psfhosted.org> Mark Dickinson added the comment: [Guido] > Possibly at some point in the future we can switch to using typing.Protocol [...] Yes, I think there's an interesting wider problem here, that typing.Protocol might be the answer to. For numbers and collections.abc in the std. lib., I'm happy to accept that simply having a method present in the relevant ABC class implicitly makes it a part of the interface (though it would be good if that were clarified somewhere). But in our own code, we've found it convenient to have abc.ABC subclasses that are a combination of interface and convenience base class, with the external interface separated from the convenience methods via the @abstractmethod and @abstractproperty decorators: classes that register with the given ABC subclass must provide all methods marked with those decorators, but the other methods are not considered part of the formal interface, and not used by client code that expects only an object implementing that interface. The alternative to that convenience is to have two classes: a separate purely abstract interface, and a base class implementing that interface that's designed for subclassing. That works too, but it's a bit unwieldy, and it's useful to have the all-in-one option available. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:02:17 2020 From: report at bugs.python.org (Ned Deily) Date: Mon, 05 Oct 2020 09:02:17 +0000 Subject: [issue41557] Upgrade Windows and macOS builds to use SQLite 3.33 In-Reply-To: <1597485864.38.0.170390742774.issue41557@roundup.psfhosted.org> Message-ID: <1601888537.75.0.73983243856.issue41557@roundup.psfhosted.org> Ned Deily added the comment: New changeset b6d37e15cfa32e04f750d78a03a68ec5bef00a59 by Miss Skeleton (bot) in branch '3.9': bpo-41557: Update macOS installer to use SQLite 3.33.0 (GH-21959) (GH-22560) https://github.com/python/cpython/commit/b6d37e15cfa32e04f750d78a03a68ec5bef00a59 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:04:10 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 09:04:10 +0000 Subject: [issue25292] [asyncio] ssl socket gets into broken state when client exits during handshake In-Reply-To: <1443729972.18.0.386386409576.issue25292@psf.upfronthosting.co.za> Message-ID: <1601888650.88.0.936315476745.issue25292@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: ssl socket gets into broken state when client exits during handshake -> [asyncio] ssl socket gets into broken state when client exits during handshake _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:06:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 09:06:41 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601888801.32.0.350475720442.issue41490@roundup.psfhosted.org> STINNER Victor added the comment: Can this issue be closed? Are we waiting for manual checks? Or is there any remaining thing to do? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:04:52 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 09:04:52 +0000 Subject: [issue30578] Misleading example in sys.set_coroutine_wrapper docs In-Reply-To: <1496717073.05.0.260137843936.issue30578@psf.upfronthosting.co.za> Message-ID: <1601888692.72.0.41757702179.issue30578@roundup.psfhosted.org> STINNER Victor added the comment: Right, I close the issue. ---------- resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:09:33 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 09:09:33 +0000 Subject: [issue25292] [asyncio] ssl socket gets into broken state when client exits during handshake In-Reply-To: <1443729972.18.0.386386409576.issue25292@psf.upfronthosting.co.za> Message-ID: <1601888973.93.0.857474350672.issue25292@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:31:19 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Oct 2020 09:31:19 +0000 Subject: [issue41940] AMD64 Debian root 3.x: tests fail because downloaded files start with: Message-ID: <1601890279.34.0.641045807794.issue41940@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is also not safe to pass data downloaded from untrusted source to eval(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:32:07 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Oct 2020 09:32:07 +0000 Subject: [issue41936] Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION In-Reply-To: <1601850031.67.0.853880469279.issue41936@roundup.psfhosted.org> Message-ID: <1601890327.14.0.99708991171.issue41936@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset dcc54215ac1eb4b6fab2a9ffe1abcdf3ac4bb77e by Serhiy Storchaka in branch 'master': bpo-41936. Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION (GH-22552) https://github.com/python/cpython/commit/dcc54215ac1eb4b6fab2a9ffe1abcdf3ac4bb77e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:32:22 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Oct 2020 09:32:22 +0000 Subject: [issue41936] Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION In-Reply-To: <1601850031.67.0.853880469279.issue41936@roundup.psfhosted.org> Message-ID: <1601890342.62.0.174035955454.issue41936@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:47:51 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Oct 2020 09:47:51 +0000 Subject: [issue41921] REDoS in parseentities In-Reply-To: <1601737969.46.0.495788645161.issue41921@roundup.psfhosted.org> Message-ID: <1601891271.5.0.0636260130765.issue41921@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Without evaluating the validity of the regex vulnerability, is important to note that the files in Tools/scripts are not part of the standard library and therefore they aren't a valid stack vector. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:47:56 2020 From: report at bugs.python.org (Eryk Sun) Date: Mon, 05 Oct 2020 09:47:56 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601891276.99.0.544135252286.issue41941@roundup.psfhosted.org> Eryk Sun added the comment: Python supports Unicode in a Windows console session by using the console API's wide-character functions (i.e. ReadConsoleW and WriteConsoleW) with UTF-16 encoded text. This is implemented in the io stack via io._WindowsConsoleIO, and for PyOS_Readline (e.g. builtin `input`) via _PyOS_WindowsConsoleReadline. The UTF-16 aspect is an internal detail that's presented externally as UTF-8 by automatically converting between the two. Notwithstanding the behavior of third-party packages, CPython intentionally makes no changes to a console session's global settings, including: * input & output codepages * input & output modes (except for msvcrt.getwch, etc) * cursor size and visibility * screen-buffer size, font, colors, & attributes * window size * window title ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:48:41 2020 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Oct 2020 09:48:41 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601891321.08.0.562027833019.issue41490@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yeah, there is some code in PR 21748 that should be merged (the new test). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 05:50:04 2020 From: report at bugs.python.org (Eryk Sun) Date: Mon, 05 Oct 2020 09:50:04 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601891404.7.0.202782375458.issue41941@roundup.psfhosted.org> Change by Eryk Sun : ---------- components: +IO, Unicode, Windows nosy: +ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 06:31:27 2020 From: report at bugs.python.org (twoone3) Date: Mon, 05 Oct 2020 10:31:27 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601893887.14.5.48107489775e-05.issue41941@roundup.psfhosted.org> twoone3 <3197653242 at qq.com> added the comment: So how does this explain ---------- Added file: https://bugs.python.org/file49495/Screenshots.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 06:33:27 2020 From: report at bugs.python.org (chienpingtsung) Date: Mon, 05 Oct 2020 10:33:27 +0000 Subject: [issue41942] Add if condition for 'for loop' Message-ID: <1601894007.96.0.390965204143.issue41942@roundup.psfhosted.org> New submission from chienpingtsung : 'for loop' always been used as follow code: arr = [...] for e in arr: if not condition(e): continue ... What if be written just like 'list expression', would it be more explicit? for e in arr if condition(e): pass ---------- components: Interpreter Core messages: 378015 nosy: chienpingtsung priority: normal severity: normal status: open title: Add if condition for 'for loop' type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 06:45:00 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 10:45:00 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601894700.58.0.105346610418.issue41941@roundup.psfhosted.org> STINNER Victor added the comment: I suggest you to use https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.PyConfig_InitIsolatedConfig API instead of the legacy Py_Initialize() API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 06:51:01 2020 From: report at bugs.python.org (Florian Bruhin) Date: Mon, 05 Oct 2020 10:51:01 +0000 Subject: [issue41940] AMD64 Debian root 3.x: tests fail because downloaded files start with: Message-ID: <1601895061.9.0.320270766693.issue41940@roundup.psfhosted.org> Florian Bruhin added the comment: > It is also not safe to pass data downloaded from untrusted source to eval(). To make matters worse, it's downloaded via HTTP (rather than HTTPS) - so anyone who can mess with the network of a machine running the Python testsuite can run arbitrary code on that machine. (I contacted security at python.org about this a couple of hours ago, but I guess this is effectively public now anyways :D) ---------- nosy: +The Compiler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 06:56:39 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 10:56:39 +0000 Subject: [issue41940] AMD64 Debian root 3.x: tests fail because downloaded files start with: Message-ID: <1601895399.0.0.74156078352.issue41940@roundup.psfhosted.org> STINNER Victor added the comment: > It is also not safe to pass data downloaded from untrusted source to eval(). Would you mind to open a separated issue for that? Does someone want to propose a change to avoid eval() in the tests? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 07:31:14 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Oct 2020 11:31:14 +0000 Subject: [issue28343] Bad encoding alias cp936 -> gbk: euro sign In-Reply-To: <1475464291.36.0.0934021228231.issue28343@psf.upfronthosting.co.za> Message-ID: <1601897474.35.0.612874947163.issue28343@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 08:22:52 2020 From: report at bugs.python.org (Ethan Furman) Date: Mon, 05 Oct 2020 12:22:52 +0000 Subject: [issue40066] Enum._convert should change __repr__ and/or __str__ to use module name instead of class name In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1601900572.11.0.551033207382.issue40066@roundup.psfhosted.org> Ethan Furman added the comment: Python-Dev thread [0], summary below: > As you may have noticed, Enums are starting to pop up all > over the stdlib [1]. > > To facilitate transforming existing module constants to > IntEnums there is `IntEnum._convert_`. In Issue36548 [2] > Serhiy modified the __repr__ of RegexFlag: > > >>> import re > >>> re.I > re.IGNORECASE > > I think for converted constants that that looks nice. > For anyone that wants the actual value, it is of course > available as the `.value` attribute: > > >>> re.I.value > 2 > > I'm looking for arguments relating to: > > - should _convert_ make the default __repr__ be > module_name.member_name? > > - should _convert_ make the default __str__ be the same, > or be the numeric value? After discussions with Guido I made a (largely done) PR [3] which: for stdlib global constants (such as RE) - repr() -> uses `module.member_name` - str() -> uses `member_name` for stdlib non-global constants, and enums in general - repr() -> uses `class.member_name` - str() -> uses `member_name` The questions I would most appreciate an answer to at this point: - do you think the change has merit? - why /shouldn't/ we make the change? As a reminder, the underlying issue is trying to keep at least the stdlib Enum representations the same for those that are replacing preexisting constants. [0] https://mail.python.org/archives/list/python-dev at python.org/message/CHQW6THTDYNPPFWQ2KDDTUYSAJDCZFNP/ [1] I'm working on making their creation faster. If anyone wanted to convert EnumMeta to C I would be grateful. [2] https://bugs.python.org/issue36548 [3] https://github.com/python/cpython/pull/22392 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 08:28:12 2020 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 05 Oct 2020 12:28:12 +0000 Subject: [issue41942] Add if condition for 'for loop' In-Reply-To: <1601894007.96.0.390965204143.issue41942@roundup.psfhosted.org> Message-ID: <1601900892.45.0.368563346492.issue41942@roundup.psfhosted.org> Ronald Oussoren added the comment: This is a language change that has been discussed on the python-ideas list a number of times. In my opinion adding this would not necessarily be an improvement, especially when names and expressions get longer. You'd also not win a lot compared to your initial pattern, especially because the "continue" statement can be placed on the same line as the if statement itself (for short enough conditions). This is something that should be discussed on python-ideas, but please investigate what's been discussed before before you do so. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 08:31:22 2020 From: report at bugs.python.org (twoone3) Date: Mon, 05 Oct 2020 12:31:22 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601901082.3.0.580515874818.issue41941@roundup.psfhosted.org> twoone3 <3197653242 at qq.com> added the comment: This problem has bothered me for a month, thank you for helping me solve this problem, you can close it ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 09:00:04 2020 From: report at bugs.python.org (chienpingtsung) Date: Mon, 05 Oct 2020 13:00:04 +0000 Subject: [issue41942] Add if condition for 'for loop' In-Reply-To: <1601894007.96.0.390965204143.issue41942@roundup.psfhosted.org> Message-ID: <1601902804.51.0.558326350746.issue41942@roundup.psfhosted.org> chienpingtsung added the comment: Got it, thanks for your reply~ ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 09:03:41 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 13:03:41 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601903021.07.0.464440613652.issue41941@roundup.psfhosted.org> STINNER Victor added the comment: > This problem has bothered me for a month, thank you for helping me solve this problem, you can close it I close the issue, but I'm not sure how you fixed it. Don't hesitate commenting to explain how you solved it ;-) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 09:07:39 2020 From: report at bugs.python.org (Eryk Sun) Date: Mon, 05 Oct 2020 13:07:39 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601903259.79.0.0547233069653.issue41941@roundup.psfhosted.org> Eryk Sun added the comment: Having looked at the screenshots, it seems that your issue is in part due to non-legacy mode not setting the standard I/O files to binary mode (_O_BINARY) from their default ANSI text mode (_O_TEXT). This is not a problem on its own. The real issue is that you're not using an isolated configuration, as Victor suggested, so the LC_CTYPE locale gets set to the default user locale instead of "C". When writing to the console in ANSI text mode with a configured locale other than the default "C" locale, the C runtime _write() function does a double translation from the locale encoding to the console codepage encoding via the internal function write_double_translated_ansi_nolock(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 09:10:49 2020 From: report at bugs.python.org (Hugo van Kemenade) Date: Mon, 05 Oct 2020 13:10:49 +0000 Subject: [issue41917] Python 3.9rc2 fails to install matplotlib In-Reply-To: <1601711365.63.0.761607861812.issue41917@roundup.psfhosted.org> Message-ID: <1601903449.99.0.66274451327.issue41917@roundup.psfhosted.org> Hugo van Kemenade added the comment: This probably isn't an issue with CPython 3.9.0 itself, but rather third-party libraries needing to add 3.9 support and provide wheels, and they may be waiting for 3.9.0 to be officially released (due out today!). Here's a PR to add Python 3.9 support to Kiwi (aka kiwisolver): https://github.com/nucleic/kiwi/pull/88 ---------- nosy: +hugovk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 09:11:50 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 13:11:50 +0000 Subject: [issue28343] Bad encoding alias cp936 -> gbk: euro sign In-Reply-To: <1475464291.36.0.0934021228231.issue28343@psf.upfronthosting.co.za> Message-ID: <1601903510.46.0.0574885666755.issue28343@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 09:12:34 2020 From: report at bugs.python.org (twoone3) Date: Mon, 05 Oct 2020 13:12:34 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601903554.03.0.600996987027.issue41941@roundup.psfhosted.org> twoone3 <3197653242 at qq.com> added the comment: I used the link you gave me https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.PyConfig_InitIsolatedConfig Click to open and turn up to see the box, I follow that box The example inside is done, and the coding problem of the console is solved, but I hope that cpython can provide a more concise API, remove useless functions or variables, so that it is convenient for you to maintain and easy for users to read. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 09:14:44 2020 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Oct 2020 13:14:44 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601903684.94.0.443009445625.issue41941@roundup.psfhosted.org> STINNER Victor added the comment: PyConfig_InitIsolatedConfig() reduces side effects on the process. For example, it doesn't set the LC_CTYPE locale and it doesn't change the standard streams (stdio). config_init_stdio() is not called in an isolated configuration: https://github.com/python/cpython/blob/dcc54215ac1eb4b6fab2a9ffe1abcdf3ac4bb77e/Python/initconfig.c#L1855 https://github.com/python/cpython/blob/dcc54215ac1eb4b6fab2a9ffe1abcdf3ac4bb77e/Python/initconfig.c#L1809-L1817 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 09:14:35 2020 From: report at bugs.python.org (twoone3) Date: Mon, 05 Oct 2020 13:14:35 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601903675.45.0.756903346807.issue41941@roundup.psfhosted.org> twoone3 <3197653242 at qq.com> added the comment: That's it ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 09:26:54 2020 From: report at bugs.python.org (Eryk Sun) Date: Mon, 05 Oct 2020 13:26:54 +0000 Subject: [issue41941] Py_Initialize affects the console In-Reply-To: <1601887902.24.0.789073375797.issue41941@roundup.psfhosted.org> Message-ID: <1601904414.0.0.233035440835.issue41941@roundup.psfhosted.org> Eryk Sun added the comment: > config_init_stdio() is not called in an isolated configuration: config_init_stdio wasn't being called anyway since Py_Initialize uses _PyConfig_InitCompatConfig. The issue was primarily due to the LC_CTYPE locale being set to the default user locale, as I discussed in msg378024. Note that for legacy mode, i.e. Py_LegacyWindowsStdioFlag = 1, there's no simple way to not modify the standard I/O files. The io stack needs binary mode. You'd have to use and modify duped file descriptors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:11:20 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Oct 2020 14:11:20 +0000 Subject: [issue41774] While removing element from list using for and remove(), which has same items output is not right In-Reply-To: <1599927635.78.0.618314187509.issue41774@roundup.psfhosted.org> Message-ID: <1601907080.56.0.162101645733.issue41774@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +21557 pull_request: https://github.com/python/cpython/pull/22562 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:15:36 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Oct 2020 14:15:36 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601907336.61.0.190074032623.issue41898@roundup.psfhosted.org> Irit Katriel added the comment: Please reopen this issue. I understand after a discussion on stackoverflow what the problem is, and there is indeed a bug. I will create a PR with a unit test for it an a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:28:37 2020 From: report at bugs.python.org (Enrico Scholz) Date: Mon, 05 Oct 2020 14:28:37 +0000 Subject: [issue38893] broken container/selinux integration In-Reply-To: <1574408245.03.0.269959513005.issue38893@roundup.psfhosted.org> Message-ID: <1601908117.07.0.758872035031.issue38893@roundup.psfhosted.org> Enrico Scholz added the comment: IMO the SELinux security attributes must not be copied (except when requested explicitly). Doing so will create badly labeled systems else. It would be better to use default transition rules and call optionally selinux_restorecon() then. E.g. when copying selinux.* attributes, after "cp /tmp/foo /bin/" the resulting "/bin/foo" would have a "tmp_t" label (which is wrong). Without copying attributes, it would be labeled as "bin_t" (which is more realistic). When there are SELinux rules for "/bin/foo", it might be relabeled e.g. to "bin_foo_t" by the manual selinux_restorecon(). Ignoring errors silently will make operations very unpredictable. ---------- nosy: +ensc2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:29:42 2020 From: report at bugs.python.org (Chris Angelico) Date: Mon, 05 Oct 2020 14:29:42 +0000 Subject: [issue41940] AMD64 Debian root 3.x: tests fail because downloaded files start with: Message-ID: <1601908182.78.0.682397645156.issue41940@roundup.psfhosted.org> Chris Angelico added the comment: Has this been ongoing, or is it something that started in the past day and a half? I've had intermittent internet issues (and expect them to continue for another half day or thereabouts), so it's possible that this is actually a symptom of that. If that's the case, then the issue would be that my gateway returned a failure page of some sort, which?would be another good reason to download the content via HTTPS (since that response happens only on non-encrypted downloads). ---------- nosy: +Rosuav _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:30:27 2020 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Oct 2020 14:30:27 +0000 Subject: [issue41894] UnicodeDecodeError during load failure in non-UTF-8 locale In-Reply-To: <1601486783.26.0.906458411993.issue41894@roundup.psfhosted.org> Message-ID: <1601908227.53.0.894991336992.issue41894@roundup.psfhosted.org> Inada Naoki added the comment: I succeeded to reproduce it on Ubuntu 20.04. $ sudo vi /var/lib/locales/supported.d/ja # add "ja_JP.EUC-JP EUC-JP" $ sudo locale-gen ja_JP.EUC-JP Generating locales (this might take a while)... ja_JP.EUC-JP... done Generation complete. $ chmod -r./build/lib.linux-x86_64-3.10/_sha3.cpython-310-x86_64-linux-gnu.so $ LC_ALL=ja_JP.eucjp ./python Python 3.10.0a0 (heads/master:fbf43f051e, Aug 17 2020, 15:13:52) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocale(locale.LC_ALL, "") 'ja_JP.eucjp' >>> import _sha3 Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 101: invalid start byte Error message contains file path (byte string, probably encoded with fs encoding) and translated error message (encoded with locale encoding). I want to use "backslashescape" error handler, but both of PyUnicode_DecodeLocale() and PyUnicode_DecodeFSDefault() don't support it. After thinking about this several minutes, now I prefer PyUnicode_DecodeUTF8(msg, strlen(msg), "backslashreplace"). It fixes the issue with minimum behavior change, although error message is still backslashescaped. It might be the best practice for creating Unicode object from C error message like strerror(3). ---------- nosy: +inada.naoki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:31:53 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Oct 2020 14:31:53 +0000 Subject: [issue41774] While removing element from list using for and remove(), which has same items output is not right In-Reply-To: <1599927635.78.0.618314187509.issue41774@roundup.psfhosted.org> Message-ID: <1601908313.78.0.422666448904.issue41774@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 060937da988347a887a5f165b023d972fcb97802 by Terry Jan Reedy in branch 'master': bpo-41774: Tweak new programming FAQ entry (GH-22562) https://github.com/python/cpython/commit/060937da988347a887a5f165b023d972fcb97802 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:32:00 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 14:32:00 +0000 Subject: [issue41774] While removing element from list using for and remove(), which has same items output is not right In-Reply-To: <1599927635.78.0.618314187509.issue41774@roundup.psfhosted.org> Message-ID: <1601908320.75.0.722451651701.issue41774@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21558 pull_request: https://github.com/python/cpython/pull/22563 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:32:09 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 14:32:09 +0000 Subject: [issue41774] While removing element from list using for and remove(), which has same items output is not right In-Reply-To: <1599927635.78.0.618314187509.issue41774@roundup.psfhosted.org> Message-ID: <1601908329.45.0.931929948166.issue41774@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21559 pull_request: https://github.com/python/cpython/pull/22564 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:38:07 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Oct 2020 14:38:07 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601908687.8.0.557080260399.issue41898@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +21560 pull_request: https://github.com/python/cpython/pull/22565 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:40:00 2020 From: report at bugs.python.org (mrbean-bremen) Date: Mon, 05 Oct 2020 14:40:00 +0000 Subject: [issue41943] unittest.assertLogs passes unexpectedly Message-ID: <1601908800.0.0.297130696317.issue41943@roundup.psfhosted.org> New submission from mrbean-bremen : Related to https://bugs.python.org/issue41898, creating a new issue after the discussion with Irit Katriel on StackOverflow (https://stackoverflow.com/a/64142338/12480730). Consider the following: import logging import unittest logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) class TestLogging(unittest.TestCase): def test_logging(self): with self.assertLogs(level=logging.WARNING): logger.info('foo') >From the docs: The test passes if at least one message emitted inside the with block matches the logger and level conditions, otherwise it fails. This means that this test should fail (nothing has been logged at warning level or above), but it passes. The reason is that in the assertLogs context manager, the log level of the passed logger is temporarily set to the passed level, and if no logging has happened on exit, the test will fail. If no logger is passed into the call, the temporary log level is set in the root level. If any descendant logger has it's own log level set (as in this example to INFO), this logger will still log at it's own level, and the test will pass. This will always happen on the condition that a descendent of the passed logger has it's own log level set that is smaller than the asserted level, and it does some logging at this level inside the assertLog context manager. ---------- components: Library (Lib) messages: 378035 nosy: mrbean-bremen priority: normal severity: normal status: open title: unittest.assertLogs passes unexpectedly type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:40:52 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Oct 2020 14:40:52 +0000 Subject: [issue41944] Python testsuite calls eval() on content received via HTTP Message-ID: <1601908852.29.0.0266876682235.issue41944@roundup.psfhosted.org> New submission from Serhiy Storchaka : As was reported by Florian Bruhin, Python testsuite calls eval() on content received via HTTP (in Lib/test/multibytecodec_support.py). ---------- components: Tests messages: 378036 nosy: The Compiler, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Python testsuite calls eval() on content received via HTTP type: security versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:42:17 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 14:42:17 +0000 Subject: [issue41774] While removing element from list using for and remove(), which has same items output is not right In-Reply-To: <1599927635.78.0.618314187509.issue41774@roundup.psfhosted.org> Message-ID: <1601908937.92.0.467288625154.issue41774@roundup.psfhosted.org> miss-islington added the comment: New changeset 7e941fa8e0454c7814ce3ec646136758c0db5a25 by Miss Skeleton (bot) in branch '3.8': bpo-41774: Tweak new programming FAQ entry (GH-22562) https://github.com/python/cpython/commit/7e941fa8e0454c7814ce3ec646136758c0db5a25 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:49:59 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Oct 2020 14:49:59 +0000 Subject: [issue41944] Python testsuite calls eval() on content received via HTTP In-Reply-To: <1601908852.29.0.0266876682235.issue41944@roundup.psfhosted.org> Message-ID: <1601909399.89.0.0787793472185.issue41944@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +21561 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22566 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:53:34 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 14:53:34 +0000 Subject: [issue41774] While removing element from list using for and remove(), which has same items output is not right In-Reply-To: <1599927635.78.0.618314187509.issue41774@roundup.psfhosted.org> Message-ID: <1601909614.19.0.39432007196.issue41774@roundup.psfhosted.org> miss-islington added the comment: New changeset 75dd70e1ce0b5ce50c572802c17b7fa427d9ce23 by Miss Skeleton (bot) in branch '3.9': bpo-41774: Tweak new programming FAQ entry (GH-22562) https://github.com/python/cpython/commit/75dd70e1ce0b5ce50c572802c17b7fa427d9ce23 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:53:41 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Oct 2020 14:53:41 +0000 Subject: [issue41943] unittest.assertLogs passes unexpectedly In-Reply-To: <1601908800.0.0.297130696317.issue41943@roundup.psfhosted.org> Message-ID: <1601909621.23.0.531316123348.issue41943@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 1.0 -> 2.0 pull_requests: +21562 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22565 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 10:54:57 2020 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Oct 2020 14:54:57 +0000 Subject: [issue41898] Any logging causes assertLogs to pass In-Reply-To: <1601493217.83.0.77998878518.issue41898@roundup.psfhosted.org> Message-ID: <1601909697.81.0.0374815751104.issue41898@roundup.psfhosted.org> Irit Katriel added the comment: Strike that - Troy has created the new issue 41943 so this one can remain closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 11:07:29 2020 From: report at bugs.python.org (Ken Jin) Date: Mon, 05 Oct 2020 15:07:29 +0000 Subject: [issue41805] types.GenericAlias and types.Union have no documentation In-Reply-To: <1600370908.0.0.224627521485.issue41805@roundup.psfhosted.org> Message-ID: <1601910449.5.0.430394792965.issue41805@roundup.psfhosted.org> Ken Jin added the comment: Hi Patrick, I've completed the docs for PEP 604, and would like to work on the docs for PEP 585. May I know if you're still working on this? ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 11:16:04 2020 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Oct 2020 15:16:04 +0000 Subject: [issue41774] Add programming FAQ entry: remove multiple entries from list In-Reply-To: <1599927635.78.0.618314187509.issue41774@roundup.psfhosted.org> Message-ID: <1601910964.92.0.57769906652.issue41774@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: While removing element from list using for and remove(), which has same items output is not right -> Add programming FAQ entry: remove multiple entries from list type: behavior -> enhancement versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 11:19:46 2020 From: report at bugs.python.org (Jan Novak) Date: Mon, 05 Oct 2020 15:19:46 +0000 Subject: [issue41945] http.cookies.SimpleCookie.parse error after [keys] Message-ID: <1601911186.95.0.178044136501.issue41945@roundup.psfhosted.org> New submission from Jan Novak : If brackets [] are around cookie name, next cookie names are not loaded. try: import http.cookies as Cookie except ImportError: import Cookie c = Cookie.SimpleCookie() c.load('id=12345; [object Object]=data; something=not loaded') print(c) Note: It could cause big problems with session etc. We found that Chrome/Edge starts to save and send this type of cookies for some (couple) users. The origin of that [object Object]=... cookies are probably some implementation of https://cookiepedia.co.uk/cookies/euconsent and errors somewhere in external javascripts or browsers? Related issues: https://bugs.python.org/issue41695 https://bugs.python.org/issue27674 The same problem occures in P3.7, P2.7, six.moves.http_cookies etc. I know RFT says that cookie-name can't use brackets. But you can set them to browser cookies. RFC 6265: set-cookie-header = "Set-Cookie:" SP set-cookie-string set-cookie-string = cookie-pair *( ";" SP cookie-av ) cookie-pair = cookie-name "=" cookie-value cookie-name = token token = RFC 2616: token = 1* separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT ---------- components: Library (Lib) messages: 378041 nosy: xnovakj priority: normal severity: normal status: open title: http.cookies.SimpleCookie.parse error after [keys] type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 11:49:17 2020 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 05 Oct 2020 15:49:17 +0000 Subject: [issue41943] unittest.assertLogs passes unexpectedly In-Reply-To: <1601908800.0.0.297130696317.issue41943@roundup.psfhosted.org> Message-ID: <1601912957.58.0.2081025882.issue41943@roundup.psfhosted.org> Change by Vinay Sajip : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 11:51:36 2020 From: report at bugs.python.org (ullix) Date: Mon, 05 Oct 2020 15:51:36 +0000 Subject: [issue41917] Python 3.9rc2 fails to install matplotlib In-Reply-To: <1601711365.63.0.761607861812.issue41917@roundup.psfhosted.org> Message-ID: <1601913096.27.0.764288103967.issue41917@roundup.psfhosted.org> ullix added the comment: I guess so. Just didn't know how else to bring this to someone's attention, thanks. But not having matplotlib? Ohmygod! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:06:07 2020 From: report at bugs.python.org (Stargirl Flowers) Date: Mon, 05 Oct 2020 16:06:07 +0000 Subject: [issue41946] Add concrete examples to os.path documentation Message-ID: <1601913967.48.0.506783023492.issue41946@roundup.psfhosted.org> New submission from Stargirl Flowers : Presently the documentation for os.path (https://docs.python.org/3.8/library/os.path.html) doesn't contain any concrete examples of the input and outputs of the various path manipulation functions. Contrast this to the Node.js documentation for similar functionality (https://nodejs.org/api/path.html) We could add replesque examples such as: >> os.path.abspath("example.py") "/full/path/to/example.py" ... >> os.path.basename("example.py") "example" & so on. I believe it would be useful for us to have concrete examples here and I'm happy to contribute this. If anyone feels differently, let me know. ---------- assignee: docs at python components: Documentation messages: 378043 nosy: docs at python, theacodes priority: normal severity: normal status: open title: Add concrete examples to os.path documentation type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:19 +0000 Subject: [issue41490] Update bundled pip to 20.2.1 and setuptools to 49.2.1 In-Reply-To: <1596662779.45.0.341157838113.issue41490@roundup.psfhosted.org> Message-ID: <1601914219.95.0.00613853942087.issue41490@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 168a8383c8358eea1b34df0e832f5d652faa6444 by ?ukasz Langa (Pablo Galindo) in branch '3.9': [3.9] bpo-41490: Bump vendored pip to version 20.2.3 (GH-22527). (GH-22544) https://github.com/python/cpython/commit/168a8383c8358eea1b34df0e832f5d652faa6444 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:20 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:20 +0000 Subject: [issue41819] Fix some compiler warnings In-Reply-To: <1600582202.7.0.502087072911.issue41819@roundup.psfhosted.org> Message-ID: <1601914220.12.0.576017932431.issue41819@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c549527ae2cc4b5934dbe80fea127fb04ff65af5 by ?ukasz Langa (Miss Islington (bot)) in branch '3.9': bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332) https://github.com/python/cpython/commit/c549527ae2cc4b5934dbe80fea127fb04ff65af5 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:19 +0000 Subject: [issue40833] Clarify docstring of Path.rename In-Reply-To: <1590933048.45.0.441602956173.issue40833@roundup.psfhosted.org> Message-ID: <1601914219.13.0.46688916936.issue40833@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 5533c4952cd6c44c63274874be7de06495b914ea by ?ukasz Langa (Miss Skeleton (bot)) in branch '3.9': [3.9] bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554) https://github.com/python/cpython/commit/5533c4952cd6c44c63274874be7de06495b914ea ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:19 +0000 Subject: [issue35293] make doctest (Sphinx) emits a lot of warnings In-Reply-To: <1542835631.23.0.788709270274.issue35293@psf.upfronthosting.co.za> Message-ID: <1601914219.41.0.680989904499.issue35293@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f8b3c64958753abce7badbff3525863577fe2e04 by ?ukasz Langa (Victor Stinner) in branch '3.9': bpo-35293: Travis CI uses "make venv" for the doc (GH-22307) (GH-22309) https://github.com/python/cpython/commit/f8b3c64958753abce7badbff3525863577fe2e04 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:19 +0000 Subject: [issue41802] Missing documentation for 'PyDict_DelItem' behavior In-Reply-To: <1600340753.64.0.782309837767.issue41802@roundup.psfhosted.org> Message-ID: <1601914219.73.0.00722106422202.issue41802@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 95de3627f1527cbb1e98d64dd7cc6463c297b616 by ?ukasz Langa (Miss Islington (bot)) in branch '3.9': bpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291) https://github.com/python/cpython/commit/95de3627f1527cbb1e98d64dd7cc6463c297b616 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:20 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:20 +0000 Subject: [issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module) In-Reply-To: <1597953517.67.0.398105173164.issue41602@roundup.psfhosted.org> Message-ID: <1601914220.27.0.618027908205.issue41602@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c26a666e6751a9fad766ef83432b893f9b15ecaf by ?ukasz Langa in branch '3.9': [3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (#22397) https://github.com/python/cpython/commit/c26a666e6751a9fad766ef83432b893f9b15ecaf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:19 +0000 Subject: [issue41858] Fix incomplete line on optparse documentation In-Reply-To: <1601000208.27.0.918892305857.issue41858@roundup.psfhosted.org> Message-ID: <1601914219.23.0.787850385283.issue41858@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a5750cf43466f5913cdeef774f7c2dcb5943d408 by ?ukasz Langa (Miss Islington (bot)) in branch '3.9': bpo-41858: Clarify line in optparse doc (GH-22407) https://github.com/python/cpython/commit/a5750cf43466f5913cdeef774f7c2dcb5943d408 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:19 +0000 Subject: [issue41875] __builtin_unreachable error in gcc 4.4.5 In-Reply-To: <1601291751.72.0.463788017117.issue41875@roundup.psfhosted.org> Message-ID: <1601914219.67.0.0701507576477.issue41875@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset df71b65a882cc9ddf9cd45ae9f83a04ec441af1e by ?ukasz Langa (Miss Islington (bot)) in branch '3.9': bpo-41875: Use __builtin_unreachable when possible (GH-22433) https://github.com/python/cpython/commit/df71b65a882cc9ddf9cd45ae9f83a04ec441af1e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:20 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:20 +0000 Subject: [issue37328] remove deprecated HTMLParser.unescape In-Reply-To: <1560839410.8.0.633433607628.issue37328@roundup.psfhosted.org> Message-ID: <1601914220.07.0.542765577573.issue37328@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8dd430265ccd4d34b74c841d6bcc8f58aa93ad94 by ?ukasz Langa (Terry Jan Reedy) in branch '3.9': [3.9] bpo-27032, bpo-37328: Document removing HTMLParser.unescape() (GH-22288) https://github.com/python/cpython/commit/8dd430265ccd4d34b74c841d6bcc8f58aa93ad94 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:19 +0000 Subject: [issue41815] SQLite: segfault if backup called on closed database In-Reply-To: <1600531699.45.0.309106066833.issue41815@roundup.psfhosted.org> Message-ID: <1601914219.86.0.0599868739084.issue41815@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset bd55c46895d2fcfadda46701d3c34d78441a7806 by ?ukasz Langa (Miss Islington (bot)) in branch '3.9': bpo-41815: SQLite: segfault if backup called on closed database (GH-22322) https://github.com/python/cpython/commit/bd55c46895d2fcfadda46701d3c34d78441a7806 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:19 +0000 Subject: [issue41844] IDLE subsection of What's New 3.9 In-Reply-To: <1600871517.81.0.0817092566943.issue41844@roundup.psfhosted.org> Message-ID: <1601914219.63.0.57867680059.issue41844@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7e21aab45d78e2593f231a1290fa6e629e50d90c by ?ukasz Langa (Miss Islington (bot)) in branch '3.9': bpo-41844: Add IDLE section to What's New 3.9 (GN-22382) https://github.com/python/cpython/commit/7e21aab45d78e2593f231a1290fa6e629e50d90c ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:19 +0000 Subject: [issue41867] Include options for timespec in docstrings of isoformat In-Reply-To: <1601138683.03.0.777121692912.issue41867@roundup.psfhosted.org> Message-ID: <1601914219.8.0.433214493486.issue41867@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset faaa30392221c7d53d995f65f59f26e86fb84d76 by ?ukasz Langa (Miss Skeleton (bot)) in branch '3.9': [3.9] bpo-41867: List options for timespec in docstrings of isoformat methods (GH-22418) https://github.com/python/cpython/commit/faaa30392221c7d53d995f65f59f26e86fb84d76 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:20 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:20 +0000 Subject: [issue37062] `AutoNumber` class in enum documentation: support *args in constructor In-Reply-To: <1558936980.63.0.0585299344314.issue37062@roundup.psfhosted.org> Message-ID: <1601914220.19.0.92302052104.issue37062@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e8165e79f57cb3ca60bf031c417f8fd20c99eaa2 by ?ukasz Langa (Miss Islington (bot)) in branch '3.9': bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22370) https://github.com/python/cpython/commit/e8165e79f57cb3ca60bf031c417f8fd20c99eaa2 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:19 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:19 +0000 Subject: [issue27032] Remove deprecated html.parser.HTMLParser.unescape() In-Reply-To: <1463339146.08.0.655083281356.issue27032@psf.upfronthosting.co.za> Message-ID: <1601914219.5.0.0570741537012.issue27032@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8dd430265ccd4d34b74c841d6bcc8f58aa93ad94 by ?ukasz Langa (Terry Jan Reedy) in branch '3.9': [3.9] bpo-27032, bpo-37328: Document removing HTMLParser.unescape() (GH-22288) https://github.com/python/cpython/commit/8dd430265ccd4d34b74c841d6bcc8f58aa93ad94 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:10:20 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:10:20 +0000 Subject: [issue41762] Documentation job fails on CIs: duplicate token description of format_spec In-Reply-To: <1599821124.33.0.316149667628.issue41762@roundup.psfhosted.org> Message-ID: <1601914220.35.0.801149029041.issue41762@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e5cc5fd89cc8855ad644ce4ba5e7de766313e418 by ?ukasz Langa (Miss Islington (bot)) in branch '3.9': bpo-41762: Fix usage of productionlist markup in the doc (GH-22281) https://github.com/python/cpython/commit/e5cc5fd89cc8855ad644ce4ba5e7de766313e418 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:24:17 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 16:24:17 +0000 Subject: [issue41939] 3.9.0 test_site warning: "urllib.requests._opener was modified by test_site" In-Reply-To: <1601881263.18.0.474767166198.issue41939@roundup.psfhosted.org> Message-ID: <1601915057.34.0.539929138296.issue41939@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +21563 pull_request: https://github.com/python/cpython/pull/22567 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:24:15 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:24:15 +0000 Subject: [issue41939] 3.9.0 test_site warning: "urllib.requests._opener was modified by test_site" In-Reply-To: <1601881263.18.0.474767166198.issue41939@roundup.psfhosted.org> Message-ID: <1601915055.33.0.241720074043.issue41939@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1fce240d6c4b2b2cc17a86e88c65169e15b9feeb by Victor Stinner in branch 'master': bpo-41939: Fix test_site.test_license_exists_at_url() (#22559) https://github.com/python/cpython/commit/1fce240d6c4b2b2cc17a86e88c65169e15b9feeb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:32:46 2020 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Oct 2020 16:32:46 +0000 Subject: [issue26680] Incorporating float.is_integer into the numeric tower and Decimal In-Reply-To: <1459452864.35.0.120403756979.issue26680@psf.upfronthosting.co.za> Message-ID: <1601915566.98.0.288386923286.issue26680@roundup.psfhosted.org> Raymond Hettinger added the comment: > I would have assumed that it's only making a promise that it > registers all the methods and properties marked *abstract* in > the ABC. Do you have references to back up the stronger statement? The isn't some weird or incidental promise. It is the fundamental reason that abstract base classes exist at all (and not just in Python). >From PEP 3119: "Each test carries with it a set of promises: it contains a promise about the general behavior of the class, and a promise as to what other class methods will be available." >From PEP 3119: "In addition, the ABCs define a minimal set of methods that establish the characteristic behavior of the type. Code that discriminates objects based on their ABC type can trust that those methods will always be present." > we need to either (a) revert PR 6121 and then re-do the changes, > without the changes to numbers.py, or (b) make a second PR to undo > the numbers.py changes. Given that (b) can't be done in the short-run, I recommend option (a) so that there is a single clean patch and to make sure this doesn't leak into a release. The PR changed 19 files, so the longer we wait the harder it will be to revert cleanly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:35:49 2020 From: report at bugs.python.org (Tal Einat) Date: Mon, 05 Oct 2020 16:35:49 +0000 Subject: [issue38490] statistics: add covariance, Pearson's correlation, and simple linear regression In-Reply-To: <1571175609.51.0.475949905245.issue38490@roundup.psfhosted.org> Message-ID: <1601915749.76.0.133443958794.issue38490@roundup.psfhosted.org> Tal Einat added the comment: Given the discussion here and the state of the attached PR, I intend to merge the PR in several weeks, unless someone has anything else to say. ---------- nosy: +taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:39:40 2020 From: report at bugs.python.org (Michael L. Boom) Date: Mon, 05 Oct 2020 16:39:40 +0000 Subject: [issue41947] Tests When Building Python Message-ID: <1601915979.99.0.0870574640961.issue41947@roundup.psfhosted.org> New submission from Michael L. Boom : When building Python it runs 416 tests in sequence. It would be a "lot" faster if these were run in parallel. ---------- components: Installation messages: 378062 nosy: boom0192 priority: normal severity: normal status: open title: Tests When Building Python versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:42:37 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 16:42:37 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1601916157.22.0.0321985165169.issue41584@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +21564 stage: commit review -> patch review pull_request: https://github.com/python/cpython/pull/22568 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:42:39 2020 From: report at bugs.python.org (Brett Cannon) Date: Mon, 05 Oct 2020 16:42:39 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1601916159.63.0.0159860620998.issue41584@roundup.psfhosted.org> Brett Cannon added the comment: New changeset d02d824e05e2cb86f4df381be18832e76e2c475f by Brett Cannon in branch 'master': bpo-41584: clarify when the reflected method of a binary arithemtic operator is called (#22505) https://github.com/python/cpython/commit/d02d824e05e2cb86f4df381be18832e76e2c475f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:42:48 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 16:42:48 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1601916168.16.0.916261698148.issue41584@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +21565 pull_request: https://github.com/python/cpython/pull/22569 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:49:49 2020 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 05 Oct 2020 16:49:49 +0000 Subject: [issue41939] 3.9.0 test_site warning: "urllib.requests._opener was modified by test_site" In-Reply-To: <1601881263.18.0.474767166198.issue41939@roundup.psfhosted.org> Message-ID: <1601916589.13.0.176970767748.issue41939@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 10b4136bfa5878c058753e1d1bd091e0f7e1ba40 by Miss Skeleton (bot) in branch '3.9': bpo-41939: Fix test_site.test_license_exists_at_url() (GH-22559) (#22567) https://github.com/python/cpython/commit/10b4136bfa5878c058753e1d1bd091e0f7e1ba40 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:52:10 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 16:52:10 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1601916730.75.0.46070587971.issue41584@roundup.psfhosted.org> miss-islington added the comment: New changeset 31ceccb2c77854893f3a754aca04bedd74bedb10 by Miss Skeleton (bot) in branch '3.8': bpo-41584: clarify when the reflected method of a binary arithemtic operator is called (GH-22505) https://github.com/python/cpython/commit/31ceccb2c77854893f3a754aca04bedd74bedb10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 12:54:12 2020 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 05 Oct 2020 16:54:12 +0000 Subject: [issue40430] ast.Slice is no longer a subclass of ast.slice In-Reply-To: <1588114083.65.0.758237100014.issue40430@roundup.psfhosted.org> Message-ID: <1601916852.32.0.959818919704.issue40430@roundup.psfhosted.org> Serhiy Storchaka added the comment: Even if make ast.Slice a (virtual) subclass of ast.slice it will not help much, because we cannot do it for ast.Index and ast.ExtSlice. ast.ExtSlice is not replaced with ast.Tuple, and any node type can now be used instead of ast.Index. The code that does isinstance() or issublass() check for ast.slice or one of its subcasses is now broken. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 13:05:58 2020 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Oct 2020 17:05:58 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1601917558.48.0.0540736993926.issue41584@roundup.psfhosted.org> miss-islington added the comment: New changeset 4aad1e5770fab72908f922a7876075d3d5a7c0d0 by Miss Skeleton (bot) in branch '3.9': bpo-41584: clarify when the reflected method of a binary arithemtic operator is called (GH-22505) https://github.com/python/cpython/commit/4aad1e5770fab72908f922a7876075d3d5a7c0d0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 13:47:51 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 05 Oct 2020 17:47:51 +0000 Subject: [issue41947] Tests When Building Python In-Reply-To: <1601915979.99.0.0870574640961.issue41947@roundup.psfhosted.org> Message-ID: <1601920071.51.0.700185346162.issue41947@roundup.psfhosted.org> Eric V. Smith added the comment: >From the test.regrtest help: -j PROCESSES, --multiprocess PROCESSES run PROCESSES processes at once So, if you want to run 4 processes in parallel: ./python -m test.regrtest -j4 ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 14:01:23 2020 From: report at bugs.python.org (Chavdar Yotov) Date: Mon, 05 Oct 2020 18:01:23 +0000 Subject: [issue41933] Wording of s * n in Common Sequence Operations is not optimal In-Reply-To: <1601828421.16.0.497838866676.issue41933@roundup.psfhosted.org> Message-ID: <1601920883.9.0.787586612531.issue41933@roundup.psfhosted.org> Chavdar Yotov added the comment: Looks like a fitting first contribution. Working on a PR now :-) ---------- nosy: +chavdar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 14:11:29 2020 From: report at bugs.python.org (Matthieu hemea) Date: Mon, 05 Oct 2020 18:11:29 +0000 Subject: [issue36207] robotsparser deny all with some rules In-Reply-To: <1551865321.24.0.407834320039.issue36207@roundup.psfhosted.org> Message-ID: <1601921489.97.0.99683372418.issue36207@roundup.psfhosted.org> Matthieu hemea added the comment: Hi, Does anyone find the solution ? It would help me for this one : https://www.hemea.com/fr/devis-travaux ---------- nosy: +matthieuhemea -Jmgray47, Patrick Valibus 410 Gone, amiir.mascud, arnaud, calamina, jeanotlapin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 14:20:12 2020 From: report at bugs.python.org (Michael L. Boom) Date: Mon, 05 Oct 2020 18:20:12 +0000 Subject: [issue41947] Tests When Building Python In-Reply-To: <1601920071.51.0.700185346162.issue41947@roundup.psfhosted.org> Message-ID: Michael L. Boom added the comment: When I do the ./configure, make -j 32, and make install it runs 416 tests in sequence. Is there a way to make it run 32 unit tests at a time so it is much quicker? Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 14:24:34 2020 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 05 Oct 2020 18:24:34 +0000 Subject: [issue41947] Tests When Building Python In-Reply-To: <1601915979.99.0.0870574640961.issue41947@roundup.psfhosted.org> Message-ID: <1601922274.43.0.210902717319.issue41947@roundup.psfhosted.org> Eric V. Smith added the comment: You could try setting EXTRATESTOPTS, although I haven't tried it. This question is probably better asked on python-list or StackOverflow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 14:34:03 2020 From: report at bugs.python.org (Brett Cannon) Date: Mon, 05 Oct 2020 18:34:03 +0000 Subject: [issue41584] Clarify documentation for binary arithmetic operation subclass __r*__ precedence In-Reply-To: <1597773394.37.0.055865211998.issue41584@roundup.psfhosted.org> Message-ID: <1601922843.7.0.928697894899.issue41584@roundup.psfhosted.org> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 14:34:50 2020 From: report at bugs.python.org (Brett Cannon) Date: Mon, 05 Oct 2020 18:34:50 +0000 Subject: [issue32192] Provide importlib.util.lazy_import helper function In-Reply-To: <1512118241.83.0.213398074469.issue32192@psf.upfronthosting.co.za> Message-ID: <1601922890.21.0.304617667297.issue32192@roundup.psfhosted.org> Brett Cannon added the comment: Yep, I think the example is enough to close this. Thanks! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 15:51:19 2020 From: report at bugs.python.org (Chavdar Yotov) Date: Mon, 05 Oct 2020 19:51:19 +0000 Subject: [issue41933] Wording of s * n in Common Sequence Operations is not optimal In-Reply-To: <1601828421.16.0.497838866676.issue41933@roundup.psfhosted.org> Message-ID: <1601927480.0.0.682066165318.issue41933@roundup.psfhosted.org> Change by Chavdar Yotov : ---------- keywords: +patch pull_requests: +21566 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22570 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 16:36:17 2020 From: report at bugs.python.org (Abhi R) Date: Mon, 05 Oct 2020 20:36:17 +0000 Subject: [issue41948] Runtime error while trying to use Python3.9 with virtualenv Message-ID: <1601930177.87.0.41815594823.issue41948@roundup.psfhosted.org> New submission from Abhi R : I tried to create a new virtual environment using virtualenv and the newly released Python3.9 version and I got a runtime error saying " failed to find interpreter for Builtin discover of python_spec='python3.9'". ---------- components: Interpreter Core files: Untitled picture.png messages: 378074 nosy: abhicantdraw priority: normal severity: normal status: open title: Runtime error while trying to use Python3.9 with virtualenv type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file49496/Untitled picture.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Oct 5 16:39:11 2020 From: report at bugs.python.org (Orian Zinger) Date: Mon, 05 Oct 2020 20:39:11 +0000 Subject: [issue18163] Add a 'key' attribute to KeyError In-Reply-To: <1370638316.1.0.167534610168.issue18163@psf.upfronthosting.co.za> Message-ID: <1601930351.04.0.137420670105.issue18163@roundup.psfhosted.org> Orian Zinger added the comment: Hi all, As a Python developer, I encountered lots of blurry exception messages in the product logs such as: