From report at bugs.python.org Sun Aug 1 00:03:53 2021 From: report at bugs.python.org (Hasan) Date: Sun, 01 Aug 2021 04:03:53 +0000 Subject: [issue42053] fwalk: incorrect boolean test for non-fd arguments In-Reply-To: <1602869505.61.0.789643368245.issue42053@roundup.psfhosted.org> Message-ID: <1627790633.17.0.564972758064.issue42053@roundup.psfhosted.org> Change by Hasan : ---------- keywords: +patch nosy: +AliyevH nosy_count: 2.0 -> 3.0 pull_requests: +26038 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27523 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 00:09:27 2021 From: report at bugs.python.org (Hasan) Date: Sun, 01 Aug 2021 04:09:27 +0000 Subject: [issue42053] fwalk: incorrect boolean test for non-fd arguments In-Reply-To: <1602869505.61.0.789643368245.issue42053@roundup.psfhosted.org> Message-ID: <1627790967.35.0.514123231661.issue42053@roundup.psfhosted.org> Change by Hasan : ---------- pull_requests: +26039 pull_request: https://github.com/python/cpython/pull/27524 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 00:11:15 2021 From: report at bugs.python.org (Hasan) Date: Sun, 01 Aug 2021 04:11:15 +0000 Subject: [issue42053] fwalk: incorrect boolean test for non-fd arguments In-Reply-To: <1602869505.61.0.789643368245.issue42053@roundup.psfhosted.org> Message-ID: <1627791075.71.0.881702935561.issue42053@roundup.psfhosted.org> Change by Hasan : ---------- pull_requests: -26038 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 01:01:39 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 05:01:39 +0000 Subject: [issue44800] Code readability: rename interpreter frames to execution frames In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1627794099.09.0.352788160952.issue44800@roundup.psfhosted.org> Nick Coghlan added the comment: As a side effect of working on this, I noticed some changes that are needed to adapt the GDB integration hooks to the new frame state layout. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 01:26:49 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 01 Aug 2021 05:26:49 +0000 Subject: [issue43758] dict.config TimedRotatingFileHandler filename .suffix does not function In-Reply-To: <1617771952.69.0.757936133435.issue43758@roundup.psfhosted.org> Message-ID: <1627795609.08.0.744899053139.issue43758@roundup.psfhosted.org> Vinay Sajip added the comment: This is not the place for asking questions like this - please use Stack Overflow or the python-users mailing list. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 01:53:29 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 01 Aug 2021 05:53:29 +0000 Subject: [issue44186] TimedRotatingFileHandler overwrite log In-Reply-To: <1621506119.34.0.442557367091.issue44186@roundup.psfhosted.org> Message-ID: <1627797209.79.0.488446544651.issue44186@roundup.psfhosted.org> Change by Vinay Sajip : Added file: https://bugs.python.org/file50194/log_44186.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 01:56:54 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 01 Aug 2021 05:56:54 +0000 Subject: [issue44186] TimedRotatingFileHandler overwrite log In-Reply-To: <1621506119.34.0.442557367091.issue44186@roundup.psfhosted.org> Message-ID: <1627797414.89.0.806251967768.issue44186@roundup.psfhosted.org> Vinay Sajip added the comment: I modified the provided test script (-> test_44186.py) and added a test shell script which runs it twice in succession. What it printed was: 6 51 43 TEST > [INFO] [2021-08-01 06:51:43] : foo 2021-08-01T06:51:43.091681 6 51 43 TEST > [INFO] [2021-08-01 06:51:43] : bar 2021-08-01T06:51:43.138274 and the log files created were $ more test.log* :::::::::::::: test.log :::::::::::::: bar 2021-08-01T06:51:43.138274 :::::::::::::: test.log.2021-07-31 :::::::::::::: foo 2021-08-01T06:51:43.091681 So from what I can see, both logged messages are present and nothing has been lost. Can you describe the problem more clearly? I can't see one. ---------- Added file: https://bugs.python.org/file50195/test.sh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 02:15:13 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 01 Aug 2021 06:15:13 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1627798513.68.0.515842192879.issue40469@roundup.psfhosted.org> Change by Vinay Sajip : Added file: https://bugs.python.org/file50196/config.json _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 02:19:21 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 01 Aug 2021 06:19:21 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1627798761.77.0.515644343535.issue40469@roundup.psfhosted.org> Vinay Sajip added the comment: With this slightly modified test script and the JSON configuration based on the YAML, I got the following results after running for a while: $ more info.log* :::::::::::::: info.log :::::::::::::: 2021-08-01 07:13:45 INFO Message no. 9 2021-08-01 07:14:15 INFO Message no. 10 :::::::::::::: info.log.2021-08-01_07-09 :::::::::::::: 2021-08-01 07:09:45 INFO Message no. 1 2021-08-01 07:10:15 INFO Message no. 2 :::::::::::::: info.log.2021-08-01_07-10 :::::::::::::: 2021-08-01 07:10:45 INFO Message no. 3 2021-08-01 07:11:15 INFO Message no. 4 :::::::::::::: info.log.2021-08-01_07-11 :::::::::::::: 2021-08-01 07:11:45 INFO Message no. 5 2021-08-01 07:12:15 INFO Message no. 6 :::::::::::::: info.log.2021-08-01_07-12 :::::::::::::: 2021-08-01 07:12:45 INFO Message no. 7 2021-08-01 07:13:15 INFO Message no. 8 The test script logs every 30 seconds, so I don't see what the problem is. Can you describe it more clearly? ---------- keywords: -patch Added file: https://bugs.python.org/file50197/log_40469.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 02:20:10 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 01 Aug 2021 06:20:10 +0000 Subject: [issue37880] For argparse add_argument with action='store_const', const should default to None. In-Reply-To: <1566088875.45.0.199116489639.issue37880@roundup.psfhosted.org> Message-ID: <1627798810.98.0.525153264092.issue37880@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 02:31:05 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 01 Aug 2021 06:31:05 +0000 Subject: [issue44489] _handle_existing_loggers should respect loggers that were manually disabled In-Reply-To: <1624366626.62.0.782556758458.issue44489@roundup.psfhosted.org> Message-ID: <1627799465.57.0.879511286678.issue44489@roundup.psfhosted.org> Vinay Sajip added the comment: Why couldn't you just do the logging configuration first, then disable any loggers you need to after that? You can pass a custom configuration dict when instantiating a Sanic app. That could contain a setting for the ddtrace logger, e.g. to set its level to logging.CRITICAL + 1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 02:34:14 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 01 Aug 2021 06:34:14 +0000 Subject: [issue43749] venv module does not copy the correct python exe In-Reply-To: <1617715625.46.0.74507922397.issue43749@roundup.psfhosted.org> Message-ID: <1627799654.28.0.609154630064.issue43749@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 02:39:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 06:39:17 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1627799957.69.0.626257740311.issue43468@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think it was a mistake to use lock in cached_property at first place. In most cases there is nothing wrong in evaluating the cached value more than once. lru_cache() does not use a lock for calling the wrapped function, and it works well. The only lock in the Python implementation is for updating internal structure, it is released when the wrapped function is called. The C implementation uses the GIL for this purpose. It is hard to get rid of the execution lock once it was introduced, but I think we should do it. Maybe deprecate cached_property and add a new decorator without a lock. Perhaps add separate decorators for automatically locking method execution, different decorators for different type of locking (global, per-method, per-instance, per-instance-and-method). Java has the synchronized keyword which allows to add implicit lock to a method. As it turned out, it was a bad idea, and it is no longer used in the modern code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 03:08:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 07:08:58 +0000 Subject: [issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec Message-ID: <1627801738.44.0.278142498011.issue44801@roundup.psfhosted.org> New submission from Serhiy Storchaka : Type expression is coerced to a list of parameter arguments in substitution of ParamSpec. For example: >>> from typing import * >>> T = TypeVar('T') >>> P = ParamSpec('P') >>> C = Callable[P, T] >>> C[int, str] typing.Callable[[int], str] int becomes [int]. There is even a dedicated test for this. But it is not followed from PEP 612. Furthermore, it contradicts one of examples in the PEP: >>> class X(Generic[T, P]): ... f: Callable[P, int] ... x: T ... >>> X[int, int] # Should be rejected __main__.X[int, int] It makes the implementation (at least the code in issue44796) more complex and makes the user code more errorprone. ---------- messages: 398687 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Type expression is coerced to a list of parameter arguments in substitution of ParamSpec _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 03:09:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 07:09:52 +0000 Subject: [issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec In-Reply-To: <1627801738.44.0.278142498011.issue44801@roundup.psfhosted.org> Message-ID: <1627801792.21.0.475228781696.issue44801@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- components: +Library (Lib) dependencies: +Arguments ignored in substitution in typing.Callable type: -> behavior versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 03:55:02 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 01 Aug 2021 07:55:02 +0000 Subject: [issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec In-Reply-To: <1627801738.44.0.278142498011.issue44801@roundup.psfhosted.org> Message-ID: <1627804502.89.0.296522722542.issue44801@roundup.psfhosted.org> Ken Jin added the comment: > Type expression is coerced to a list of parameter arguments in substitution of ParamSpec. It's not, only the repr is like that. Internally it's not coerced. >>> C[int, str] typing.Callable[[int], str] >>> C[int, str].__args__ (, ) Because Callable's correct form is Callable[[type], type] (where type is not ParamSpec or Concatenate) so the repr reflects that. Internally, Callable also flattens the list of args: >>> Callable[[int, str], int].__args__ (, , ) Because __args__ *must* be hashable and immutable. Otherwise, it will not work with Union or Literal. Some time ago we tried converting to nested tuple. But that was too difficult (and backwards incompatible) because every other typing operation expected __args__ to contain types, not a tuple. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 04:07:17 2021 From: report at bugs.python.org (Jon Camilleri) Date: Sun, 01 Aug 2021 08:07:17 +0000 Subject: [issue25947] Installation problem In-Reply-To: <1624370760.39.0.984641998774.issue25947@roundup.psfhosted.org> Message-ID: Jon Camilleri added the comment: this is your call, sorry. On Tue, Jun 22, 2021 at 4:06 PM Irit Katriel wrote: > > Irit Katriel added the comment: > > Version 3.5 is no longer supported. If you are having issues installing a > current version (3.9+) please create a new issue. > > ---------- > nosy: +iritkatriel > resolution: -> out of date > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > -- Jonathan Camilleri Mobile (MT): ++356 7982 7113 E-mail: camilleri.jon at gmail.com Please consider your environmental responsibility before printing this e-mail. I usually reply to emails within 2 business days. If it's urgent, give me a call. https://worldhappiness.report/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 04:30:36 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 08:30:36 +0000 Subject: [issue44590] Create frame objects lazily when needed In-Reply-To: <1625828020.36.0.429011373838.issue44590@roundup.psfhosted.org> Message-ID: <1627806636.39.0.906102192116.issue44590@roundup.psfhosted.org> Change by Nick Coghlan : ---------- nosy: +ncoghlan nosy_count: 3.0 -> 4.0 pull_requests: +26041 pull_request: https://github.com/python/cpython/pull/27525 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 04:30:36 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 08:30:36 +0000 Subject: [issue44800] Code readability: rename interpreter frames to execution frames In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1627806636.1.0.186669950507.issue44800@roundup.psfhosted.org> Change by Nick Coghlan : ---------- keywords: +patch pull_requests: +26040 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27525 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 04:48:35 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 08:48:35 +0000 Subject: [issue44800] Code readability: rename interpreter frames to execution frames In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1627807715.72.0.318155852061.issue44800@roundup.psfhosted.org> Nick Coghlan added the comment: PR for this proposed refactoring is now up, with a review requested from Mark: https://github.com/python/cpython/pull/27525/ The PR mostly follows what I originally posted, except that I went with _Py_execution_frame and _PyExecFrame for the struct and typedef names, since these are present in a public header. The outdated GDB hooks I found were in the gdbinit example file, rather than the actual libpython.py file that test_gdb covers. I suspect the gdbinit example will need further adjustments to actually work with Python 3.11, so rather than fully updating the implementation dependent pieces, I just added a comment suggesting it be checked after the interpreter optimisation development for 3.11 settles down. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 05:11:14 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 01 Aug 2021 09:11:14 +0000 Subject: [issue43596] change assertRaises message when wrong exception is raised In-Reply-To: <1616429766.92.0.297524624601.issue43596@roundup.psfhosted.org> Message-ID: <1627809074.03.0.711573672926.issue43596@roundup.psfhosted.org> Irit Katriel added the comment: Another way to look at it is that your test has two problems. One is that the expected exception didn?t happen and the other is that an unexpected exception happened. The two problems are usually unrelated, and trying to conflate them into one error message can be confusing in some cases. When a test has multiple problems you get an error for the first one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 05:35:10 2021 From: report at bugs.python.org (Harry) Date: Sun, 01 Aug 2021 09:35:10 +0000 Subject: [issue44186] TimedRotatingFileHandler overwrite log In-Reply-To: <1621506119.34.0.442557367091.issue44186@roundup.psfhosted.org> Message-ID: <1627810510.38.0.428156844552.issue44186@roundup.psfhosted.org> Harry added the comment: The issue appears when the TimedRotatingHandler rolls over to a filename that already exists. Running your bash script, the handler correctly rolls over so you end up with the expected behaviour. This issue arises in the case that there is already a file with the target name, that file will be overwritten when the handler rolls over. This can be seen clearly if you modify test.sh to contain python3 log_44186.py foo python3 log_44186.py bar python3 log_44186.py baz results are below: $ python3 --version Python 3.9.5 $ bash ./test.sh 10 14 51 TEST > [INFO] [2021-08-01 10:14:51] : foo 2021-08-01T10:14:51.521266 10 14 51 TEST > [INFO] [2021-08-01 10:14:51] : bar 2021-08-01T10:14:51.577802 10 14 51 TEST > [INFO] [2021-08-01 10:14:51] : baz 2021-08-01T10:14:51.634795 $ ls | grep .log test.log test.log.2021-07-31 $ cat test.log baz 2021-08-01T10:14:51.634795 $ cat test.log.2021-07-31 bar 2021-08-01T10:14:51.577802 as you can see, the logs from foo have been overwritten. A very similar result can be seen if you manually create a file and then run the test script. $ python3 --version Python 3.9.5 $ echo "logging test" > test.log.2021-07-31 $ python3 log_44186.py foo 10 33 25 TEST > [INFO] [2021-08-01 10:33:25] : foo 2021-08-01T10:33:25.003750 $ cat test.log foo 2021-08-01T10:33:25.003750 $ cat test.log.2021-07-31 $ once again, you can see that the handler overwrote the target file (this time leaving it blank as there were no logs to write). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 06:46:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 10:46:45 +0000 Subject: [issue43596] change assertRaises message when wrong exception is raised In-Reply-To: <1616429766.92.0.297524624601.issue43596@roundup.psfhosted.org> Message-ID: <1627814805.02.0.725952709692.issue43596@roundup.psfhosted.org> Serhiy Storchaka added the comment: I concur with Irit. The test is failed in any case, so you need to look at the code to fix it. For the same reason we do not have assertNotRaises(). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 07:37:51 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 11:37:51 +0000 Subject: [issue44802] Substitution does not work after ParamSpec substitution of the user generic with a list of TypeVars Message-ID: <1627817871.37.0.426591576704.issue44802@roundup.psfhosted.org> New submission from Serhiy Storchaka : If the user generic with ParamSpec parameter substituted with a parametrised list containing TypeVar, that TypeVar cannot be substituted. >>> from typing import * >>> T = TypeVar("T") >>> P = ParamSpec("P") >>> class X(Generic[P]): ... f: Callable[P, int] ... >>> Y = X[[int, T]] >>> Y __main__.X[(, ~T)] >>> Y[str] Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 309, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 1028, in __getitem__ _check_generic(self, params, len(self.__parameters__)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 228, in _check_generic raise TypeError(f"{cls} is not a generic class") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: __main__.X[(, ~T)] is not a generic class Expected result equal to X[[int, str]]. ---------- components: Library (Lib) messages: 398694 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Substitution does not work after ParamSpec substitution of the user generic with a list of TypeVars type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 08:13:39 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Sun, 01 Aug 2021 12:13:39 +0000 Subject: [issue20779] Add pathlib.chown method In-Reply-To: <1393408310.22.0.917230781145.issue20779@psf.upfronthosting.co.za> Message-ID: <1627820019.87.0.069763374675.issue20779@roundup.psfhosted.org> Emmanuel Arias added the comment: Hello! I also use it frequently, but looking this issue I can agree with pitrou that there aren't lot of people that use chown. If I'm not wrong, there's a trend to move os to pathlib, perhaps chown should be in pathlib too :) I can work on this. ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 08:55:36 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Sun, 01 Aug 2021 12:55:36 +0000 Subject: [issue20779] Add pathlib.chown method In-Reply-To: <1393408310.22.0.917230781145.issue20779@psf.upfronthosting.co.za> Message-ID: <1627822536.49.0.134422614232.issue20779@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- versions: +Python 3.11 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 09:19:21 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 13:19:21 +0000 Subject: [issue44590] Create frame objects lazily when needed In-Reply-To: <1625828020.36.0.429011373838.issue44590@roundup.psfhosted.org> Message-ID: <1627823961.58.0.545364380964.issue44590@roundup.psfhosted.org> Nick Coghlan added the comment: The newly linked pull request isn't actually for this ticket, it's for bpo-44800, a follow-up refactoring proposal related to the variable, struct field, and API naming schemes used for the new lighter weight execution frames. However, the commit message and PR description refer back to this ticket as well, so the RoundUp automation picked it up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 09:44:11 2021 From: report at bugs.python.org (Nathan Collins) Date: Sun, 01 Aug 2021 13:44:11 +0000 Subject: [issue43183] Asyncio can't close sockets properly on Linux cause CLOSE_WAIT In-Reply-To: <1612922194.82.0.214805555542.issue43183@roundup.psfhosted.org> Message-ID: <1627825451.42.0.18091846036.issue43183@roundup.psfhosted.org> Nathan Collins added the comment: What was the resolution for this issue? I'm experiencing asyncio.StreamReader.readline() hanging forever on a socket in CLOSE_WAIT state. ---------- nosy: +NathanCollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 10:13:07 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 14:13:07 +0000 Subject: [issue22240] argparse support for "python -m module" in help In-Reply-To: <1408564751.42.0.897410433728.issue22240@psf.upfronthosting.co.za> Message-ID: <1627827187.58.0.478743647851.issue22240@roundup.psfhosted.org> Nick Coghlan added the comment: (Note: this is an old enough ticket that it started out with patch files on the tracker rather than PRs on GitHub. That's just a historical artifact, so feel free to open a PR as described in the devguide if you would prefer to work that way) There are two common ways of solving import bootstrapping problems that affect the build process: 1. Make the problematic import lazy, so it only affects the specific operation that needs the binary dependency; or 2. Wrap a try/except around the import, and do something reasonable in the failing case However, I think in this case it should be possible to avoid the zipfile dependency entirely, and instead make the determination based on the contents of __main__ and __main__.__spec__ using the suggestions I noted in an earlier comment (see https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec for the info the module spec makes available). This should also solve a problem I believe the current patch has, where I think directory execution will give the wrong result (returning "python -m __main__" as the answer instead of the path to the directory containing the __main__.py file). The three cases to cover come from https://docs.python.org/3/using/cmdline.html#interface-options: * if `__main__.__spec__` is None, the result should continue to be `_os.path.basename(_sys.argv[0])` (as it is in the patch) * if `__main__.__spec__.name` is exactly the string "__main__", `__main__.__spec__.parent` is the empty string, and `__main__.__spec__.has_location` is true, and sys.argv[0] is equal to `__main__.__spec__.origin` with the trailing `__main__.py` removed, then we have a directory or zipfile path execution case, and the result should be a Python path execution command using f'{py} {arg0} * otherwise, we have a `-m` invocation, using f'{py} -m {mod.__spec__.name.removesuffix(".__main__")}' The patch gets the three potential results right, but it gets the check for the second case wrong by looking specifically for zipfiles instead of looking at the contents of __main__.__spec__ and seeing if it refers to a __main__.py file located inside the sys.argv[0] path (which may be a directory, zipfile, or any other valid sys.path entry). For writing robust automated tests, I'd suggest either looking at test.support.script_helper for programmatic creation of executable zipfiles and directories ( https://github.com/python/cpython/blob/208a7e957b812ad3b3733791845447677a704f3e/Lib/test/support/script_helper.py#L209 ) or else factoring the logic out such that there is a helper function that receives "__main__.__spec__" and "sys.argv[0]" as parameters, allowing the test suite to easily control them. The latter approach would require some up front manual testing to ensure the behaviour of the different scenarios was being emulated correctly, but would execute a lot faster than actually running subprocesses would. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 10:31:36 2021 From: report at bugs.python.org (=?utf-8?q?Anton_Gr=C3=BCbel?=) Date: Sun, 01 Aug 2021 14:31:36 +0000 Subject: [issue44803] change tracemalloc.BaseFilter to an abstract class Message-ID: <1627828296.31.0.469663144509.issue44803@roundup.psfhosted.org> New submission from Anton Gr?bel : during some work on typeshed I found the BaseFilter class in tracemalloc and it totally looks like and is used as a typical abstract class. I will also directly create the PR :) if you think I'm missing something, I'm happy to hear some other thoughts. ---------- components: Library (Lib) messages: 398699 nosy: anton.gruebel priority: normal severity: normal status: open title: change tracemalloc.BaseFilter to an abstract class type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 10:33:00 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 14:33:00 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1627828380.54.0.238589539168.issue43838@roundup.psfhosted.org> Nick Coghlan added the comment: Ouch, you're right - I forgot that dict just returned NotImplemented from comparisons and unions and made it the other operand's problem: >>> d1 = dict(x=1) >>> d2 = dict(x=1) >>> from types import MappingProxyType as proxy >>> d1.__eq__(proxy(d2)) NotImplemented >>> d1.__or__(proxy(d2)) NotImplemented Perhaps we could mitigate the performance hit by skipping the copy when the other side is either a builtin dict (subclasses don't count), or a proxy around a builtin dict? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 10:37:36 2021 From: report at bugs.python.org (=?utf-8?q?Anton_Gr=C3=BCbel?=) Date: Sun, 01 Aug 2021 14:37:36 +0000 Subject: [issue44803] change tracemalloc.BaseFilter to an abstract class In-Reply-To: <1627828296.31.0.469663144509.issue44803@roundup.psfhosted.org> Message-ID: <1627828656.05.0.0150210043188.issue44803@roundup.psfhosted.org> Change by Anton Gr?bel : ---------- keywords: +patch pull_requests: +26042 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27527 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 10:40:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Aug 2021 14:40:38 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1627828838.38.0.457326329324.issue43468@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +carljm, ncoghlan, pydanny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 10:53:55 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 01 Aug 2021 14:53:55 +0000 Subject: [issue43596] change assertRaises message when wrong exception is raised In-Reply-To: <1616429766.92.0.297524624601.issue43596@roundup.psfhosted.org> Message-ID: <1627829635.66.0.67654413204.issue43596@roundup.psfhosted.org> Mark Dickinson added the comment: I think I understand where the request comes from: in the case where you've changed the exception type that an API is expected to raise, and you've either updated the test to check for the new exception type and missed an update in the business logic, or vice versa, you'd like the test to tell you that the wrong exception type was raised. I've definitely done this myself on more than a few occasions. So this *particular* case is an exception to Irit's observation that "The two problems are usually unrelated [...]". But I think it *is* an exception: I agree that the rule holds in general, and that the current behaviour shouldn't be changed. I think we've got sufficient agreement from core devs to close here. ---------- nosy: +mark.dickinson resolution: -> rejected stage: -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 10:56:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 01 Aug 2021 14:56:19 +0000 Subject: [issue43596] change assertRaises message when wrong exception is raised In-Reply-To: <1616429766.92.0.297524624601.issue43596@roundup.psfhosted.org> Message-ID: <1627829779.35.0.788294208673.issue43596@roundup.psfhosted.org> Irit Katriel added the comment: I agree. That?s what the ?usually? was for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 10:57:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Aug 2021 14:57:27 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627829847.4.0.475214005773.issue44782@roundup.psfhosted.org> Raymond Hettinger added the comment: Possible replacement recipes: -- Implement as a class ----------------- class LRU: def __init__(self, func, maxsize=128): self.func = func self.d = OrderedDict() def __call__(self, *args): if args in self.d: value = self.d[args] self.d.move_to_end(args) return value value = self.func(*args) if len(self.d) >= self.maxsize: self.d.popitem(False) self.d[args] = value return value -- Implement as a closure --------------- def lru_cache(maxsize): def deco(func): d = OrderedDict() def inner(*args): if args in d: d.move_to_end(args) return d[args] answer = func(args) d[args] = answer if len(d) > maxsize: d.popitem(False) return answer return inner return deco ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 10:59:17 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 14:59:17 +0000 Subject: [issue37398] contextlib.ContextDecorator decorating async functions In-Reply-To: <1561445403.56.0.10750759042.issue37398@roundup.psfhosted.org> Message-ID: <1627829957.39.0.717722415866.issue37398@roundup.psfhosted.org> Nick Coghlan added the comment: You are correct that this proposal is technically rejected, rather than being a true duplicate of the AsyncContextManager addition. The core problem with the automatic inference idea is that it isn't possible for the standard library to reliably distinguish at decoration time between "synchronous function that happens to return an awaitable" and "coroutine factory function written as a synchronous function that should nevertheless be treated like a coroutine function". That ambiguity doesn't exist when ContextDecorator and AsyncContextDecorator are applied to distinct helper functions. Within a given codebase, you may be able to write a "coroutine argument detection" function that is robust enough for that particular codebase (and iscoroutinefunction() may even be adequate for that purpose), in which case ContextDecorator and AsyncContextDecorator provide the building blocks for implementing the two halves of the solution, leaving only the auto-switching code as project specific. ---------- resolution: duplicate -> rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 11:01:50 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Aug 2021 15:01:50 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627830110.47.0.378826816399.issue27275@roundup.psfhosted.org> Raymond Hettinger added the comment: > I think Serhiy's patch here (before revert) may be a > good idea (to re-apply). That seems sensible to me as well. It keeps the C version in harmony with the pure python version and it follows how regular dict's are implemented. Serhiy, do you remember why your patch was reverted? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 11:12:03 2021 From: report at bugs.python.org (Dennis Clarke) Date: Sun, 01 Aug 2021 15:12:03 +0000 Subject: [issue44789] CPython cannot be compiled with -pedantic In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627830723.37.0.837163078318.issue44789@roundup.psfhosted.org> Dennis Clarke added the comment: I very likely do not understand what is happening here. From my little perspective the Python project has become far too critical to be yet another language that can not be ported and used just about anywhere. I often port software from various places into strange machines and even onto z/OS mainframe type places. There is nothing more beautiful than to take some C89 clean code and watch it just work. Flawlessly. Even the OpenSSL project is locked neatly to that old C89 standard. I have tried to get into a discussion about C99 but was always flatly told that we need OpenSSL to work everywhere. Pretty much on anything that you can get a compiler will do just fine. With the exception of some very small embedded devices or tight memory constraints. It just works. Sadly the Go Programming language is not like that. Neither is Rust. When I look at The Python Project "Style Guide for C Code" here : https://www.python.org/dev/peps/pep-0007/ The message is clearly stated : Python versions greater than or equal to 3.6 use C89 with several select C99 features: - Standard integer types in and . We require the fixed width integer types. - static inline functions - designated initializers (especially nice for type declarations) - intermingled declarations - booleans - C++-style line comments Future C99 features may be added to this list in the future depending on compiler support (mostly significantly MSVC). Don't use GCC extensions (e.g. don't write multi-line strings without trailing backslashes). All function declarations and definitions must use full prototypes (i.e. specify the types of all arguments). Only use C++ style // one-line comments in Python 3.6 or later. No compiler warnings with major compilers (gcc, VC++, a few others). That last line is a bit of a dream but I didn't write that. I merely took a copy from the "Style Guide for C Code". So perhaps that needs a rewrite and just state that the code will be mostly C99 safe and maybe it would be best to just say iso9899:2011 and keep on plowing forwards. One thing is certain, I built the OpenSSL 3.0.0 beta1 software on a pile of systems in the last few weeks and then rebuilt a pile of dependant libs and tools. They all work. Curl and libCurl is flawless. I am trying to get Apache httpd 2.4.x ( and also trunk ) built and running. The only major piece missing, critical and really important, is Python. OKay I also have issues with ISC Bind but they seem to be drinking some strange brew lately and their unit tests and other code has gone crab sideways. That is another problem in someone elses backyard. Python however looks to be very highly portable and it just works on everything. Pretty much. So having said all that should this just be iso9899:2011 with no major surprises? ps: from the "Style Guide for C Code" we also see these gems : Use 4-space indents and no tabs at all. No line should be longer than 79 characters. If this and the previous rule together don't give you enough room to code, your code is too complicated -- consider using subroutines. No line should end in whitespace. If you think you need significant trailing whitespace, think again -- somebody's editor might delete it as a matter of routine. Those are just priceless old rules from the Fortan punchcard days. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 11:19:43 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 01 Aug 2021 15:19:43 +0000 Subject: [issue41973] Docs: TypedDict is now of type function instead of class In-Reply-To: <1602138406.98.0.272652370144.issue41973@roundup.psfhosted.org> Message-ID: <1627831183.44.0.38609783814.issue41973@roundup.psfhosted.org> Andrei Kulakov added the comment: I haven't looked too much into typing module, so take this with a grain of salt, but my understanding is that TypedDict is a special construct (as the first sentence in the docs defines it), which can be used as a base. I think most users would consider something a kind of a class if it can be inherited from by a user-defined class, so this classification in the docs is useful. Normally functions can't be used as a base of course. There's no "inheritable from" abc or anything like that and functions are not inherited from "function type". You generally don't care if something is a function, you care if it's a callable and test for that with `callable()`. So in a sense a function is the most inherently duck typed object in Python. The only way for a specific check of a function type is AFAIK type(known_function) == type(myobj), but this type of checking is discouraged. So static checkers that run into a problem with this are probably assuming too much about what a function is or should be in Python. To sum up, TypedDict is a kind of a construct between a class and a function that's more usefully documented as, and used as, a class. The docs make it very clear that it's not your usual, run of the mill class. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 11:40:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 15:40:20 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627832420.08.0.835487264324.issue27275@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was reverted because it did not keep the C version in harmony with the pure Python version. In the pure Python version pop() calls __getitem__ and __delitem__ which can be overridden in subclasses of OrederedDict. My patch always called dict.__getitem__ and dict.__delitem__. But I see now clearer what is the problem with the current C code. It removes the key from the linked list before calling __delitem__ which itself removes the key from the linked list. Perhaps I can fix it correctly this time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 11:40:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 15:40:35 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627832435.16.0.299440352476.issue27275@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 11:44:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Aug 2021 15:44:50 +0000 Subject: [issue44789] CPython cannot be compiled with -pedantic In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627832690.06.0.158944328935.issue44789@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I understand where you are coming from and I do agree, but this is something bigger than just what we can do in an issue, as it spawns multiple other places (again, many files fail with -pedantic). Is not a titanic task but is also not straightforward. My recommendation is to send a brief email to python-dev about these concerns to gather some feedback from the community, as this issue is probably not going to have all the attention that this would otherwise require. For example, there are several pieces of infrastructure that use GNU extensions already by default when compiled with clang and gcc (like computed gotos), so activating -pedantic will invalidate those simple checks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 11:53:24 2021 From: report at bugs.python.org (Dennis Clarke) Date: Sun, 01 Aug 2021 15:53:24 +0000 Subject: [issue44789] CPython cannot be compiled with -pedantic In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627833204.05.0.53405734604.issue44789@roundup.psfhosted.org> Dennis Clarke added the comment: Oh, I think we can give up on -pedantic and -pedantic-errors. It is just a nifty litmus paper test to see how code cranks under nasty contraints. I would be hapyp with iso9899:1999 or even iso9899:2011. Thank you for the feedback and the excellent response time. I am so very happy with the Python team bug report process and quite frankly there are a lot of good people working on the quality code. -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 12:04:41 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 01 Aug 2021 16:04:41 +0000 Subject: [issue42019] Override MagicMock special methods In-Reply-To: <1602527199.87.0.454087859253.issue42019@roundup.psfhosted.org> Message-ID: <1627833881.97.0.382383907263.issue42019@roundup.psfhosted.org> Andrei Kulakov added the comment: I think this can be closed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 12:15:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 01 Aug 2021 16:15:00 +0000 Subject: [issue42019] Override MagicMock special methods In-Reply-To: <1602527199.87.0.454087859253.issue42019@roundup.psfhosted.org> Message-ID: <1627834500.67.0.294459764714.issue42019@roundup.psfhosted.org> Irit Katriel added the comment: + Michael, in case he has something to add. ---------- nosy: +michael.foord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 12:51:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 16:51:37 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627836697.29.0.635760150557.issue27275@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is complicated. The pure Python implementation of OrderedDict.popitem() and OrderedDict.pop() are not consistent. The former uses dict.pop() which doesn't call __getitem__ and __setitem__. The latter calls __getitem__ and __setitem__. The C implementation shared code between popitem() and pop(), therefore it will differ from the pure Python implementation until we write separate code for popitem() and pop(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 12:53:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 16:53:08 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627836788.09.0.326854303145.issue27275@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26043 pull_request: https://github.com/python/cpython/pull/27528 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 13:05:05 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 01 Aug 2021 17:05:05 +0000 Subject: [issue42038] Tracemalloc's format() doc contradictory In-Reply-To: <1602695346.39.0.326290965149.issue42038@roundup.psfhosted.org> Message-ID: <1627837505.67.0.758762350884.issue42038@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +26044 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27529 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 13:05:18 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Aug 2021 17:05:18 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627837518.87.0.233571386752.issue27275@roundup.psfhosted.org> Raymond Hettinger added the comment: Let's do the right thing and fix the pure python OrderedDict.pop() method as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 13:07:07 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 01 Aug 2021 17:07:07 +0000 Subject: [issue42038] Tracemalloc's format() doc contradictory In-Reply-To: <1602695346.39.0.326290965149.issue42038@roundup.psfhosted.org> Message-ID: <1627837627.5.0.956869541634.issue42038@roundup.psfhosted.org> Andrei Kulakov added the comment: I agree that the doc is wrong; I've put up the tiny PR here: https://github.com/python/cpython/pull/27529/files Note that linecache.getline() returns line with \n but is then .strip()'ed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 13:19:51 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 17:19:51 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627838391.88.0.61733891316.issue44782@roundup.psfhosted.org> Serhiy Storchaka added the comment: I agree that composition is methodologically more correct than inheritance for implementing a variant of lru_cache(). But if you need lru_cache() why not use lru_cache() from the stdlib? I think that instead of showing a poor version of the lru_cache() decorator, it is better to show a tool which can be used for LRU caching. The key and the value should be evaluated externally. In other word, class LRU with methods __contains__(), __getitem__() and __setitem__() (or get() and set()). It should use composition. Alternatively we can add a comment that it is just an example, and some methods (like pop()) can not work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 13:36:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 17:36:05 +0000 Subject: [issue41973] Docs: TypedDict is now of type function instead of class In-Reply-To: <1602138406.98.0.272652370144.issue41973@roundup.psfhosted.org> Message-ID: <1627839365.22.0.69404086882.issue41973@roundup.psfhosted.org> Serhiy Storchaka added the comment: TypeDict is a callable, it can be used as Point2D = TypedDict('Point2D', x=int, y=int, label=str) It can also be used as a base in class definition, but is is not a class itself. It does not occur in __bases__ of the created class, and it cannot be used in isinstance() and issubclass() checks. It is just yet one weird way to customize class creation. I agree that documenting it as class is not correct. Perhaps it should be declared as a function (with specifying its signature when used as a function) and referred with the :data: role. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 14:01:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 18:01:50 +0000 Subject: [issue41973] Docs: TypedDict is now of type function instead of class In-Reply-To: <1602138406.98.0.272652370144.issue41973@roundup.psfhosted.org> Message-ID: <1627840910.35.0.960796596186.issue41973@roundup.psfhosted.org> Serhiy Storchaka added the comment: Actually most names defined in typing are no longer classes. ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, gvanrossum, kj versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 14:06:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Aug 2021 18:06:38 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1627841198.07.0.0748006010085.issue43468@roundup.psfhosted.org> Raymond Hettinger added the comment: > It is hard to get rid of the execution lock once > it was introduced, but I think we should do it. It's likely some apps are relying on the locking feature. So if we can fix it, we should do prefer that over more disruptive changes. Addenda to my code sketch: It should use "(id(instance), instance)" rather than just "instance" as the key. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 15:47:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 19:47:37 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627847257.13.0.651641959801.issue27275@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26045 pull_request: https://github.com/python/cpython/pull/27530 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 15:52:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 01 Aug 2021 19:52:12 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627847532.6.0.537792429536.issue27275@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 27528 makes the C implementation of OrderedDict.popitem() consistent with the Python implementation (do not call overridden __getitem__ and __setitem__). PR 27530 changes also both implementations of OrderedDict.pop(). It simplifies the C code, but adds a duplication of the code in Python. I am not sure how far we should backport these changes if backport them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 17:47:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 01 Aug 2021 21:47:55 +0000 Subject: [issue31724] test_xmlrpc_net should use something other than buildbot.python.org In-Reply-To: <1507441441.34.0.213398074469.issue31724@psf.upfronthosting.co.za> Message-ID: <1627854475.95.0.830463666692.issue31724@roundup.psfhosted.org> Irit Katriel added the comment: The test is now skipped, but still need to be fixed. ---------- keywords: -patch nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 18:25:09 2021 From: report at bugs.python.org (Joshua Bronson) Date: Sun, 01 Aug 2021 22:25:09 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1627856709.96.0.489078122556.issue43468@roundup.psfhosted.org> Change by Joshua Bronson : ---------- nosy: +jab _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 19:30:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Aug 2021 23:30:23 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627860623.54.0.181468236123.issue27275@roundup.psfhosted.org> Raymond Hettinger added the comment: > I am not sure how far we should backport these changes > if backport them. We've had no reports of the current code causing problems for any existing applications (except the LRU recipe in the docs), so there is likely no value in making backports. Instead, we can clean it up so there won't be new issues going forward. ---------- versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 20:42:29 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 02 Aug 2021 00:42:29 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627864949.76.0.74173984235.issue44782@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +26046 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27536 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 20:48:48 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 02 Aug 2021 00:48:48 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627865328.68.0.200657128607.issue44782@roundup.psfhosted.org> Raymond Hettinger added the comment: > But if you need lru_cache() why not use lru_cache() > from the stdlib? This gives a foundation for people who want to roll their own variants of the standard library lru_cache(). From here, people can experiment with pickle support, dynamic resizing, invalidation methods, max age parameters, other ways to construct a key, tests for total available memory, direct access to cache entries, or any of the other feature requests we've declined because they weren't appropriate for the standard library. Also, it nicely shows-off the original motivating use case for move_to_end(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 21:14:38 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 02 Aug 2021 01:14:38 +0000 Subject: [issue41980] Argparse documentation is slightly misleading In-Reply-To: <1602246859.95.0.133972345732.issue41980@roundup.psfhosted.org> Message-ID: <1627866878.14.0.538188681415.issue41980@roundup.psfhosted.org> Andrei Kulakov added the comment: Yannick: the PRs are submitted via github; you can find more detail on contributions workflow / process here: https://devguide.python.org/ ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 1 23:26:38 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 02 Aug 2021 03:26:38 +0000 Subject: [issue42235] [macOS] Use --enable-optimizations in build-installer.py In-Reply-To: <1604248273.75.0.377267734476.issue42235@roundup.psfhosted.org> Message-ID: <1627874798.95.0.649887771932.issue42235@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: -24521 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 01:18:58 2021 From: report at bugs.python.org (Arun) Date: Mon, 02 Aug 2021 05:18:58 +0000 Subject: [issue44804] Port fix of "issue44422" to Python3.6.x Message-ID: <1627881538.72.0.243584861486.issue44804@roundup.psfhosted.org> New submission from Arun : We have seen multiple occurrences of the issue reported and fixed in https://bugs.python.org/issue44422, on RHEL8.3 with Python3.6.x. I understand RHEL8.4 is also shipping with Python3.6.x as the default version and it's going to be the same with RHEL8.5 as well. This bug is to port that fix to Python3.6.x version as well. This is impacting lot of our customers running large scale enterprise application. ---------- components: Library (Lib) messages: 398725 nosy: arunshan priority: normal severity: normal status: open title: Port fix of "issue44422" to Python3.6.x versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 02:01:27 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 02 Aug 2021 06:01:27 +0000 Subject: [issue32397] textwrap output may change if you wrap a paragraph twice In-Reply-To: <1513865443.17.0.213398074469.issue32397@psf.upfronthosting.co.za> Message-ID: <1627884087.77.0.569539055369.issue32397@roundup.psfhosted.org> Andrei Kulakov added the comment: This issue is due to *drop_whitespace* arg being True by default. Documentation states that *drop_whitespace* applies after wrapping, so the fix in the PR would break that promise because, as far as I understand, it applies the wrapping after *drop_whitespace*. (Irit's comment on the PR refers to this). I feel like the behaviour in the PR is more logical and probably what most users would prefer and need in most cases. But it's a backwards compatibility change of behaviour that's not buggy. 'foo bar' # wrap for width=10 ['foo','bar'] # current behaviour ['foo bar'] # more intuitive wrapping to width=10 As I was looking at this, I thought that wrapping with drop_whitespace=False would surely be stable. Not so! It looks like the logic assumes that \n needs to be replaced by a space for cases like 'foo\nbar', which makes sense because otherwise two words would be joined together. But with drop_whitespace=False, repeated fill() calls will keep replacing \n with a space and then adding a new \n to split lines again: original: 'xxxx xxxx xxxx xxxx xxxx. xxxx' wrapped: 'xxxx xxxx xxxx xxxx xxxx. \nxxxx' wrapped twice: 'xxxx xxxx xxxx xxxx xxxx. \nxxxx' wrapped thrice: 'xxxx xxxx xxxx xxxx xxxx. \nxxxx' Further, a newline with a nearby space within the requested width will be converted to two spaces: 'a\n b' => 'a b' I don't know if the original issue is worth fixing or not, but I think the issue shown above would be good to fix. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 02:11:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Aug 2021 06:11:15 +0000 Subject: [issue20703] RuntimeError caused by lazy imports in pdb In-Reply-To: <1392914840.47.0.865855778793.issue20703@psf.upfronthosting.co.za> Message-ID: <1627884675.28.0.104351902916.issue20703@roundup.psfhosted.org> Serhiy Storchaka added the comment: Having a side effect at import time is not good. It will interfere with programs which just import pdb, but not use it. There are two other options: 1. Import readline at top level, but call set_completer_delims() lazily. 2. Do not import readline at all. Call set_completer_delims() only if readline is already imported (sys.modules.get('readline') is not None). I prefer the latter one. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 02:14:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Aug 2021 06:14:41 +0000 Subject: [issue44804] Port fix of "issue44422" to Python3.6.x In-Reply-To: <1627881538.72.0.243584861486.issue44804@roundup.psfhosted.org> Message-ID: <1627884881.03.0.298012900233.issue44804@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 02:18:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Aug 2021 06:18:17 +0000 Subject: [issue44793] Arguments ignored in substitution in typing.Callable In-Reply-To: <1627734266.52.0.0397934894464.issue44793@roundup.psfhosted.org> Message-ID: <1627885097.53.0.69454696619.issue44793@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset f92b9133ef67e77605cbd315b6b6c81036ce110e by Serhiy Storchaka in branch 'main': bpo-44793: Fix checking the number of arguments when subscribe a generic type with ParamSpec parameter. (GH-27515) https://github.com/python/cpython/commit/f92b9133ef67e77605cbd315b6b6c81036ce110e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 02:18:10 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 06:18:10 +0000 Subject: [issue44793] Arguments ignored in substitution in typing.Callable In-Reply-To: <1627734266.52.0.0397934894464.issue44793@roundup.psfhosted.org> Message-ID: <1627885090.86.0.869332236136.issue44793@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26047 pull_request: https://github.com/python/cpython/pull/27537 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 02:33:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Aug 2021 06:33:36 +0000 Subject: [issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.." In-Reply-To: <1627669471.31.0.97257359702.issue44785@roundup.psfhosted.org> Message-ID: <1627886016.87.0.284747525924.issue44785@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka nosy_count: 2.0 -> 3.0 pull_requests: +26048 pull_request: https://github.com/python/cpython/pull/27538 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 02:42:14 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 02 Aug 2021 06:42:14 +0000 Subject: [issue44804] Port fix of "issue44422" to Python3.6.x In-Reply-To: <1627881538.72.0.243584861486.issue44804@roundup.psfhosted.org> Message-ID: <1627886534.88.0.083205730526.issue44804@roundup.psfhosted.org> Ned Deily added the comment: Sorry you are running into this problem. Alas, Python 3.6 has been in the "security-fix-only" phase of its life cycle for over 2.5 years now and will reach end-of-life in several months at the end of 2021. Our criteria for changes to a "security" branch are: "The only changes made to a security branch are those fixing issues exploitable by attackers such as crashes, privilege escalation and, optionally, other issues such as denial of service attacks. Any other changes are not considered a security risk and thus not backported to a security branch." The problem referenced here does not seem to meet those criteria and thus the original fix was not considered for backporting to current security branches, i.e. 3.8, 3.7, and 3.6. Unless it can be shown that the problem can be exploited as an attack vector, it is not eligible to be officially backported to 3.6. However, there is nothing stopping either you or a downstream supplier of Python 3.6 (like RedHat) from backporting it yourselves. https://devguide.python.org/devcycle/#security-branches ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 03:08:33 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 07:08:33 +0000 Subject: [issue44793] Arguments ignored in substitution in typing.Callable In-Reply-To: <1627734266.52.0.0397934894464.issue44793@roundup.psfhosted.org> Message-ID: <1627888113.56.0.818312918941.issue44793@roundup.psfhosted.org> miss-islington added the comment: New changeset c8db292012dd84aab81eb3ed9146709696a3d290 by Miss Islington (bot) in branch '3.10': bpo-44793: Fix checking the number of arguments when subscribe a generic type with ParamSpec parameter. (GH-27515) https://github.com/python/cpython/commit/c8db292012dd84aab81eb3ed9146709696a3d290 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 03:32:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Aug 2021 07:32:47 +0000 Subject: [issue44793] Arguments ignored in substitution in typing.Callable In-Reply-To: <1627734266.52.0.0397934894464.issue44793@roundup.psfhosted.org> Message-ID: <1627889567.01.0.122976991878.issue44793@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 Aug 2 03:45:23 2021 From: report at bugs.python.org (Nathan Collins) Date: Mon, 02 Aug 2021 07:45:23 +0000 Subject: [issue44805] asyncio.StreamReader.read hangs for reused socket file descriptors when asyncio.StreamWriter.close() is not called Message-ID: <1627890323.27.0.0668623257849.issue44805@roundup.psfhosted.org> New submission from Nathan Collins : Problem ======= When using asyncio streams via (r,w) = asyncio.open_connection(sock=socket) with a already connected socket `socket`, if you call `socket.close()` but not `w.close()` when you're done, then when the OS later reuses the file descriptor of `socket` for a new socket, and that new socket is used with (r,w) = asyncio.open_connection(sock=socket) again, the `r.read(...)` for the new `r` can hang indefinitely, even when data is available on the underlying socket. When the hang happens, closing the socket on the writer side doesn't help, and the socket gets stuck forever in the CLOSE_WAIT state on the reader side. Using `strace` shows that the reader side is stuck in `epoll_wait(...)`. Client and server programs that reproduce the bug ================================================= Run the server in one shell and then run the client in the other shell. They each take one argument, that controls how they close their sockets/streams when they're done. Usage: python3 client.py CLOSE_MODE Usage: python3 server.py CLOSE_MODE Where CLOSE_MODE can be * "": don't close the socket in any way * "S": close `open_connection` socket using `socket.socket.close()` * "A": close `open_connection` socket using `asyncio.StreamWriter.close()` * "SA": close `open_connection` socket both ways These are also attached, but here's the source. The `client.py`: ``` python import asyncio, socket, sys async def client(src_ip, close_mode): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) src_ip_port = (src_ip, 0) s.bind(src_ip_port) dst_ip_port = ('127.0.0.2', 12345) s.connect(dst_ip_port) print(f'Connected from {src_ip}') print(s) try: (r,w) = await asyncio.open_connection(sock=s) print('<- ', end='', flush=True) in_line = await r.read(100) print(in_line) out_line = b'client' print('-> ', end='', flush=True) w.write(out_line) await w.drain() print(out_line) finally: if 'S' in close_mode: s.close() if 'A' in close_mode: w.close() await w.wait_closed() print('Closed socket') print() async def main(close_mode): await client('127.0.0.3', close_mode) await client('127.0.0.4', close_mode) close_mode = sys.argv[1] asyncio.run(main(close_mode)) ``` The `server.py`: ``` python import asyncio, socket, sys async def server(close_mode): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) ip = '127.0.0.2' port = 12345 print(f'Listening on {ip}:{port}') print(s) try: s.bind((ip, port)) s.listen() while True: (a, (a_ip, a_port)) = s.accept() print(f'Client connected from {a_ip}:{a_port}') print(a) try: (r,w) = await asyncio.open_connection(sock=a) print('-> ', end='', flush=True) out_line = b'server' w.write(out_line) await w.drain() print(out_line) print('<- ', end='', flush=True) in_line = await r.read(100) print(in_line) finally: if 'S' in close_mode: a.close() if 'A' in close_mode: w.close() await w.wait_closed() print('Closed client socket') print() finally: s.close() print('Closed server socket') close_mode = sys.argv[1] asyncio.run(server(close_mode)) ``` Example session: `server.py S` and `client.py A` ================================================ Note that file descriptor 7 is reused on the server side, before the server hangs on `r.read`. Run the server in one shell: $ python3 server.py S Listening on 127.0.0.2:12345 Client connected from 127.0.0.3:34135 -> b'server' <- b'client' Closed client socket Client connected from 127.0.0.4:46639 -> b'server' <- The server is hanging on `r.read` above. Run the client in another shell, after starting the server: $ python3 client.py A Connected from 127.0.0.3 <- b'server' -> b'client' Closed socket Connected from 127.0.0.4 <- b'server' -> b'client' Closed socket $ lsof -ni @127.0.0.2 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME python3 26692 conathan 6u IPv4 9992763 0t0 TCP 127.0.0.2:12345 (LISTEN) python3 26692 conathan 7u IPv4 9991149 0t0 TCP 127.0.0.2:12345->127.0.0.4:46639 (CLOSE_WAIT) Example session: `server.py ''` and `client.py A` ================================================ Note that file descriptors are not reused on the server side now, and nothing hangs. Server: $ python3 server.py '' Listening on 127.0.0.2:12345 Client connected from 127.0.0.3:37833 -> b'server' <- b'client' Closed client socket Client connected from 127.0.0.4:39463 -> b'server' <- b'client' Closed client socket Client: $ python3 client.py A Connected from 127.0.0.3 <- b'server' -> b'client' Closed socket Connected from 127.0.0.4 <- b'server' -> b'client' Closed socket Behavior for different combinations of closure modes ==================================================== Perhaps this is overkill, but here's what happens for all 15 possible combinations of how the client and server close their connections. For example, "Client=S, Server=S" below means we run `$ python3 client.py S` and `$ python3 server.py S`. Sometimes multiple combinations have the same behavior, so they're grouped together below. Client=S, Server=''; Client=S, Server=S; Client=S, Server=A; Client=S, Server=SA ------------------- Client hangs on `r.read` on second connection, and killing the server on the other end has no effect, with the socket stuck in CLOSE_WAIT on the client side forever. Client='', Server=S; Client=A, Server=S ------------------ Server hangs on `r.read` on second connection, and client exits normally, with the socket stuck in CLOSE_WAIT on the server side forever. Client=SA, Server=S ------------------- Everything works the first time, but if you run the client in a loop, e.g. with $ while true; do python3 client.py SA; done then the server will eventually hang on `r.read` after ~3 client sessions. Client='', Server=''; Client='', Server=A; Client=A, Server=''; Client=SA, Server='' ------------------- Everything works! But here we see that the client and/or server (whichever side is using '' for mode) is not reusing the socket file descriptors right away (have to wait for GC). This is evidence that the problem is due to stale state in asyncio tied to the reused file descriptors. Client=A, Server=A; Client=A, Server=SA; Client=SA, Server=A; Client=SA, Server=SA -------------------- Everything works, but this is not surprising because both sides closed the `StreamWriter` with `w.close()`. Possibly related bugs ===================== https://bugs.python.org/issue43253: Windows only, calling socket.socket.close() on a socket used with asyncio.open_connection(sock=socket). https://bugs.python.org/issue41317: reused file descriptors across different connections. https://bugs.python.org/issue34795, https://bugs.python.org/issue30064: closing a socket used with asyncio. https://bugs.python.org/issue35065: reading from a closed stream can hang. Could be related if the problem is due to aliased streams from reused file descriptors. https://bugs.python.org/issue43183: sockets used with asyncio getting stuck in WAIT_CLOSED. System info =========== $ python3 --version Python 3.9.6 $ lsb_release -a LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch Distributor ID: Ubuntu Description: Ubuntu 18.04.5 LTS Release: 18.04 Codename: bionic ---------- components: asyncio files: server.py messages: 398731 nosy: NathanCollins, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio.StreamReader.read hangs for reused socket file descriptors when asyncio.StreamWriter.close() is not called type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50198/server.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 03:45:52 2021 From: report at bugs.python.org (Nathan Collins) Date: Mon, 02 Aug 2021 07:45:52 +0000 Subject: [issue44805] asyncio.StreamReader.read hangs for reused socket file descriptors when asyncio.StreamWriter.close() is not called In-Reply-To: <1627890323.27.0.0668623257849.issue44805@roundup.psfhosted.org> Message-ID: <1627890352.29.0.864397896386.issue44805@roundup.psfhosted.org> Change by Nathan Collins : Added file: https://bugs.python.org/file50199/client.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 03:48:35 2021 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 02 Aug 2021 07:48:35 +0000 Subject: [issue44186] TimedRotatingFileHandler overwrite log In-Reply-To: <1621506119.34.0.442557367091.issue44186@roundup.psfhosted.org> Message-ID: <1627890515.36.0.249535372299.issue44186@roundup.psfhosted.org> Vinay Sajip added the comment: OK, I get it now :-) See my comments on the PR - I think the renaming strategy might need rethinking in the presence of a "namer" routine being set. See bpo-43344, bpo-44753. This area (TimedRotatingFileHandler) is unfortunately not yet well tested, because you would need mocking to avoid delays in test runs. But ideally, we would test in the absence and presence of a renamer routine that moved the ".log" to the end of the filename. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 03:59:27 2021 From: report at bugs.python.org (Nathan Collins) Date: Mon, 02 Aug 2021 07:59:27 +0000 Subject: [issue43183] Asyncio can't close sockets properly on Linux cause CLOSE_WAIT In-Reply-To: <1612922194.82.0.214805555542.issue43183@roundup.psfhosted.org> Message-ID: <1627891167.07.0.446376973884.issue43183@roundup.psfhosted.org> Nathan Collins added the comment: I created a new issue for my bug here: https://bugs.python.org/issue44805 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 04:50:52 2021 From: report at bugs.python.org (Nathan Collins) Date: Mon, 02 Aug 2021 08:50:52 +0000 Subject: [issue44805] asyncio.StreamReader.read hangs for reused socket file descriptors when asyncio.StreamWriter.close() is not called In-Reply-To: <1627890323.27.0.0668623257849.issue44805@roundup.psfhosted.org> Message-ID: <1627894252.91.0.248062362357.issue44805@roundup.psfhosted.org> Nathan Collins added the comment: Oh, and I can't count: there are 16 = 4x4 possible combinations of socket closure modes for the client and server. The one I missed was Client='', Server=SA, where everything works because the client doesn't reuse file descriptors and the server closes its sockets correctly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:17:16 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 02 Aug 2021 09:17:16 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1627895836.78.0.661436031455.issue44206@roundup.psfhosted.org> Mark Shannon added the comment: Pablo, There is another failure on that buildbot: test_inspect fails with ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mark/repos/cpython/Lib/inspect.py", line 1154, in walktree classes.sort(key=attrgetter('__module__', '__name__')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: '<' not supported between instances of 'str' and 'module' I can reproduce that failure with a debug build and either of ./python -m test -R 3:3 test_inspect ./python -m test test_inspect -F Known issue or should I file a new issue? This issue is also present in 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:20:47 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 02 Aug 2021 09:20:47 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ Message-ID: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> New submission from Yurii Karabas <1998uriyyo at gmail.com>: When we subclassing Protocol, we get a __init__ differing from default one but the protocol in question didn't define any __init__. More information can be found here - https://github.com/python/typing/issues/644 ---------- components: Library (Lib) messages: 398736 nosy: kj, uriyyo priority: normal severity: normal status: open title: Subclassing Protocol get different __init__ type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:29:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Aug 2021 09:29:59 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627896599.25.0.154369819522.issue44806@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:34:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 09:34:59 +0000 Subject: [issue44781] test_distutils emits deprecation warning about distutils In-Reply-To: <1627660167.89.0.985497227047.issue44781@roundup.psfhosted.org> Message-ID: <1627896899.02.0.288488977069.issue44781@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a9134fa2ffb7e4684c980325dd5444afca596586 by Irit Katriel in branch 'main': bpo-44781: make distutils test suppress deprecation warning from import distutils (GH-27485) https://github.com/python/cpython/commit/a9134fa2ffb7e4684c980325dd5444afca596586 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:35:05 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 09:35:05 +0000 Subject: [issue44781] test_distutils emits deprecation warning about distutils In-Reply-To: <1627660167.89.0.985497227047.issue44781@roundup.psfhosted.org> Message-ID: <1627896905.2.0.781615728317.issue44781@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26049 pull_request: https://github.com/python/cpython/pull/27540 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:35:30 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 02 Aug 2021 09:35:30 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627896930.11.0.907476247123.issue44806@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +26050 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27541 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:43:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 09:43:49 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline In-Reply-To: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> Message-ID: <1627897429.04.0.442514400189.issue44667@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 33a4010198aad31346e46dafdda17e02f8349017 by Miss Islington (bot) in branch '3.10': bpo-44667: Treat correctly lines ending with comments and no newlines in the Python tokenizer (GH-27499) (GH-27500) https://github.com/python/cpython/commit/33a4010198aad31346e46dafdda17e02f8349017 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:44:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 09:44:05 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline In-Reply-To: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> Message-ID: <1627897445.56.0.392273470761.issue44667@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2d11797c81be3ae776e418a5ba507098356d357c by Miss Islington (bot) in branch '3.9': bpo-44667: Treat correctly lines ending with comments and no newlines in the Python tokenizer (GH-27499) (GH-27501) https://github.com/python/cpython/commit/2d11797c81be3ae776e418a5ba507098356d357c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:45:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 09:45:55 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1627897555.36.0.42322007869.issue44206@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Known issue or should I file a new issue? This issue is also present in 3.10. Can you open a different issue, please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:52:12 2021 From: report at bugs.python.org (Khaled K) Date: Mon, 02 Aug 2021 09:52:12 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1627897932.0.0.412377920498.issue42369@roundup.psfhosted.org> Khaled K added the comment: Hi Thomas, I'm facing the same issue. Would you care to opensource your implementation. ---------- nosy: +khaledkoutini _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:53:46 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 02 Aug 2021 09:53:46 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class Message-ID: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> New submission from Yurii Karabas <1998uriyyo at gmail.com>: typing.Protocol silently overrides __init__ method of delivered class. I think it should be forbidden to define __init__ method at Protocol delivered class in case if cls is not Protocol. ---------- components: Library (Lib) messages: 398742 nosy: kj, uriyyo priority: normal severity: normal status: open title: typing.Protocol silently overrides __init__ method of delivered class type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:54:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 09:54:56 +0000 Subject: [issue44781] test_distutils emits deprecation warning about distutils In-Reply-To: <1627660167.89.0.985497227047.issue44781@roundup.psfhosted.org> Message-ID: <1627898096.11.0.998038298348.issue44781@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1bc83eb5c8040855de425c68fc9c5d3c5b48d38e by Miss Islington (bot) in branch '3.10': bpo-44781: make distutils test suppress deprecation warning from import distutils (GH-27485) (GH-27540) https://github.com/python/cpython/commit/1bc83eb5c8040855de425c68fc9c5d3c5b48d38e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:55:33 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 02 Aug 2021 09:55:33 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1627898133.83.0.903033812973.issue44206@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +26051 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27542 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:55:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 09:55:50 +0000 Subject: [issue44808] test_inspect fails in refleak mode Message-ID: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : >From https://bugs.python.org/issue44206 : File "/home/mark/repos/cpython/Lib/inspect.py", line 1154, in walktree classes.sort(key=attrgetter('__module__', '__name__')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: '<' not supported between instances of 'str' and 'module' I can reproduce that failure with a debug build and either of ./python -m test -R 3:3 test_inspect ./python -m test test_inspect -F ---------- messages: 398744 nosy: Mark.Shannon, pablogsal priority: normal severity: normal status: open title: test_inspect fails in refleak mode versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:55:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 09:55:56 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627898156.64.0.396844708864.issue44808@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm bisecting ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:56:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 09:56:09 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627898169.04.0.946904092706.issue44808@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:56:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 09:56:11 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1627898171.31.0.848463828152.issue44206@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Opened https://bugs.python.org/issue44808 ---------- stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:57:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 09:57:56 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627898276.17.0.785986736635.issue44808@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: f468ede4a2b7ab5c72ae85ab04cb56904300cd23 is the first bad commit commit f468ede4a2b7ab5c72ae85ab04cb56904300cd23 Author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> Date: Fri Jul 30 10:46:42 2021 -0700 bpo-44648: Fix error type in inspect.getsource() in interactive session (GH-27171) (GH-27495) (cherry picked from commit 48a62559dfaf775e4f1cc56b19379c799e8e2587) Co-authored-by: andrei kulakov Lib/inspect.py | 2 ++ Lib/test/test_inspect.py | 17 ++++++++++++++++- .../Library/2021-07-15-16-51-32.bpo-44648.2o49TB.rst | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2021-07-15-16-51-32.bpo-44648.2o49TB.rst ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:58:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 09:58:24 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627898304.94.0.241349790961.issue44808@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:59:22 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 02 Aug 2021 09:59:22 +0000 Subject: [issue44807] typing.Protocol silently overrides __init__ method of delivered class In-Reply-To: <1627898026.7.0.991897199639.issue44807@roundup.psfhosted.org> Message-ID: <1627898362.05.0.411059881633.issue44807@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +26052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27543 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 05:59:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 09:59:39 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1627898379.84.0.556067117739.issue44648@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately, this PR has broken test_inspect when executed with -R, see: https://bugs.python.org/issue44808 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 06:09:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 10:09:41 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627898981.95.0.397260485949.issue44808@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The reason buildbots have not catched this is because the re-run login seems to not detect the problem on the second run: ./python.exe -m test test_inspect -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -R 3:3 -u-cpu -w WARNING: Disable --verbose3 because it's incompatible with --huntrleaks: see http://bugs.python.org/issue27103 0:00:00 load avg: 2.73 Run tests in parallel using 1 child processes (timeout: 3 hour 15 min, worker timeout: 3 hour 20 min) 0:00:03 load avg: 2.92 [1/1/1] test_inspect failed (1 error) beginning 6 repetitions 123456 .test test_inspect failed -- Traceback (most recent call last): File "/Users/pgalindo3/github/cpython/Lib/test/test_inspect.py", line 398, in test_getclasses tree = inspect.getclasstree([cls[1] for cls in classes]) File "/Users/pgalindo3/github/cpython/Lib/inspect.py", line 1185, in getclasstree return walktree(roots, children, None) File "/Users/pgalindo3/github/cpython/Lib/inspect.py", line 1158, in walktree results.append(walktree(children[c], children, c)) File "/Users/pgalindo3/github/cpython/Lib/inspect.py", line 1154, in walktree classes.sort(key=attrgetter('__module__', '__name__')) TypeError: '<' not supported between instances of 'str' and 'module' == Tests result: FAILURE == 10 slowest tests: - test_inspect: 3.4 sec 1 test failed: test_inspect 1 re-run test: test_inspect 0:00:03 load avg: 2.92 Re-running failed tests in verbose mode 0:00:03 load avg: 2.92 Re-running test_inspect in verbose mode (matching: test_getclasses) beginning 6 repetitions 123456 test_getclasses (test.test_inspect.TestRetrievingSourceCode) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.001s OK .test_getclasses (test.test_inspect.TestRetrievingSourceCode) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.001s OK .test_getclasses (test.test_inspect.TestRetrievingSourceCode) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.001s OK .test_getclasses (test.test_inspect.TestRetrievingSourceCode) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.001s OK .test_getclasses (test.test_inspect.TestRetrievingSourceCode) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.001s OK .test_getclasses (test.test_inspect.TestRetrievingSourceCode) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.001s OK . == Tests result: FAILURE then SUCCESS == 1 test OK. 10 slowest tests: - test_inspect: 3.4 sec Total duration: 4.6 sec Tests result: FAILURE then SUCCESS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 06:09:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 10:09:51 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627898991.79.0.148523089075.issue44808@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Check for instance the logs in https://buildbot.python.org/all/#/builders/679/builds/92/steps/5/logs/stdio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 06:12:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 10:12:51 +0000 Subject: [issue44781] test_distutils emits deprecation warning about distutils In-Reply-To: <1627660167.89.0.985497227047.issue44781@roundup.psfhosted.org> Message-ID: <1627899171.57.0.188329601498.issue44781@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 06:49:32 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 02 Aug 2021 10:49:32 +0000 Subject: [issue15870] PyType_FromSpec should take metaclass as an argument In-Reply-To: <1346946566.36.0.583610018294.issue15870@psf.upfronthosting.co.za> Message-ID: <1627901372.37.0.196918054921.issue15870@roundup.psfhosted.org> Petr Viktorin added the comment: > 2. Use eval from C to create the class with a metaclass, eg. > class Foo(metaclass=MessageMeta) You can also call (PyObject_Call*) the metaclass with (name, bases, namespace); this should produce a class. Or not: >>> class Foo(metaclass=print): ... def foo(self): pass ... Foo () {'__module__': '__main__', '__qualname__': 'Foo', 'foo': } PyType_FromSpecEx will surely need to limit the metaclass to subtypes of type. What other limitations are there? How closely can we approach the behavior of the `class` statement in Python? > 3. Manually set FooType->ob_type = &MetaType I wouldn't recommend doing that after PyType_Ready is called. Including indirectly, which the type-creation functions in the stable ABI do. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 07:05:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 11:05:43 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627902343.79.0.640806475369.issue44808@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >From f468ede4a2b7ab5c72ae85ab04cb56904300cd23: This code looks quite dangerous: class TestGetsourceInteractive(unittest.TestCase): def tearDown(self): mod.ParrotDroppings.__module__ = mod sys.modules['__main__'] = self.main That is modifing sys.modules globally! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 07:12:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 11:12:02 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627902722.38.0.534961019363.issue44808@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ah, the problem is that: mod.ParrotDroppings.__module__ = mod is wrong: `__module__` must be a string, not a module object ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 07:13:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 11:13:40 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627902820.8.0.830200408745.issue44808@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +26053 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27544 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 07:14:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 11:14:39 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627902879.41.0.443344477621.issue44808@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PR 27544 just addresses the main problem, but I still have concerns about the test affecting sys.modules directly, making it dangerous to run in parallel. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 07:15:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 11:15:09 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627902909.54.0.834754433964.issue44808@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: With PR 27544: ? ./python.exe -m test test_inspect -R : 0:00:00 load avg: 2.91 Run tests sequentially 0:00:00 load avg: 2.91 [1/1] test_inspect beginning 9 repetitions 123456789 ......... == Tests result: SUCCESS == 1 test OK. Total duration: 13.7 sec Tests result: SUCCESS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 07:39:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Aug 2021 11:39:59 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627904399.11.0.885870794543.issue44806@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26054 pull_request: https://github.com/python/cpython/pull/27545 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 07:45:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 02 Aug 2021 11:45:21 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627904721.24.0.0992272989957.issue44806@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is other related case: >>> from typing import * >>> class P(Protocol): pass ... >>> class B: ... def __init__(self): ... self.test = 'OK' ... >>> class D(P, B): ... pass ... >>> D().test Traceback (most recent call last): File "", line 1, in AttributeError: 'D' object has no attribute 'test' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 07:54:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 11:54:35 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627905275.08.0.696020072048.issue44808@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 626d397cc1612ea5eef153dd910834c2ee00ddbd by Pablo Galindo Salgado in branch 'main': bpo-44808: Fix test_inspect in refleak mode (GH-27544) https://github.com/python/cpython/commit/626d397cc1612ea5eef153dd910834c2ee00ddbd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 07:58:41 2021 From: report at bugs.python.org (Van Warren) Date: Mon, 02 Aug 2021 11:58:41 +0000 Subject: [issue39927] IDLE.app fails on macOS 10.15 if denied access to Documents In-Reply-To: <1583881879.01.0.624890561041.issue39927@roundup.psfhosted.org> Message-ID: <1627905521.5.0.120868075489.issue39927@roundup.psfhosted.org> Van Warren added the comment: If you are running from a conda python library and don't want the weight of Jupyter for a quick python hack, add this to your .bashrc file (or equivalent shell startup) alias idle='python -m idlelib' This will bypass faulty default MacOS installs in /usr/local/bin Ref: https://www.urbandictionary.com/define.php?term=hack ---------- nosy: +lvwarren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 08:02:05 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 02 Aug 2021 12:02:05 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627905725.86.0.421113016754.issue44808@roundup.psfhosted.org> Andrei Kulakov added the comment: Pablo: thanks for investigating and fixing this, I will look for examples of changing or patching sys.modules in the testsuite to see how to avoid global effects. I think we can keep this issue open for the follow-up discussion / fix? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 08:22:17 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 02 Aug 2021 12:22:17 +0000 Subject: [issue44809] Changelog missing removal of StrEnum etc. Message-ID: <1627906937.39.0.327433164161.issue44809@roundup.psfhosted.org> New submission from Sebastian Rittau : It seems that at some point StrEnum and a few other members were added to Python 3.10. I think they were present in 3.10 beta 2, but it seems they were removed by beta 4. While the Changelog at https://docs.python.org/3.10/whatsnew/changelog.html mentions that they were added, there is no note about their removal again. ---------- assignee: docs at python components: Documentation messages: 398760 nosy: docs at python, srittau priority: normal severity: normal status: open title: Changelog missing removal of StrEnum etc. versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 08:24:05 2021 From: report at bugs.python.org (Nick) Date: Mon, 02 Aug 2021 12:24:05 +0000 Subject: [issue44810] nturl2path: drive definition Message-ID: <1627907045.83.0.78613807665.issue44810@roundup.psfhosted.org> New submission from Nick : Due some problem in a third-party package the `url2path` function from `nturl2path` got `a/"https://b"` (without `, `a`,`b` are just masks ) as the first and only argument. In the function there is the following code ( https://github.com/python/cpython/blob/414dcb13aaa4fd42f264fdee47782dede5c83d6c/Lib/nturl2path.py#L30 ; current state of the `main` branch): ``` comp = url.split('|') if len(comp) != 2 or comp[0][-1] not in string.ascii_letters: error = 'Bad URL: ' + url raise OSError(error) drive = comp[0][-1].upper() ``` As a result, the function decided that the file was located on the `S:` drive and returned the `S:\b` path without a warning. To my mind, it is not right to take just the last letter as a drive letter because the returned path must be only for the specified URL and the unsupported ones must be marked as "bad" without any silent transformations. ---------- components: Windows messages: 398761 nosy: NickVeld, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: nturl2path: drive definition type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 08:25:20 2021 From: report at bugs.python.org (Anis Gandoura) Date: Mon, 02 Aug 2021 12:25:20 +0000 Subject: [issue44811] Change default signature algorithms for context in the ssl library Message-ID: <1627907120.03.0.784092959739.issue44811@roundup.psfhosted.org> New submission from Anis Gandoura : Expose the OpenSSL function SSL_CTX_set1_sigalgs_list to allow the user to modify the supported signature algorithms for a given SSL Context. OpenSSL documentation: https://www.openssl.org/docs/man1.1.0/man3/SSL_CTX_set1_sigalgs_list.html ---------- messages: 398762 nosy: anis.gandoura priority: normal severity: normal status: open title: Change default signature algorithms for context in the ssl library _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 08:28:48 2021 From: report at bugs.python.org (Anis Gandoura) Date: Mon, 02 Aug 2021 12:28:48 +0000 Subject: [issue44811] Change default signature algorithms for context in the ssl library In-Reply-To: <1627907120.03.0.784092959739.issue44811@roundup.psfhosted.org> Message-ID: <1627907328.92.0.471813051453.issue44811@roundup.psfhosted.org> Change by Anis Gandoura : ---------- assignee: -> christian.heimes components: +SSL nosy: +christian.heimes versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 08:29:40 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 12:29:40 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627907380.46.0.757599607993.issue44808@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26055 pull_request: https://github.com/python/cpython/pull/27546 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:00:29 2021 From: report at bugs.python.org (Roundup Robot) Date: Mon, 02 Aug 2021 13:00:29 +0000 Subject: [issue44811] Change default signature algorithms for context in the ssl library In-Reply-To: <1627907120.03.0.784092959739.issue44811@roundup.psfhosted.org> Message-ID: <1627909229.63.0.399425588975.issue44811@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +26056 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27550 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:00:56 2021 From: report at bugs.python.org (hai shi) Date: Mon, 02 Aug 2021 13:00:56 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1627909256.38.0.756531133307.issue42035@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +26057 pull_request: https://github.com/python/cpython/pull/27551 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:03:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 02 Aug 2021 13:03:11 +0000 Subject: [issue28356] [easy doc] Document os.rename() behavior on Windows when src and dst are on different filesystems In-Reply-To: <1475588552.47.0.916118565333.issue28356@psf.upfronthosting.co.za> Message-ID: <1627909391.79.0.964682746363.issue28356@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:06:15 2021 From: report at bugs.python.org (Nick) Date: Mon, 02 Aug 2021 13:06:15 +0000 Subject: [issue44810] nturl2path: drive definition In-Reply-To: <1627907045.83.0.78613807665.issue44810@roundup.psfhosted.org> Message-ID: <1627909575.31.0.932617303485.issue44810@roundup.psfhosted.org> Change by Nick : ---------- keywords: +patch pull_requests: +26058 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27552 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:12:06 2021 From: report at bugs.python.org (Nick) Date: Mon, 02 Aug 2021 13:12:06 +0000 Subject: [issue44810] nturl2path: drive definition In-Reply-To: <1627907045.83.0.78613807665.issue44810@roundup.psfhosted.org> Message-ID: <1627909926.78.0.934366462589.issue44810@roundup.psfhosted.org> Nick added the comment: For the visualization I created a PR with a possible fix. (The link is set into the corresponding field.) If everything is OK, I will perform all the required things like the CLA, news entry... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:23:20 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 02 Aug 2021 13:23:20 +0000 Subject: [issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar In-Reply-To: <1627751984.55.0.589090528607.issue44799@roundup.psfhosted.org> Message-ID: <1627910600.53.0.0509677085941.issue44799@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch nosy: +uriyyo nosy_count: 1.0 -> 2.0 pull_requests: +26060 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27553 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:29:40 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 02 Aug 2021 13:29:40 +0000 Subject: [issue34422] __name__ not available for classes in typing module In-Reply-To: <1534526466.89.0.56676864532.issue34422@psf.upfronthosting.co.za> Message-ID: <1627910980.57.0.830923447147.issue34422@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: I believe we can close this issue. It has been fixed in scope of this issue - https://bugs.python.org/issue44524 ---------- nosy: +uriyyo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:33:47 2021 From: report at bugs.python.org (hai shi) Date: Mon, 02 Aug 2021 13:33:47 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1627911227.18.0.407108499206.issue42035@roundup.psfhosted.org> hai shi added the comment: > - for the qualified name you can use `PyObject_GetAttrString(t, "__qualname__")` After PR-27551 merged, we can use PyType_GetQualName() to get type's `__qualname__`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:41:38 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 13:41:38 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627911698.92.0.68705557831.issue44808@roundup.psfhosted.org> miss-islington added the comment: New changeset a1eaa74d9dcd973ec278cefc22aac7f514faee4b by Miss Islington (bot) in branch '3.10': bpo-44808: Fix test_inspect in refleak mode (GH-27544) https://github.com/python/cpython/commit/a1eaa74d9dcd973ec278cefc22aac7f514faee4b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:46:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 13:46:08 +0000 Subject: [issue20703] RuntimeError caused by lazy imports in pdb In-Reply-To: <1392914840.47.0.865855778793.issue20703@psf.upfronthosting.co.za> Message-ID: <1627911968.13.0.859666314073.issue20703@roundup.psfhosted.org> Irit Katriel added the comment: I think option 2 changes the current behaviour, because cmd.Cmd.cmdloop will import readline later, and the set_completer_delims() call would never happen even though readline is used. I'll update the patch to do option 1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:53:56 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 02 Aug 2021 13:53:56 +0000 Subject: [issue44811] Change default signature algorithms for context in the ssl library In-Reply-To: <1627907120.03.0.784092959739.issue44811@roundup.psfhosted.org> Message-ID: <1627912436.23.0.376993276182.issue44811@roundup.psfhosted.org> Christian Heimes added the comment: Thanks for your PR. Before we move forward, let's discuss reasoning and API design first. Why should a Python application be able to modify the signature algorithms? The default settings are safe and sane. Security properties should rather be set system-wide with a crypto policy in OpenSSL's global config file. Application specific settings can cause security or compatibility issues. **If** there is a solid reason to expose the feature, then - the API should be modeled after SSLContext.set_alpn_protocols() and accept a sequence of strings. - the API should also be able to return currently enabled and perhaps currently available algorithms. - the ssl module should get an enum of common algorithms with names based on IANA's TLS parameter list. - the PR needs tests and documentation ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:54:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 13:54:40 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1627912480.36.0.951021211293.issue44206@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset e06ae75e16dbf46b6626b6a41b62391ea1fdb319 by Mark Shannon in branch 'main': bpo-44206: Make sure that dict-keys's version is set to zero when value is popped (GH-27542) https://github.com/python/cpython/commit/e06ae75e16dbf46b6626b6a41b62391ea1fdb319 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 09:54:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 13:54:55 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1627912495.66.0.573346941582.issue44206@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Closing for now unless we see the error again ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 10:10:30 2021 From: report at bugs.python.org (Anis Gandoura) Date: Mon, 02 Aug 2021 14:10:30 +0000 Subject: [issue44811] Change default signature algorithms for context in the ssl library In-Reply-To: <1627907120.03.0.784092959739.issue44811@roundup.psfhosted.org> Message-ID: <1627913430.56.0.714298462861.issue44811@roundup.psfhosted.org> Anis Gandoura added the comment: Hello, thank you for your message. The default signatures list is very different from what a usual Internet Browser (like Chrome or Firefox) displays. Here is an example: With Chrome I have: SHA256/ECDSA, RSA_PSS_SHA256, SHA256/RSA, SHA384/ECDSA, RSA_PSS_SHA384, SHA384/RSA, RSA_PSS_SHA512, SHA512/RSA With default SSL settings: SHA256/ECDSA, SHA384/ECDSA, SHA512/ECDSA, Ed25519, Ed448, Unknown (0x8)/Unknown (0x9), Unknown (0x8)/Unknown (0xa), Unknown (0x8)/Unknown (0xb), RSA_PSS_SHA256, RSA_PSS_SHA384, RSA_PSS_SHA512, SHA256/RSA, SHA384/RSA, SHA512/RSA, SHA224/ECDSA, SHA1/ECDSA, SHA224/RSA, SHA1/RSA, SHA224/DSA, SHA1/DSA, SHA256/DSA, SHA384/DSA, SHA512/DSA You can use this website for testing: https://clienttest.ssllabs.com:8443/ssltest/viewMyClient.html We are building a security suite in Python to protect websites from DDOS attacks and we are not able to run "Chrome like" tests due to this limitation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 10:14:51 2021 From: report at bugs.python.org (Francis Johnson) Date: Mon, 02 Aug 2021 14:14:51 +0000 Subject: [issue44660] email.feedparser: support RFC 6532 section 3.5 In-Reply-To: <1626493971.02.0.0360385916287.issue44660@roundup.psfhosted.org> Message-ID: <1627913691.01.0.505701389199.issue44660@roundup.psfhosted.org> Francis Johnson added the comment: As requested, I?ve started testing and writing changes for the generator and content manager. I?m assuming there is no rush since the scope is now widened. Will have some follow-on questions about the design. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 10:19:41 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 02 Aug 2021 14:19:41 +0000 Subject: [issue34422] __name__ not available for classes in typing module In-Reply-To: <1534526466.89.0.56676864532.issue34422@psf.upfronthosting.co.za> Message-ID: <1627913981.88.0.114583539648.issue34422@roundup.psfhosted.org> Ken Jin added the comment: Agree with Yurii. This is no longer an issue in 3.10 onwards. Thanks to Yurii for providing the fix in the other issue. ---------- nosy: +kj resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 10:21:08 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 02 Aug 2021 14:21:08 +0000 Subject: [issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar In-Reply-To: <1627751984.55.0.589090528607.issue44799@roundup.psfhosted.org> Message-ID: <1627914068.04.0.458368906045.issue44799@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 10:22:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 14:22:55 +0000 Subject: [issue44725] Expose specialization stats in python In-Reply-To: <1627049048.24.0.175321998203.issue44725@roundup.psfhosted.org> Message-ID: <1627914175.61.0.825928239606.issue44725@roundup.psfhosted.org> Irit Katriel added the comment: Closing as the stats we added. I'll create a new issue for the refactor we discussed on the PR. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 11:00:49 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 02 Aug 2021 15:00:49 +0000 Subject: [issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar In-Reply-To: <1627751984.55.0.589090528607.issue44799@roundup.psfhosted.org> Message-ID: <1627916449.48.0.632447341562.issue44799@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 11:45:16 2021 From: report at bugs.python.org (Josh Haberman) Date: Mon, 02 Aug 2021 15:45:16 +0000 Subject: [issue15870] PyType_FromSpec should take metaclass as an argument In-Reply-To: <1346946566.36.0.583610018294.issue15870@psf.upfronthosting.co.za> Message-ID: <1627919116.9.0.982721021255.issue15870@roundup.psfhosted.org> Josh Haberman added the comment: > You can also call (PyObject_Call*) the metaclass with (name, bases, namespace); But won't that just call my metaclass's tp_new? I'm trying to do this from my metaclass's tp_new, so I can customize the class creation process. Then Python code can use my metaclass to construct classes normally. > I wouldn't recommend [setting ob_type] after PyType_Ready is called. Why not? What bad things will happen? It seems to be working so far. Setting ob_type directly actually solves another problem that I had been having with the limited API. I want to implement tp_getattro on the metaclass, but I want to first delegate to PyType.tp_getattro to return any entry that may be present in the type's tp_dict. With the full API I could call self->ob_type->tp_base->tp_getattro() do to the equivalent of super(), but with the limited API I can't access type->tp_getattro (and PyType_GetSlot() can't be used on non-heap types). I find that this does what I want: PyTypeObject *saved_type = self->ob_type; self->ob_type = &PyType_Type; PyObject *ret = PyObject_GetAttr(self, name); self->ob_type = saved_type; Previously I had tried: PyObject *super = PyObject_CallFunction((PyObject *)&PySuper_Type, "OO", self->ob_type, self); PyObject *ret = PyObject_GetAttr(super, name); Py_DECREF(super); But for some reason this didn't work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:06:04 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 02 Aug 2021 16:06:04 +0000 Subject: [issue44812] [docs] Document PyMember_{Get/Set}One in C API reference Message-ID: <1627920364.08.0.650340648911.issue44812@roundup.psfhosted.org> New submission from Ken Jin : I can't seem to find PyMember_GetOne or PyMember_SetOne in C API docs, yet they are in stable_abi.txt. Sending a PR shortly, please tell me if these were accidentally exposed and not supposed to be documented (I will close the PR if so). ---------- assignee: docs at python components: Documentation messages: 398777 nosy: docs at python, kj, petr.viktorin priority: normal severity: normal status: open title: [docs] Document PyMember_{Get/Set}One in C API reference versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:06:25 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 02 Aug 2021 16:06:25 +0000 Subject: [issue44812] [docs] Document PyMember_{Get/Set}One in C API reference In-Reply-To: <1627920364.08.0.650340648911.issue44812@roundup.psfhosted.org> Message-ID: <1627920385.72.0.289841494789.issue44812@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +26061 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27555 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:11:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 16:11:20 +0000 Subject: [issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.." In-Reply-To: <1627669471.31.0.97257359702.issue44785@roundup.psfhosted.org> Message-ID: <1627920680.22.0.324111081214.issue44785@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 36d952d228582b0ffc7a86c520d4ddbe8943d803 by Serhiy Storchaka in branch 'main': bpo-44785: Silence deprecation warnings in test_pickle (#27538) https://github.com/python/cpython/commit/36d952d228582b0ffc7a86c520d4ddbe8943d803 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:12:19 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 16:12:19 +0000 Subject: [issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.." In-Reply-To: <1627669471.31.0.97257359702.issue44785@roundup.psfhosted.org> Message-ID: <1627920739.26.0.506535507518.issue44785@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26062 pull_request: https://github.com/python/cpython/pull/27556 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:12:24 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 16:12:24 +0000 Subject: [issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.." In-Reply-To: <1627669471.31.0.97257359702.issue44785@roundup.psfhosted.org> Message-ID: <1627920744.59.0.616285055092.issue44785@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26063 pull_request: https://github.com/python/cpython/pull/27557 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:17:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 16:17:05 +0000 Subject: [issue44813] generate specialization stat names list into opcode.h Message-ID: <1627921025.25.0.316615064433.issue44813@roundup.psfhosted.org> New submission from Irit Katriel : The stat names are repeated in several places in the code, refactor to have this list appear only once in opcode.py. ---------- messages: 398779 nosy: iritkatriel priority: normal severity: normal status: open title: generate specialization stat names list into opcode.h type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:23:32 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 16:23:32 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627921412.76.0.299051034451.issue44806@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26064 pull_request: https://github.com/python/cpython/pull/27558 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:23:38 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 16:23:38 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627921418.73.0.242468291609.issue44806@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26065 pull_request: https://github.com/python/cpython/pull/27559 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:23:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 16:23:33 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627921413.43.0.140969784424.issue44806@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 043cd60abed09edddc7185bcf7d039771acc734d by Serhiy Storchaka in branch 'main': bpo-44806: Fix __init__ in subclasses of protocols (GH-27545) https://github.com/python/cpython/commit/043cd60abed09edddc7185bcf7d039771acc734d ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:27:53 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 16:27:53 +0000 Subject: [issue44812] [docs] Document PyMember_{Get/Set}One in C API reference In-Reply-To: <1627920364.08.0.650340648911.issue44812@roundup.psfhosted.org> Message-ID: <1627921673.32.0.861997742192.issue44812@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26066 pull_request: https://github.com/python/cpython/pull/27561 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:27:59 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 16:27:59 +0000 Subject: [issue44812] [docs] Document PyMember_{Get/Set}One in C API reference In-Reply-To: <1627920364.08.0.650340648911.issue44812@roundup.psfhosted.org> Message-ID: <1627921679.43.0.126947887275.issue44812@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26067 pull_request: https://github.com/python/cpython/pull/27560 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:30:30 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 02 Aug 2021 16:30:30 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627921830.12.0.779667924519.issue44806@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +26068 pull_request: https://github.com/python/cpython/pull/27543 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:31:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 16:31:38 +0000 Subject: [issue44813] generate specialization stat names list into opcode.h In-Reply-To: <1627921025.25.0.316615064433.issue44813@roundup.psfhosted.org> Message-ID: <1627921898.74.0.297442642963.issue44813@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26069 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27562 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:39:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 16:39:32 +0000 Subject: [issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.." In-Reply-To: <1627669471.31.0.97257359702.issue44785@roundup.psfhosted.org> Message-ID: <1627922372.97.0.851405068218.issue44785@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4817c1439519081d7bd9b396bb18b0f4124613be by Miss Islington (bot) in branch '3.9': bpo-44785: Silence deprecation warnings in test_pickle (GH-27538) (#27557) https://github.com/python/cpython/commit/4817c1439519081d7bd9b396bb18b0f4124613be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:52:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 16:52:32 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627923152.65.0.295590882031.issue44806@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0f6a7739df0055b5c6abe2180f1be97ea4da87b7 by Miss Islington (bot) in branch '3.9': bpo-44806: Fix __init__ in subclasses of protocols (GH-27545) (GH-27559) https://github.com/python/cpython/commit/0f6a7739df0055b5c6abe2180f1be97ea4da87b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 12:54:09 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 02 Aug 2021 16:54:09 +0000 Subject: [issue44809] Changelog missing removal of StrEnum etc. In-Reply-To: <1627906937.39.0.327433164161.issue44809@roundup.psfhosted.org> Message-ID: <1627923249.45.0.752981744154.issue44809@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: There was a revert of enum related changes in Python 3.10. Since the news file is generated I guess this is probably missed. ---------- nosy: +ethan.furman, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 13:02:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 17:02:02 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example In-Reply-To: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> Message-ID: <1627923722.23.0.0874037848211.issue35183@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset aa0894b3792901adb91e5f6d049154b7bcb980ec by Jake Stockwin in branch 'main': bpo-35183: Add typical examples to os.path.splitext docs (GH-27286) https://github.com/python/cpython/commit/aa0894b3792901adb91e5f6d049154b7bcb980ec ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 13:02:09 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 17:02:09 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example In-Reply-To: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> Message-ID: <1627923729.79.0.987317762966.issue35183@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26071 pull_request: https://github.com/python/cpython/pull/27564 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 13:02:02 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 17:02:02 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example In-Reply-To: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> Message-ID: <1627923722.91.0.234790750075.issue35183@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26070 pull_request: https://github.com/python/cpython/pull/27563 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 13:09:07 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 17:09:07 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627924147.33.0.819817390352.issue44806@roundup.psfhosted.org> miss-islington added the comment: New changeset 2cc19a5463c804b2f39b94de896d55dcb57a364c by Miss Islington (bot) in branch '3.10': bpo-44806: Fix __init__ in subclasses of protocols (GH-27545) https://github.com/python/cpython/commit/2cc19a5463c804b2f39b94de896d55dcb57a364c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 13:09:08 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 17:09:08 +0000 Subject: [issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.." In-Reply-To: <1627669471.31.0.97257359702.issue44785@roundup.psfhosted.org> Message-ID: <1627924148.82.0.878001616665.issue44785@roundup.psfhosted.org> miss-islington added the comment: New changeset aa7266854abc63524b4be40a3a83977b8ad166c6 by Miss Islington (bot) in branch '3.10': bpo-44785: Silence deprecation warnings in test_pickle (GH-27538) https://github.com/python/cpython/commit/aa7266854abc63524b4be40a3a83977b8ad166c6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 13:11:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 17:11:44 +0000 Subject: [issue44792] Improve syntax errors for invalid if expressions In-Reply-To: <1627730720.99.0.100491103427.issue44792@roundup.psfhosted.org> Message-ID: <1627924304.29.0.824536199214.issue44792@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 28b6dc9dd5d1ce6f8aff7e06d4ef9afdc2bc8332 by Miguel Brito in branch 'main': bpo-44792: Improve syntax errors for if expressions (GH-27506) https://github.com/python/cpython/commit/28b6dc9dd5d1ce6f8aff7e06d4ef9afdc2bc8332 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 13:11:46 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 17:11:46 +0000 Subject: [issue44792] Improve syntax errors for invalid if expressions In-Reply-To: <1627730720.99.0.100491103427.issue44792@roundup.psfhosted.org> Message-ID: <1627924306.69.0.344904608288.issue44792@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26072 pull_request: https://github.com/python/cpython/pull/27565 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 13:37:34 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 17:37:34 +0000 Subject: [issue44806] Subclassing Protocol get different __init__ In-Reply-To: <1627896047.68.0.683763116752.issue44806@roundup.psfhosted.org> Message-ID: <1627925854.15.0.887483253265.issue44806@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 13:59:16 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 02 Aug 2021 17:59:16 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627927156.78.0.931584945864.issue44808@roundup.psfhosted.org> Andrei Kulakov added the comment: I've been looking into avoiding global modification of modules['__main__'], the options are: 1. remove the test and leave it at that 2. remove the test and open a new issue for re-adding a test ; and look for a way to do it safely 3. create a temp script file, add code to it that creates a class, sets `sys.modules['__main__'].__file__ = None` and inspects the class, and run this module in a new interpreter, checks exception raised and does sys.exit(1); and check the exit code after running this script. 4. patch inspect.sys.modules; as far as I understand, this would mean other modules accessing sys.modules in other threads won't be affected, and sys.modules['__main__'] is currently used in inspect in a very limited way, so it can probably be shown that this patching won't affect other tests that use inspect, -- but I would need to look more into this. I'm not sure if #3 is too heavy/complex for this test. The advantage of #1 and #2 is that it's easy to do and ensures that there won't be strange random test failures that are hard to track down and debug (which is something that I'm afraid can happen right now, caused by this test). #4 I've added to get comments / thought. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:04:40 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 18:04:40 +0000 Subject: [issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.." In-Reply-To: <1627669471.31.0.97257359702.issue44785@roundup.psfhosted.org> Message-ID: <1627927480.82.0.554485191823.issue44785@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:06:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 18:06:46 +0000 Subject: [issue44812] [docs] Document PyMember_{Get/Set}One in C API reference In-Reply-To: <1627920364.08.0.650340648911.issue44812@roundup.psfhosted.org> Message-ID: <1627927606.31.0.5216144836.issue44812@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:08:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 18:08:35 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example In-Reply-To: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> Message-ID: <1627927715.38.0.923653884897.issue35183@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e0d599fa48032eb7b8d837f8412bbca72b6ad820 by Miss Islington (bot) in branch '3.9': bpo-35183: Add typical examples to os.path.splitext docs (GH-27286) (GH-27564) https://github.com/python/cpython/commit/e0d599fa48032eb7b8d837f8412bbca72b6ad820 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:10:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 18:10:54 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example In-Reply-To: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> Message-ID: <1627927854.09.0.434613371006.issue35183@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 14cb669357bc30bdc235d1c32ee1b99be05ac9d8 by Miss Islington (bot) in branch '3.10': bpo-35183: Add typical examples to os.path.splitext docs (GH-27286) (GH-27563) https://github.com/python/cpython/commit/14cb669357bc30bdc235d1c32ee1b99be05ac9d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:12:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 02 Aug 2021 18:12:04 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example In-Reply-To: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> Message-ID: <1627927924.76.0.767639872049.issue35183@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Jake! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:15:53 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 02 Aug 2021 18:15:53 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627928153.71.0.22120053655.issue44782@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 54f185b6d321a6354aef2b2886c766677f487ecb by Raymond Hettinger in branch 'main': bpo-44782: Improve OrderedDict recipe for LRU cache variants (GH-27536) https://github.com/python/cpython/commit/54f185b6d321a6354aef2b2886c766677f487ecb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:16:05 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 18:16:05 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627928165.72.0.701327436273.issue44782@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26073 pull_request: https://github.com/python/cpython/pull/27566 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:16:11 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 18:16:11 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627928171.7.0.716506639402.issue44782@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26074 pull_request: https://github.com/python/cpython/pull/27567 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:22:18 2021 From: report at bugs.python.org (nyizel) Date: Mon, 02 Aug 2021 18:22:18 +0000 Subject: [issue44814] python 3.9.6 installation installs 0 modules Message-ID: <1627928538.73.0.0238112884083.issue44814@roundup.psfhosted.org> New submission from nyizel : https://nizel.is-inside.me/NEi7A4aM.png ---------- messages: 398793 nosy: trambell priority: normal severity: normal status: open title: python 3.9.6 installation installs 0 modules type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:29:57 2021 From: report at bugs.python.org (Sam Bull) Date: Mon, 02 Aug 2021 18:29:57 +0000 Subject: [issue44815] asyncio.gather no DeprecationWarning if task are passed Message-ID: <1627928997.24.0.837145443801.issue44815@roundup.psfhosted.org> New submission from Sam Bull : When calling asyncio.gather() a DeprecationWarning is only emitted if no tasks are passed (which is probably the exceptional case, rather than the standard one). This has resulted in us missing this deprecated argument in aiohttp until we received a bug report from a user trying it out against the 3.10 beta. For some reason the warning only appears under a `if not coros_or_futures:` block. I think it should be run regardless: https://github.com/python/cpython/blob/3.9/Lib/asyncio/tasks.py#L757 ---------- components: asyncio messages: 398794 nosy: asvetlov, dreamsorcerer, yselivanov priority: normal severity: normal status: open title: asyncio.gather no DeprecationWarning if task are passed versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:30:49 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 02 Aug 2021 18:30:49 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627929049.92.0.727731263892.issue44782@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:35:42 2021 From: report at bugs.python.org (Sam Bull) Date: Mon, 02 Aug 2021 18:35:42 +0000 Subject: [issue44815] asyncio.gather no DeprecationWarning if task are passed In-Reply-To: <1627928997.24.0.837145443801.issue44815@roundup.psfhosted.org> Message-ID: <1627929342.13.0.701345222403.issue44815@roundup.psfhosted.org> Change by Sam Bull : ---------- keywords: +patch pull_requests: +26075 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27568 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:37:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 02 Aug 2021 18:37:45 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627929465.85.0.194743372871.issue44782@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset c50a672eebb16cf778d9a3b22b72d506c3f54ced by Miss Islington (bot) in branch '3.9': bpo-44782: Improve OrderedDict recipe for LRU cache variants (GH-27536) (GH-27567) https://github.com/python/cpython/commit/c50a672eebb16cf778d9a3b22b72d506c3f54ced ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:38:18 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 02 Aug 2021 18:38:18 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627929498.53.0.92706381786.issue44782@roundup.psfhosted.org> miss-islington added the comment: New changeset c6e7c9860d5ac968c7a1073fdbfbd44e0e87f582 by Miss Islington (bot) in branch '3.10': bpo-44782: Improve OrderedDict recipe for LRU cache variants (GH-27536) https://github.com/python/cpython/commit/c6e7c9860d5ac968c7a1073fdbfbd44e0e87f582 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 14:55:21 2021 From: report at bugs.python.org (Sam Bull) Date: Mon, 02 Aug 2021 18:55:21 +0000 Subject: [issue44815] asyncio.gather no DeprecationWarning if task are passed In-Reply-To: <1627928997.24.0.837145443801.issue44815@roundup.psfhosted.org> Message-ID: <1627930521.89.0.830455854574.issue44815@roundup.psfhosted.org> Sam Bull added the comment: There is another issue with asyncio.sleep() too, if the passed argument is 0. This also tripped up the tests in aiohttp (though I've also used an explicit 0 in production code to yield back to the loop). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 15:02:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 19:02:33 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627930953.55.0.312223862668.issue44808@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 15:03:56 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 02 Aug 2021 19:03:56 +0000 Subject: [issue44814] python 3.9.6 installation installs 0 modules In-Reply-To: <1627928538.73.0.0238112884083.issue44814@roundup.psfhosted.org> Message-ID: <1627931036.7.0.219167406746.issue44814@roundup.psfhosted.org> Zachary Ware added the comment: Posting just an image link makes this look like spam. Please copy and paste text showing your problem into a message instead. ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 15:05:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 19:05:42 +0000 Subject: [issue44792] Improve syntax errors for invalid if expressions In-Reply-To: <1627730720.99.0.100491103427.issue44792@roundup.psfhosted.org> Message-ID: <1627931142.93.0.193311038723.issue44792@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 Mon Aug 2 15:05:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 02 Aug 2021 19:05:43 +0000 Subject: [issue44792] Improve syntax errors for invalid if expressions In-Reply-To: <1627730720.99.0.100491103427.issue44792@roundup.psfhosted.org> Message-ID: <1627931143.09.0.251498173161.issue44792@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 567176249ea95c074eb80199aaf19f3a55aa3954 by Miss Islington (bot) in branch '3.10': bpo-44792: Improve syntax errors for if expressions (GH-27506) (GH-27565) https://github.com/python/cpython/commit/567176249ea95c074eb80199aaf19f3a55aa3954 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 15:45:49 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 02 Aug 2021 19:45:49 +0000 Subject: [issue44814] python 3.9.6 installation installs 0 modules In-Reply-To: <1627928538.73.0.0238112884083.issue44814@roundup.psfhosted.org> Message-ID: <1627933549.66.0.614004618562.issue44814@roundup.psfhosted.org> Dennis Sweeney added the comment: Are you still able to `import heapq` or `import sys`? `requests` and `filetype` are not part of the Python standard library, and must be installed separately. You can check out the tutorial here: https://packaging.python.org/tutorials/installing-packages/ ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 16:04:50 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 02 Aug 2021 20:04:50 +0000 Subject: [issue42698] Deadlock in pysqlite_connection_dealloc() In-Reply-To: <1608511484.37.0.765804145287.issue42698@roundup.psfhosted.org> Message-ID: <1627934690.07.0.461425155507.issue42698@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks! I had to comment out the reg_func() call (it is not defined in test.py, and I don't know what it's supposed to do), and change "with lock.shared_context():" to "with lock:", but I'm unable get a deadlock. I've tried with Python 3.8 though 3.11 (dev) and SQLite 3.7.15 through 3.37.0 (dev). - How long do you normally have to run this in order to force a deadlock? - Could you attach the output of "python -m sysconfig"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 16:11:42 2021 From: report at bugs.python.org (hydroflask) Date: Mon, 02 Aug 2021 20:11:42 +0000 Subject: [issue42698] Deadlock in pysqlite_connection_dealloc() In-Reply-To: <1608511484.37.0.765804145287.issue42698@roundup.psfhosted.org> Message-ID: <1627935102.71.0.839538152666.issue42698@roundup.psfhosted.org> hydroflask added the comment: You did the right thing in terms of editing the code. I was not able to get a deadlock with this code which I think should be representative of the error. In production the error was happening after 30 minutes of so. The major problem is that I don't exactly know how to provoke SQLite to acquire an internal lock. If we assume that it does acquire internal locks and other threads release the GIL before calling into SQLite functions that acquire an internal lock, then you can reason that if sqlite3_close() acquires that lock without first releasing the GIL a deadlock will certainly occur. This is the deadlock that my application was running into. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 16:24:12 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 02 Aug 2021 20:24:12 +0000 Subject: [issue42698] Deadlock in pysqlite_connection_dealloc() In-Reply-To: <1608511484.37.0.765804145287.issue42698@roundup.psfhosted.org> Message-ID: <1627935852.81.0.413208941466.issue42698@roundup.psfhosted.org> Erlend E. Aasland added the comment: > In production the error was happening after 30 minutes of so. Great, thanks. > The major problem is that I don't exactly know how to provoke SQLite to > acquire an internal lock. IIRC, you can provoke the internal SQLite lock simply by using transaction control: BEGIN (lock) => COMMIT / ROLLBACK (unlock). > If we assume that it does acquire internal locks and other threads release > the GIL before calling into SQLite functions that acquire an internal lock, > then you can reason that if sqlite3_close() acquires that lock without first > releasing the GIL a deadlock will certainly occur. True. For the record, I'm not doubting the existence of this deadlock, nor the correctness of the proposed solution (allow threads around sqlite3_close()) :) I'll see if I can come up with a compact repro. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 16:29:41 2021 From: report at bugs.python.org (hydroflask) Date: Mon, 02 Aug 2021 20:29:41 +0000 Subject: [issue42698] Deadlock in pysqlite_connection_dealloc() In-Reply-To: <1608511484.37.0.765804145287.issue42698@roundup.psfhosted.org> Message-ID: <1627936181.46.0.275104250595.issue42698@roundup.psfhosted.org> hydroflask added the comment: >> The major problem is that I don't exactly know how to provoke SQLite to >> acquire an internal lock. > IIRC, you can provoke the internal SQLite lock simply by using transaction control: BEGIN (lock) => COMMIT / ROLLBACK (unlock). Ah okay, so the sequence would have to be this: thread1: pysqlite.some_operation() thread1: release gil thread1: sqlite3_some_procedure() thread1: acquire sqlite lock thread2: acquire gil thread2: pysqlite.close() thread2: sqlite3_close() thread2: acquire sqlite lock > I'll see if I can come up with a compact repro. It should be possible, good luck! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 16:57:26 2021 From: report at bugs.python.org (Thomas Petazzoni) Date: Mon, 02 Aug 2021 20:57:26 +0000 Subject: [issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread In-Reply-To: <1615796616.26.0.51182574064.issue43498@roundup.psfhosted.org> Message-ID: <1627937846.34.0.90097167111.issue43498@roundup.psfhosted.org> Thomas Petazzoni added the comment: I can confirm we are seeing the same issue when building Python 3.9 in the context of Buildroot. See http://autobuild.buildroot.net/results/ae6/ae6c4ab292589a4e4442dfb0a1286349a9bf4d29/build-end.log for an example build result. This happens since we have added 48-cores (96 threads) build machines to our build farm, which dramatically increased the build parallelism. ---------- nosy: +thomas-petazzoni _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 17:00:24 2021 From: report at bugs.python.org (Thomas Petazzoni) Date: Mon, 02 Aug 2021 21:00:24 +0000 Subject: [issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread In-Reply-To: <1615796616.26.0.51182574064.issue43498@roundup.psfhosted.org> Message-ID: <1627938024.08.0.100604939189.issue43498@roundup.psfhosted.org> Thomas Petazzoni added the comment: For the record: we're seeing this issue ~50 times a day on our build infrastructure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 17:21:36 2021 From: report at bugs.python.org (Sam Bull) Date: Mon, 02 Aug 2021 21:21:36 +0000 Subject: [issue44815] asyncio.gather no DeprecationWarning if task are passed In-Reply-To: <1627928997.24.0.837145443801.issue44815@roundup.psfhosted.org> Message-ID: <1627939296.81.0.419444143339.issue44815@roundup.psfhosted.org> Change by Sam Bull : ---------- pull_requests: +26076 pull_request: https://github.com/python/cpython/pull/27569 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 17:30:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 21:30:10 +0000 Subject: [issue34782] Pdb raises exception when code is executed in a mapping that does not define `__contains__` In-Reply-To: <1537738681.57.0.956365154283.issue34782@psf.upfronthosting.co.za> Message-ID: <1627939810.72.0.148440635751.issue34782@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Pdb crashes when code is executed in a mapping that does not define `__contains__` -> Pdb raises exception when code is executed in a mapping that does not define `__contains__` versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 17:31:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 21:31:03 +0000 Subject: [issue34782] Pdb raises exception when code is executed in a mapping that does not define `__contains__` In-Reply-To: <1537738681.57.0.956365154283.issue34782@psf.upfronthosting.co.za> Message-ID: <1627939863.44.0.932477134173.issue34782@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +iritkatriel nosy_count: 4.0 -> 5.0 pull_requests: +26077 pull_request: https://github.com/python/cpython/pull/27570 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 18:01:33 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 22:01:33 +0000 Subject: [issue2824] zipfile to handle duplicate files in archive In-Reply-To: <1210537070.35.0.0613996133193.issue2824@psf.upfronthosting.co.za> Message-ID: <1627941693.02.0.661333896908.issue2824@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.6, Python 2.7, Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 18:10:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 22:10:18 +0000 Subject: [issue16580] [doc] Add examples to int.to_bytes and int.from_bytes In-Reply-To: <1354217109.61.0.534443148437.issue16580@psf.upfronthosting.co.za> Message-ID: <1627942218.0.0.50491152887.issue16580@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Add examples to int.to_bytes and int.from_bytes -> [doc] Add examples to int.to_bytes and int.from_bytes versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 18:19:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 22:19:35 +0000 Subject: [issue33008] urllib.request.parse_http_list incorrectly strips backslashes In-Reply-To: <1520319116.64.0.467229070634.issue33008@psf.upfronthosting.co.za> Message-ID: <1627942775.88.0.922642090243.issue33008@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 18:21:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 22:21:51 +0000 Subject: [issue33003] [doc] urllib: Document parse_http_list In-Reply-To: <1520289391.9.0.467229070634.issue33003@psf.upfronthosting.co.za> Message-ID: <1627942911.64.0.42520034769.issue33003@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: urllib: Document parse_http_list -> [doc] urllib: Document parse_http_list versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 18:39:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 22:39:13 +0000 Subject: [issue18255] CPython setup.py problems In-Reply-To: <1371561186.46.0.280107378589.issue18255@psf.upfronthosting.co.za> Message-ID: <1627943953.82.0.374382630154.issue18255@roundup.psfhosted.org> Irit Katriel added the comment: Is this still relevant now that distutils is deprecated? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 18:55:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 22:55:13 +0000 Subject: [issue22039] PyObject_SetAttr doesn't mention value = NULL In-Reply-To: <1406051790.64.0.0676928180206.issue22039@psf.upfronthosting.co.za> Message-ID: <1627944913.94.0.310784206239.issue22039@roundup.psfhosted.org> Irit Katriel added the comment: This behaviour is documented as deprecated all the way back to 2.7. Should we repurpose the issue to removing it? Otherwise it can be closed. https://docs.python.org/2.7/c-api/object.html#c.PyObject_SetAttr ---------- nosy: +iritkatriel resolution: -> duplicate status: open -> pending superseder: -> Document that tp_setattro and tp_setattr are used for deleting attributes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 19:08:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 02 Aug 2021 23:08:41 +0000 Subject: [issue28973] [doc] The fact that multiprocess.Queue uses serialization should be documented. In-Reply-To: <1481726309.53.0.886951264774.issue28973@psf.upfronthosting.co.za> Message-ID: <1627945721.69.0.395220819513.issue28973@roundup.psfhosted.org> Irit Katriel added the comment: There is a note mentioning pickle in this section: https://docs.python.org/3/library/multiprocessing.html#pipes-and-queues It starts with "When an object is put on a queue, the object is pickled and..." A comment about the object ids can be added there. ---------- keywords: +easy nosy: +iritkatriel title: The fact that multiprocess.Queue uses serialization should be documented. -> [doc] The fact that multiprocess.Queue uses serialization should be documented. versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 19:28:31 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 02 Aug 2021 23:28:31 +0000 Subject: [issue44816] Folded constants do not trace correctly. Message-ID: <1627946911.28.0.590925278018.issue44816@roundup.psfhosted.org> New submission from Brandt Bucher : PEP 626 says that "all expressions and parts of expressions are considered to be executable code" for the purposes of tracing. However, folding constants at compile-time can lose or change tracing events. For example, these expressions (which can't be folded) generate events for two lines each: [ # <-- None # <-- ] ( # <-- foo, # <-- ) ( 1 # <-- / 0 # <-- ) ( 1 # <-- / bar # <-- ) While these (which are folded) only generate events for one line each: ( # <-- None, ) ( # <-- 1 / 42 ) Note that for the binary operation, a completely different line is traced in the optimized version. We should correctly generate events for lines which are "folded away". This *might* mean refusing to fold nodes in the AST optimizer if they span multiple lines, or including some sort of additional line-coverage metadata on the new Constant nodes to fill NOPs as appropriate (which I personally prefer). ---------- components: Interpreter Core messages: 398810 nosy: Mark.Shannon, brandtbucher priority: normal severity: normal status: open title: Folded constants do not trace correctly. type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 21:30:49 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 03 Aug 2021 01:30:49 +0000 Subject: [issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread In-Reply-To: <1615796616.26.0.51182574064.issue43498@roundup.psfhosted.org> Message-ID: <1627954249.28.0.41578222726.issue43498@roundup.psfhosted.org> Dennis Sweeney added the comment: It was mentioned in bpo-40327 that although copy() makes the situation much better, it doesn't solve the problem entirely, since the memory allocation of the copy() call can release the GIL. I don't know enough to know whether it would be worth it to add locking. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 21:55:08 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 03 Aug 2021 01:55:08 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627955708.12.0.0238078760188.issue44808@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- pull_requests: +26078 pull_request: https://github.com/python/cpython/pull/27571 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 21:56:42 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 03 Aug 2021 01:56:42 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627955802.49.0.541880460258.issue44808@roundup.psfhosted.org> Andrei Kulakov added the comment: Please disregard my last comment, I think I found a good way to fix it, the PR is up here: https://github.com/python/cpython/pull/27571/files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 22:17:30 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 02:17:30 +0000 Subject: [issue39091] _PyErr_CreateException() must check that the result is an exception (CPython Segfault in 5 lines of code) In-Reply-To: <1576694715.09.0.414064649134.issue39091@roundup.psfhosted.org> Message-ID: <1627957050.63.0.409451146169.issue39091@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26079 pull_request: https://github.com/python/cpython/pull/27572 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 22:17:36 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 02:17:36 +0000 Subject: [issue39091] _PyErr_CreateException() must check that the result is an exception (CPython Segfault in 5 lines of code) In-Reply-To: <1576694715.09.0.414064649134.issue39091@roundup.psfhosted.org> Message-ID: <1627957056.15.0.772785253194.issue39091@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26080 pull_request: https://github.com/python/cpython/pull/27573 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 2 22:17:33 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Tue, 03 Aug 2021 02:17:33 +0000 Subject: [issue39091] _PyErr_CreateException() must check that the result is an exception (CPython Segfault in 5 lines of code) In-Reply-To: <1576694715.09.0.414064649134.issue39091@roundup.psfhosted.org> Message-ID: <1627957053.45.0.789757819128.issue39091@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset 83ca46b7784b7357d82ec47b33295e09ed7380cb by Noah in branch 'main': closes bpo-39091: Fix segfault when Exception constructor returns non-exception for gen.throw. (#17658) https://github.com/python/cpython/commit/83ca46b7784b7357d82ec47b33295e09ed7380cb ---------- nosy: +benjamin.peterson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 01:24:11 2021 From: report at bugs.python.org (=?utf-8?q?Michael_F=C3=B6rderer?=) Date: Tue, 03 Aug 2021 05:24:11 +0000 Subject: [issue44817] os.path.realpath fails with WinError 161 Message-ID: <1627968251.97.0.10381933547.issue44817@roundup.psfhosted.org> New submission from Michael F?rderer : Using os.path.realpath(...) in the MVFS of Clearcase SCM (virtual file system) in Windows 10 a exception occures: X:\my_view\tools\python\3_8>python.exe Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.path.realpath('.') Traceback (most recent call last): File "X:\my_view\tools\python\3_8\lib\ntpath.py", line 647, in realpath path = _getfinalpathname(path) OSError: [WinError 87] Falscher Parameter: 'X:\\my_view\\tools\\python\\3_8\\.' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "X:\my_view\tools\python\3_8\lib\ntpath.py", line 651, in realpath path = _getfinalpathname_nonstrict(path) File "X:\my_view\tools\python\3_8\lib\ntpath.py", line 601, in _getfinalpathname_nonstrict path = _getfinalpathname(path) FileNotFoundError: [WinError 161] Der angegebene Pfadname ist ung?ltig: 'X:\\' >>> The error 161 (ERROR_BAD_PATHNAME) should also be ignored in _getfinalpathname_nonstrict. ---------- components: Library (Lib) messages: 398814 nosy: Spacetown priority: normal severity: normal status: open title: os.path.realpath fails with WinError 161 versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 01:41:08 2021 From: report at bugs.python.org (=?utf-8?q?Michael_F=C3=B6rderer?=) Date: Tue, 03 Aug 2021 05:41:08 +0000 Subject: [issue44817] os.path.realpath fails with WinError 161 In-Reply-To: <1627968251.97.0.10381933547.issue44817@roundup.psfhosted.org> Message-ID: <1627969268.12.0.380121292338.issue44817@roundup.psfhosted.org> Change by Michael F?rderer : ---------- keywords: +patch pull_requests: +26081 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27574 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 04:25:05 2021 From: report at bugs.python.org (Pooia) Date: Tue, 03 Aug 2021 08:25:05 +0000 Subject: [issue44818] '\t' (tab) support Message-ID: <1627979105.66.0.152787864247.issue44818@roundup.psfhosted.org> New submission from Pooia : Python can't use '\t' character. if I want fix it I will work a long time but a shorter fashion is replacing '\t' character with 4 space (by first clause of pep: 8) ---------- components: Parser messages: 398815 nosy: Pooia, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: '\t' (tab) support type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 06:10:06 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 03 Aug 2021 10:10:06 +0000 Subject: [issue44818] '\t' (tab) support In-Reply-To: <1627979105.66.0.152787864247.issue44818@roundup.psfhosted.org> Message-ID: <1627985406.97.0.946461520475.issue44818@roundup.psfhosted.org> Steven D'Aprano added the comment: I don't understand what you mean by "Python can't use '\t' character." Can you demonstrate an example? It works for me. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 06:11:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Aug 2021 10:11:05 +0000 Subject: [issue39091] _PyErr_CreateException() must check that the result is an exception (CPython Segfault in 5 lines of code) In-Reply-To: <1576694715.09.0.414064649134.issue39091@roundup.psfhosted.org> Message-ID: <1627985465.59.0.610577526856.issue39091@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8ce7f2f4ef04e19209f1dfd2a0cf50ddcd0e999f by Miss Islington (bot) in branch '3.10': bpo-39091: Fix segfault when Exception constructor returns non-exception for gen.throw. (GH-17658) (GH-27572) https://github.com/python/cpython/commit/8ce7f2f4ef04e19209f1dfd2a0cf50ddcd0e999f ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 06:11:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Aug 2021 10:11:05 +0000 Subject: [issue39091] _PyErr_CreateException() must check that the result is an exception (CPython Segfault in 5 lines of code) In-Reply-To: <1576694715.09.0.414064649134.issue39091@roundup.psfhosted.org> Message-ID: <1627985465.82.0.061651859737.issue39091@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0b551db04a99a97abb1e44a071c688c3ca704b67 by Miss Islington (bot) in branch '3.9': bpo-39091: Fix segfault when Exception constructor returns non-exception for gen.throw. (GH-17658) (GH-27573) https://github.com/python/cpython/commit/0b551db04a99a97abb1e44a071c688c3ca704b67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 07:01:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Aug 2021 11:01:30 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627988490.62.0.715492752963.issue27275@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8c9f847997196aa76500d1ae104cbe7fe2a467ed by Serhiy Storchaka in branch 'main': bpo-27275: Change popitem() and pop() methods of collections.OrderedDict (GH-27530) https://github.com/python/cpython/commit/8c9f847997196aa76500d1ae104cbe7fe2a467ed ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 07:25:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Aug 2021 11:25:55 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627989955.32.0.499037620105.issue27275@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 07:28:33 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 11:28:33 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627990113.34.0.14208570144.issue41737@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26083 pull_request: https://github.com/python/cpython/pull/27577 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 07:28:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Aug 2021 11:28:23 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627990103.11.0.125535475834.issue41737@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f7c23a99cd4f8179b6ba2cffaeb78b852c0f6488 by andrei kulakov in branch 'main': bpo-41737: expand doc for NotADirectoryError (GH-27471) https://github.com/python/cpython/commit/f7c23a99cd4f8179b6ba2cffaeb78b852c0f6488 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 07:28:27 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 11:28:27 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627990107.55.0.152944368783.issue41737@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26082 pull_request: https://github.com/python/cpython/pull/27576 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 07:36:57 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 03 Aug 2021 11:36:57 +0000 Subject: [issue18255] CPython setup.py problems In-Reply-To: <1371561186.46.0.280107378589.issue18255@psf.upfronthosting.co.za> Message-ID: <1627990617.12.0.226259621602.issue18255@roundup.psfhosted.org> Ronald Oussoren added the comment: This is no longer relevant now that distutils is deprecated. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 08:03:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Aug 2021 12:03:44 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627992224.31.0.623021811346.issue41737@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b5f026112768eb0a06622263bdea86d7d85981c5 by Miss Islington (bot) in branch '3.9': bpo-41737: expand doc for NotADirectoryError (GH-27471) (GH-27577) https://github.com/python/cpython/commit/b5f026112768eb0a06622263bdea86d7d85981c5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 08:05:08 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 12:05:08 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627992308.65.0.35854403167.issue41737@roundup.psfhosted.org> miss-islington added the comment: New changeset 84494db41902774ea6ac72e5b308b429850bbf71 by Miss Islington (bot) in branch '3.10': bpo-41737: expand doc for NotADirectoryError (GH-27471) https://github.com/python/cpython/commit/84494db41902774ea6ac72e5b308b429850bbf71 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 08:47:39 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 12:47:39 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627994859.6.0.896404951134.issue44808@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26084 pull_request: https://github.com/python/cpython/pull/27578 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 08:47:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Aug 2021 12:47:53 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627994873.4.0.977767021473.issue44808@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 58325971de0faf330c9c38269dae8315a0746e59 by andrei kulakov in branch 'main': bpo-44808: fixes test for interactive inspect getsource of a class (GH-27571) https://github.com/python/cpython/commit/58325971de0faf330c9c38269dae8315a0746e59 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 09:08:07 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 13:08:07 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627996087.15.0.243060552503.issue44808@roundup.psfhosted.org> miss-islington added the comment: New changeset bc2841c7a9fe2b05ef77ebdf77701188dc83b2ce by Miss Islington (bot) in branch '3.10': bpo-44808: fixes test for interactive inspect getsource of a class (GH-27571) https://github.com/python/cpython/commit/bc2841c7a9fe2b05ef77ebdf77701188dc83b2ce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 09:08:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Aug 2021 13:08:55 +0000 Subject: [issue44808] test_inspect fails in refleak mode In-Reply-To: <1627898150.7.0.730504757269.issue44808@roundup.psfhosted.org> Message-ID: <1627996135.61.0.755729502657.issue44808@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 09:29:45 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 03 Aug 2021 13:29:45 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? In-Reply-To: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> Message-ID: <1627997385.44.0.706264181002.issue44301@roundup.psfhosted.org> Petr Viktorin added the comment: You are missing m_free. The clear function is used to break reference counts. In this case, there are no reference counts to be broken, so it is not called. Your custom_clear function is idempotent, so you can use it in both free and clear and let Python call it either once or twice: .m_clear = custom_clear, .m_free = custom_clear, I agree that this is not at all clear from the documentation. I'm going to spend some time organizing the info around the GC API and writing it up. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 09:54:19 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 03 Aug 2021 13:54:19 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1627998859.17.0.379423487381.issue44756@roundup.psfhosted.org> Petr Viktorin added the comment: I'm one of those who disagree with "make html" suddenly downloading code from the internet and running it, but I guess I'm in a minority. I'll switch to using `sphinx-build` directly. Still, I'd have appreciated a heads-up notice. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 10:03:34 2021 From: report at bugs.python.org (Stephen Carboni) Date: Tue, 03 Aug 2021 14:03:34 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1627999414.25.0.285595957728.issue30256@roundup.psfhosted.org> Stephen Carboni added the comment: Just chiming in to say that this is still broken for me on Python 3.9.6, Win10/64: https://pastebin.com/64F2iKaj But, works for 3.10.0b4. ---------- nosy: +stephen.entropy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 10:08:54 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 03 Aug 2021 14:08:54 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1627999734.26.0.71236325117.issue30256@roundup.psfhosted.org> Ken Jin added the comment: > Just chiming in to say that this is still broken for me on Python 3.9.6 >From what I understand, the patch landed on 2021-07-02, 4 days after Python 3.9.6's release date of 2021-06-28, so it wasn't included. It should come in 3.9.7, which should be out on 2021-08-30 according to PEP 596. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 10:46:56 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Aug 2021 14:46:56 +0000 Subject: [issue34782] Pdb raises exception when code is executed in a mapping that does not define `__contains__` In-Reply-To: <1537738681.57.0.956365154283.issue34782@psf.upfronthosting.co.za> Message-ID: <1628002016.86.0.302153614282.issue34782@roundup.psfhosted.org> Serhiy Storchaka added the comment: You cannot expect that running code under debugger does not have any effect. Otherwise there would not be any meaning in debugger. Running code under debugger has some side effects, and setting locals __return__ and __exception__ is one of them. If it exposes bugs in user code -- well, it is a purpose of debugger. I think that there are two options for this issue. 1. Add a type check for locals in the frame constructor (and maybe at higher levels). 2. Close it as "not a bug". Using functions outside of documented scope has undefined behavior. Python usually does not check types of arguments. If it works -- it works, if not -- blame on you. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 10:51:01 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 03 Aug 2021 14:51:01 +0000 Subject: [issue44817] os.path.realpath fails with WinError 161 In-Reply-To: <1627968251.97.0.10381933547.issue44817@roundup.psfhosted.org> Message-ID: <1628002261.67.0.104859660481.issue44817@roundup.psfhosted.org> Change by Eryk Sun : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 11:10:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 03 Aug 2021 15:10:03 +0000 Subject: [issue34782] Pdb raises exception when code is executed in a mapping that does not define `__contains__` In-Reply-To: <1537738681.57.0.956365154283.issue34782@psf.upfronthosting.co.za> Message-ID: <1628003403.01.0.96562822583.issue34782@roundup.psfhosted.org> Irit Katriel added the comment: I think we should close this. It's not a problem you will come across if you're not looking for trouble, so there's no point trying to make the error message a little nicer. ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 11:15:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Aug 2021 15:15:29 +0000 Subject: [issue20703] RuntimeError caused by lazy imports in pdb In-Reply-To: <1392914840.47.0.865855778793.issue20703@psf.upfronthosting.co.za> Message-ID: <1628003729.0.0.654796024989.issue20703@roundup.psfhosted.org> Serhiy Storchaka added the comment: My concern about importing readline at the top of the module is that importing readline has a side effect. The only module which imports it unconditionally at the top is rlcompleter. In all other places it is imported lazily. And importing readline ahead may not fix the original issue, because there are other modules lazily imported in pdb: runpy, shlex, pydoc. Perhaps we should just say that sys.modules should not be iterated directly, you should first make a copy. There are other issues about RuntimeError raised during iterating sys.modules. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 11:18:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 03 Aug 2021 15:18:21 +0000 Subject: [issue20703] RuntimeError caused by lazy imports in pdb In-Reply-To: <1392914840.47.0.865855778793.issue20703@psf.upfronthosting.co.za> Message-ID: <1628003901.17.0.998387406425.issue20703@roundup.psfhosted.org> Irit Katriel added the comment: Can we make sys.modules automatically return an iterator that has a copy of its contents? Otherwise it's an odd API - it's iterable but we tell people not to iterate it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 11:19:19 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 03 Aug 2021 15:19:19 +0000 Subject: [issue44816] PEP 626 does not explain the handling of constants, at all. In-Reply-To: <1627946911.28.0.590925278018.issue44816@roundup.psfhosted.org> Message-ID: <1628003959.66.0.0363874624554.issue44816@roundup.psfhosted.org> Mark Shannon added the comment: This isn't a bug. Although PEP 626 is not at all clear about this. The key word in the PEP is "executed". Because compound and multi-line constants are constants, the parts of them are not "executed", but computed at compile time. Having re-read the PEP, this is as clear as mud :( I'll add a section to the PEP clarifying this. ---------- assignee: -> Mark.Shannon title: Folded constants do not trace correctly. -> PEP 626 does not explain the handling of constants, at all. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 11:29:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Aug 2021 15:29:09 +0000 Subject: [issue44818] '\t' (tab) support In-Reply-To: <1627979105.66.0.152787864247.issue44818@roundup.psfhosted.org> Message-ID: <1628004549.6.0.539077943736.issue44818@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 11:37:22 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 03 Aug 2021 15:37:22 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? In-Reply-To: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> Message-ID: <1628005042.45.0.788802760887.issue44301@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +26085 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27581 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 11:46:27 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 03 Aug 2021 15:46:27 +0000 Subject: [issue44817] os.path.realpath fails with WinError 161 In-Reply-To: <1627968251.97.0.10381933547.issue44817@roundup.psfhosted.org> Message-ID: <1628005587.18.0.725259386291.issue44817@roundup.psfhosted.org> Eryk Sun added the comment: It should also ignore ERROR_BAD_NETPATH (53). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 12:04:21 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 03 Aug 2021 16:04:21 +0000 Subject: [issue32397] textwrap output may change if you wrap a paragraph twice In-Reply-To: <1513865443.17.0.213398074469.issue32397@psf.upfronthosting.co.za> Message-ID: <1628006661.01.0.0697169356812.issue32397@roundup.psfhosted.org> Andrei Kulakov added the comment: I think fix to make `drop_whitespace=False` stable, can be as simple as adding two lines in `_munge_whitespace()`: + text = re.sub(r' \n', ' ', text) + text = re.sub(r'\n ', ' ', text) text = text.translate(self.unicode_whitespace_trans) The perf impact is not small though, 12% : 2892 (~/opensource/cpython) % ./python.exe -mtimeit 'import textwrap' 'textwrap.wrap("abc foo\nbar baz", 5)' --INS-- 5000 loops, best of 5: 60.2 usec per loop 2893 (~/opensource/cpython) % r --INS-- ./python.exe -mtimeit 'import textwrap' 'textwrap.wrap("abc foo\nbar baz", 5)' 5000 loops, best of 5: 52.9 usec per loop I don't know if it's worth doing, but if yes, the options are: - just add this change for drop_whitespace=False, which is not the default, so perf regression will not affect default usage of wrap. - add a new arg that will only have effect when drop_whitespace=False, and will run these 2 lines. Name could be something like `collapse_space_newline`. It's hard to think of a good name. If '\r\n' is handled, it needs one additional `sub()` line, and the perf. difference is 22%. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 12:05:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Aug 2021 16:05:14 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1628006714.29.0.82296394457.issue43468@roundup.psfhosted.org> Serhiy Storchaka added the comment: > It should use "(id(instance), instance)" rather than just "instance" as the key. It should use a dict with id(instance) as a key and instance as value. An instance can be non-hashable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 12:30:58 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 03 Aug 2021 16:30:58 +0000 Subject: [issue44816] PEP 626 does not explain the handling of constants, at all. In-Reply-To: <1627946911.28.0.590925278018.issue44816@roundup.psfhosted.org> Message-ID: <1628008258.55.0.71570824225.issue44816@roundup.psfhosted.org> Brandt Bucher added the comment: Thanks for clarifying. I'm worried, though, that the PEP's emphasis on "*all* lines of code executed and *only* for lines of code that are executed" could be problematic for other optimizations we perform. Consider: if ( # <-- True # <-- ): pass # <-- I understand why lines 1 and 4 are covered, since PEP 626 defines "if" and "pass" keywords as executable code. But line 2 isn't executed at runtime (it's peepholed into a NOP)... is it a bug that it creates a line event? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:06:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 03 Aug 2021 17:06:55 +0000 Subject: [issue32397] textwrap output may change if you wrap a paragraph twice In-Reply-To: <1513865443.17.0.213398074469.issue32397@psf.upfronthosting.co.za> Message-ID: <1628010415.99.0.131290058933.issue32397@roundup.psfhosted.org> Irit Katriel added the comment: You should be able to do them in one re, something like text = re.sub(r' ?\n', ' ', text) ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:11:57 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 03 Aug 2021 17:11:57 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628010717.32.0.994143195311.issue44756@roundup.psfhosted.org> Jack DeVries added the comment: @petr.viktorin a whatsnew entry was added, what more notice could have been provided? I have an idea for an alternative that might be better. What if ``make clean`` deletes and restores the venv only if it already existed in the first place? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:18:03 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 03 Aug 2021 17:18:03 +0000 Subject: [issue41886] PyType_Type is documented incorrectly In-Reply-To: <1601413083.05.0.277057194365.issue41886@roundup.psfhosted.org> Message-ID: <1628011083.95.0.277500941823.issue41886@roundup.psfhosted.org> Change by Ammar Askar : ---------- versions: +Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:21:29 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 03 Aug 2021 17:21:29 +0000 Subject: [issue41886] PyType_Type is documented incorrectly In-Reply-To: <1601413083.05.0.277057194365.issue41886@roundup.psfhosted.org> Message-ID: <1628011289.24.0.0863062795828.issue41886@roundup.psfhosted.org> Ammar Askar added the comment: New changeset ac811f9b5a68ce8756911ef2c8be83b46696018f by da-woods in branch 'main': bpo-41886: Fix documented type of PyType_Type (GH-22454) https://github.com/python/cpython/commit/ac811f9b5a68ce8756911ef2c8be83b46696018f ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:22:56 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 17:22:56 +0000 Subject: [issue41886] PyType_Type is documented incorrectly In-Reply-To: <1601413083.05.0.277057194365.issue41886@roundup.psfhosted.org> Message-ID: <1628011376.24.0.517530867931.issue41886@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26086 pull_request: https://github.com/python/cpython/pull/27583 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:26:06 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 17:26:06 +0000 Subject: [issue41886] PyType_Type is documented incorrectly In-Reply-To: <1601413083.05.0.277057194365.issue41886@roundup.psfhosted.org> Message-ID: <1628011566.49.0.805809921074.issue41886@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26087 pull_request: https://github.com/python/cpython/pull/27584 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:46:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Aug 2021 17:46:04 +0000 Subject: [issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec In-Reply-To: <1627801738.44.0.278142498011.issue44801@roundup.psfhosted.org> Message-ID: <1628012764.61.0.155590008376.issue44801@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you Ken Jin. So the problem is the __args__ (x, str) is interpreted differently depending on x, and after substituting x the interpretation can be changed. If x was ParamSpec, it was interpreted in one way, but if it becomes int, it is now interpreted in other way. The solution is to forbid substitution of P with wrong values (not parameters expression). Some normalization is also needed, before and after substitution. Other related example is: >>> from typing import * >>> P = ParamSpec("P") >>> class Z(Generic[P]): pass ... >>> A = Z[[int]] >>> B = Z[int] >>> A __main__.Z[(,)] >>> B __main__.Z[int] >>> A.__args__ ((,),) >>> B.__args__ (,) It is expected that A and B should the same. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:48:17 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 17:48:17 +0000 Subject: [issue41886] PyType_Type is documented incorrectly In-Reply-To: <1601413083.05.0.277057194365.issue41886@roundup.psfhosted.org> Message-ID: <1628012897.17.0.871453141968.issue41886@roundup.psfhosted.org> miss-islington added the comment: New changeset f26fec4f74ae7da972595703bc39d3d30b8cfdf9 by Miss Islington (bot) in branch '3.9': bpo-41886: Fix documented type of PyType_Type (GH-22454) https://github.com/python/cpython/commit/f26fec4f74ae7da972595703bc39d3d30b8cfdf9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:50:33 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 03 Aug 2021 17:50:33 +0000 Subject: [issue41886] PyType_Type is documented incorrectly In-Reply-To: <1601413083.05.0.277057194365.issue41886@roundup.psfhosted.org> Message-ID: <1628013033.43.0.59416410647.issue41886@roundup.psfhosted.org> miss-islington added the comment: New changeset 952aa31c89f70d3c53596449bd2ed9a4817a2364 by Miss Islington (bot) in branch '3.10': bpo-41886: Fix documented type of PyType_Type (GH-22454) https://github.com/python/cpython/commit/952aa31c89f70d3c53596449bd2ed9a4817a2364 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:51:54 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 03 Aug 2021 17:51:54 +0000 Subject: [issue41886] PyType_Type is documented incorrectly In-Reply-To: <1601413083.05.0.277057194365.issue41886@roundup.psfhosted.org> Message-ID: <1628013114.41.0.677589690154.issue41886@roundup.psfhosted.org> Ammar Askar added the comment: Thank you for spotting this and the patch da-woods! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:53:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 03 Aug 2021 17:53:12 +0000 Subject: [issue32397] textwrap output may change if you wrap a paragraph twice In-Reply-To: <1513865443.17.0.213398074469.issue32397@psf.upfronthosting.co.za> Message-ID: <1628013192.27.0.601030918266.issue32397@roundup.psfhosted.org> Andrei Kulakov added the comment: Irit: I assume you mean r' \r?\n', that's a great idea, it's much faster than adding a separate replacement step. Latest version I came up with is this: if re.search(r' \r?\n', text): text = re.sub(r' \r?\n', ' ', text) if re.search(r'\r?\n ', text): text = re.sub(r'\r?\n ', ' ', text) This optimizes the case when there's no newlines, which is likely the most common case for small fragments of text, but it may be the less common case for larger fragments where performance is more important; so I'm not sure if it's worth it. Timings: # sub() has to run 2904 (~/opensource/cpython) % ./python.exe -mtimeit 'import textwrap' 'textwrap.wrap("abc foo\n bar baz", 5)' ----VICMD---- 5000 loops, best of 5: 67.6 usec per loop # search() runs; but sub() does NOT because there's no adjacent space 2906 (~/opensource/cpython) % ./python.exe -mtimeit 'import textwrap' 'textwrap.wrap("abc foo\nbar baz", 5)' ----VICMD---- 5000 loops, best of 5: 60.3 usec per loop ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:54:40 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 03 Aug 2021 17:54:40 +0000 Subject: [issue32397] textwrap output may change if you wrap a paragraph twice In-Reply-To: <1513865443.17.0.213398074469.issue32397@psf.upfronthosting.co.za> Message-ID: <1628013280.36.0.916092932653.issue32397@roundup.psfhosted.org> Andrei Kulakov added the comment: Note that I'm not handling a single '\r' because that was before Mac OS X; but it is handled by the following line (i.e. by the old logic): text = text.translate(self.unicode_whitespace_trans) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 13:57:31 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 03 Aug 2021 17:57:31 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628013451.93.0.136113039918.issue44756@roundup.psfhosted.org> Jack DeVries added the comment: Actually, I tested out that idea (https://github.com/python/cpython/compare/main...jdevries3133:bpo-44756-doc-make), and I don't think its as nice of a solution. I think it is valuable for new contributors to be able to type "make html" and have it work. Look at how much the change simplifies the README for new contributors to setup their documentation build toolchain. Then, look at how many ``docs at python`` open issues there are. We need documentation contributors, and there is value in simplifying the process for them. Additionally, this is the extent of the "downloading code from the internet and running it" that occurs:: pip install -U pip setuptools pip install sphynx blurb python-docs-theme If running that is ever unsafe, we have big problems! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 14:12:53 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 03 Aug 2021 18:12:53 +0000 Subject: [issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec In-Reply-To: <1627801738.44.0.278142498011.issue44801@roundup.psfhosted.org> Message-ID: <1628014373.3.0.167917763078.issue44801@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26088 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27585 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 14:54:24 2021 From: report at bugs.python.org (Terence Honles) Date: Tue, 03 Aug 2021 18:54:24 +0000 Subject: [issue43874] argparse crashes on subparsers with no dest/metava In-Reply-To: <1618600066.88.0.240618154113.issue43874@roundup.psfhosted.org> Message-ID: <1628016864.94.0.53859564947.issue43874@roundup.psfhosted.org> Terence Honles added the comment: Closing as a duplicate of https://bugs.python.org/issue29298 (which was recently merged and caused conflicts with my patch) ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 16:24:17 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 03 Aug 2021 20:24:17 +0000 Subject: [issue44037] Broad performance regression from 3.10a7 to 3.10b2 with python.org macOS binaries In-Reply-To: <1620152354.35.0.099245224395.issue44037@roundup.psfhosted.org> Message-ID: <1628022257.43.0.868051590682.issue44037@roundup.psfhosted.org> Ned Deily added the comment: Summary: With the 3.10.0rc1 release, this performance regression in the var_access_benchmark starting with the 3.10.0b1 binaries in the python.org macOS universal2 installer is now resolved. With the rc1 release, the performance of this micro benchmark has actually improved over alpha7 in many cases, most notably on Intel Macs. We have also taken some steps to reduce the chances of significant performance regressions in future releases of the macOS binaries going undetected prior to release. Details: All var_access_benchmark results (Appendix A and B) are from running macOS Big Sur 11.5.1 (the current release at the moment). The rc1 binaries were also built on 11.5.1 using the current Apple (Xcode) Command Line Tools 12.5.1. In general, we build the python.org macOS installers on the most current macOS and Command Line Tools that have been released by Apple prior to that Python release. The a7 and b2 released universal2 binaries were thus made on then current versions of macOS Big Sur and the Command Line Tools, each different from rc1. To put these results in context, let me once again note that the primary goal of the python.org macOS installers for many years has been to provide a convenient way to run Python on macOS on as many different Mac systems as possible with one download. For 3.10, the universal2 installer variant we provide is designed to run natively on all Macs that can run any version of macOS from 10.9 through the current macOS 11 Big Sur (and soon to include macOS 12 Monterey), both Intel and Apple Silicon (M1) Macs. To be able to run on such a wide variety of systems obviously requires some compromises. Thus providing optimum performance in every situation has *never* been a goal for these installers. That doesn't mean we should totally ignore performance issues and I am grateful to Raymond for bringing this issue forward. But, and not to belabor the point: for those situations where optimum performance is important, there is no substitute to using a Python built and optimized explicitly for that environment; in other words, don't look to the python.org binaries for those cases. As an example, with 3.10.0b1, we introduced the first python.org macOS builds that use newer compile- and link-time optimizations (--enable-optimizations and --with-lto). There were some kinks with that that have been subsequently ironed out. But the performance improvements aren't uniform across all systems. It appears that Intel Macs see much more of an improvement than Apple Silicon Macs do. There are probably a couple of reasons for that: for one, the longer experience with the tool chain for Intel archs, but, perhaps more importantly, we currently build universal2 binaries on Intel-based Macs which means performance-based optimizations by the tool chain are based on the performance on an Intel arch which may not be the same as performance on an Apple Silicon (arm64) CPU. That's a topic for future investigation but it is an example of the potential pitfalls when looking at performance. Another example is that while there are some significant differences in the var_access_benchmark results, which targets specific micro-operations in the Python virtual machine, there is a different story looking at the larger-scale "realworld" benchmarks in the pyperformance package. When I first started looking at this issue, I ran pyperformance and var_access_benchmark and found that, in general, there were *significant* performance improvements in most pyperformance benchmarks between 3.10.0a7 and 3.10.0b2 even though the var_access_benchmark showed performance regressions. For 3.10.0rc1, the pyperformance results have mostly improved even more. I have with some trepidation included some pyperformance results in Appendix C (3.10.0a7 vs 3.10.0b2) and Appendix D (3.10.0a7 vs 3.10.0rc1). Note that these results were run on a different, faster Intel Mac than the var_access_benchmark results and were run under different updates of macOS 11 so they should be viewed cautiously; as always with performance issues, your mileage may vary. So by now, one might be curious as to how the performance regression was fixed in rc1. The answer at the moment is: I'm not totally sure! There are a *lot* of moving parts in making a Python release and the binaries that we provide for macOS. While I do try to control the build environments as much as possible (for example, by using dedicated virtual machines for builds) and be conservative about making changes to the build process and environments, especially later in a development/release cycle, as noted above I normally try to keep up with the most recent Apple updates to a given macOS version and build tools to ensure everyone is getting the benefit of the latest security and performance fixes. There have been Apple updates along the way between a7, b2, and rc1. So I can't rule those out and at the moment seem to me to be the most likely. I have put quite a bit of effort into trying to reproduce these results by rebuilding the previous Python pre-releases on newer macOS updates and vice versa but with inconclusive results. I am also handwaving over the special requirements to produce macOS binaries that can be widely-distributed and easily-installed, such as those needed to meet Apple's Gatekeeper requirements (code-signing, hardened runtime, notarization, etc) that have become increasingly stringent (with good reason in an effort to increase overall system security); these can have a performance impact as well. There certainly might be other causes (including operator error) but I don't think there is much to be gained by further pursuing these lines. Instead, I have added some additional steps to our macOS installer manufacturing process to now run var_access_benchmark as part of the installer testing we do on multiple systems for every release and also to run the lengthier pyperformance benchmarks at key points in a release cycle. Thanks to this issue, we now have some baseline measurements and, with some due diligence, we should be able to catch future significant regressions earlier in a release, unlike up to now where we have basically ignored performance concerns. That's a good thing, I think! ----------------------------------------------------------------- Appendix A: =========== python.org macOS universal2: 3.10.0a7 vs 3.10.0b2 vs 3.10.0rc1 Intel Mac Mini (3Ghz 6-Core Intel Core i5) macOS Big Sur 11.5.1 alpha7 beta2 rc1 ====== ====== ====== Variable and attribute read access: read_local 3.6 ns 4.9 ns 3.3 ns read_nonlocal 3.8 ns 4.5 ns 3.5 ns read_global 5.6 ns 6.0 ns 5.2 ns read_builtin 5.6 ns 6.1 ns 5.3 ns read_classvar_from_class 16.1 ns 16.6 ns 14.3 ns read_classvar_from_instance 14.9 ns 15.6 ns 13.5 ns read_instancevar 13.6 ns 12.3 ns 10.7 ns read_instancevar_slots 7.6 ns 8.9 ns 8.2 ns read_namedtuple 18.0 ns 17.4 ns 15.8 ns read_boundmethod 38.0 ns 33.5 ns 34.0 ns Variable and attribute write access: write_local 4.3 ns 4.6 ns 3.8 ns write_nonlocal 4.1 ns 4.8 ns 3.9 ns write_global 13.9 ns 13.5 ns 13.2 ns write_classvar 35.4 ns 33.4 ns 34.6 ns write_instancevar 34.5 ns 30.3 ns 27.3 ns write_instancevar_slots 22.7 ns 23.7 ns 20.8 ns Data structure read access: read_list 17.6 ns 20.4 ns 16.8 ns read_deque 19.1 ns 19.8 ns 17.1 ns read_dict 19.5 ns 17.5 ns 15.7 ns read_strdict 16.6 ns 16.8 ns 14.8 ns Data structure write access: write_list 17.8 ns 20.1 ns 18.2 ns write_deque 21.5 ns 22.0 ns 20.7 ns write_dict 24.0 ns 21.5 ns 19.2 ns write_strdict 21.8 ns 20.5 ns 18.9 ns Stack (or queue) operations: list_append_pop 46.2 ns 42.4 ns 39.3 ns deque_append_pop 40.3 ns 37.8 ns 31.9 ns deque_append_popleft 40.9 ns 37.8 ns 32.2 ns Timing loop overhead: loop_overhead 0.3 ns 0.3 ns 0.2 ns ----------------------------------------------------------------- Appendix B: =========== python.org macOS universal2: 3.10.0a7 vs 3.10.0b2 vs 3.10.0rc1 Apple Silicon MacBook Air (Apple M1 2020) macOS Big Sur 11.5.1 alpha7 beta2 rc1 ====== ====== ====== Variable and attribute read access: read_local 4.1 ns 4.9 ns 4.1 ns read_nonlocal 4.1 ns 4.5 ns 4.1 ns read_global 4.2 ns 5.2 ns 4.1 ns read_builtin 4.2 ns 4.9 ns 4.1 ns read_classvar_from_class 10.2 ns 12.6 ns 10.7 ns read_classvar_from_instance 9.5 ns 12.0 ns 9.5 ns read_instancevar 9.3 ns 11.3 ns 9.5 ns read_instancevar_slots 5.7 ns 8.7 ns 6.6 ns read_namedtuple 11.4 ns 14.2 ns 11.8 ns read_boundmethod 23.9 ns 23.1 ns 21.3 ns Variable and attribute write access: write_local 4.1 ns 5.2 ns 4.1 ns write_nonlocal 4.1 ns 5.1 ns 4.1 ns write_global 9.5 ns 10.1 ns 8.7 ns write_classvar 22.1 ns 25.5 ns 25.7 ns write_instancevar 21.5 ns 21.2 ns 18.6 ns write_instancevar_slots 15.9 ns 17.6 ns 15.3 ns Data structure read access: read_list 10.3 ns 14.1 ns 11.0 ns read_deque 11.1 ns 15.6 ns 11.9 ns read_dict 12.1 ns 13.4 ns 11.0 ns read_strdict 10.8 ns 13.4 ns 10.9 ns Data structure write access: write_list 12.5 ns 16.3 ns 12.8 ns write_deque 12.7 ns 16.8 ns 13.5 ns write_dict 15.4 ns 16.6 ns 13.9 ns write_strdict 14.8 ns 17.1 ns 13.8 ns Stack (or queue) operations: list_append_pop 27.5 ns 29.0 ns 24.6 ns deque_append_pop 25.3 ns 26.0 ns 21.6 ns deque_append_popleft 25.2 ns 26.4 ns 21.6 ns Timing loop overhead: loop_overhead 0.2 ns 0.3 ns 0.2 ns ----------------------------------------------------------------- Appendix C: =========== pyperformance (python.org macOS universal2: 3.10.0a7 vs 3.10.0b2) Intel iMac (3.6 GHz 8-Core Intel Core i9) py310a7_11.json =============== Performance version: 1.0.2 Report on macOS-11.3.1-x86_64-i386-64bit Number of logical CPUs: 16 Start date: 2021-05-25 23:21:49.171748 End date: 2021-05-25 23:41:48.281555 py310b2_11.json =============== Performance version: 1.0.2 Report on macOS-11.4-x86_64-i386-64bit Number of logical CPUs: 16 Start date: 2021-05-31 11:11:51.120522 End date: 2021-05-31 11:31:17.010744 ### 2to3 ### Mean +- std dev: 404 ms +- 46 ms -> 334 ms +- 28 ms: 1.21x faster Significant (t=9.99) ### chameleon ### Mean +- std dev: 10.8 ms +- 0.2 ms -> 8.8 ms +- 0.2 ms: 1.23x faster Significant (t=62.03) ### chaos ### Mean +- std dev: 130 ms +- 1 ms -> 103 ms +- 2 ms: 1.27x faster Significant (t=95.95) ### crypto_pyaes ### Mean +- std dev: 136 ms +- 1 ms -> 112 ms +- 2 ms: 1.21x faster Significant (t=74.54) ### deltablue ### Mean +- std dev: 9.26 ms +- 0.12 ms -> 7.03 ms +- 0.15 ms: 1.32x faster Significant (t=87.77) ### django_template ### Mean +- std dev: 60.1 ms +- 1.1 ms -> 45.6 ms +- 1.0 ms: 1.32x faster Significant (t=75.49) ### dulwich_log ### Mean +- std dev: 109 ms +- 1 ms -> 93 ms +- 2 ms: 1.17x faster Significant (t=57.00) ### fannkuch ### Mean +- std dev: 524 ms +- 3 ms -> 476 ms +- 5 ms: 1.10x faster Significant (t=63.67) ### float ### Mean +- std dev: 119 ms +- 2 ms -> 96 ms +- 2 ms: 1.24x faster Significant (t=59.37) ### go ### Mean +- std dev: 260 ms +- 2 ms -> 217 ms +- 4 ms: 1.20x faster Significant (t=77.33) ### hexiom ### Mean +- std dev: 11.0 ms +- 0.1 ms -> 9.0 ms +- 0.1 ms: 1.23x faster Significant (t=94.06) ### json_dumps ### Mean +- std dev: 15.1 ms +- 0.1 ms -> 12.1 ms +- 0.3 ms: 1.25x faster Significant (t=74.07) ### json_loads ### Mean +- std dev: 30.9 us +- 0.3 us -> 23.8 us +- 0.4 us: 1.30x faster Significant (t=116.60) ### logging_format ### Mean +- std dev: 12.1 us +- 0.2 us -> 9.4 us +- 0.2 us: 1.28x faster Significant (t=72.96) ### logging_silent ### Mean +- std dev: 218 ns +- 6 ns -> 159 ns +- 8 ns: 1.36x faster Significant (t=46.17) ### logging_simple ### Mean +- std dev: 11.0 us +- 0.2 us -> 8.4 us +- 0.2 us: 1.31x faster Significant (t=77.65) ### mako ### Mean +- std dev: 18.9 ms +- 0.4 ms -> 14.7 ms +- 0.2 ms: 1.29x faster Significant (t=78.98) ### meteor_contest ### Mean +- std dev: 108 ms +- 1 ms -> 96 ms +- 2 ms: 1.13x faster Significant (t=48.25) ### nbody ### Mean +- std dev: 159 ms +- 2 ms -> 139 ms +- 3 ms: 1.15x faster Significant (t=41.09) ### nqueens ### Mean +- std dev: 116 ms +- 1 ms -> 98 ms +- 2 ms: 1.18x faster Significant (t=72.36) ### pathlib ### Mean +- std dev: 51.5 ms +- 0.8 ms -> 44.1 ms +- 0.9 ms: 1.17x faster Significant (t=48.46) ### pickle ### Mean +- std dev: 12.1 us +- 0.1 us -> 9.3 us +- 0.2 us: 1.30x faster Significant (t=94.04) ### pickle_dict ### Mean +- std dev: 28.6 us +- 0.1 us -> 21.7 us +- 0.3 us: 1.32x faster Significant (t=167.94) ### pickle_list ### Mean +- std dev: 4.55 us +- 0.04 us -> 3.59 us +- 0.07 us: 1.27x faster Significant (t=94.87) ### pickle_pure_python ### Mean +- std dev: 547 us +- 4 us -> 424 us +- 11 us: 1.29x faster Significant (t=78.84) ### pidigits ### Mean +- std dev: 183 ms +- 1 ms -> 172 ms +- 2 ms: 1.07x faster Significant (t=38.00) ### pyflate ### Mean +- std dev: 782 ms +- 8 ms -> 634 ms +- 9 ms: 1.23x faster Significant (t=100.31) ### python_startup ### Mean +- std dev: 14.4 ms +- 0.1 ms -> 13.5 ms +- 0.4 ms: 1.07x faster Significant (t=32.46) ### python_startup_no_site ### Mean +- std dev: 10.7 ms +- 0.1 ms -> 10.1 ms +- 0.1 ms: 1.06x faster Significant (t=58.48) ### raytrace ### Mean +- std dev: 616 ms +- 4 ms -> 452 ms +- 6 ms: 1.36x faster Significant (t=174.57) ### regex_compile ### Mean +- std dev: 197 ms +- 2 ms -> 165 ms +- 3 ms: 1.19x faster Significant (t=67.90) ### regex_dna ### Mean +- std dev: 174 ms +- 1 ms -> 170 ms +- 3 ms: 1.02x faster Not significant ### regex_effbot ### Mean +- std dev: 3.28 ms +- 0.03 ms -> 3.07 ms +- 0.06 ms: 1.07x faster Significant (t=26.18) ### regex_v8 ### Mean +- std dev: 26.0 ms +- 0.2 ms -> 23.1 ms +- 0.2 ms: 1.13x faster Significant (t=78.18) ### richards ### Mean +- std dev: 91.2 ms +- 0.8 ms -> 67.2 ms +- 2.2 ms: 1.36x faster Significant (t=80.61) ### scimark_fft ### Mean +- std dev: 498 ms +- 4 ms -> 373 ms +- 6 ms: 1.34x faster Significant (t=140.60) ### scimark_lu ### Mean +- std dev: 194 ms +- 2 ms -> 155 ms +- 2 ms: 1.25x faster Significant (t=88.27) ### scimark_monte_carlo ### Mean +- std dev: 120 ms +- 1 ms -> 94 ms +- 2 ms: 1.28x faster Significant (t=79.90) ### scimark_sor ### Mean +- std dev: 231 ms +- 1 ms -> 179 ms +- 4 ms: 1.29x faster Significant (t=88.38) ### scimark_sparse_mat_mult ### Mean +- std dev: 7.31 ms +- 0.19 ms -> 5.11 ms +- 0.10 ms: 1.43x faster Significant (t=79.51) ### spectral_norm ### Mean +- std dev: 186 ms +- 3 ms -> 139 ms +- 3 ms: 1.34x faster Significant (t=93.33) ### sqlalchemy_declarative ### Mean +- std dev: 165 ms +- 3 ms -> 144 ms +- 3 ms: 1.15x faster Significant (t=37.78) ### sqlalchemy_imperative ### Mean +- std dev: 26.2 ms +- 0.8 ms -> 22.9 ms +- 0.6 ms: 1.14x faster Significant (t=24.65) ### sqlite_synth ### Mean +- std dev: 2.98 us +- 0.04 us -> 2.52 us +- 0.06 us: 1.19x faster Significant (t=47.11) ### sympy_expand ### Mean +- std dev: 615 ms +- 6 ms -> 521 ms +- 10 ms: 1.18x faster Significant (t=63.67) ### sympy_integrate ### Mean +- std dev: 25.5 ms +- 0.3 ms -> 23.1 ms +- 0.4 ms: 1.10x faster Significant (t=38.96) ### sympy_str ### Mean +- std dev: 366 ms +- 4 ms -> 316 ms +- 4 ms: 1.16x faster Significant (t=61.03) ### sympy_sum ### Mean +- std dev: 204 ms +- 3 ms -> 186 ms +- 8 ms: 1.10x faster Significant (t=16.06) ### telco ### Mean +- std dev: 7.40 ms +- 0.15 ms -> 5.91 ms +- 0.13 ms: 1.25x faster Significant (t=57.40) ### tornado_http ### Mean +- std dev: 167 ms +- 4 ms -> 157 ms +- 5 ms: 1.07x faster Significant (t=13.39) ### unpack_sequence ### Mean +- std dev: 47.3 ns +- 2.7 ns -> 61.4 ns +- 0.5 ns: 1.30x slower Significant (t=-40.46) ### unpickle ### Mean +- std dev: 17.4 us +- 0.2 us -> 13.7 us +- 0.2 us: 1.27x faster Significant (t=91.92) ### unpickle_list ### Mean +- std dev: 4.73 us +- 0.07 us -> 3.93 us +- 0.10 us: 1.21x faster Significant (t=49.78) ### unpickle_pure_python ### Mean +- std dev: 365 us +- 7 us -> 311 us +- 4 us: 1.18x faster Significant (t=51.04) ### xml_etree_generate ### Mean +- std dev: 103 ms +- 2 ms -> 89 ms +- 1 ms: 1.15x faster Significant (t=48.39) ### xml_etree_iterparse ### Mean +- std dev: 115 ms +- 3 ms -> 101 ms +- 2 ms: 1.14x faster Significant (t=29.21) ### xml_etree_parse ### Mean +- std dev: 158 ms +- 3 ms -> 145 ms +- 3 ms: 1.09x faster Significant (t=24.41) ### xml_etree_process ### Mean +- std dev: 85.5 ms +- 1.8 ms -> 70.4 ms +- 1.1 ms: 1.22x faster Significant (t=55.52) ----------------------------------------------------------------- Appendix D: =========== pyperformance (python.org macOS universal2: 3.10.0a7 vs 3.10.0rc1) Intel iMac (3.6 GHz 8-Core Intel Core i9) py310a7_11.json =============== Performance version: 1.0.2 Report on macOS-11.3.1-x86_64-i386-64bit Number of logical CPUs: 16 Start date: 2021-05-25 23:21:49.171748 End date: 2021-05-25 23:41:48.281555 py310rc1.json ============= Performance version: 1.0.2 Report on macOS-11.5.1-x86_64-i386-64bit Number of logical CPUs: 16 Start date: 2021-08-02 18:43:01.388887 End date: 2021-08-02 19:01:56.172079 ### 2to3 ### Mean +- std dev: 404 ms +- 46 ms -> 314 ms +- 24 ms: 1.29x faster Significant (t=13.40) ### chameleon ### Mean +- std dev: 10.8 ms +- 0.2 ms -> 8.5 ms +- 0.1 ms: 1.28x faster Significant (t=78.99) ### chaos ### Mean +- std dev: 130 ms +- 1 ms -> 95 ms +- 1 ms: 1.37x faster Significant (t=143.64) ### crypto_pyaes ### Mean +- std dev: 136 ms +- 1 ms -> 109 ms +- 1 ms: 1.24x faster Significant (t=136.81) ### deltablue ### Mean +- std dev: 9.26 ms +- 0.12 ms -> 6.76 ms +- 0.13 ms: 1.37x faster Significant (t=108.53) ### django_template ### Mean +- std dev: 60.1 ms +- 1.1 ms -> 44.3 ms +- 0.9 ms: 1.36x faster Significant (t=84.30) ### dulwich_log ### Mean +- std dev: 109 ms +- 1 ms -> 91 ms +- 2 ms: 1.19x faster Significant (t=65.99) ### fannkuch ### Mean +- std dev: 524 ms +- 3 ms -> 444 ms +- 5 ms: 1.18x faster Significant (t=114.93) ### float ### Mean +- std dev: 119 ms +- 2 ms -> 93 ms +- 2 ms: 1.28x faster Significant (t=62.91) ### go ### Mean +- std dev: 260 ms +- 2 ms -> 204 ms +- 3 ms: 1.27x faster Significant (t=119.49) ### hexiom ### Mean +- std dev: 11.0 ms +- 0.1 ms -> 8.5 ms +- 0.2 ms: 1.29x faster Significant (t=80.26) ### json_dumps ### Mean +- std dev: 15.1 ms +- 0.1 ms -> 12.0 ms +- 0.2 ms: 1.27x faster Significant (t=91.36) ### json_loads ### Mean +- std dev: 30.9 us +- 0.3 us -> 23.2 us +- 0.4 us: 1.34x faster Significant (t=132.63) ### logging_format ### Mean +- std dev: 12.1 us +- 0.2 us -> 9.2 us +- 0.2 us: 1.31x faster Significant (t=84.91) ### logging_silent ### Mean +- std dev: 218 ns +- 6 ns -> 151 ns +- 4 ns: 1.44x faster Significant (t=74.47) ### logging_simple ### Mean +- std dev: 11.0 us +- 0.2 us -> 8.3 us +- 0.2 us: 1.33x faster Significant (t=79.84) ### mako ### Mean +- std dev: 18.9 ms +- 0.4 ms -> 14.1 ms +- 0.3 ms: 1.34x faster Significant (t=81.37) ### meteor_contest ### Mean +- std dev: 108 ms +- 1 ms -> 92 ms +- 1 ms: 1.18x faster Significant (t=72.28) ### nbody ### Mean +- std dev: 159 ms +- 2 ms -> 120 ms +- 3 ms: 1.32x faster Significant (t=96.54) ### nqueens ### Mean +- std dev: 116 ms +- 1 ms -> 94 ms +- 1 ms: 1.23x faster Significant (t=106.68) ### pathlib ### Mean +- std dev: 51.5 ms +- 0.8 ms -> 46.5 ms +- 0.8 ms: 1.11x faster Significant (t=33.82) ### pickle ### Mean +- std dev: 12.1 us +- 0.1 us -> 9.5 us +- 0.2 us: 1.28x faster Significant (t=110.62) ### pickle_dict ### Mean +- std dev: 28.6 us +- 0.1 us -> 21.5 us +- 0.3 us: 1.33x faster Significant (t=176.35) ### pickle_list ### Mean +- std dev: 4.55 us +- 0.04 us -> 3.62 us +- 0.08 us: 1.26x faster Significant (t=82.58) ### pickle_pure_python ### Mean +- std dev: 547 us +- 4 us -> 402 us +- 8 us: 1.36x faster Significant (t=130.95) ### pidigits ### Mean +- std dev: 183 ms +- 1 ms -> 172 ms +- 2 ms: 1.07x faster Significant (t=35.90) ### pyflate ### Mean +- std dev: 782 ms +- 8 ms -> 598 ms +- 8 ms: 1.31x faster Significant (t=127.68) ### python_startup ### Mean +- std dev: 14.4 ms +- 0.1 ms -> 13.2 ms +- 0.3 ms: 1.09x faster Significant (t=46.93) ### python_startup_no_site ### Mean +- std dev: 10.7 ms +- 0.1 ms -> 10.2 ms +- 0.2 ms: 1.05x faster Significant (t=42.58) ### raytrace ### Mean +- std dev: 616 ms +- 4 ms -> 434 ms +- 7 ms: 1.42x faster Significant (t=172.50) ### regex_compile ### Mean +- std dev: 197 ms +- 2 ms -> 159 ms +- 2 ms: 1.24x faster Significant (t=106.63) ### regex_dna ### Mean +- std dev: 174 ms +- 1 ms -> 172 ms +- 3 ms: 1.01x faster Not significant ### regex_effbot ### Mean +- std dev: 3.28 ms +- 0.03 ms -> 3.14 ms +- 0.05 ms: 1.05x faster Significant (t=20.22) ### regex_v8 ### Mean +- std dev: 26.0 ms +- 0.2 ms -> 22.8 ms +- 0.2 ms: 1.14x faster Significant (t=78.67) ### richards ### Mean +- std dev: 91.2 ms +- 0.8 ms -> 64.5 ms +- 1.6 ms: 1.41x faster Significant (t=119.12) ### scimark_fft ### Mean +- std dev: 498 ms +- 4 ms -> 347 ms +- 5 ms: 1.44x faster Significant (t=185.69) ### scimark_lu ### Mean +- std dev: 194 ms +- 2 ms -> 148 ms +- 3 ms: 1.31x faster Significant (t=87.01) ### scimark_monte_carlo ### Mean +- std dev: 120 ms +- 1 ms -> 89 ms +- 2 ms: 1.35x faster Significant (t=99.22) ### scimark_sor ### Mean +- std dev: 231 ms +- 1 ms -> 166 ms +- 3 ms: 1.39x faster Significant (t=169.87) ### scimark_sparse_mat_mult ### Mean +- std dev: 7.31 ms +- 0.19 ms -> 4.82 ms +- 0.13 ms: 1.52x faster Significant (t=83.76) ### spectral_norm ### Mean +- std dev: 186 ms +- 3 ms -> 134 ms +- 3 ms: 1.39x faster Significant (t=104.61) ### sqlalchemy_declarative ### Mean +- std dev: 165 ms +- 3 ms -> 143 ms +- 4 ms: 1.16x faster Significant (t=33.78) ### sqlalchemy_imperative ### Mean +- std dev: 26.2 ms +- 0.8 ms -> 21.8 ms +- 0.6 ms: 1.20x faster Significant (t=32.12) ### sqlite_synth ### Mean +- std dev: 2.98 us +- 0.04 us -> 2.43 us +- 0.04 us: 1.23x faster Significant (t=68.81) ### sympy_expand ### Mean +- std dev: 615 ms +- 6 ms -> 486 ms +- 8 ms: 1.27x faster Significant (t=106.54) ### sympy_integrate ### Mean +- std dev: 25.5 ms +- 0.3 ms -> 21.2 ms +- 0.4 ms: 1.20x faster Significant (t=73.67) ### sympy_str ### Mean +- std dev: 366 ms +- 4 ms -> 296 ms +- 4 ms: 1.24x faster Significant (t=92.10) ### sympy_sum ### Mean +- std dev: 204 ms +- 3 ms -> 172 ms +- 3 ms: 1.19x faster Significant (t=57.73) ### telco ### Mean +- std dev: 7.40 ms +- 0.15 ms -> 5.67 ms +- 0.12 ms: 1.31x faster Significant (t=70.86) ### tornado_http ### Mean +- std dev: 167 ms +- 4 ms -> 154 ms +- 5 ms: 1.09x faster Significant (t=18.37) ### unpack_sequence ### Mean +- std dev: 47.3 ns +- 2.7 ns -> 44.4 ns +- 0.7 ns: 1.07x faster Significant (t=8.35) ### unpickle ### Mean +- std dev: 17.4 us +- 0.2 us -> 13.2 us +- 0.3 us: 1.32x faster Significant (t=81.72) ### unpickle_list ### Mean +- std dev: 4.73 us +- 0.07 us -> 3.87 us +- 0.05 us: 1.22x faster Significant (t=76.77) ### unpickle_pure_python ### Mean +- std dev: 365 us +- 7 us -> 283 us +- 3 us: 1.29x faster Significant (t=78.83) ### xml_etree_generate ### Mean +- std dev: 103 ms +- 2 ms -> 83 ms +- 2 ms: 1.23x faster Significant (t=57.90) ### xml_etree_iterparse ### Mean +- std dev: 115 ms +- 3 ms -> 95 ms +- 1 ms: 1.21x faster Significant (t=40.39) ### xml_etree_parse ### Mean +- std dev: 158 ms +- 3 ms -> 142 ms +- 2 ms: 1.11x faster Significant (t=34.23) ### xml_etree_process ### Mean +- std dev: 85.5 ms +- 1.8 ms -> 66.1 ms +- 1.3 ms: 1.29x faster Significant (t=68.72) ----------------------------------------------------------------- ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 16:24:40 2021 From: report at bugs.python.org (Brian) Date: Tue, 03 Aug 2021 20:24:40 +0000 Subject: [issue44819] assertSequenceEqual does not use _getAssertEqualityFunc Message-ID: <1628022280.67.0.522628726203.issue44819@roundup.psfhosted.org> New submission from Brian : Like the title says, TestCase.assertSequenceEqual does not behave like TestCase.assertEqual where it uses TestCase._getAssertEqualityFunc. Instead, TestCase.assertSequenceEqual uses `item1 != item2`. That way I can do something like this: ``` def test_stuff(self): self.addTypeEqualityFunc( MyObject, comparison_method_which_compares_how_i_want, ) self.assertListEqual( get_list_of_objects(), [MyObject(...), MyObject(...)], ) ``` ---------- components: Tests messages: 398851 nosy: Rarity priority: normal severity: normal status: open title: assertSequenceEqual does not use _getAssertEqualityFunc type: behavior versions: Python 3.6, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 17:12:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 03 Aug 2021 21:12:10 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1628025130.47.0.859310651853.issue41737@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 18:26:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 03 Aug 2021 22:26:46 +0000 Subject: [issue20703] RuntimeError caused by lazy imports in pdb In-Reply-To: <1392914840.47.0.865855778793.issue20703@psf.upfronthosting.co.za> Message-ID: <1628029606.75.0.747460918241.issue20703@roundup.psfhosted.org> Irit Katriel added the comment: Closing as this is not a problem with pdb, it's a general problem with iterating sys.modules while doing things that can cause imports. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 18:40:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 03 Aug 2021 22:40:08 +0000 Subject: [issue42524] pdb access to return value In-Reply-To: <1606835598.54.0.959102851686.issue42524@roundup.psfhosted.org> Message-ID: <1628030408.31.0.870524790935.issue42524@roundup.psfhosted.org> Irit Katriel added the comment: It actually is in the locals, and it's called __return__. So you can access it with locals()['__return__'] I'll try to see where that can be documented. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 18:56:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 03 Aug 2021 22:56:46 +0000 Subject: [issue42524] [doc] pdb access to return value In-Reply-To: <1606835598.54.0.959102851686.issue42524@roundup.psfhosted.org> Message-ID: <1628031406.56.0.0215613141435.issue42524@roundup.psfhosted.org> Irit Katriel added the comment: I just noticed your PR. Would you like to continue working on this? I think we should update the documentation of retval (in the doc and in the functions' doctring) to say: """ retval Print the return value for the last return of a function. Alternatively, the return can be accessed with ``locals()['__return__']``. """ Then add unit tests and examples as you did. ---------- title: pdb access to return value -> [doc] pdb access to return value versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 18:57:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 03 Aug 2021 22:57:37 +0000 Subject: [issue42524] [doc] pdb access to return value In-Reply-To: <1606835598.54.0.959102851686.issue42524@roundup.psfhosted.org> Message-ID: <1628031457.62.0.801044759118.issue42524@roundup.psfhosted.org> Irit Katriel added the comment: I just noticed your PR. Would you like to continue working on this? I think we should update the documentation of retval (in the doc and in the function's doctring) to say: """ retval Print the return value for the last return of a function. Alternatively, the return value can be accessed with ``locals()['__return__']``. """ Then add unit tests and examples as you did. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 18:57:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 03 Aug 2021 22:57:46 +0000 Subject: [issue42524] [doc] pdb access to return value In-Reply-To: <1606835598.54.0.959102851686.issue42524@roundup.psfhosted.org> Message-ID: <1628031466.62.0.457201116777.issue42524@roundup.psfhosted.org> Change by Irit Katriel : ---------- Removed message: https://bugs.python.org/msg398854 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 21:00:06 2021 From: report at bugs.python.org (jack1142) Date: Wed, 04 Aug 2021 01:00:06 +0000 Subject: [issue43532] Add keyword-only fields to dataclasses In-Reply-To: <1616002761.92.0.652624260802.issue43532@roundup.psfhosted.org> Message-ID: <1628038806.42.0.580735071404.issue43532@roundup.psfhosted.org> jack1142 added the comment: Does this change deserve an entry in the What's New in Python document in addition to the changelog entry? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 3 21:55:06 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 04 Aug 2021 01:55:06 +0000 Subject: [issue44772] Regression in memory use of instances due to dictionary ordering In-Reply-To: <1627554489.64.0.275505717552.issue44772@roundup.psfhosted.org> Message-ID: <1628042106.78.0.821437741179.issue44772@roundup.psfhosted.org> Raymond Hettinger added the comment: ISTM this was mostly a net win. We get compactness and sharing most of the time, and lose sharing only in cases like this where different instances of the same class happen to have different attributes. Personally, I would not have expected sharing to occur in those cases. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 00:12:08 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 04 Aug 2021 04:12:08 +0000 Subject: [issue32397] textwrap output may change if you wrap a paragraph twice In-Reply-To: <1513865443.17.0.213398074469.issue32397@psf.upfronthosting.co.za> Message-ID: <1628050328.01.0.926235475237.issue32397@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- pull_requests: +26089 pull_request: https://github.com/python/cpython/pull/27587 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 00:15:31 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 04 Aug 2021 04:15:31 +0000 Subject: [issue32397] textwrap output may change if you wrap a paragraph twice In-Reply-To: <1513865443.17.0.213398074469.issue32397@psf.upfronthosting.co.za> Message-ID: <1628050531.8.0.0836091940054.issue32397@roundup.psfhosted.org> Andrei Kulakov added the comment: I've added an initial draft PR: https://github.com/python/cpython/pull/27587/files I will add docs and news if this looks good in general. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 00:24:15 2021 From: report at bugs.python.org (Antony Lee) Date: Wed, 04 Aug 2021 04:24:15 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1628051055.88.0.674203633155.issue44019@roundup.psfhosted.org> Antony Lee added the comment: Actually, upon further thought, the semantics I suggested above should go into `operator.caller` (cf. `operator.methodcaller`), and `operator.call`/`operator.__call__` should instead be defined as `operator.call(f, *args, **kwargs) == f(*args, **kwargs)`, so that the general rule `operator.opname(a, b) == a.__opname__(b)` (modulo dunder lookup rules) remains applicable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 00:31:33 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 04 Aug 2021 04:31:33 +0000 Subject: [issue44819] assertSequenceEqual does not use _getAssertEqualityFunc In-Reply-To: <1628022280.67.0.522628726203.issue44819@roundup.psfhosted.org> Message-ID: <1628051493.66.0.502128918818.issue44819@roundup.psfhosted.org> Jack DeVries added the comment: Brian, can you be more specific about what problem is caused by the fact that assertSequenceEqual does not use _getAssertEqualityFunc? Also, I'm not sure what your example is trying to demonstrate. Can you provide a minimal example that shows the problem, but also defines what ``MyObject``, etc. are? Let me know if I'm missing something. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 01:19:26 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 04 Aug 2021 05:19:26 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1628054366.92.0.193302809619.issue43468@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's the latest effort: --------------------------------------------------------------- def __get__(self, instance, owner=None): if instance is None: return self if self.attrname is None: raise TypeError( "Cannot use cached_property instance without calling __set_name__ on it.") try: cache = instance.__dict__ except AttributeError: # not all objects have __dict__ (e.g. class defines slots) msg = ( f"No '__dict__' attribute on {type(instance).__name__!r} " f"instance to cache {self.attrname!r} property." ) raise TypeError(msg) from None # Quickly and atomically determine which thread is reponsible # for doing the update, so other threads can wait for that # update to complete. If the update is already done, don't # wait. If the updating thread is reentrant, don't wait. key = id(self) this_thread = get_ident() with self.updater_lock: val = cache.get(self.attrname, _NOT_FOUND) if val is not _NOT_FOUND: return val wait = self.updater.setdefault(key, this_thread) != this_thread # ONLY if this instance currently being updated, block and wait # for the computed result. Other instances won't have to wait. # If an exception occurred, stop waiting. if wait: with self.cv: while cache.get(self.attrname, _NOT_FOUND) is _NOT_FOUND: self.cv.wait() val = cache[self.attrname] if val is not _EXCEPTION_RAISED: return val # Call the underlying function to compute the value. try: val = self.func(instance) except Exception: val = _EXCEPTION_RAISED # Attempt to store the value try: cache[self.attrname] = val except TypeError: # Note: we have no way to communicate this exception to # threads waiting on the condition variable. However, the # inability to store an attribute is a programming problem # rather than a runtime problem -- this exception would # likely occur early in testing rather than being runtime # event triggered by specific data. msg = ( f"The '__dict__' attribute on {type(instance).__name__!r} instance " f"does not support item assignment for caching {self.attrname!r} property." ) raise TypeError(msg) from None # Now that the value is stored, threads waiting on the condition # variable can be awakened and the updater dictionary can be # cleaned up. with self.updater_lock: self.updater.pop(key, None) cache[self.attrname] = _EXCEPTION_RAISED self.cv.notify_all() if val is _EXCEPTION_RAISED: raise return val ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 01:49:38 2021 From: report at bugs.python.org (jb) Date: Wed, 04 Aug 2021 05:49:38 +0000 Subject: [issue44820] subprocess hungs when processing value from mariadb Message-ID: <1628056178.39.0.585124478432.issue44820@roundup.psfhosted.org> New submission from jb : I am doing an insert in mariadb databases. For example, INSERT INTO t (a, b, c) VALUES (1, 3, None) RETURNING a, b. Upon execution, I get the value as (, ). When accessing the zero element, my subroutine hangs. ---------- components: Interpreter Core messages: 398862 nosy: zh.bolatbek priority: normal severity: normal status: open title: subprocess hungs when processing value from mariadb type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 03:28:39 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 04 Aug 2021 07:28:39 +0000 Subject: [issue44814] python 3.9.6 installation installs 0 modules In-Reply-To: <1627928538.73.0.0238112884083.issue44814@roundup.psfhosted.org> Message-ID: <1628062119.67.0.716355986553.issue44814@roundup.psfhosted.org> Mark Dickinson added the comment: Setting as pending. It looks as though this report represents a misunderstanding of how Python works rather than a bug in Python. ---------- nosy: +mark.dickinson resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 03:57:16 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 04 Aug 2021 07:57:16 +0000 Subject: [issue44821] Instance dictionaries should be created eagerly Message-ID: <1628063836.31.0.548816977554.issue44821@roundup.psfhosted.org> New submission from Mark Shannon : Currently, instance dictionaries (__dict__ attribute) are created lazily when the first attribute is set. This is bad for performance for a number of reasons: 1. It causes additional checks on every attribute access. 2. It causes allocation of the object and its dict to be temporarily separated, most likely leading to increased physical separation and worse cache behavior. 3. It has a large impact on specialization, as the first SET_ATTR for an object has to behave differently. Creating a __dict__ lazily does not save a significant amount of memory. If an object has a __dict__ slot, then it will end up with a dictionary before it dies in almost all cases. Many objects, e.g. ints, floats, don't have a dictionary. They are unaffected. Plain python objects that have no instance attributes are extremely rare, unless they have __slots__, in which case they don't have a dictionary anyway. The remaining case is subclasses of builtin types that do not add extra attributes, but these are rare, and the overhead of an empty dictionary is only 64 bytes (on a 64 bit machine). ---------- assignee: Mark.Shannon components: Interpreter Core messages: 398864 nosy: Mark.Shannon priority: normal severity: normal status: open title: Instance dictionaries should be created eagerly type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 04:29:38 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 04 Aug 2021 08:29:38 +0000 Subject: [issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text() Message-ID: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> New submission from Erlend E. Aasland : The third argument to sqlite3_result_text() is the length of the string passed as the second argument. Currently, we pass -1, so SQLite has to invoke strlen() to compute the length of the passed string. Suggesting to use PyUnicode_AsUTF8AndSize() iso. PyUnicode_AsUTF8() and pass the string size to avoid the superfluous strlen(). See also: - https://sqlite.org/c3ref/result_blob.html ---------- assignee: erlendaasland components: Extension Modules messages: 398865 nosy: erlendaasland priority: normal severity: normal status: open title: [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text() type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 04:33:55 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 04 Aug 2021 08:33:55 +0000 Subject: [issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text() In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628066035.47.0.31097227877.issue44822@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +26090 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27588 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 04:39:24 2021 From: report at bugs.python.org (Karolina Surma) Date: Wed, 04 Aug 2021 08:39:24 +0000 Subject: [issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1) Message-ID: <1628066364.71.0.124570746372.issue44823@roundup.psfhosted.org> New submission from Karolina Surma : Documentation for Python3.10-rc1 fails to build. sphinx-build looks for non-existing interpreter, which causes a crash. Looking at the tarball with Python, there is Doc/venv/ present (which probably shouldn't be included) containing executable sphinx-build with shebang " #!/home/pablogsal/github/python/3.10/3.10.0rc1/Python-3.10.0rc1/Doc/venv/bin/python3". Traceback from our Fedora RPM build: + make -C Doc html PYTHON=/usr/bin/python3 make: Entering directory '/builddir/build/BUILD/Python-3.10.0rc1/Doc' venv already exists mkdir -p build Using existing Misc/NEWS file PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees -W . build/html /bin/sh: ./venv/bin/sphinx-build: /home/pablogsal/github/python/3.10/3.10.0rc1/Python-3.10.0rc1/Doc/venv/bin/python3: bad interpreter: No such file or directory make: Leaving directory '/builddir/build/BUILD/Python-3.10.0rc1/Doc' make: *** [Makefile:51: build] Error 126 ---------- assignee: docs at python components: Documentation messages: 398866 nosy: docs at python, ksurma priority: normal severity: normal status: open title: Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1) versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 04:52:38 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 04 Aug 2021 08:52:38 +0000 Subject: [issue44824] The 3.10.0rv1 source tarballs contain the Docs/venv directory populated with pablogsal's venv Message-ID: <1628067158.48.0.0776789887836.issue44824@roundup.psfhosted.org> New submission from Miro Hron?ok : When we download the signed Python-3.10.0rc1.tgz or Python-3.10.0rc1.tar.xz source tarball, we see that the Docs/venv directory contains teh actual virtual environment with #!/home/pablogsal/github/python/3.10/3.10.0rc1/Python-3.10.0rc1/Doc/venv/bin/python3 shebangs. That means, an attempt to build the documentation (e.g. with make html) will fail with: PATH=./venv/bin:$PATH sphinx-build -b html -d build/doctrees -W . build/html /bin/sh: ./venv/bin/sphinx-build: /home/pablogsal/github/python/3.10/3.10.0rc1/Python-3.10.0rc1/Doc/venv/bin/python3: bad interpreter: No such file or directory make: Leaving directory '/builddir/build/BUILD/Python-3.10.0rc1/Doc' make: *** [Makefile:51: build] Error 126 I believe the venv directory should not be part of the release tarball, especially since it is unusbale from different paths than pablogsal's github/python/3.10/3.10.0rc1/Python-3.10.0rc1 directory. Also, technically the entire effective license of the tarball is now hard to determine, since it contains many different packages. ---------- assignee: docs at python components: Documentation messages: 398867 nosy: docs at python, hroncok, pablogsal priority: normal severity: normal status: open title: The 3.10.0rv1 source tarballs contain the Docs/venv directory populated with pablogsal's venv versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 04:52:52 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 04 Aug 2021 08:52:52 +0000 Subject: [issue44824] The 3.10.0rc1 source tarballs contain the Docs/venv directory populated with pablogsal's venv In-Reply-To: <1628067158.48.0.0776789887836.issue44824@roundup.psfhosted.org> Message-ID: <1628067172.36.0.0361270937509.issue44824@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- title: The 3.10.0rv1 source tarballs contain the Docs/venv directory populated with pablogsal's venv -> The 3.10.0rc1 source tarballs contain the Docs/venv directory populated with pablogsal's venv _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 04:53:40 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 04 Aug 2021 08:53:40 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628067220.08.0.926548228643.issue44756@roundup.psfhosted.org> Miro Hron?ok added the comment: The 3.10.0rc1 source tarballs contain the Docs/venv directory populated with pablogsal's venv: issue44824 ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:01:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 04 Aug 2021 09:01:35 +0000 Subject: [issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text() In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628067695.34.0.587371889844.issue44822@roundup.psfhosted.org> Serhiy Storchaka added the comment: The difference between specifying negative and non-negative third argument of sqlite3_result_text() is that in the latter case the result can contain embedded NUL characters. Could you please add a test for string containing embedded NUL? Letting SQLite compute string length would work incorrect in case of embedded NULs, so I think that we should raise explicit error if sz > INT_MAX. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:02:55 2021 From: report at bugs.python.org (Jakub Kulik) Date: Wed, 04 Aug 2021 09:02:55 +0000 Subject: [issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread In-Reply-To: <1615796616.26.0.51182574064.issue43498@roundup.psfhosted.org> Message-ID: <1628067775.72.0.974391420668.issue43498@roundup.psfhosted.org> Jakub Kulik added the comment: I think that even if copy() doesn't fix it entirely, it's still much better than nothing. I never encountered the issue mentioned in bpo-40327, but I saw this issue several times a week (before applying the proposed patch). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:04:19 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 04 Aug 2021 09:04:19 +0000 Subject: [issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1) In-Reply-To: <1628066364.71.0.124570746372.issue44823@roundup.psfhosted.org> Message-ID: <1628067859.5.0.230994301559.issue44823@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Seems like a duplicate of https://bugs.python.org/issue44824 ---------- nosy: +pablogsal, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:06:23 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 04 Aug 2021 09:06:23 +0000 Subject: [issue44824] The 3.10.0rc1 source tarballs contain the Docs/venv directory populated with pablogsal's venv In-Reply-To: <1628067158.48.0.0776789887836.issue44824@roundup.psfhosted.org> Message-ID: <1628067983.26.0.465474016728.issue44824@roundup.psfhosted.org> Miro Hron?ok added the comment: This is the same as https://bugs.python.org/issue44823, sorry about that. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:06:42 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 04 Aug 2021 09:06:42 +0000 Subject: [issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text() In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628068002.92.0.438348068815.issue44822@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Could you please add a test for string containing embedded NUL? Of course, thanks for the heads up. > I think that we should raise explicit error if sz > INT_MAX. Yes, I thought about this. I do agree that raising OverflowError would be better. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:21:58 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 04 Aug 2021 09:21:58 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628068918.42.0.880083894894.issue44756@roundup.psfhosted.org> Petr Viktorin added the comment: The issue this (or lack of communication about it) caused in rc1 is tracked in https://bugs.python.org/issue44823 > @petr.viktorin a whatsnew entry was added, what more notice could have been provided? Ideally, the python-dev mailing list (or Discourse). > pip install sphinx blurb python-docs-theme > If running that is ever unsafe, we have big problems! Who is "we"? We do have big problems. Anyone who can upload wheels for sphinx blurb python-docs-theme or any of their dependencies (or anyone who has their credentials) can now easily put code on machines of CPython developers. For example, PyPI doesn't guarantee that wheels correspond to sources. "Markupsafe" is particularly dangerous because the wheels are platform-specific and have compiled code, so tampering is nearly undetectable. (But if another dependency starts using platform-specific wheels, I don't think anyone would notice.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:29:43 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 04 Aug 2021 09:29:43 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628069383.54.0.996453168464.issue44756@roundup.psfhosted.org> Petr Viktorin added the comment: I've sent a mail to python-dev: https://mail.python.org/archives/list/python-dev at python.org/thread/MGPNI7OSA7UXNOTVDVW2I2GUMXV25FRS/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:30:36 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 04 Aug 2021 09:30:36 +0000 Subject: [issue44772] Regression in memory use of instances due to dictionary ordering In-Reply-To: <1627554489.64.0.275505717552.issue44772@roundup.psfhosted.org> Message-ID: <1628069436.78.0.918882459703.issue44772@roundup.psfhosted.org> Mark Shannon added the comment: Raymond, When you say "this was mostly a net win" do you mean the more compact layout or ordering? The compact layout is obviously a win, and doesn't conflict with sharing. The problem is that ordering conflicts with sharing. As long as instances all have attributes that are a subset of the shared keys stored on the class, they can share attributes, or least they could in 3.5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:32:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 04 Aug 2021 09:32:31 +0000 Subject: [issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1) In-Reply-To: <1628066364.71.0.124570746372.issue44823@roundup.psfhosted.org> Message-ID: <1628069551.98.0.369549344385.issue44823@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I will look into this ASAP ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:41:50 2021 From: report at bugs.python.org (Samuel Marks) Date: Wed, 04 Aug 2021 09:41:50 +0000 Subject: [issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)` Message-ID: <1628070110.26.0.654462088107.issue44825@roundup.psfhosted.org> New submission from Samuel Marks : I tried making `node.annotation` an `ast.Name("str", ast.Load())`, which worked but when the AST was unparsed to a string it shows as `# type: `. https://github.com/offscale/cdd-python/runs/3213864077 Replicate with: ``` unparse(Assign(annotation=None, simple=1, targets=[Name("foo", Store())], value=Constant(value=5, kind=None), expr=None, expr_targe ...: t=None, expr_annotation=None, type_comment=Name('str', Load()), lineno=None)) ``` Checking what it expects, it does expect a str. E.g.,: ``` $ python3.9 -c 'import ast; tc=ast.parse("foo = 5 # type: int", type_comments=True).body[0].type_comment; print("type_comment is a", type(tc).__name__, "with value", tc)' type_comment is a str with value int ``` But when I do make it a str and unparse it, I get: ``` File "/opt/python3.10/lib/python3.10/ast.py", line 1674, in unparse return unparser.visit(ast_obj) File "/opt/python3.10/lib/python3.10/ast.py", line 808, in visit self.traverse(node) File "/opt/python3.10/lib/python3.10/ast.py", line 799, in traverse super().visit(node) File "/opt/python3.10/lib/python3.10/ast.py", line 410, in visit return visitor(node) File "/opt/python3.10/lib/python3.10/ast.py", line 1005, in visit_FunctionDef self._function_helper(node, "def") File "/opt/python3.10/lib/python3.10/ast.py", line 1023, in _function_helper self._write_docstring_and_traverse_body(node) File "/opt/python3.10/lib/python3.10/ast.py", line 816, in _write_docstring_and_traverse_body self.traverse(node.body) File "/opt/python3.10/lib/python3.10/ast.py", line 797, in traverse self.traverse(item) File "/opt/python3.10/lib/python3.10/ast.py", line 799, in traverse super().visit(node) File "/opt/python3.10/lib/python3.10/ast.py", line 410, in visit return visitor(node) File "/opt/python3.10/lib/python3.10/ast.py", line 879, in visit_AnnAssign self.traverse(node.annotation) File "/opt/python3.10/lib/python3.10/ast.py", line 799, in traverse super().visit(node) File "/opt/python3.10/lib/python3.10/ast.py", line 410, in visit return visitor(node) File "/opt/python3.10/lib/python3.10/ast.py", line 414, in generic_visit for field, value in iter_fields(node): File "/opt/python3.10/lib/python3.10/ast.py", line 252, in iter_fields for field in node._fields: AttributeError: 'str' object has no attribute '_fields' ``` ---------- messages: 398878 nosy: samuelmarks priority: normal severity: normal status: open title: node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)` versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:43:47 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 04 Aug 2021 09:43:47 +0000 Subject: [issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)` In-Reply-To: <1628070110.26.0.654462088107.issue44825@roundup.psfhosted.org> Message-ID: <1628070227.99.0.892758451073.issue44825@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:46:00 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 04 Aug 2021 09:46:00 +0000 Subject: [issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)` In-Reply-To: <1628070110.26.0.654462088107.issue44825@roundup.psfhosted.org> Message-ID: <1628070360.79.0.327056115385.issue44825@roundup.psfhosted.org> Batuhan Taskaya added the comment: @samuelmarks can you share the full reproducer / AST and what you expect it to be unparsed? (you can use gist or other pasting services if it is too big) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:57:23 2021 From: report at bugs.python.org (Samuel Marks) Date: Wed, 04 Aug 2021 09:57:23 +0000 Subject: [issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)` In-Reply-To: <1628070110.26.0.654462088107.issue44825@roundup.psfhosted.org> Message-ID: <1628071043.93.0.104733568428.issue44825@roundup.psfhosted.org> Samuel Marks added the comment: Hmm, debugging my test and I was able to replicate it with this smaller one: ``` from ast import FunctionDef, arguments, Load, Name, AnnAssign, Store, BinOp, Add, unparse unparse(FunctionDef(args=arguments(args=[], defaults=[], kw_defaults=[], kwarg=None, kwonlyargs=[], posonlyargs=[], vararg=None), body=[AnnAssign(annotation='int', simple=1, target=Name(ctx=Store(), id='res'), value=BinOp(left=Name(ctx=Load(), id='a'), op=Add(), right=Name(ctx=Load(), id='b')))], decorator_list=[], name='sum', returns=None, lineno=None, type_comment=None)) ``` Which for some reason has made the `annotation` a `str` rather than `Name`. So I think it's my bug then? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 05:59:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 04 Aug 2021 09:59:41 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628071181.14.0.660811177547.issue44756@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:03:10 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 04 Aug 2021 10:03:10 +0000 Subject: [issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text() In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628071390.1.0.960672715018.issue44822@roundup.psfhosted.org> Erlend E. Aasland added the comment: Serhiy, I've updated the PR, if you want to take a look. Thanks for your feedback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:12:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 04 Aug 2021 10:12:25 +0000 Subject: [issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1) In-Reply-To: <1628066364.71.0.124570746372.issue44823@roundup.psfhosted.org> Message-ID: <1628071945.38.0.347835137502.issue44823@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The tarball in the download server has been updated to not contain the venv directory and the release machinery has been updated to account for https://bugs.python.org/issue44756 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:12:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 04 Aug 2021 10:12:42 +0000 Subject: [issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1) In-Reply-To: <1628066364.71.0.124570746372.issue44823@roundup.psfhosted.org> Message-ID: <1628071962.45.0.734942455974.issue44823@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Note, this problem was created due to: https://bugs.python.org/issue44756 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:13:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 04 Aug 2021 10:13:04 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628071984.71.0.852923732186.issue44756@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Note this issue has impacted negatively the release process of 3.10.0rc1: https://bugs.python.org/issue44823 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:17:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 04 Aug 2021 10:17:48 +0000 Subject: [issue44823] Docs fail to build - looking for the wrong interpreter (Python 3.10-rc1) In-Reply-To: <1628066364.71.0.124570746372.issue44823@roundup.psfhosted.org> Message-ID: <1628072268.4.0.753920814819.issue44823@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:19:37 2021 From: report at bugs.python.org (Samuel Marks) Date: Wed, 04 Aug 2021 10:19:37 +0000 Subject: [issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)` In-Reply-To: <1628070110.26.0.654462088107.issue44825@roundup.psfhosted.org> Message-ID: <1628072377.88.0.0267388698545.issue44825@roundup.psfhosted.org> Samuel Marks added the comment: Fixed with https://github.com/offscale/cdd-python/commit/079dc28 ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:20:46 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 04 Aug 2021 10:20:46 +0000 Subject: [issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)` In-Reply-To: <1628070110.26.0.654462088107.issue44825@roundup.psfhosted.org> Message-ID: <1628072446.75.0.0712000450748.issue44825@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Which for some reason has made the `annotation` a `str` rather than `Name`. So I think it's my bug then? Yes, from what I can see it is a bug in your code. > body=[AnnAssign(annotation='int', The 'annotation' field in 'AnnAssign' nodes are designated as expressions. So you need to either wrap that into an ast.Name() node, or an ast.Constant() node (if you want to stringify it with quotes in the generated code). For more information about fields you can read this; https://github.com/python/cpython/blob/ac811f9b5a68ce8756911ef2c8be83b46696018f/Parser/Python.asdl#L29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:34:42 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 04 Aug 2021 10:34:42 +0000 Subject: [issue44826] Specialize STORE_ATTR using PEP 659 machinery. Message-ID: <1628073282.4.0.475634168415.issue44826@roundup.psfhosted.org> New submission from Mark Shannon : Add specializations of STORE_ATTR following the pattern of LOAD_ATTR and LOAD_GLOBAL. For this to work well we need https://bugs.python.org/issue44821, otherwise the first assigned to an attribute of any object cannot be specialized. ---------- messages: 398887 nosy: Mark.Shannon priority: normal severity: normal status: open title: Specialize STORE_ATTR using PEP 659 machinery. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:38:08 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 04 Aug 2021 10:38:08 +0000 Subject: [issue44821] Instance dictionaries should be created eagerly In-Reply-To: <1628063836.31.0.548816977554.issue44821@roundup.psfhosted.org> Message-ID: <1628073488.93.0.797475487633.issue44821@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +26091 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27589 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:38:25 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 04 Aug 2021 10:38:25 +0000 Subject: [issue44826] Specialize STORE_ATTR using PEP 659 machinery. In-Reply-To: <1628073282.4.0.475634168415.issue44826@roundup.psfhosted.org> Message-ID: <1628073505.56.0.139375304008.issue44826@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +26092 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27590 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 06:46:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 04 Aug 2021 10:46:38 +0000 Subject: [issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628073998.52.0.597826881068.issue44822@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- title: [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text() -> [sqlite3] Do not truncate results of user functions and aggregates on the first NUL type: enhancement -> behavior versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 07:08:19 2021 From: report at bugs.python.org (PEW's Corner) Date: Wed, 04 Aug 2021 11:08:19 +0000 Subject: [issue44827] Incomplete 3.10.0rc1 release info Message-ID: <1628075299.02.0.423683995444.issue44827@roundup.psfhosted.org> New submission from PEW's Corner : The "Files" section is empty on this page: https://www.python.org/downloads/release/python-3100rc1/ Also, the Python Insider blog post contains the outdated b4 text under "And now for something completely different". ---------- messages: 398888 nosy: pewscorner priority: normal severity: normal status: open title: Incomplete 3.10.0rc1 release info versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 07:21:33 2021 From: report at bugs.python.org (Nythepegasus) Date: Wed, 04 Aug 2021 11:21:33 +0000 Subject: [issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6 Message-ID: <1628076093.82.0.287740145135.issue44828@roundup.psfhosted.org> New submission from Nythepegasus : Using tkinter.filedialog crashes on macOS 12.0 Beta (21A5294g) on M1 when the open file dialog window is created. Full crash below: 2021-08-04 07:19:04.239 Python[40251:323363] *** Assertion failure in -[NSOpenPanel beginServicePanel:asyncExHandler:], NSVBOpenAndSavePanels.m:1910 2021-08-04 07:19:04.241 Python[40251:323363] -[NSSavePanel beginWithCompletionHandler:]_block_invoke caught non-fatal NSInternalInconsistencyException ' is attempting to advance this Open/Save panel to run phase while another self.advanceToRunPhaseCompletionHandler is in waiting for a previous attempt. An Open/Save panel cannot start to advance more than once.' with user dictionary { NSAssertFile = "NSVBOpenAndSavePanels.m"; NSAssertLine = 1910; } and backtrace ( 0 CoreFoundation 0x00000001a9d47150 __exceptionPreprocess + 240 1 libobjc.A.dylib 0x00000001a9a986e8 objc_exception_throw + 60 2 Foundation 0x00000001aac3b4a4 -[NSCalendarDate initWithCoder:] + 0 3 AppKit 0x00000001ad1f02b0 -[NSSavePanel beginServicePanel:asyncExHandler:] + 512 4 AppKit 0x00000001ad1f1708 -[NSSavePanel runModal] + 332 5 libtk8.6.dylib 0x00000001013d8c18 showOpenSavePanel + 360 6 libtk8.6.dylib 0x00000001013d99e4 Tk_ChooseDirectoryObjCmd + 992 7 libtcl8.6.dylib 0x00000001011cbafc TclNRRunCallbacks + 80 8 _tkinter.cpython-39-darwin.so 0x0000000100c111a4 Tkapp_Call + 400 9 Python 0x0000000100d66a40 cfunction_call + 96 10 Python 0x0000000100d184e0 _PyObject_Call + 128 11 Python 0x0000000100e10150 _PyEval_EvalFrameDefault + 40288 12 Python 0x0000000100e053f0 _PyEval_EvalCode + 444 13 Python 0x0000000100d1877c _PyFunction_Vectorcall + 364 14 Python 0x0000000100e12590 call_function + 128 15 Python 0x0000000100e0ff08 _PyEval_EvalFrameDefault + 39704 16 Python 0x0000000100e053f0 _PyEval_EvalCode + 444 17 Python 0x0000000100d1877c _PyFunction_Vectorcall + 364 18 Python 0x0000000100e12590 call_function + 128 19 Python 0x0000000100e0ff84 _PyEval_EvalFrameDefault + 39828 20 Python 0x0000000100e053f0 _PyEval_EvalCode + 444 21 Python 0x0000000100e5cce4 run_eval_code_obj + 136 22 Python 0x0000000100e5cbf8 run_mod + 112 23 Python 0x0000000100e5a434 pyrun_file + 168 24 Python 0x0000000100e59d58 pyrun_simple_file + 276 25 Python 0x0000000100e59c04 PyRun_SimpleFileExFlags + 80 26 Python 0x0000000100e79d2c pymain_run_file + 320 27 Python 0x0000000100e7947c Py_RunMain + 916 28 Python 0x0000000100e7a6c4 pymain_main + 36 29 Python 0x0000000100e7a93c Py_BytesMain + 40 30 dyld 0x00000001007990fc start + 520 ) . ---------- components: Tkinter files: tkinter_crash.py messages: 398889 nosy: Nythepegasus priority: normal severity: normal status: open title: Using tkinter.filedialog crashes on macOS Python 3.9.6 type: crash versions: Python 3.9 Added file: https://bugs.python.org/file50200/tkinter_crash.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 07:27:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 04 Aug 2021 11:27:51 +0000 Subject: [issue39940] Micro-optimizations to PySequence_Tuple() In-Reply-To: <1583963052.53.0.534992223538.issue39940@roundup.psfhosted.org> Message-ID: <1628076471.67.0.993874723897.issue39940@roundup.psfhosted.org> Irit Katriel added the comment: Marco, are you planning to complete this work, and in particular show the benefit with benchmarks? Otherwise, if this project is abandoned I will close the issue and the PR. ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 07:47:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 04 Aug 2021 11:47:48 +0000 Subject: [issue44819] assertSequenceEqual does not use _getAssertEqualityFunc In-Reply-To: <1628022280.67.0.522628726203.issue44819@roundup.psfhosted.org> Message-ID: <1628077668.11.0.910713947303.issue44819@roundup.psfhosted.org> Irit Katriel added the comment: That's correct, and apparently not mentioned in the doc: https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertSequenceEqual ---------- nosy: +ezio.melotti, iritkatriel, michael.foord, rbcollins _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 07:49:43 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 04 Aug 2021 11:49:43 +0000 Subject: [issue44827] Incomplete 3.10.0rc1 release info In-Reply-To: <1628075299.02.0.423683995444.issue44827@roundup.psfhosted.org> Message-ID: <1628077783.76.0.296745839352.issue44827@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: I can see the files section table with links. ---------- nosy: +pablogsal, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 08:57:02 2021 From: report at bugs.python.org (PEW's Corner) Date: Wed, 04 Aug 2021 12:57:02 +0000 Subject: [issue44827] Incomplete 3.10.0rc1 release info In-Reply-To: <1628075299.02.0.423683995444.issue44827@roundup.psfhosted.org> Message-ID: <1628081822.79.0.30282358088.issue44827@roundup.psfhosted.org> PEW's Corner added the comment: Yes, they're there now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 09:12:05 2021 From: report at bugs.python.org (Romuald Brunet) Date: Wed, 04 Aug 2021 13:12:05 +0000 Subject: [issue42524] [doc] pdb access to return value In-Reply-To: <1606835598.54.0.959102851686.issue42524@roundup.psfhosted.org> Message-ID: <1628082725.07.0.35511778642.issue42524@roundup.psfhosted.org> Romuald Brunet added the comment: I'm not sure I follow. You wish to "simply" update the doc? (and not update the retval to allow storing it into a varible. I'm OK with that) But if we choose this, I'm not sure what needs changing in the doctests :-? Another interrogation: is the use locals() really necessary? I can see that I can simply use `__return__` to access the return object. Is there a reason to access it via locals() inside pdb? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 09:19:16 2021 From: report at bugs.python.org (Trygve Aaberge) Date: Wed, 04 Aug 2021 13:19:16 +0000 Subject: [issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9 In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1628083156.63.0.505143458344.issue44050@roundup.psfhosted.org> Trygve Aaberge added the comment: @jack__d: If you're just getting "no data" once and nothing else, the test isn't working correctly. You should get "no data" twice when it works correctly and the issue is fixed, or "unknown error" and some other info if the issue is present. I'm not sure why it doesn't work for you though. I tried it with Python 3.9.6 now, and I'm still seeing the issue, with the same output as in my original post (apart from a newline between "no data" and "unknown error", and a different line number and id numbers). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 09:21:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 04 Aug 2021 13:21:56 +0000 Subject: [issue42524] [doc] pdb access to return value In-Reply-To: <1606835598.54.0.959102851686.issue42524@roundup.psfhosted.org> Message-ID: <1628083316.62.0.51481175903.issue42524@roundup.psfhosted.org> Irit Katriel added the comment: Yes, exactly - to update the doc so that the next person who needs it will easily find a way to do it (which was not available to you when you created this issue). The test should assert that what the doc says, so that if someone breaks documented functionality we will immediately know. Your point about accessing __return__ directly from the prompt is interesting - sure, if that works just document that and make sure the test fails if we make a change that breaks it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 09:38:43 2021 From: report at bugs.python.org (PEW's Corner) Date: Wed, 04 Aug 2021 13:38:43 +0000 Subject: [issue44827] Incomplete 3.10.0rc1 release info In-Reply-To: <1628075299.02.0.423683995444.issue44827@roundup.psfhosted.org> Message-ID: <1628084323.4.0.649259241522.issue44827@roundup.psfhosted.org> PEW's Corner added the comment: It was probably a caching issue, because another device was just now still displaying the page without files until I forced a refresh. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 10:18:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 04 Aug 2021 14:18:41 +0000 Subject: [issue44827] Incomplete 3.10.0rc1 release info In-Reply-To: <1628075299.02.0.423683995444.issue44827@roundup.psfhosted.org> Message-ID: <1628086721.35.0.508908996751.issue44827@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yeah, there is CDN in front and it has to get invalidated when we update it ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 10:24:11 2021 From: report at bugs.python.org (Harry) Date: Wed, 04 Aug 2021 14:24:11 +0000 Subject: [issue44760] Turtle Documentation - Contents Hyperlink conflict In-Reply-To: <1627464661.57.0.766056732309.issue44760@roundup.psfhosted.org> Message-ID: <1628087051.73.0.325247156457.issue44760@roundup.psfhosted.org> Harry added the comment: The conflict comes from the fact that the documentation is written from the perspective of the procedure-oriented interface "All methods of TurtleScreen/Screen also exist as functions, i.e. as part of the procedure-oriented interface" The conflict in the documentation comes from the fact that there is a conflict in the code as-well. The way the conflict is resolved in the code is that: "This TurtleScreen method is available as a global function only under the name clearscreen. The global function clear is a different one derived from the Turtle method clear." I propose that we noindex the TurtleScreen.clear() method, and index the Turtle.clear() method instead which more accurately reflects the behaviour of the turtle module itself. A link to the TurtleScreen.clear() method will still be available through its alias TurtleScreen.clearscreen(). ---------- nosy: +Harry-Lees _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 10:36:58 2021 From: report at bugs.python.org (apple502j) Date: Wed, 04 Aug 2021 14:36:58 +0000 Subject: [issue44829] zoneinfo.ZoneInfo does not check for Windows device names Message-ID: <1628087818.07.0.11590329108.issue44829@roundup.psfhosted.org> New submission from apple502j : Note: this issue was submitted to security@ due to its potential as a DoS vector on 2021-05-08, but I have not received a response (excluding the automated email). It is over 88 days since the report, so I am now reporting this publicly. Issue: zoneinfo.ZoneInfo does not check for Windows device names on Windows. For example, a timezone "NUL" do not raise ZoneInfoNotFoundError; instead, it raises ValueError ("Invalid TZif file: magic not found"). If the timezone passed is "CON", then the program would read the content from stdin, and parse it as tzdata file. This can be abused for a DoS attack for programs that call ZoneInfo with untrusted timezone; for example, since reading CON is a blocking operation in the asyncio world, a web server that calls ZoneInfo with untrusted timezone input would stop its job and no future connections will succeed. Note that this bug only occurs on Windows for obvious reasons. Repro case: >>> from zoneinfo import ZoneInfo >>> ZoneInfo("CON") This is related to bpo-41530 where timezone __init__.py does not raise ZoneInfoNotFoundError. And finally, this happens with other file-based operations (and they are probably intentional); however, zoneinfo is designed to be secure by default, for example by disallowing path traversals. The interactions with Windows device names are not documented at all in the references. It's a common practice to let the users choose their preferred timezone in web applications, and such programs are expected to call ZoneInfo constructor with externally provided string. Timezone calculation should never cause a web server to stop to read stdin. ---------- components: Library (Lib) messages: 398900 nosy: apple502j priority: normal severity: normal status: open title: zoneinfo.ZoneInfo does not check for Windows device names type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:00:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Aug 2021 15:00:23 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1628089223.63.0.545250221847.issue44611@roundup.psfhosted.org> STINNER Victor added the comment: Would it be possible to document in os.urandom() documentation that the BCryptGenRandom() function is used on Windows with the "system-preferred random number generator algorithm"? (I don't think that we should mention the BCRYPT_USE_SYSTEM_PREFERRED_RNG constant.) ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:01:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Aug 2021 15:01:09 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1628089269.78.0.14691043722.issue44611@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for this change, I like the fact that hCryptProv variable could be removed! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:01:34 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 04 Aug 2021 15:01:34 +0000 Subject: [issue44820] subprocess hungs when processing value from mariadb In-Reply-To: <1628056178.39.0.585124478432.issue44820@roundup.psfhosted.org> Message-ID: <1628089294.81.0.585327669096.issue44820@roundup.psfhosted.org> Mark Dickinson added the comment: Hi @jb. This tracker is for reporting bugs in the core Python language. While it's possible that what you're experiencing is due to a bug in core Python, on the information given it's likely that the problem is either in your own code, or in whatever database driver code you're using. In either case, I'm afraid this tracker is not the appropriate place to seek help. For general debugging help, you could try any of the various dedicated Python groups and mailing lists (for example, discuss.python.org), or something like Stack Overflow. Be prepared to give details of exactly what you did, what you expected to happen, and what actually happened, along with code that will help others reproduce your issue. I'm going to close here - currently, there's nothing useful that the Python core team can do with this report. The issue can be re-opened with more information after further investigation, if that investigation produces reasonable grounds to suspect a core Python bug. ---------- nosy: +mark.dickinson resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:15:55 2021 From: report at bugs.python.org (Harry) Date: Wed, 04 Aug 2021 15:15:55 +0000 Subject: [issue44760] Turtle Documentation - Contents Hyperlink conflict In-Reply-To: <1627464661.57.0.766056732309.issue44760@roundup.psfhosted.org> Message-ID: <1628090155.36.0.827316146068.issue44760@roundup.psfhosted.org> Change by Harry : ---------- keywords: +patch pull_requests: +26093 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27592 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:25:06 2021 From: report at bugs.python.org (Pooia) Date: Wed, 04 Aug 2021 15:25:06 +0000 Subject: [issue44818] '\t' (tab) support In-Reply-To: <1628004549.62.0.750947198771.issue44818@roundup.psfhosted.org> Message-ID: Pooia added the comment: unexcpeted indent On Tue, Aug 3, 2021 at 7:59 PM Serhiy Storchaka wrote: > > Change by Serhiy Storchaka : > > > ---------- > status: open -> pending > > _______________________________________ > Python tracker > > _______________________________________ > ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:32:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Aug 2021 15:32:05 +0000 Subject: [issue31426] [3.5] crash in gen_traverse(): gi_frame.ob_type=NULL, called by subtract_refs() during a GC collection In-Reply-To: <1505205309.2.0.369809964342.issue31426@psf.upfronthosting.co.za> Message-ID: <1628091125.03.0.710185252453.issue31426@roundup.psfhosted.org> STINNER Victor added the comment: This bug report mentions Python 3.5 and 3.6 which no longer accept bugfixes. Since nobody reported issues on Python 3.9 and newer (which still accept bugfixes), I close the issue as out of date. Victor Zhestkov: > It seems I have the same segfault, but with 3.6.13 python shipped with SLE15SP2. It's salt-api process under intensive usage. I'm able to reproduce it, but can't isolate due to the service complexity. In some cases it takes about 5 minutes to be crashed, but in others it could run with no crash for about an hour or more (I keep the workload on this service with a kind of stress test). See my notes to debug crashes happening during GC collections: https://pythondev.readthedocs.io/debug_tools.html#debug-crash-in-garbage-collection-visit-decref You can try to use a way smaller GC threshold: call gc.set_threshold(5) at the very beginning of your application. I strongly advice you to use a debug mode of Python, since it includes way more debug modes. I also strongly advice you to upgrade Python. I added many debug checks for object consistency in the GC in recent Python releases (3.8, 3.9, 3.10) and when a bug arises, Python dumps way more information about the faulty Python object. Good luck for debug it. But please don't comment this closed issue. Python 3.6 is no longer supported. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:35:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Aug 2021 15:35:05 +0000 Subject: [issue41117] [easy C] GC: Use local variable 'op' when invoking 'traverse' in 'subtract_refs' In-Reply-To: <1593102927.54.0.130776638406.issue41117@roundup.psfhosted.org> Message-ID: <1628091305.05.0.261732863733.issue41117@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 1.0 -> 2.0 pull_requests: +26094 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27593 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:36:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Aug 2021 15:36:03 +0000 Subject: [issue41117] [easy C] GC: Use local variable 'op' when invoking 'traverse' in 'subtract_refs' In-Reply-To: <1593102927.54.0.130776638406.issue41117@roundup.psfhosted.org> Message-ID: <1628091363.9.0.284953326095.issue41117@roundup.psfhosted.org> STINNER Victor added the comment: I created PR 27593. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:39:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Aug 2021 15:39:42 +0000 Subject: [issue44683] Can't subscript objects with the string "1" using str.format() In-Reply-To: <1626785904.54.0.269807586162.issue44683@roundup.psfhosted.org> Message-ID: <1628091582.09.0.398224018956.issue44683@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:40:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Aug 2021 15:40:50 +0000 Subject: [issue44661] Update property_descr_set to use vectorcall if possible. In-Reply-To: <1626499183.47.0.424501329703.issue44661@roundup.psfhosted.org> Message-ID: <1628091650.4.0.749691672743.issue44661@roundup.psfhosted.org> STINNER Victor added the comment: > Mean +- std dev: [property_base] 140 ns +- 5 ns -> [property_vectorcall] 125 ns +- 2 ns: 1.12x faster Ah! That's better. If it was only 1.01x faster, I would say that it's not worth it. But 1.12x is worth it. Thanks for this optimization. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:41:22 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 04 Aug 2021 15:41:22 +0000 Subject: [issue44821] Instance dictionaries should be created eagerly In-Reply-To: <1628063836.31.0.548816977554.issue44821@roundup.psfhosted.org> Message-ID: <1628091682.27.0.66048527006.issue44821@roundup.psfhosted.org> Mark Shannon added the comment: New changeset cee67fa66129b5d1db5c8aa3884338f82f0da3de by Mark Shannon in branch 'main': bpo-44821: Eagerly assign __dict__ for new objects. (GH-27589) https://github.com/python/cpython/commit/cee67fa66129b5d1db5c8aa3884338f82f0da3de ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 11:51:57 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 04 Aug 2021 15:51:57 +0000 Subject: [issue44683] Can't subscript objects with the string "1" using str.format() In-Reply-To: <1626785904.54.0.269807586162.issue44683@roundup.psfhosted.org> Message-ID: <1628092317.68.0.596724825104.issue44683@roundup.psfhosted.org> Change by Eric V. Smith : ---------- components: +Interpreter Core -Unicode _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 12:09:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Aug 2021 16:09:31 +0000 Subject: [issue41117] [easy C] GC: Use local variable 'op' when invoking 'traverse' in 'subtract_refs' In-Reply-To: <1593102927.54.0.130776638406.issue41117@roundup.psfhosted.org> Message-ID: <1628093371.59.0.686693210883.issue41117@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c34fa2bb06ea44045af8493dfa414addb2b7ce66 by Victor Stinner in branch 'main': bpo-41117: Cleanup subtract_refs() (GH-27593) https://github.com/python/cpython/commit/c34fa2bb06ea44045af8493dfa414addb2b7ce66 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 12:09:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 04 Aug 2021 16:09:51 +0000 Subject: [issue41117] [easy C] GC: Use local variable 'op' when invoking 'traverse' in 'subtract_refs' In-Reply-To: <1593102927.54.0.130776638406.issue41117@roundup.psfhosted.org> Message-ID: <1628093391.14.0.0959085663009.issue41117@roundup.psfhosted.org> STINNER Victor added the comment: Thanks William, I made the change that you suggested. Next time, please create a PR directly ;-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 12:34:06 2021 From: report at bugs.python.org (Brian) Date: Wed, 04 Aug 2021 16:34:06 +0000 Subject: [issue44819] assertSequenceEqual does not use _getAssertEqualityFunc In-Reply-To: <1628022280.67.0.522628726203.issue44819@roundup.psfhosted.org> Message-ID: <1628094846.13.0.638973274023.issue44819@roundup.psfhosted.org> Brian added the comment: I've attached an example of what I want. It contains a class, a function to be tested, and a test class which tests the function. What TestCase.addTypeEqualityFunc feels like it offers is a chance to compare objects however I feel like is needed for each test. Sometimes all I want is to compare the properties of the objects, and maybe not even all of the properties! When I have a list of these objects and I've added an equality function for the object, I was expecting the test class to use my equality function when comparing objects in the list. ---------- Added file: https://bugs.python.org/file50201/example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 12:42:30 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 04 Aug 2021 16:42:30 +0000 Subject: [issue41946] Add concrete examples to os.path documentation In-Reply-To: <1601913967.48.0.506783023492.issue41946@roundup.psfhosted.org> Message-ID: <1628095350.85.0.676143516008.issue41946@roundup.psfhosted.org> Andrei Kulakov added the comment: Some examples were added since this issue was created, but more can be added. Stargirl: feel free to open a PR, I can review it. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 12:59:27 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 04 Aug 2021 16:59:27 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section Message-ID: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> New submission from Mark Dickinson : The "Bug Report Writing Guidelines" link in the "Dealing with Bugs" doc section (https://docs.python.org/3/bugs.html) looks broken. The linked URL is https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines, but that gives me a "Page not found" error. I tried to find equivalent content elsewhere on developer.mozilla.org, but either it's not there or my search-fu is failing me. ---------- assignee: docs at python components: Documentation messages: 398913 nosy: docs at python, mark.dickinson priority: normal severity: normal status: open title: Broken Mozilla devguide link in "Dealing with Bugs" doc section type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:00:53 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 04 Aug 2021 17:00:53 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628096453.21.0.159858811234.issue44830@roundup.psfhosted.org> Mark Dickinson added the comment: A bit more Googling found this: https://support.mozilla.org/en-US/kb/contributors-guide-writing-good-bug ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:05:11 2021 From: report at bugs.python.org (Hasan) Date: Wed, 04 Aug 2021 17:05:11 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1628096711.86.0.308320146465.issue39355@roundup.psfhosted.org> Hasan added the comment: If nobody works, i would like to solve this ---------- nosy: +AliyevH _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:19:52 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 04 Aug 2021 17:19:52 +0000 Subject: [issue44829] zoneinfo.ZoneInfo does not check for Windows device names In-Reply-To: <1628087818.07.0.11590329108.issue44829@roundup.psfhosted.org> Message-ID: <1628097592.99.0.94738693937.issue44829@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +belopolsky, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:32:45 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 04 Aug 2021 17:32:45 +0000 Subject: [issue44829] zoneinfo.ZoneInfo does not check for Windows device names In-Reply-To: <1628087818.07.0.11590329108.issue44829@roundup.psfhosted.org> Message-ID: <1628098365.28.0.673071443937.issue44829@roundup.psfhosted.org> Eryk Sun added the comment: In zoneinfo._tzpath, _validate_tzfile_path() depends on os.path.normpath(). I think the Windows implementation of normpath() in the ntpath module should be extended to normalize reserved names in the final path component in the same manner as WinAPI GetFullPathNameW(). Alternatively, an isreserved() function could be added to os.path. This would allow _validate_tzfile_path() to raise a more informative exception for a reserved name. Reserved names: GetFullPathNameW() strips trailing spaces and dots from the final path component. This applies to all path types. For example: >>> nt._getfullpathname('\\\\?\\UNC/server/share/spam. . .') '\\\\?\\UNC\\server\\share\\spam' GetFullPathNameW() reserves DOS device names in the final component of a relative path or drive path -- but not in a UNC path or device path. The following case-insensitive names are reserved: * NUL * CON * CONIN$ * CONOUT$ * AUX * PRN * COM<1-9> * LPT<1-9> A reserved device name begins with one of the above base names plus an optional suffix. The suffix is zero or more spaces followed optionally by a "." or ":" and zero or more characters. The normalized result is a "\\\\.\\" device path for the base device name. For example: >>> nt._getfullpathname('C:/Temp/con . spam') '\\\\.\\con' >>> nt._getfullpathname('C:/Temp/con : spam') '\\\\.\\con' ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:40:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 04 Aug 2021 17:40:20 +0000 Subject: [issue44819] assertSequenceEqual does not use _getAssertEqualityFunc In-Reply-To: <1628022280.67.0.522628726203.issue44819@roundup.psfhosted.org> Message-ID: <1628098820.82.0.804381466355.issue44819@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate superseder: -> addTypeEqualityFunc is not used in assertListEqual _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:41:09 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 04 Aug 2021 17:41:09 +0000 Subject: [issue44818] '\t' (tab) support In-Reply-To: <1627979105.66.0.152787864247.issue44818@roundup.psfhosted.org> Message-ID: <1628098869.15.0.858657553647.issue44818@roundup.psfhosted.org> Eric V. Smith added the comment: Please show us an example that demonstrates your problem. Show us the code you tried, what you expected to happen, and what actually happened. Otherwise we can?t help you. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:45:15 2021 From: report at bugs.python.org (Paul Ganssle) Date: Wed, 04 Aug 2021 17:45:15 +0000 Subject: [issue44829] zoneinfo.ZoneInfo does not check for Windows device names In-Reply-To: <1628087818.07.0.11590329108.issue44829@roundup.psfhosted.org> Message-ID: <1628099115.1.0.142283415922.issue44829@roundup.psfhosted.org> Paul Ganssle added the comment: Sorry you didn't receive a response to your security@ email, I guess my response just went to the PSRT, not to you as well. I believe we determined that this was an issue in importlib.resources generally, not specific to zoneinfo. I think `importlib.resources.open_binary` should check if a resource is a file with `os.isfile` before opening it. That will solve the issue in zoneinfo and other similar situations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:47:50 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 17:47:50 +0000 Subject: [issue44760] Turtle Documentation - Contents Hyperlink conflict In-Reply-To: <1627464661.57.0.766056732309.issue44760@roundup.psfhosted.org> Message-ID: <1628099270.33.0.979036107686.issue44760@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26095 pull_request: https://github.com/python/cpython/pull/27594 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:47:57 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 17:47:57 +0000 Subject: [issue44760] Turtle Documentation - Contents Hyperlink conflict In-Reply-To: <1627464661.57.0.766056732309.issue44760@roundup.psfhosted.org> Message-ID: <1628099277.44.0.746986029956.issue44760@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26096 pull_request: https://github.com/python/cpython/pull/27595 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:49:51 2021 From: report at bugs.python.org (Miksus) Date: Wed, 04 Aug 2021 17:49:51 +0000 Subject: [issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None) Message-ID: <1628099391.12.0.0928824788179.issue44831@roundup.psfhosted.org> New submission from Miksus : I am trying to measure time twice and the second measurement gives a time that is 1 microsecond before the first measurement about half of the time. My experiment in short: --------------------------------------------------- import time, datetime start = time.time() end = datetime.datetime.now() start = datetime.datetime.fromtimestamp(start, None) assert end >= start # fails about half the time. --------------------------------------------------- The problem is somewhat interesting. This does not fail: --------------------------------------------------- import time, datetime start = time.time() end = time.time() start = datetime.datetime.fromtimestamp(start, None) end = datetime.datetime.fromtimestamp(end, None) assert end >= start --------------------------------------------------- And neither does this: --------------------------------------------------- import datetime start = datetime.datetime.now() end = datetime.datetime.now() assert end >= start --------------------------------------------------- And it seems datetime.datetime.now() works the same way as to how I handled the "start" time in my first experiment: https://github.com/python/cpython/blob/3.6/Lib/datetime.py#L1514 and therefore the issue seems to be under the hood. I have tested this on two Windows 10 machines (Python 3.6 & 3.8) in which cases this occurred. This did not happen on Raspberry Pi OS using Python 3.7. In short: - The time module imported in datetime.datetime.now() seems to measure time slightly differently than the time module imported by a Python user. - This seems to be Windows specific. My actual application has some code in between the measurements suffering from the same problem thus this is not an issue affecting only toy examples. ---------- components: Library (Lib), Windows messages: 398919 nosy: Miksus, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None) versions: Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:52:18 2021 From: report at bugs.python.org (Ben Boeckel) Date: Wed, 04 Aug 2021 17:52:18 +0000 Subject: [issue44832] Compiler detection is not strict enough Message-ID: <1628099537.98.0.0593378255107.issue44832@roundup.psfhosted.org> New submission from Ben Boeckel : Generally, the `configure.ac` script tries to detect compilers based on the path to the compiler. This is mostly fine, but trips up when using `mpicc` as the compiler. Even if the underlying compiler is `gcc`, this gets detected as `icc` in various situations. The best solution is to do some compiler introspection like CMake does to determine what the compiler actually is, but I'm not familiar with the patterns used or available tools in autotools for such things. ---------- components: Build messages: 398920 nosy: mathstuf priority: normal severity: normal status: open title: Compiler detection is not strict enough type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:55:21 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 17:55:21 +0000 Subject: [issue44803] change tracemalloc.BaseFilter to an abstract class In-Reply-To: <1627828296.31.0.469663144509.issue44803@roundup.psfhosted.org> Message-ID: <1628099721.2.0.741546179903.issue44803@roundup.psfhosted.org> ?ukasz Langa added the comment: Many standard libraries, including new ones like asyncio, use `raise NotImplementedError` to denote methods that need re-implementation in subclasses. Some of those base classes even literally *called* Abstract and yet don't inherit from ABC (nor use ABCMeta). Do you intend to change all those as well? While I agree it would be cleaner to have them defined as abstract, at the moment I'm not sure it's worth the churn. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:55:51 2021 From: report at bugs.python.org (Miksus) Date: Wed, 04 Aug 2021 17:55:51 +0000 Subject: [issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None) In-Reply-To: <1628099391.12.0.0928824788179.issue44831@roundup.psfhosted.org> Message-ID: <1628099751.77.0.360037910162.issue44831@roundup.psfhosted.org> Miksus added the comment: I accidentially posted Python 3.6 link to the declaration of datetime.datetime.now() but this has been unchanged: https://github.com/python/cpython/blob/3d2b4c6f18d7e644e5850d2af74ac5dc530eb24c/Lib/datetime.py#L1696 The actual piece of code as of now: ... import time as _time ... @classmethod def now(cls, tz=None): "Construct a datetime from time.time() and optional time zone info." t = _time.time() return cls.fromtimestamp(t, tz) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 13:56:03 2021 From: report at bugs.python.org (ENG19EC0098_Swathi.M) Date: Wed, 04 Aug 2021 17:56:03 +0000 Subject: [issue44833] VideoCapture is not installing Message-ID: <1628099763.63.0.902079879024.issue44833@roundup.psfhosted.org> New submission from ENG19EC0098_Swathi.M : The python version is failing to install the VideoCapture of opencv despite many trials. Would request you to kindly go through this at the earliest ---------- components: Installation files: Screenshot 2021-08-04 232419.jpg messages: 398923 nosy: eng19ec0098.swathim priority: normal severity: normal status: open title: VideoCapture is not installing type: resource usage versions: Python 3.9 Added file: https://bugs.python.org/file50202/Screenshot 2021-08-04 232419.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:02:23 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 18:02:23 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? In-Reply-To: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> Message-ID: <1628100143.12.0.279723523507.issue44301@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26098 pull_request: https://github.com/python/cpython/pull/27597 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:02:15 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 18:02:15 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? In-Reply-To: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> Message-ID: <1628100135.89.0.0523650391774.issue44301@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26097 pull_request: https://github.com/python/cpython/pull/27596 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:03:14 2021 From: report at bugs.python.org (Adrian Garcia Badaracco) Date: Wed, 04 Aug 2021 18:03:14 +0000 Subject: [issue44834] contextvars.Context.run w/ coroutines gives inconsistent behavior Message-ID: <1628100194.12.0.330262028027.issue44834@roundup.psfhosted.org> New submission from Adrian Garcia Badaracco : I recently tried to use `contextvars.Context.run` w/ coroutines, expecting the same behavior as with regular functions, but it seems that `contextvars.Context.run` does not work w/ coroutines. I'm sorry if this is something obvious to do with how coroutines work under the hood, if so I'd appreciate some help in understanding why this is the expected behavior. ```python import asyncio import contextvars ctxvar = contextvars.ContextVar("ctxvar", default="spam") def func(): assert ctxvar.get() == "spam" async def coro(): func() async def main(): ctx = contextvars.copy_context() ctxvar.set("ham") ctx.run(func) # works await ctx.run(coro) # breaks asyncio.run(main()) ``` Thanks! ---------- components: Library (Lib) messages: 398924 nosy: adriangb priority: normal severity: normal status: open title: contextvars.Context.run w/ coroutines gives inconsistent behavior type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:03:38 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 04 Aug 2021 18:03:38 +0000 Subject: [issue44829] zoneinfo.ZoneInfo does not check for Windows device names In-Reply-To: <1628087818.07.0.11590329108.issue44829@roundup.psfhosted.org> Message-ID: <1628100218.36.0.96250450606.issue44829@roundup.psfhosted.org> Change by Eryk Sun : ---------- Removed message: https://bugs.python.org/msg398916 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:05:52 2021 From: report at bugs.python.org (Adrian Garcia Badaracco) Date: Wed, 04 Aug 2021 18:05:52 +0000 Subject: [issue42815] new thread doesn't copy context of the parent thread In-Reply-To: <1609674214.71.0.941381845328.issue42815@roundup.psfhosted.org> Message-ID: <1628100352.78.0.539228664281.issue42815@roundup.psfhosted.org> Change by Adrian Garcia Badaracco : ---------- nosy: +adriangb _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:06:43 2021 From: report at bugs.python.org (Adrian Garcia Badaracco) Date: Wed, 04 Aug 2021 18:06:43 +0000 Subject: [issue44834] contextvars.Context.run w/ coroutines gives inconsistent behavior In-Reply-To: <1628100194.12.0.330262028027.issue44834@roundup.psfhosted.org> Message-ID: <1628100403.9.0.210872204403.issue44834@roundup.psfhosted.org> Change by Adrian Garcia Badaracco : ---------- nosy: +yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:07:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 18:07:08 +0000 Subject: [issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec In-Reply-To: <1627801738.44.0.278142498011.issue44801@roundup.psfhosted.org> Message-ID: <1628100428.74.0.992347403827.issue44801@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 3875a6954741065b136650db67ac533bc70a3eac by Serhiy Storchaka in branch 'main': bpo-44801: Check arguments in substitution of ParamSpec in Callable (GH-27585) https://github.com/python/cpython/commit/3875a6954741065b136650db67ac533bc70a3eac ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:07:09 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 18:07:09 +0000 Subject: [issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec In-Reply-To: <1627801738.44.0.278142498011.issue44801@roundup.psfhosted.org> Message-ID: <1628100429.89.0.583939596307.issue44801@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26099 pull_request: https://github.com/python/cpython/pull/27598 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:07:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 04 Aug 2021 18:07:41 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1628100461.88.0.892411347308.issue33277@roundup.psfhosted.org> Irit Katriel added the comment: > We didn't make it stronger since we can't get rid of any of these attributes until Python 2.7 compatibility is no longer a concern. Maybe this can be revisited now. ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:15:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 18:15:59 +0000 Subject: [issue44760] Turtle Documentation - Contents Hyperlink conflict In-Reply-To: <1627464661.57.0.766056732309.issue44760@roundup.psfhosted.org> Message-ID: <1628100959.01.0.924484580891.issue44760@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Harry! ? ? ? ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:21:36 2021 From: report at bugs.python.org (Sebastian Berg) Date: Wed, 04 Aug 2021 18:21:36 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1628101296.33.0.350859925007.issue44698@roundup.psfhosted.org> Sebastian Berg added the comment: The fix broke NumPy (see also https://github.com/numpy/numpy/pull/19612) It seems incorrect. After all, it doesn't matter much whether the float can be converted to an integer correctly (or even if it returns an undefined value), so long `int_value == float_value` remains sensible. The old cast cast integers to complex when they were out of range (which is fine), the new code raises an error instead. ---------- nosy: +seberg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:24:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 18:24:37 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? In-Reply-To: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> Message-ID: <1628101477.62.0.568257861577.issue44301@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:24:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 18:24:59 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? In-Reply-To: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> Message-ID: <1628101499.65.0.156221529218.issue44301@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for your report, Azat! ? ? ? ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:29:00 2021 From: report at bugs.python.org (Sebastian Berg) Date: Wed, 04 Aug 2021 18:29:00 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1628101740.96.0.462698591511.issue44698@roundup.psfhosted.org> Sebastian Berg added the comment: Hmm, sorry, I overshot/misread :(. The thing that the NumPy test-suite trips over is that: c_powi(inf+0j, 3) seems to not raise, but: _Py_c_pow(inf+0j, 3.+0j) (or nan+0.j rather then inf+0j) does seem to raise (returning `nan+nanj` in both cases). If this is the `inf` code path, raising an error may actually be fix and the integer code path should maybe also do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:31:41 2021 From: report at bugs.python.org (=?utf-8?q?Michael_F=C3=B6rderer?=) Date: Wed, 04 Aug 2021 18:31:41 +0000 Subject: [issue44817] os.path.realpath fails with WinError 161 In-Reply-To: <1627968251.97.0.10381933547.issue44817@roundup.psfhosted.org> Message-ID: <1628101901.86.0.326520596456.issue44817@roundup.psfhosted.org> Michael F?rderer added the comment: Updated with ERROR_BAD_NETPATH (53). What about following errors: - ERROR_LOCK_VIOLATION (33) - ERROR_DEV_NOT_EXIST (52) - ERROR_BAD_NET_RESP (58) - ERROR_UNEXP_NET_ERR (59) - ERROR_NETNAME_DELETED (64) - ERROR_NETWORK_ACCESS_DENIED (65) - ERROR_BAD_DEV_TYPE (66) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:40:26 2021 From: report at bugs.python.org (Sebastian Berg) Date: Wed, 04 Aug 2021 18:40:26 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1628102426.91.0.282056547185.issue44698@roundup.psfhosted.org> Sebastian Berg added the comment: (Sorry for the spam. I think we can/should just hard-code the expected values in the NumPy test-suite. So this is not actually an issue for NumPy and probably just warrants a double-check that the behaviour change is desirable.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:51:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 18:51:38 +0000 Subject: [issue41354] filecmp.cmp documentation does not match actual code In-Reply-To: <1595316543.83.0.558279011146.issue41354@roundup.psfhosted.org> Message-ID: <1628103098.47.0.313753152792.issue41354@roundup.psfhosted.org> ?ukasz Langa added the comment: Closed in favor of BPO-42958. Thanks for your report, Christof! ---------- nosy: +lukasz.langa resolution: -> out of date stage: patch review -> resolved status: open -> closed superseder: -> filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:53:11 2021 From: report at bugs.python.org (E. Paine) Date: Wed, 04 Aug 2021 18:53:11 +0000 Subject: [issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6 In-Reply-To: <1628076093.82.0.287740145135.issue44828@roundup.psfhosted.org> Message-ID: <1628103191.54.0.933271838639.issue44828@roundup.psfhosted.org> E. Paine added the comment: Thanks for reporting issue and for including the backtrace. I presume you used the Universal 2 installer, given that you are running an M1 mac? Kevin, do you have access to the macOS 12 beta to help test whether this is a Tkinter or Tk bug? (I assume the latter, as it is likely Apple have changed the API again) ---------- components: +macOS nosy: +epaine, ned.deily, ronaldoussoren, serhiy.storchaka, wordtech _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 14:53:38 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 04 Aug 2021 18:53:38 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1628103218.56.0.295439185563.issue44698@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks, @seberg. I'll take a look and see if we can restore the old behaviour, at least for Python 3.9 and 3.10. I'm not convinced that the new behaviour is objectively wrong, but I agree that the *change* in behaviour is problematic. I do find it a little odd that we're special-casing integer exponents for complex numbers when no such special-casing exists for floats. It's not purely for optimization (despite what the code might say). And all the messing around with trying to figure out exactly _which_ doubles can safely be cast to long (which was the original cause of this issue) seems like a symptom of a deeper problem, which is that it doesn't make a whole lot of sense to be distinguishing in the first place. But if we're going to change the behaviour, we should only be doing that in 3.11. OTOH, there *is* real value in z**2 being fast and accurate; we definitely want to keep that. (Perhaps the math and cmath modules should grow a `square` function.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:01:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 19:01:41 +0000 Subject: [issue44564] DeprecationWarning in test_enum over formatting In-Reply-To: <1625459046.43.0.477755678755.issue44564@roundup.psfhosted.org> Message-ID: <1628103701.9.0.325549248326.issue44564@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f99c015638b46e46ae3ee3f27b96a514007cdaef by Brandon Schabell in branch 'main': bpo-44564 Move formatted assertion under deprecation warning context (GH-27090) https://github.com/python/cpython/commit/f99c015638b46e46ae3ee3f27b96a514007cdaef ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:03:17 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 04 Aug 2021 19:03:17 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1628103797.75.0.583086079314.issue44698@roundup.psfhosted.org> Mark Dickinson added the comment: > a double-check that the behaviour change is desirable I'm not sure I'm brave or foolhardy enough to try to figure out what all of the special case results *should* be for complex pow. The special cases seem reasonably clear cut for everything else in the cmath module, but for pow it's pretty much going to be a nightmare. I'm not sure there's much Python can do here in the way of guarantees, other than "not obviously horribly wrong". (And while I have reasonable confidence we can achieve the "not obviously horribly wrong" goal for everything else, I still have doubts for pow.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:03:50 2021 From: report at bugs.python.org (Brett Cannon) Date: Wed, 04 Aug 2021 19:03:50 +0000 Subject: [issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules In-Reply-To: <1523656102.14.0.682650639539.issue33277@psf.upfronthosting.co.za> Message-ID: <1628103830.55.0.413330673718.issue33277@roundup.psfhosted.org> Brett Cannon added the comment: > Maybe this can be revisited now. I've started the work already (albeit rather slowly ?). Importlib has been updated to prefer __spec__.parent of __package__ and warns when the values are not equal. Next step will be to raise an ImportWarning when __package__ is defined but __spec__.parent is not (then DeprecationWarning after that). For __loader__ I got Python 3.10 to fall back on to __spec__.loader. Next step is https://bugs.python.org/issue42132 to update C code to set __spec__ where appropriate. From there the check for equivalence can go in (which then leads to the warnings). I have not started with __cached__ yet, so next step is making sure all uses fall back on __spec__. So, to be clear, the steps I have been following are: 1. Make sure all code falls back on __spec__ when appropriate (one release) 2. Raise an ImportWarning when values differ (one release) 3. Make __spec__ take precedence over old attribute (one release) 4. Raise an ImportWarning when having to fall back to older attribute (two releases) 5. Raise a DeprecationWarning when falling back on older attribute (two releases) 6. Clean up code ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:04:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 19:04:28 +0000 Subject: [issue44564] DeprecationWarning in test_enum over formatting In-Reply-To: <1625459046.43.0.477755678755.issue44564@roundup.psfhosted.org> Message-ID: <1628103868.08.0.569113184438.issue44564@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Brandon! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:14:08 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 04 Aug 2021 19:14:08 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1628104448.42.0.120112266286.issue44698@roundup.psfhosted.org> Change by Mark Dickinson : ---------- assignee: twouters -> mark.dickinson status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:19:17 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 04 Aug 2021 19:19:17 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1628104757.73.0.206420953673.issue44698@roundup.psfhosted.org> Mark Dickinson added the comment: > brave or foolhardy enough to try to figure out what all of the special case results *should* be for complex pow Addendum: even the C standards give up at this point. For everything else the special cases are spelled out in detail, but for cpow, from ?G.6.4.1 of C17 (in Annex G), we have: > The cpow functions raise floating-point exceptions if appropriate for the calculation of the parts of the result, and may also raise spurious floating-point exceptions. And that's it. (Well, not quite: there's a footnote, which says: > This allows cpow(z, c) to be implemented as cexp(cclog(z)) without precluding implementations that treat special cases more carefully. ) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:28:20 2021 From: report at bugs.python.org (Sebastian Berg) Date: Wed, 04 Aug 2021 19:28:20 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1628105300.72.0.388149810273.issue44698@roundup.psfhosted.org> Sebastian Berg added the comment: Thanks for looking into it! `cpow` is indeed complicated. We had some discussion in NumPy about `0**y` branch cuts (I did yet not finish it, because thinking about the branch cuts is tricky). It is almost reassuring that the C standard also hedges out :). Although, it means that there is no reliance on math libraries if we want to treat the special cases more carefully :(. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:30:48 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 04 Aug 2021 19:30:48 +0000 Subject: [issue44833] VideoCapture is not installing In-Reply-To: <1628099763.63.0.902079879024.issue44833@roundup.psfhosted.org> Message-ID: <1628105448.9.0.655887373264.issue44833@roundup.psfhosted.org> Eric V. Smith added the comment: Please do no post screen captures. Copy and paste the text into the bug report. It looks like VideoCapture has not released a 3.9 compatible wheel file on PyPI. You should follow up with that project directly, as it is not part of python?s standard library. ---------- nosy: +eric.smith resolution: -> third party stage: -> resolved status: open -> closed type: resource usage -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:34:48 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 19:34:48 +0000 Subject: [issue43066] Zipfile with leading slashes In-Reply-To: <1611952128.43.0.663068649879.issue43066@roundup.psfhosted.org> Message-ID: <1628105688.04.0.90969957491.issue43066@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26101 pull_request: https://github.com/python/cpython/pull/27606 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:34:43 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 19:34:43 +0000 Subject: [issue43066] Zipfile with leading slashes In-Reply-To: <1611952128.43.0.663068649879.issue43066@roundup.psfhosted.org> Message-ID: <1628105683.96.0.819464398861.issue43066@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26100 pull_request: https://github.com/python/cpython/pull/27605 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:35:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 19:35:02 +0000 Subject: [issue43066] Zipfile with leading slashes In-Reply-To: <1611952128.43.0.663068649879.issue43066@roundup.psfhosted.org> Message-ID: <1628105702.72.0.278245646099.issue43066@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7c5dab4340032eb15d3797d8b601ef11649bbab3 by andrei kulakov in branch 'main': [doc] bpo-43066: zipfile - add note on leading slash in the filename arg (GH-26899) https://github.com/python/cpython/commit/7c5dab4340032eb15d3797d8b601ef11649bbab3 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:39:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 19:39:54 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1628105994.66.0.657303953506.issue42958@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a8dc4893d2b28827e82447326ea47759c161a722 by andrei kulakov in branch 'main': bpo-42958: Improve description of shallow= in filecmp.cmp docs (GH-27166) https://github.com/python/cpython/commit/a8dc4893d2b28827e82447326ea47759c161a722 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:39:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 19:39:55 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1628105994.66.0.657303953506.issue42958@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a8dc4893d2b28827e82447326ea47759c161a722 by andrei kulakov in branch 'main': bpo-42958: Improve description of shallow= in filecmp.cmp docs (GH-27166) https://github.com/python/cpython/commit/a8dc4893d2b28827e82447326ea47759c161a722 ---------- message_count: 10.0 -> 11.0 nosy: +lukasz.langa, miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26102 pull_request: https://github.com/python/cpython/pull/27607 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:39:58 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 19:39:58 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1628105998.53.0.963717817326.issue42958@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26103 pull_request: https://github.com/python/cpython/pull/27608 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:48:44 2021 From: report at bugs.python.org (Bas van Beek) Date: Wed, 04 Aug 2021 19:48:44 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628106524.12.0.0461571739799.issue44524@roundup.psfhosted.org> Bas van Beek added the comment: This PRs herein have created a situation wherein the `__name__`/`__qualname__` attributes of certain typing objects can be `None`. Is this behavior intentional? ``` >>> from typing import Union >>> print(Union[int, float].__name__) None ``` ---------- nosy: +BvB93 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 15:59:11 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 19:59:11 +0000 Subject: [issue43066] Zipfile with leading slashes In-Reply-To: <1611952128.43.0.663068649879.issue43066@roundup.psfhosted.org> Message-ID: <1628107151.33.0.788163195687.issue43066@roundup.psfhosted.org> miss-islington added the comment: New changeset 98f6a72ff621c2033e8f2c38df410e9bfa2b772a by Miss Islington (bot) in branch '3.10': [doc] bpo-43066: zipfile - add note on leading slash in the filename arg (GH-26899) https://github.com/python/cpython/commit/98f6a72ff621c2033e8f2c38df410e9bfa2b772a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 16:00:58 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 20:00:58 +0000 Subject: [issue43066] Zipfile with leading slashes In-Reply-To: <1611952128.43.0.663068649879.issue43066@roundup.psfhosted.org> Message-ID: <1628107258.09.0.748920950402.issue43066@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1a2c0ecfa2ef8542baee951f12b60afd165be9cf by Miss Islington (bot) in branch '3.9': [doc] bpo-43066: zipfile - add note on leading slash in the filename arg (GH-26899) (GH-27606) https://github.com/python/cpython/commit/1a2c0ecfa2ef8542baee951f12b60afd165be9cf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 16:02:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 20:02:09 +0000 Subject: [issue43066] Zipfile with leading slashes In-Reply-To: <1611952128.43.0.663068649879.issue43066@roundup.psfhosted.org> Message-ID: <1628107329.73.0.38768298909.issue43066@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for the report, Garrison. And Andrei for the patch! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 16:03:40 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 20:03:40 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1628107420.83.0.475696019001.issue42958@roundup.psfhosted.org> miss-islington added the comment: New changeset c2593b4d06712cefcdeae93b32f88faa4772bc3a by Miss Islington (bot) in branch '3.10': bpo-42958: Improve description of shallow= in filecmp.cmp docs (GH-27166) https://github.com/python/cpython/commit/c2593b4d06712cefcdeae93b32f88faa4772bc3a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 16:09:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 20:09:59 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1628107799.07.0.794992465459.issue42958@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7dad0337518a0d599caf8f803a5bf45db67cbe9b by Miss Islington (bot) in branch '3.9': bpo-42958: Improve description of shallow= in filecmp.cmp docs (GH-27166) (GH-27608) https://github.com/python/cpython/commit/7dad0337518a0d599caf8f803a5bf45db67cbe9b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 16:11:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 20:11:39 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1628107899.52.0.376783207087.issue42958@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks all for your effort on improving this! ? ? ? ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 16:29:16 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Aug 2021 20:29:16 +0000 Subject: [issue44828] Using tkinter.filedialog crashes on macOS 12 Monterey beta 4 with tk8.6.11 from python.org installers In-Reply-To: <1628076093.82.0.287740145135.issue44828@roundup.psfhosted.org> Message-ID: <1628108956.47.0.251696381358.issue44828@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the report. I verified that the crash also occurs on an Intel Mac VM with Monterey beta 4 using the current python.org universal2 installers for 3.9.6 and 3.10.0rc1; they both have a private copy of Tk 8.6.11; so the problem does not appear to be Apple Silicon (M1) related. For what it's worth, the legacy python.org 3.9.6 Intel-only installer, which uses a copy of Tk 8.6.8, does not crash the Monterey beta 4. And no such failures are observed using any of those installers on the current Big Sur 11.5.1 release. ---------- title: Using tkinter.filedialog crashes on macOS Python 3.9.6 -> Using tkinter.filedialog crashes on macOS 12 Monterey beta 4 with tk8.6.11 from python.org installers versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 16:36:34 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 04 Aug 2021 20:36:34 +0000 Subject: [issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec In-Reply-To: <1627801738.44.0.278142498011.issue44801@roundup.psfhosted.org> Message-ID: <1628109394.61.0.548459626321.issue44801@roundup.psfhosted.org> miss-islington added the comment: New changeset 536e35ae6a2555a01f4b51a68ad71dbf7923536d by Miss Islington (bot) in branch '3.10': bpo-44801: Check arguments in substitution of ParamSpec in Callable (GH-27585) https://github.com/python/cpython/commit/536e35ae6a2555a01f4b51a68ad71dbf7923536d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 16:40:13 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 04 Aug 2021 20:40:13 +0000 Subject: [issue44772] Regression in memory use of instances due to dictionary ordering In-Reply-To: <1627554489.64.0.275505717552.issue44772@roundup.psfhosted.org> Message-ID: <1628109613.5.0.92776321612.issue44772@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 16:43:15 2021 From: report at bugs.python.org (Brett Cannon) Date: Wed, 04 Aug 2021 20:43:15 +0000 Subject: [issue41706] docs: operator dunder (`__add__`, et al.) invocations described incorrectly In-Reply-To: <1599165050.43.0.0605757296817.issue41706@roundup.psfhosted.org> Message-ID: <1628109795.04.0.491693856324.issue41706@roundup.psfhosted.org> Brett Cannon added the comment: New changeset 80f33f266b4ad5925a3e58ea3a54ae139a6b6f0e by William Chargin in branch 'main': bpo-41706: Fix special method invocation docs to mention using type() (GH-22084) https://github.com/python/cpython/commit/80f33f266b4ad5925a3e58ea3a54ae139a6b6f0e ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 17:00:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 04 Aug 2021 21:00:35 +0000 Subject: [issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec In-Reply-To: <1627801738.44.0.278142498011.issue44801@roundup.psfhosted.org> Message-ID: <1628110835.0.0.806132497423.issue44801@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 17:12:18 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 04 Aug 2021 21:12:18 +0000 Subject: [issue44617] Undesired Behavior on `match` using Singleton object In-Reply-To: <1626147288.08.0.390931510004.issue44617@roundup.psfhosted.org> Message-ID: <1628111538.11.0.82725729321.issue44617@roundup.psfhosted.org> Brandt Bucher added the comment: Yep, everything is working as intended here. Thanks, Dennis, for taking the time to explain why. Pablo, if you're still unsure of why your examples behave the way they do, I strongly recommend reading through the official tutorial (PEP 636). It goes through the behavior of each of the different patterns in a very straightforward, easy-to-digest way. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 17:46:25 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 04 Aug 2021 21:46:25 +0000 Subject: [issue44817] os.path.realpath fails with WinError 161 In-Reply-To: <1627968251.97.0.10381933547.issue44817@roundup.psfhosted.org> Message-ID: <1628113585.65.0.875049513717.issue44817@roundup.psfhosted.org> Eryk Sun added the comment: ERROR_NETWORK_ACCESS_DENIED (65) should probably be added to the ignore list. I don't know whether it occurs in practice, but we have it mapped to EACCES in PC/errmap.h. The common access error is ERROR_ACCESS_DENIED (5), even on a UNC share with restricted access. Add ERROR_DEV_NOT_EXIST (55) only if you have a case that fails with this error code. It's from the NT status code STATUS_DEVICE_DOES_NOT_EXIST. This might occur when trying to automount a device that's pending removal (see the implementation in ReactOS IopMountVolume [1]), but I can't create this condition. I think a device object would need to be practically stuck in the pending removal state for this to be a practical problem. ERROR_LOCK_VIOLATION (33) isn't relevant. It's an I/O access error for a locked range of a file. realpath() doesn't read or write file data. For the others, I'd wait for an issue to be reported. --- [1] https://github.com/reactos/reactos/blob/master/ntoskrnl/io/iomgr/volume.c#L457 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 18:16:21 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 04 Aug 2021 22:16:21 +0000 Subject: [issue44818] '\t' (tab) support In-Reply-To: Message-ID: <20210804221543.GO10582@ando.pearwood.info> Steven D'Aprano added the comment: On Wed, Aug 04, 2021 at 03:25:06PM +0000, Pooia wrote: > unexcpeted indent What about an unexpected indent? Please explain what you think the bug is in full sentences, showing some example code we can run. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 18:25:43 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 04 Aug 2021 22:25:43 +0000 Subject: [issue44818] '\t' (tab) support In-Reply-To: <1627979105.66.0.152787864247.issue44818@roundup.psfhosted.org> Message-ID: <1628115943.36.0.469642825101.issue44818@roundup.psfhosted.org> Erlend E. Aasland added the comment: I'm guessing this has to do with mixing spaces and tabs when indenting code. This can be fixed in your text editor. ---------- nosy: +erlendaasland status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 18:49:34 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 04 Aug 2021 22:49:34 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1628117374.95.0.266923569258.issue43468@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +26104 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27609 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 19:54:36 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 04 Aug 2021 23:54:36 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1628121276.62.0.304297870282.issue44689@roundup.psfhosted.org> Ned Deily added the comment: > Regarding the "explicit weak linking" when building on MacOS Big Sur and later; wouldn't this mean that a Big Sur build wouldn't work on Catalina? No, if it is done correctly. I think you are trying to solve the wrong problem here. As Ronald noted earlier, we now fully support building Python on a newer version of macOS to run correctly on that version and on older versions (for current python.org-provided macOS binary installers, we support one build that runs on macOS 10.9 through 11 Big Sur). The key to this is weak-linking with the help of Apple-provided availability macros and by properly setting the MACOSX_DEPLOYMENT_TARGET variable when running ./configure to the oldest desired supported macOS release. Because this area is neither well-understood nor well-documented, let me try to get it written down here at the risk of covering some familiar ground. To support more than one version of macOS when building Python, there are basically two approaches: either build on the oldest targeted system and trust that Apple will continue to provide compatibility when running older binaries on new systems; or, build on the newest targeted system and dynamically test at runtime whether specific newer OS features are available and gracefully handle cases where they are not available (which we call "weak-linking" here for short). Prior to Python 3.9.1, we did not support the latter approach, i.e. weak-linking for many APIs / features added in recent macOS releases. So our practice and recommendation was to always build on the oldest macOS release to be supported. That's the approach we took for many years, for example, with the macOS 64-bit Intel installer variant for 10.9+ systems. Because Apple has had a very good track record of providing compatibility on newer systems (at least for the mostly C-based APIs CPython uses), that approached worked reasonably well. The main drawback was that certain new features added to Python, primarily in the os module, were not available when using the python.org installer binaries on newer (post-10.9) systems. That was not ideal but, for the most part, the missing features weren't commonly used yet and this was essentially only an issue if you were using the python.org-supplied binaries; you could always use or build a Python targeted for the system in use. However, things changed with macOS 11 Big Sur and the removal of system library files which broke ctype's find_library() when searching for system files, the subject of this issue. There were a number of other changes needed in CPython to fully support Big Sur, as documented in Issue41100 and others. As part of that work, Ronald and Lawrence D'Anna bit the bullet and went through the interpreter and the standard library to finally properly support weak-linking for multiple macOS versions. That means, as of 3.9.1 with the introduction of Big Sur support, it is finally possible to build on newer systems but still work properly on older ones. For 3.9.1, we introduced a new python.org installer variant, the "universal2" variant, that provides Intel and Apple Silicon fat binaries that should work on all Macs that can run macOS 10.9 through at least 11 with newer features conditionally tested at runtime. So our recommendation has changed as of 3.9.1 to now use the second approach above (which previously could cause Python segfaults when running on older systems) and to deprecate and phase out the use of the first approach (which still works as before - i.e. missing some features - with the notable exception of find_library() with system libraries on Big Sur). Note that the find_library() issue is only one reason for that change in recommendation. How does this work? Here's a quick demo using current head of Python 3.10 (although you should see similar results with Python 3.9.x as of 3.9.1), the latest versions of macOS 11, 10.15, and 10.9. We'll build on 11 in all cases, then deploy and run test_ctypes and test_posix on 11, 10.15, and 10.9. -------------------------------------------- 1. Default case, no MACOSX_DEPLOYMENT_TARGET specified. If the deployment target is not specified, configure normally uses the operating system version the build is running on, so in this case, 11 Big Sur. $ sw_vers ProductName: macOS ProductVersion: 11.5.1 BuildVersion: 20G80 $ ./configure --prefix=/tmp/py && make -j3 && make install [...] checking which MACOSX_DEPLOYMENT_TARGET to use... 11.5 [...] # run on 11, works as expected $ /tmp/py/bin/python3.10 Python 3.10.0rc1+ (heads/3.10:536e35ae6a, Aug 4 2021, 16:46:59) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D $ /tmp/py/bin/python3.10 -m test test_ctypes 0:00:00 load avg: 1.86 Run tests sequentially 0:00:00 load avg: 1.86 [1/1] test_ctypes == Tests result: SUCCESS == 1 test OK. Total duration: 762 ms Tests result: SUCCESS $ /tmp/py/bin/python3.10 -m test test_posix 0:00:00 load avg: 1.87 Run tests sequentially 0:00:00 load avg: 1.87 [1/1] test_posix == Tests result: SUCCESS == 1 test OK. Total duration: 758 ms Tests result: SUCCESS # same build, copied to 10.15 system: find_library test fails and test_posix fails % sw_vers ProductName: Mac OS X ProductVersion: 10.15.7 BuildVersion: 19H1323 sysadmin at pyb15 ~ % /tmp/py/bin/python3.10 Python 3.10.0rc1+ (heads/3.10:536e35ae6a, Aug 4 2021, 16:46:59) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D $ /tmp/py/bin/python3.10 -m test test_ctypes 0:00:00 load avg: 0.97 Run tests sequentially 0:00:00 load avg: 0.97 [1/1] test_ctypes test_ctypes skipped -- dlopen(/tmp/py/lib/python3.10/lib-dynload/_ctypes.cpython-310-darwin.so, 2): Symbol not found: __dyld_shared_cache_contains_path Referenced from: /tmp/py/lib/python3.10/lib-dynload/_ctypes.cpython-310-darwin.so (which was built for Mac OS X 11.5) Expected in: /usr/lib/libSystem.B.dylib in /tmp/py/lib/python3.10/lib-dynload/_ctypes.cpython-310-darwin.so test_ctypes skipped == Tests result: SUCCESS == 1 test skipped: test_ctypes Total duration: 72 ms Tests result: SUCCESS $ /tmp/py/bin/python3.10 -m test test_posix 0:00:00 load avg: 2.04 Run tests sequentially 0:00:00 load avg: 2.04 [1/1] test_posix dyld: lazy symbol binding failed: Symbol not found: _preadv Referenced from: /tmp/py/bin/python3.10 (which was built for Mac OS X 11.5) Expected in: /usr/lib/libSystem.B.dylib dyld: Symbol not found: _preadv Referenced from: /tmp/py/bin/python3.10 (which was built for Mac OS X 11.5) Expected in: /usr/lib/libSystem.B.dylib Fatal Python error: Aborted Current thread 0x000000011373bdc0 (most recent call first): File "/tmp/py/lib/python3.10/test/test_posix.py", line 302 in test_preadv File "/tmp/py/lib/python3.10/unittest/case.py", line 549 in _callTestMethod File "/tmp/py/lib/python3.10/unittest/case.py", line 592 in run File "/tmp/py/lib/python3.10/unittest/case.py", line 652 in __call__ File "/tmp/py/lib/python3.10/unittest/suite.py", line 122 in run File "/tmp/py/lib/python3.10/unittest/suite.py", line 84 in __call__ File "/tmp/py/lib/python3.10/unittest/suite.py", line 122 in run File "/tmp/py/lib/python3.10/unittest/suite.py", line 84 in __call__ File "/tmp/py/lib/python3.10/test/support/testresult.py", line 169 in run File "/tmp/py/lib/python3.10/test/support/__init__.py", line 971 in _run_suite File "/tmp/py/lib/python3.10/test/support/__init__.py", line 1096 in run_unittest File "/tmp/py/lib/python3.10/test/test_posix.py", line 2176 in test_main File "/tmp/py/lib/python3.10/test/libregrtest/runtest.py", line 297 in _runtest_inner2 File "/tmp/py/lib/python3.10/test/libregrtest/runtest.py", line 335 in _runtest_inner File "/tmp/py/lib/python3.10/test/libregrtest/runtest.py", line 215 in _runtest File "/tmp/py/lib/python3.10/test/libregrtest/runtest.py", line 245 in runtest File "/tmp/py/lib/python3.10/test/libregrtest/main.py", line 437 in run_tests_sequential File "/tmp/py/lib/python3.10/test/libregrtest/main.py", line 535 in run_tests File "/tmp/py/lib/python3.10/test/libregrtest/main.py", line 708 in _main File "/tmp/py/lib/python3.10/test/libregrtest/main.py", line 655 in main File "/tmp/py/lib/python3.10/test/libregrtest/main.py", line 733 in main File "/tmp/py/lib/python3.10/test/__main__.py", line 2 in File "/tmp/py/lib/python3.10/runpy.py", line 86 in _run_code File "/tmp/py/lib/python3.10/runpy.py", line 196 in _run_module_as_main Extension modules: _testcapi (total: 1) # same build, copied to 10.9 system: interpreter fails to launch $ sw_vers ProductName: Mac OS X ProductVersion: 10.9.5 BuildVersion: 13F1911 $ /tmp/py/bin/python3.10 dyld: lazy symbol binding failed: Symbol not found: _getentropy Referenced from: /tmp/py/bin/python3.10 Expected in: /usr/lib/libSystem.B.dylib dyld: Symbol not found: _getentropy Referenced from: /tmp/py/bin/python3.10 Expected in: /usr/lib/libSystem.B.dylib Trace/BPT trap: 5 -------------------------------------------- 2. Build on Big Sur 11 with MACOSX_DEPLOYMENT_TARGET=10.15 $ ./configure --prefix=/tmp/py MACOSX_DEPLOYMENT_TARGET=10.15 [...] checking which MACOSX_DEPLOYMENT_TARGET to use... 10.15 [...] # run on 11, still works as expected $ /tmp/py/bin/python3.10 Python 3.10.0rc1+ (heads/3.10:536e35ae6a, Aug 4 2021, 17:00:45) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D $ /tmp/py/bin/python3.10 -m test test_ctypes 0:00:00 load avg: 2.99 Run tests sequentially 0:00:00 load avg: 2.99 [1/1] test_ctypes == Tests result: SUCCESS == 1 test OK. Total duration: 736 ms Tests result: SUCCESS $ /tmp/py/bin/python3.10 -m test test_posix 0:00:00 load avg: 2.99 Run tests sequentially 0:00:00 load avg: 2.99 [1/1] test_posix == Tests result: SUCCESS == 1 test OK. # same build, copied to 10.15 system: test_ctypes and test_posix both now pass % /tmp/py/bin/python3.10 Python 3.10.0rc1+ (heads/3.10:536e35ae6a, Aug 4 2021, 17:00:45) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D % /tmp/py/bin/python3.10 -m test test_ctypes 0:00:00 load avg: 1.29 Run tests sequentially 0:00:00 load avg: 1.29 [1/1] test_ctypes == Tests result: SUCCESS == 1 test OK. Total duration: 908 ms Tests result: SUCCESS % /tmp/py/bin/python3.10 -m test test_posix 0:00:00 load avg: 1.09 Run tests sequentially 0:00:00 load avg: 1.09 [1/1] test_posix == Tests result: SUCCESS == 1 test OK. Total duration: 812 ms Tests result: SUCCESS # same build, copied to 10.9: still fails to launch $ /tmp/py/bin/python3.10 dyld: lazy symbol binding failed: Symbol not found: _getentropy Referenced from: /tmp/py/bin/python3.10 Expected in: /usr/lib/libSystem.B.dylib dyld: Symbol not found: _getentropy Referenced from: /tmp/py/bin/python3.10 Expected in: /usr/lib/libSystem.B.dylib Trace/BPT trap: 5 -------------------------------------------- 3. Build on Big Sur 11 with MACOSX_DEPLOYMENT_TARGET=10.9 $ ./configure --prefix=/tmp/py MACOSX_DEPLOYMENT_TARGET=10.9 [...] checking which MACOSX_DEPLOYMENT_TARGET to use... 10.9 [...] # run on 11, still works as expected $ /tmp/py/bin/python3.10 Python 3.10.0rc1+ (heads/3.10:536e35ae6a, Aug 4 2021, 17:07:23) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D $ /tmp/py/bin/python3.10 -m test test_ctypes 0:00:00 load avg: 2.31 Run tests sequentially 0:00:00 load avg: 2.31 [1/1] test_ctypes == Tests result: SUCCESS == 1 test OK. Total duration: 646 ms Tests result: SUCCESS $ /tmp/py/bin/python3.10 -m test test_posix 0:00:00 load avg: 2.12 Run tests sequentially 0:00:00 load avg: 2.12 [1/1] test_posix == Tests result: SUCCESS == 1 test OK. Total duration: 767 ms Tests result: SUCCESS # same build run on 10.15, still works as expected % /tmp/py/bin/python3.10 Python 3.10.0rc1+ (heads/3.10:536e35ae6a, Aug 4 2021, 17:07:23) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D $ /tmp/py/bin/python3.10 -m test test_ctypes 0:00:00 load avg: 1.65 Run tests sequentially 0:00:00 load avg: 1.65 [1/1] test_ctypes == Tests result: SUCCESS == 1 test OK. Total duration: 964 ms Tests result: SUCCESS $ /tmp/py/bin/python3.10 -m test test_posix 0:00:00 load avg: 1.68 Run tests sequentially 0:00:00 load avg: 1.68 [1/1] test_posix == Tests result: SUCCESS == 1 test OK. Total duration: 795 ms Tests result: SUCCESS # same build run on 10.9, now also works as expected $ /tmp/py/bin/python3.10 Python 3.10.0rc1+ (heads/3.10:536e35ae6a, Aug 4 2021, 17:07:23) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D $ /tmp/py/bin/python3.10 -m test test_ctypes 0:00:00 load avg: 0.68 Run tests sequentially 0:00:00 load avg: 0.68 [1/1] test_ctypes == Tests result: SUCCESS == 1 test OK. Total duration: 398 ms Tests result: SUCCESS $ /tmp/py/bin/python3.10 -m test test_posix 0:00:00 load avg: 0.62 Run tests sequentially 0:00:00 load avg: 0.62 [1/1] test_posix == Tests result: SUCCESS == 1 test OK. Total duration: 543 ms Tests result: SUCCESS -------------------------------------------- To summarize, we believe that building on current systems and targeting older systems by using MACOS_DEPLOYMENT_TARGET should work properly and, going forward from 3.9.1, is the recommended and supported method for current multi-version macOS builds for 3.9.x+. (For the record, note that, while 3.8.10, the final maintenance release of the 3.8 series, did gain support for running natively on macOS 11 when built on macOS 11, the much more invasive weak-linking support was not backported. 3.8.x is now in the security-fix-only phase of its life cycle.) So, what are the remaining issues? I believe them to be and in rough priority order: 1. Better document how to build Python on macOS for multiple releases. Mac/README.txt was updated to include a section on weak linking support but it should be expanded and should give more concrete examples along the lines of above. We should do that for the next releases: 3.9.7 and 3.10.0. We should also re-iterate that building Python for multiple macOS versions and/or architectures is only supported when building on macOS using the Apple-supplied build tools (I will make sure this gets done.) 2. Make the universal2 10.9+ python.org installer variant the default download for 3.9.7 and mark the Intel-only 10.9+ variant as deprecated for 3.9.7 and drop in a future 3.9.x maintenance release. (I will also make sure this gets done.) With 3.10.0 pre-releases, we are already only providing the 10.9+ universal2 variant. 3. Consider accepting a PR to support find_library() on macOS 11+ in the legacy and deprecated case of building on older versions of macOS to also run on newer versions. The current revision of PR 27251 is still problematic; as Ronald noted before, "the current code path using explicit weak linking should be kept for those building using a recent SDK (cleaner code, better error reporting)." And the description is misleading as demonstrated above. Opinions? BTW, thanks again for all your work so far on this issue, Tobias. Because of it, I think we will end up with some major improvements for both builders and users of Python. https://stackoverflow.com/questions/25352389/what-is-the-difference-between-macosx-deployment-target-and-mmacosx-version-min ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 20:08:48 2021 From: report at bugs.python.org (Brett Cannon) Date: Thu, 05 Aug 2021 00:08:48 +0000 Subject: [issue41706] docs: operator dunder (`__add__`, et al.) invocations described incorrectly In-Reply-To: <1599165050.43.0.0605757296817.issue41706@roundup.psfhosted.org> Message-ID: <1628122128.08.0.325241423934.issue41706@roundup.psfhosted.org> Change by Brett Cannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 23:11:23 2021 From: report at bugs.python.org (ENG19EC0098_Swathi.M) Date: Thu, 05 Aug 2021 03:11:23 +0000 Subject: [issue44833] VideoCapture is not installing In-Reply-To: <1628105448.9.0.655887373264.issue44833@roundup.psfhosted.org> Message-ID: ENG19EC0098_Swathi.M added the comment: Thanks for your response so which latest version of python is compatible for both VideoCapture and OpenCv? Also the error was: ERROR: Could not find a vsion that satisfies the requirement VideoCapture (from versions: none) ERROR: No matching distribution found for VideoCapture On Thu, 5 Aug, 2021, 1:01 am Eric V. Smith, wrote: > > Eric V. Smith added the comment: > > Please do no post screen captures. Copy and paste the text into the bug > report. > > It looks like VideoCapture has not released a 3.9 compatible wheel file on > PyPI. You should follow up with that project directly, as it is not part of > python?s standard library. > > ---------- > nosy: +eric.smith > resolution: -> third party > stage: -> resolved > status: open -> closed > type: resource usage -> behavior > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 4 23:57:42 2021 From: report at bugs.python.org (jb) Date: Thu, 05 Aug 2021 03:57:42 +0000 Subject: [issue44820] subprocess hungs when processing value from mariadb In-Reply-To: <1628089294.81.0.585327669096.issue44820@roundup.psfhosted.org> Message-ID: jb added the comment: Privet, spasibo za otklik. Poprobuyu yeshche raz provesti issledovaniye. Yesli budet problema, napishu, na discuss.python.org ili stackoverflow.com. S uvazheniyem, Bolatbek. volume_up 165 / 5000 keyboard Translation results Hi, thanks for your feedback. I'll try to do my research again. If there is a problem, I will write to discuss.python.org or stackoverflow.com. Best regards, Bolatbek. ??, 4 ???. 2021 ?. ? 21:02, Mark Dickinson : > > > Mark Dickinson added the comment: > > Hi @jb. This tracker is for reporting bugs in the core Python language. While it's possible that what you're experiencing is due to a bug in core Python, on the information given it's likely that the problem is either in your own code, or in whatever database driver code you're using. In either case, I'm afraid this tracker is not the appropriate place to seek help. > > For general debugging help, you could try any of the various dedicated Python groups and mailing lists (for example, discuss.python.org), or something like Stack Overflow. Be prepared to give details of exactly what you did, what you expected to happen, and what actually happened, along with code that will help others reproduce your issue. > > I'm going to close here - currently, there's nothing useful that the Python core team can do with this report. The issue can be re-opened with more information after further investigation, if that investigation produces reasonable grounds to suspect a core Python bug. > > ---------- > nosy: +mark.dickinson > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 00:12:44 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 05 Aug 2021 04:12:44 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1628136764.58.0.747148371198.issue44762@roundup.psfhosted.org> Terry J. Reedy added the comment: The rationale for the __stdin__ and stdin check is this: When python starts, both are usually set an io.TextIOWrapper wrapping a system console. (At least on Windows, both may instead be None instead.) __stdin__ should never be altered. Getpass.getpass knows how to turn off echo on a system terminal. So if stdin is not None and is not __stdin__, stdin is very likely not a system terminal, and if so, getpass does not know to turn off echo, if indeed this is possible. As far as I know, the tk and hence tkinter text widget do not come with a option to not display key presses that are stored in the widget. An application would have to intercept keypresses and store them elsewhere. But this is quite different issue. This issue is not about echo, but about interactivity. Testing that with isatty is *NOT* a substitute for testing whether an interactive device is the system terminal or not. (IDLE's stdio connected to Shell passes isatty.) Any new test would have to added without deleting the current test. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 00:13:06 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 05 Aug 2021 04:13:06 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is incomplete In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1628136786.6.0.0835014719099.issue44762@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: getpass.getpass on Windows fallback detection is bad -> getpass.getpass on Windows fallback detection is incomplete _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 00:19:41 2021 From: report at bugs.python.org (jb) Date: Thu, 05 Aug 2021 04:19:41 +0000 Subject: [issue44820] subprocess hungs when processing value from mariadb In-Reply-To: Message-ID: jb added the comment: Great, thanks! ??, 5 ???. 2021 ?. ? 09:57, jb : > > > jb added the comment: > > Privet, spasibo za otklik. Poprobuyu yeshche raz provesti > issledovaniye. Yesli budet problema, napishu, na discuss.python.org > ili stackoverflow.com. S uvazheniyem, Bolatbek. > volume_up > 165 / 5000 > keyboard > > Translation results > > Hi, thanks for your feedback. I'll try to do my research again. If > there is a problem, I will write to discuss.python.org or > stackoverflow.com. > Best regards, Bolatbek. > > ??, 4 ???. 2021 ?. ? 21:02, Mark Dickinson : > > > > > > Mark Dickinson added the comment: > > > > Hi @jb. This tracker is for reporting bugs in the core Python language. While it's possible that what you're experiencing is due to a bug in core Python, on the information given it's likely that the problem is either in your own code, or in whatever database driver code you're using. In either case, I'm afraid this tracker is not the appropriate place to seek help. > > > > For general debugging help, you could try any of the various dedicated Python groups and mailing lists (for example, discuss.python.org), or something like Stack Overflow. Be prepared to give details of exactly what you did, what you expected to happen, and what actually happened, along with code that will help others reproduce your issue. > > > > I'm going to close here - currently, there's nothing useful that the Python core team can do with this report. The issue can be re-opened with more information after further investigation, if that investigation produces reasonable grounds to suspect a core Python bug. > > > > ---------- > > nosy: +mark.dickinson > > resolution: -> not a bug > > stage: -> resolved > > status: open -> closed > > > > _______________________________________ > > Python tracker > > > > _______________________________________ > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 00:26:53 2021 From: report at bugs.python.org (chen-y0y0) Date: Thu, 05 Aug 2021 04:26:53 +0000 Subject: [issue44835] What does "Python for Windows will still be Python for DOS" mean? Message-ID: <1628137613.72.0.466224932387.issue44835@roundup.psfhosted.org> Change by chen-y0y0 : ---------- components: Installation, Windows nosy: paul.moore, prasechen, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: What does "Python for Windows will still be Python for DOS" mean? type: performance versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 00:46:26 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 05 Aug 2021 04:46:26 +0000 Subject: [issue44833] VideoCapture is not installing In-Reply-To: <1628099763.63.0.902079879024.issue44833@roundup.psfhosted.org> Message-ID: <1628138786.17.0.499277068476.issue44833@roundup.psfhosted.org> Eric V. Smith added the comment: I don't know, and this isn't the right place to ask (since this is not a bug in Python). I suggest you ask on a VideoCapture specific forum. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 00:48:17 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 05 Aug 2021 04:48:17 +0000 Subject: [issue44835] What does "Python for Windows will still be Python for DOS" mean? Message-ID: <1628138897.44.0.377615960798.issue44835@roundup.psfhosted.org> New submission from Eric V. Smith : Since this is not a bug in Python, this is not the appropriate place to ask. I suggest you try the python-list mailing list https://mail.python.org/mailman/listinfo/python-list And I don't know what it means. I've never heard of that saying before. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: performance -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 01:42:31 2021 From: report at bugs.python.org (Tim Peters) Date: Thu, 05 Aug 2021 05:42:31 +0000 Subject: [issue44835] What does "Python for Windows will still be Python for DOS" mean? In-Reply-To: <1628138897.44.0.377615960798.issue44835@roundup.psfhosted.org> Message-ID: <1628142151.23.0.92137869059.issue44835@roundup.psfhosted.org> Tim Peters added the comment: The CPython Windows installer has a "thank you" box at the end: """ Special Windows thanks to Mark Hammond, without whose years of freely shared Windows expertise, Python for Windows would still be Python for DOS. """ There was no support for Windows in Python's earliest releases, and Mark Hammond did heroic work adding Windows support. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 02:20:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 05 Aug 2021 06:20:54 +0000 Subject: [issue44749] LOAD_NAME not using PyObject_GetItem when globals() is a dict subclass In-Reply-To: <1627395215.45.0.945166676554.issue44749@roundup.psfhosted.org> Message-ID: <1628144454.7.0.729536968775.issue44749@roundup.psfhosted.org> Terry J. Reedy added the comment: Both preceding issues were closed as rejected. ---------- nosy: +terry.reedy resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Inconsistent behavior if globals is a dict subclass type: -> enhancement versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 02:22:21 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 05 Aug 2021 06:22:21 +0000 Subject: [issue44749] LOAD_NAME not using PyObject_GetItem when globals() is a dict subclass In-Reply-To: <1627395215.45.0.945166676554.issue44749@roundup.psfhosted.org> Message-ID: <1628144541.21.0.957194932429.issue44749@roundup.psfhosted.org> Terry J. Reedy added the comment: If you want to change that decision, I suggest posting on python-ideas list explaining why you disagree and get support for a change now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 02:35:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 05 Aug 2021 06:35:53 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628145353.01.0.817215825213.issue44524@roundup.psfhosted.org> Guido van Rossum added the comment: Serhiy or Ken-Jin? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 03:15:53 2021 From: report at bugs.python.org (Zaur Shibzukhov) Date: Thu, 05 Aug 2021 07:15:53 +0000 Subject: [issue13299] namedtuple row factory for sqlite3 In-Reply-To: <1320021145.59.0.53370875256.issue13299@psf.upfronthosting.co.za> Message-ID: <1628147753.4.0.865582360645.issue13299@roundup.psfhosted.org> Zaur Shibzukhov added the comment: Instead of using cache, maybe better to use mutable default argument? For example: def make_row_factory(cls_factory, **kw): def row_factory(cursor, row, cls=[None]): rf = cls[0] if rf is None: fields = [col[0] for col in cursor.description] cls[0] = cls_factory("Row", fields, **kw) return cls[0](*row) return rf(*row) return row_factory namedtuple_row_factory = make_row_factory(namedtuple) Seem it should add less overhead. ---------- nosy: +intellimath _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 03:22:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Aug 2021 07:22:17 +0000 Subject: [issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628148137.68.0.119997961504.issue44822@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26105 pull_request: https://github.com/python/cpython/pull/27611 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 03:22:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 05 Aug 2021 07:22:30 +0000 Subject: [issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628148150.35.0.904648857485.issue44822@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 8f010dc920e1f6dc6a357e7cc1460a7a567c05c6 by Erlend Egeberg Aasland in branch 'main': bpo-44822: Don't truncate `str`s with embedded NULL chars returned by `sqlite3` UDF callbacks (GH-27588) https://github.com/python/cpython/commit/8f010dc920e1f6dc6a357e7cc1460a7a567c05c6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 03:29:35 2021 From: report at bugs.python.org (=?utf-8?q?Michael_F=C3=B6rderer?=) Date: Thu, 05 Aug 2021 07:29:35 +0000 Subject: [issue44817] os.path.realpath fails with WinError 161 In-Reply-To: <1627968251.97.0.10381933547.issue44817@roundup.psfhosted.org> Message-ID: <1628148575.81.0.791586044083.issue44817@roundup.psfhosted.org> Michael F?rderer added the comment: Done. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 03:57:49 2021 From: report at bugs.python.org (Nythepegasus) Date: Thu, 05 Aug 2021 07:57:49 +0000 Subject: [issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6 In-Reply-To: <1628103191.54.0.933271838639.issue44828@roundup.psfhosted.org> Message-ID: <27c6dbb2-e968-4b5d-87e8-fe3f735f9746@Spark> Nythepegasus added the comment: I used brew.sh to install Python, which I think uses the universal installer (although I can?t check, reinstalling macOS after hours of failing to downgrade back to Big Sur). I can?t remember the exact error, but it seemed to be from Apple?s end since it complained about not having access to the save/open dialog box. After I reinstall macOS, if you need further testing, i?m open to trying. On Aug 4, 2021, 2:53 PM -0400, E. Paine , wrote: > > E. Paine added the comment: > > Thanks for reporting issue and for including the backtrace. I presume you used the Universal 2 installer, given that you are running an M1 mac? > > Kevin, do you have access to the macOS 12 beta to help test whether this is a Tkinter or Tk bug? (I assume the latter, as it is likely Apple have changed the API again) > > ---------- > components: +macOS > nosy: +epaine, ned.deily, ronaldoussoren, serhiy.storchaka, wordtech > > _______________________________________ > Python tracker > > _______________________________________ ---------- title: Using tkinter.filedialog crashes on macOS 12 Monterey beta 4 with tk8.6.11 from python.org installers -> Using tkinter.filedialog crashes on macOS Python 3.9.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 04:10:47 2021 From: report at bugs.python.org (Romuald Brunet) Date: Thu, 05 Aug 2021 08:10:47 +0000 Subject: [issue42524] [doc] pdb access to return value In-Reply-To: <1606835598.54.0.959102851686.issue42524@roundup.psfhosted.org> Message-ID: <1628151047.49.0.487359928137.issue42524@roundup.psfhosted.org> Change by Romuald Brunet : ---------- pull_requests: +26106 pull_request: https://github.com/python/cpython/pull/27612 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 04:33:02 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 05 Aug 2021 08:33:02 +0000 Subject: [issue41103] Removing old buffer support In-Reply-To: <1593006222.66.0.567274053686.issue41103@roundup.psfhosted.org> Message-ID: <1628152382.87.0.698321919528.issue41103@roundup.psfhosted.org> Petr Viktorin added the comment: These should be removed from the *limited API*, but stay for the stable ABI. (PEP 652 mentions this can happen but doesn't give details, which will be a bit tricky. These are good candidates for figuring out the process.) I assigned this to myself; I'll try to get to it for 3.11. > What is the benefit of removing this? Is copy pasting the compatibility layer to (possibly many) different projects worth the "cleanup"? Yes. PyObject_AsReadBuffer is dangerous *in general*, but in certain specific cases where you're relying on CPython implementations details it can work. For example, borrowing a buffer from a *string* or *array* will work on CPython, and I don't see that changing any time soon. So, using PyObject_AsReadBuffer is still tech debt, but for some projects that's OK. All this should be documented in the release notes, though, so the projects know what they're doing. (And the release notes should be written *with the change*, not later, so projects testing early can read them.) ---------- assignee: -> petr.viktorin nosy: +petr.viktorin status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 04:48:32 2021 From: report at bugs.python.org (Yogendra kumar soni) Date: Thu, 05 Aug 2021 08:48:32 +0000 Subject: [issue44836] shutil _unpack_zipfile filename encoding issue Message-ID: <1628153312.77.0.338052443243.issue44836@roundup.psfhosted.org> New submission from Yogendra kumar soni : shutil _unpack_zipfile uses takes filename using name = info.filename if files are created in a machine that uses different encoding say utf-8 containing u'\u201c' in filename and the machine where we are extracting has a different encoding say Latin-1. creating target path using ?_ensure_directory(targetpath) ?is not able to correctly check target path and creating targetpath also fails. UnicodeEncodeError: 'latin-1' codec can't encode character u'\u201c'. ---------- components: Library (Lib) messages: 398975 nosy: yogendraksoni priority: normal severity: normal status: open title: shutil _unpack_zipfile filename encoding issue type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 05:01:32 2021 From: report at bugs.python.org (Douglas Raillard) Date: Thu, 05 Aug 2021 09:01:32 +0000 Subject: [issue44749] LOAD_NAME not using PyObject_GetItem when globals() is a dict subclass In-Reply-To: <1627395215.45.0.945166676554.issue44749@roundup.psfhosted.org> Message-ID: <1628154092.03.0.282440665767.issue44749@roundup.psfhosted.org> Douglas Raillard added the comment: I ended up with a slightly different API that allows me to preemptively set some global names before the code runs in the module, so my use case sort of vanished. I don't think there is a real need of beating the dead horse here. My only suggestion on the topic is that since the feature is not documented and is not really usable anyway, we might as well remove the slow path in LOAD_GLOBAL (unless there is a use case for having LOAD_GLOBAL and not LOAD_NAME I'm missing) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 05:08:14 2021 From: report at bugs.python.org (krey) Date: Thu, 05 Aug 2021 09:08:14 +0000 Subject: [issue44837] os.symlink arg names are bad Message-ID: <1628154494.92.0.350164707154.issue44837@roundup.psfhosted.org> New submission from krey : From: https://docs.python.org/3/library/os.html os.symlink(src, dst, target_is_directory=False, *, dir_fd=None) Create a symbolic link pointing to `src` named `dst`. It's a bit like saying find(needle, haystack) Finds `haystack` in `needle` If you look at the manpage ln, it says ln [OPTION]... [-T] TARGET LINK_NAME So os.symlink isn't consistent with ln ---------- assignee: docs at python components: Documentation messages: 398977 nosy: docs at python, krey priority: normal severity: normal status: open title: os.symlink arg names are bad type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 05:09:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 05 Aug 2021 09:09:38 +0000 Subject: [issue44803] change tracemalloc.BaseFilter to an abstract class In-Reply-To: <1627828296.31.0.469663144509.issue44803@roundup.psfhosted.org> Message-ID: <1628154578.3.0.00839606418739.issue44803@roundup.psfhosted.org> STINNER Victor added the comment: I don't see the benefit of the PR 27527. "BaseFilter" contains "Base" in its name and its only *private* method raises NotImplementedError. Maybe my design mistake (I wrote the tracemalloc module) was to expose it in the first place. I suggest to leave the code as it is. As ?ukasz wrote, there are other stdlib modules using "base" or "abstract" classes without using the abc module. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 05:20:08 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 05 Aug 2021 09:20:08 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? In-Reply-To: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> Message-ID: <1628155208.07.0.403766644466.issue44301@roundup.psfhosted.org> Petr Viktorin added the comment: I see that I wrote "counts" rather than "cycles" before; that line should be: The clear function is used to break reference cycles. In this case, there are no reference cycles to be broken, so it is not called. Thanks to Pablo for the review & ?ukasz for the merges! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 05:28:05 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 05 Aug 2021 09:28:05 +0000 Subject: [issue44837] os.symlink arg names are bad In-Reply-To: <1628154494.92.0.350164707154.issue44837@roundup.psfhosted.org> Message-ID: <1628155685.92.0.388588860394.issue44837@roundup.psfhosted.org> Steven D'Aprano added the comment: There is nothing wrong with saying Create a symbolic link pointing to `src` named `dst`. That is grammatically correct English. We could say "create a sym link called dst pointing to src" but they mean exactly the same thing. And given that the order of parameters is src first and dst second, it makes more sense to keep the same order in the description. Your analogy with Finds `haystack` in `needle` is not correct. The analogy would be find(needle, haystack) -> Finds `needle` in `haystack` -> or search haystack for needle os.symlink(src, dst) -> create symlink pointing to source called dst -> or create symlink called dst pointing to src The order of arguments is the same as for ln: ln [OPTION]... [-T] TARGET LINK_NAME TARGET is src, LINK_NAME is dst. I don't think that there is anything needed to be done here. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:02:00 2021 From: report at bugs.python.org (krey) Date: Thu, 05 Aug 2021 10:02:00 +0000 Subject: [issue44837] os.symlink arg names are bad In-Reply-To: <1628154494.92.0.350164707154.issue44837@roundup.psfhosted.org> Message-ID: <1628157720.63.0.819069565612.issue44837@roundup.psfhosted.org> krey added the comment: OK, let's ignore the analogy. Everywhere else I've seen, arrows (or directed edges in a graph) point as SOURCE -> TARGET SOURCE -> DESTINATION (TARGET and DESTINATION are synonymous in this context) An example from math: https://en.wikipedia.org/wiki/Category_(mathematics)#Definition ln has two arguments, LINKNAME and TARGET, so it's implied that LINKNAME -> TARGET In fact that's exactly what you see visually when you run ls -l In os.symlink, however, you have SRC <- DST which is weird. I agree that this weirdness is explained in grammatically correct English. Just because it's the first argument, we shouldn't call it src. The arg ordering is already confusing enough https://unix.stackexchange.com/questions/541795/tips-for-remembering-the-order-of-parameters-for-ln ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:05:56 2021 From: report at bugs.python.org (=?utf-8?q?Anton_Gr=C3=BCbel?=) Date: Thu, 05 Aug 2021 10:05:56 +0000 Subject: [issue44803] change tracemalloc.BaseFilter to an abstract class In-Reply-To: <1627828296.31.0.469663144509.issue44803@roundup.psfhosted.org> Message-ID: <1628157956.49.0.357557805166.issue44803@roundup.psfhosted.org> Anton Gr?bel added the comment: Even it is a private method, it is essential, when you use Snapshot.filter_traces(). Creating a Filter without implementing this method will just result in a runtime error. https://github.com/python/cpython/blob/029cb4a6adacb650dbfc8ea71d2875ab771fe92e/Lib/tracemalloc.py#L442-L451 For me it feels like a bad practice to just recommend the developer to implement this method instead of enforcing it. Why is there a possibility to state clearly that a class is an abstract class and not use it? Even PEP20 states, "Explicit is better than implicit." So why is there a way to create an abstract class in Python, just for fun? I don't think so, it is to make the intent very clear. As said, there is probably a lot of old code laying around in Python, which could be modernized by using functionality of newer Python versions, so why not change it? Is there actually any drawback in defining this class as an abstract class or do you actually gain more, because everyone directly understands that an abstract method has to be implemented in the subclass. @Lukasz: if you ask me, I would change all of them, but I'm definitely lacking the skill and experience to find all those flaws and fix them. I'm happy to help and for me making code better even it is small is always appreciated, if you always think it is not worth the trouble or nothing really to gain, then it will stay that way and more and more of those constructs will arise. In Germany we have a saying, small cattle also make muck :D But thanks for taking a look, even it was not worth the trouble. I had fun creating the PR, but you can just do what you like with it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:14:05 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 05 Aug 2021 10:14:05 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628158445.0.0.0189426555578.issue44524@roundup.psfhosted.org> Ken Jin added the comment: > This PRs herein have created a situation wherein the `__name__`/`__qualname__` attributes of certain typing objects can be `None`. Is this behavior intentional? The affected objects are special forms which can hold types, so Union[], TypeGuard[], and Concatenate[]. Personally, I don't really understand the meaning of __name__ for special forms. From the docs https://docs.python.org/3/library/stdtypes.html#definition.__name__, __name__ refers to "The name of the class, function, method, descriptor, or generator instance.". __name__ make sense for GenericAlias because it's supposed to be an almost transparent proxy to the original class (eg. typing.Callable -> collections.abc.Callable). A special form is not really any one of those things listed in the docs (though I'm aware it's implemented using GenericAlias internally). OTOH, Python's definition of a type and typing's are wildly different. Union[X, Y] is called a "Union type" (despite being an object), and all types ought to have __name__ ;). @Lars, would it help your use case for Union[X, Y] and friends to have __name__ too? Note that this would mean the builtin union object (int | str) will need to support __name__ too. It looks a bit strange to me, but if it's useful I'm a +0.5 on this. CC-ed Serhiy for his opinion too. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:26:25 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 05 Aug 2021 10:26:25 +0000 Subject: [issue44837] os.symlink arg names are bad In-Reply-To: <1628157720.63.0.819069565612.issue44837@roundup.psfhosted.org> Message-ID: <20210805102539.GP10582@ando.pearwood.info> Steven D'Aprano added the comment: Order of arguments for ln: ln -s SOURCE DESTINATION Order of arguments for os.symlink: os.symlink(SOURCE, DESTINATION) They are exactly the same order. > Everywhere else I've seen, arrows (or directed edges in a graph) point as > SOURCE -> TARGET > SOURCE -> DESTINATION The source doesn't point to the symlink. The symlink points to the source. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:30:17 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 05 Aug 2021 10:30:17 +0000 Subject: [issue44837] os.symlink arg names are bad In-Reply-To: <1628154494.92.0.350164707154.issue44837@roundup.psfhosted.org> Message-ID: <1628159417.87.0.832046438233.issue44837@roundup.psfhosted.org> Eric V. Smith added the comment: @krey: What's your suggested change? We can change neither the parameter order nor parameter names without breaking code, so that won't happen. You created this as a documentation issue. Do you have a suggested documentation change? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:30:52 2021 From: report at bugs.python.org (Pooia) Date: Thu, 05 Aug 2021 10:30:52 +0000 Subject: [issue44818] '\t' (tab) support In-Reply-To: <1628115943.36.0.469642825101.issue44818@roundup.psfhosted.org> Message-ID: Pooia added the comment: Got it, thanks! Erlend E. Aasland: > I'm guessing this has to do with mixing spaces and tabs when indenting code. This can be fixed in your text editor precisely! It's the problem. Thank you I guess Python can't support tab but it sounds Gnu nano mix spaces and tabs! On Thu, Aug 5, 2021 at 2:56 AM Erlend E. Aasland wrote: > > Erlend E. Aasland added the comment: > > I'm guessing this has to do with mixing spaces and tabs when indenting > code. This can be fixed in your text editor. > > ---------- > nosy: +erlendaasland > status: open -> pending > > _______________________________________ > Python tracker > > _______________________________________ > ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:30:29 2021 From: report at bugs.python.org (Bas van Beek) Date: Thu, 05 Aug 2021 10:30:29 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628159429.59.0.124419497829.issue44524@roundup.psfhosted.org> Bas van Beek added the comment: I do agree that it's nice to have a `__name__` for special forms, as they do very much behave like types even though they're strictly speaking not distinct classes. Whether we should have this feature is a distinct "problem" from its `__name__` being `None` (as can happen in its the current implementation), the latter of which is actively breaking tests over in https://github.com/numpy/numpy/pull/19612. I don't recall ever seeing a non-string name before, so I'd argue that this is a bug. It seems to be easy to fix though (see below for a `Union` example), so if there are objections I'd like to submit a PR. ``` - return _UnionGenericAlias(self, parameters) + return _UnionGenericAlias(self, parameters, name="Union") ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:32:02 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 05 Aug 2021 10:32:02 +0000 Subject: [issue44818] '\t' (tab) support In-Reply-To: <1627979105.66.0.152787864247.issue44818@roundup.psfhosted.org> Message-ID: <1628159522.23.0.127629674708.issue44818@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:43:47 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 05 Aug 2021 10:43:47 +0000 Subject: [issue44818] '\t' (tab) support In-Reply-To: <1627979105.66.0.152787864247.issue44818@roundup.psfhosted.org> Message-ID: <1628160227.2.0.146799449646.issue44818@roundup.psfhosted.org> Erlend E. Aasland added the comment: > I guess Python can't support tab AFAIK, it was a deliberate decision during the Python 2 => Python 3 transition. > [...] it sounds Gnu nano mix spaces and tabs! You can set up GNU nano to expand tabs: $ echo "set tabstospaces" >> ~/.nanorc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:45:07 2021 From: report at bugs.python.org (Andre Roberge) Date: Thu, 05 Aug 2021 10:45:07 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown Message-ID: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> New submission from Andre Roberge : Given the following code containing no if expression (only if statements): if True: print('hello' if 2: print(123)) The following traceback is generated in Python 3.10.0RC1 File "...\example.py", line 2 print('hello' ^^^^^^^ SyntaxError: expected 'else' after 'if' expression ---------- components: Parser messages: 398989 nosy: aroberge, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:45:34 2021 From: report at bugs.python.org (krey) Date: Thu, 05 Aug 2021 10:45:34 +0000 Subject: [issue44837] os.symlink arg names are bad In-Reply-To: <1628154494.92.0.350164707154.issue44837@roundup.psfhosted.org> Message-ID: <1628160334.67.0.336794319026.issue44837@roundup.psfhosted.org> krey added the comment: @eric.smith Sorry for tagging this as docs, wasn't sure what to pick. I guess it should be under Library Does CPython have a process for changing arg names via deprecation warnings? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:58:22 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 05 Aug 2021 10:58:22 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628161102.67.0.453947618836.issue44524@roundup.psfhosted.org> Ken Jin added the comment: @Bas van Beek, thanks for testing numpy on 3.10rc1 and sending that link over. I was confused about what your original question entailed. The link provided much more context :). Seems that __name__ = None unintentionally breaks things that use annotations to generate docstrings. > I don't recall ever seeing a non-string name before, so I'd argue that this is a bug. Yes. > Whether we should have this feature is a distinct "problem" from its `__name__` being `None` If we properly set __name__ for all typing special forms, it won't have this problem anymore right? So we can kill two birds with one stone :). > I'd like to submit a PR. Please do! I'm re-opening this issue. Thanks for informing us. ---------- priority: normal -> high resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:58:40 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 05 Aug 2021 10:58:40 +0000 Subject: [issue20587] sqlite3 converter not being called In-Reply-To: <1392069177.84.0.794324739968.issue20587@psf.upfronthosting.co.za> Message-ID: <1628161120.67.0.0824256672464.issue20587@roundup.psfhosted.org> Erlend E. Aasland added the comment: Closing as out-of-date. If anyone disagrees, please reopen :) ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 06:59:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 05 Aug 2021 10:59:35 +0000 Subject: [issue21465] sqlite3 Row can return duplicate keys when using adapters In-Reply-To: <1399672256.68.0.166250570949.issue21465@psf.upfronthosting.co.za> Message-ID: <1628161175.66.0.360259793968.issue21465@roundup.psfhosted.org> Erlend E. Aasland added the comment: Closing this for now. If anyone disagrees, please reopen :) ---------- resolution: -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 07:15:38 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 05 Aug 2021 11:15:38 +0000 Subject: [issue44837] os.symlink arg names are bad In-Reply-To: <1628160334.67.0.336794319026.issue44837@roundup.psfhosted.org> Message-ID: <20210805111427.GR10582@ando.pearwood.info> Steven D'Aprano added the comment: Yes, we have a process: - At least one full release with a pending deprecation warning (silent by default); 3.11 is the earliest that could take place. - At least one full release with an active deprecation warning; 3.12 would be the earliest for this. - Make the change. 3.13 would be the earliest for this. If the change is particularly urgent, we could skip the pending warning and bring it forward one release, but since this isn't a critical security bug that needs immediate action, 3.12 would be the absolute earliest we could make this change. But it is vanishingly unlikely that we would change either the names of the parameters, or their order, without a really good reason. You haven't given us any convincing justification for why we should make this change. The os.symlink function takes its arguments in exactly the same order as `ln -s` takes them: original source file first, symbolic link destination second. We're not likely to change the order to be the opposite to that used by `ln`. Different Unixes and Linuxes already use different argument names for `ln`, we're not obliged to match any of them. "src, dest" is fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 07:16:52 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 05 Aug 2021 11:16:52 +0000 Subject: [issue44837] os.symlink arg names are bad In-Reply-To: <1628154494.92.0.350164707154.issue44837@roundup.psfhosted.org> Message-ID: <1628162212.78.0.422891624826.issue44837@roundup.psfhosted.org> Eric V. Smith added the comment: There's really no way we'd consider breaking possibly millions of working programs to change the parameter names. I guess you could come up with some way of supporting both sets of parameter names, but I doubt we'd accept that, either. While maybe in hindsight we should have chosen the parameter names that "ln -s" uses, that ship has sailed, and we'll have to live with it like it is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 07:52:47 2021 From: report at bugs.python.org (Marco Sulla) Date: Thu, 05 Aug 2021 11:52:47 +0000 Subject: [issue39940] Micro-optimizations to PySequence_Tuple() In-Reply-To: <1583963052.53.0.534992223538.issue39940@roundup.psfhosted.org> Message-ID: <1628164367.72.0.85841911271.issue39940@roundup.psfhosted.org> Marco Sulla added the comment: Close it, I have no time now :-( ---------- resolution: -> later stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 08:00:31 2021 From: report at bugs.python.org (krey) Date: Thu, 05 Aug 2021 12:00:31 +0000 Subject: [issue44837] os.symlink arg names are bad In-Reply-To: <1628154494.92.0.350164707154.issue44837@roundup.psfhosted.org> Message-ID: <1628164831.71.0.0570542876067.issue44837@roundup.psfhosted.org> krey added the comment: @eric.smith Fair enough, though the impact would probably be quite low in reality. Nobody seems to pass these args by keyword: https://github.com/search?q=%22os.symlink(src%3D%22&type=Code @steven.daprano My suggestion was changing the names of the args, not the order Current def os.symlink(src, dst): ln -s src dst Changing the names def os.symlink(dst, src): ln -s dst src Changing the order def os.symlink(dst, src): ln -s src dst I concede that different unixes have different argnames for ln, it's a bit of a mess. From a CS theory perspective, I think the GNU convention makes more sense. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 08:05:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 05 Aug 2021 12:05:11 +0000 Subject: [issue44839] Convert Python exceptions to appropriate SQLite error codes In-Reply-To: <1628164492.41.0.705893137688.issue44839@roundup.psfhosted.org> Message-ID: <1628165111.23.0.175516984801.issue44839@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26107 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27613 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 07:54:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 05 Aug 2021 11:54:52 +0000 Subject: [issue44839] Convert Python exceptions to appropriate SQLite error codes Message-ID: <1628164492.41.0.705893137688.issue44839@roundup.psfhosted.org> New submission from Serhiy Storchaka : Currently, any exception raised in user-defined function set the general SQLITE_ERROR error which then produce sqlite3.OperationalError. For example, if the user function returns a string or bytes object larger than INT_MAX you get OperationalError, but if it is less than INT_MAX and larger than the SQLite limit (configurable, 1000000000 by default) you get DataError. If a memory error occurred in Python code you get OperationalError, but if it is occurred in the SQLite code you get MemoryError. The proposed PR sets corresponding SQLite error codes for MemoryError and OverflowError in user-defined functions. They will produce MemoryError and DataError in Python. ---------- components: Extension Modules messages: 398997 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: Convert Python exceptions to appropriate SQLite error codes type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 08:08:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 05 Aug 2021 12:08:57 +0000 Subject: [issue44839] Convert Python exceptions to appropriate SQLite error codes In-Reply-To: <1628164492.41.0.705893137688.issue44839@roundup.psfhosted.org> Message-ID: <1628165337.68.0.962221320804.issue44839@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was grown from bigmem tests for issue44822. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 08:14:39 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 05 Aug 2021 12:14:39 +0000 Subject: [issue44837] os.symlink arg names are bad In-Reply-To: <1628162212.78.0.422891624826.issue44837@roundup.psfhosted.org> Message-ID: <20210805121355.GS10582@ando.pearwood.info> Steven D'Aprano added the comment: There is no one single set of names used by `ln` that we could have chosen. Any choice we made would have annoyed some people. I strongly argue that, of all the various naming conventions in common usage (see below), Python's choice of src, dest (source, destination) is the most clear and understandable. Source is the source file, the original file. When a symlink is made, it gets written to the destination path, dest. Clear and straightforward. Using "target" is ambiguous, "target" can mean the target of the symbolic link (where the sym link points, i.e. the original file) *or* it can mean the target of the `ln` command, i.e. where the symlink is created. Some of the common naming conventions: POSIX, NetBSD, FreeBSD, MacOS use source_file, target_file. OpenBSD uses source, target. Solaris uses source_file, target. AIX uses SourceFile, TargetFile. GNU uses target, linkname. https://unix.stackexchange.com/questions/541795/tips-for-remembering-the-order-of-parameters-for-ln Windows mklink not only uses yet another set of names, but puts them in the opposite order: link, target. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink MKS Toolkit calls them old, new. https://www.mkssoftware.com/docs/man1/ln.1.asp The Open Group Base Specifications document calls them path1, path2. https://pubs.opengroup.org/onlinepubs/9699919799/functions/symlink.html# ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 08:25:12 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 05 Aug 2021 12:25:12 +0000 Subject: [issue44837] os.symlink arg names are bad In-Reply-To: <1628164831.71.0.0570542876067.issue44837@roundup.psfhosted.org> Message-ID: <20210805122429.GT10582@ando.pearwood.info> Steven D'Aprano added the comment: On Thu, Aug 05, 2021 at 12:00:31PM +0000, krey wrote: > @steven.daprano My suggestion was changing the names of the args, not the order > > Current > def os.symlink(src, dst): > ln -s src dst So far so good. > Changing the names > def os.symlink(dst, src): > ln -s dst src That's not changing the names, that's changing the order. You're putting the destination first, and the source second. That's the opposite order to that of `ln` in all the Unixes I can find, but it matches the order of Windows, which seems to be the only OS I can see that puts the destination (the path to the symlink) first and the source (the path to the target/original) second. In any case, we have no power to change the order of arguments to `ln`. > Changing the order > def os.symlink(dst, src): > ln -s src dst And that's just confused, because you have `ln` use the same order it has now, and symlink reverse the order. > I concede that different unixes have different argnames for ln, it's a > bit of a mess. From a CS theory perspective, I think the GNU > convention makes more sense. The GNU convention is the same convention as all the other Unixes, and os.symlink. Only the documented names are different. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 09:00:20 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 05 Aug 2021 13:00:20 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628168420.13.0.673590265751.issue44838@roundup.psfhosted.org> Lysandros Nikolaou added the comment: Oh, this is a difficult one. It's caused by GH-27506 that was recently added to produce better errors for things like `print('hello' if something)`, where the correct syntax is `print('hello' if something else 'hi'). This is going to have a lot of false positives though, especially in cases like this, where an if statement immediately follows a line with unclosed parentheses. What do you think, Pablo? Should we maybe revert this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 09:11:40 2021 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 05 Aug 2021 13:11:40 +0000 Subject: [issue44840] Nested if/else gets phantom else trace again (3.10) Message-ID: <1628169100.37.0.353483963834.issue44840@roundup.psfhosted.org> New submission from Ned Batchelder : Note: this is very similar to https://bugs.python.org/issue42810 This was originally reported against coverage.py: https://github.com/nedbat/coveragepy/issues/1205 ---8<------------- import linecache, sys def trace(frame, event, arg): # The weird globals here is to avoid a NameError on shutdown... if frame.f_code.co_filename == globals().get("__file__"): lineno = frame.f_lineno print("{} {}: {}".format(event[:4], lineno, linecache.getline(__file__, lineno).rstrip())) return trace print(sys.version) sys.settrace(trace) def func(): if A: if B: if C: if D: return False else: return False elif E and F: return True A = B = True C = False func() ------------------------- This produces this trace output: 3.10.0rc1 (default, Aug 3 2021, 15:03:55) [Clang 12.0.0 (clang-1200.0.32.29)] call 13: def func(): line 14: if A: line 15: if B: line 16: if C: line 21: elif E and F: retu 21: elif E and F: The elif on line 21 is not executed, and should not be traced. Also, if I change line 21 to `elif E:`, then the trace changes to: 3.10.0rc1 (default, Aug 3 2021, 15:03:55) [Clang 12.0.0 (clang-1200.0.32.29)] call 13: def func(): line 14: if A: line 15: if B: line 16: if C: line 22: return True retu 22: return True ---------- components: Interpreter Core keywords: 3.10regression messages: 399003 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Nested if/else gets phantom else trace again (3.10) type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 09:22:40 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 05 Aug 2021 13:22:40 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is incomplete In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1628169760.98.0.404138205954.issue44762@roundup.psfhosted.org> Eryk Sun added the comment: The `sys.stdin is not sys.__stdin__` check is not relevant information. We need to know whether msvcrt.getwch() works and that the user should be able to type the password in the console window. sys.__stdin__ could be a file object for the NUL device, a pipe, or a file. Also, this check has never been implemented in POSIX. If I run `python -m idlelib` in Linux, getpass() still reads the password from the terminal instead of sys.stdin. > IDLE's stdio connected to Shell passes isatty IOBase.isatty() is more abstract than I expected, since it can be true for any stream that's "interactive". While FileIO.isatty() and os.isatty() are definitely wrong in Windows (i.e. they should not be true for NUL or a serial/parallel port), I see now that fixing isatty() doesn't solve the problem. We need to directly check whether sys.stdin is a console. If so, we can reasonably assume that there's a visible, accessible console window. The check would be something like: try: _winapi.GetConsoleMode(msvcrt.get_osfhandle(sys.stdin.fileno())) except (AttributeError, OSError): return fallback_getpass(prompt, stream) _winapi.GetConsoleMode() would need to be implemented. This is inconsistent with Unix since it's not trying to open "CONIN$". But relying on the latter is problematic in Windows since it succeeds in any process that's attached to a console session, even if the console window is hidden or never created (i.e. CREATE_NO_WINDOW). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 09:44:24 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Thu, 05 Aug 2021 13:44:24 +0000 Subject: [issue44840] Nested if/else gets phantom else trace again (3.10) In-Reply-To: <1628169100.37.0.353483963834.issue44840@roundup.psfhosted.org> Message-ID: <1628171064.71.0.303057046768.issue44840@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 09:58:25 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 05 Aug 2021 13:58:25 +0000 Subject: [issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers In-Reply-To: <1622658712.23.0.244922352408.issue44291@roundup.psfhosted.org> Message-ID: <1628171905.76.0.173832867813.issue44291@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 3d315c311676888201f4a3576e4ee3698684a3a2 by Kirill Pinchuk in branch 'main': bpo-44291: Fix reconnection in logging.handlers.SysLogHandler (GH-26490) https://github.com/python/cpython/commit/3d315c311676888201f4a3576e4ee3698684a3a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 09:59:45 2021 From: report at bugs.python.org (Gabor Rakosy) Date: Thu, 05 Aug 2021 13:59:45 +0000 Subject: [issue44841] ZipInfo crashes on filemode Message-ID: <1628171985.04.0.233917766436.issue44841@roundup.psfhosted.org> New submission from Gabor Rakosy : """ ZipInfo crashes on filemode In file /usr/lib/python3.7/zipfile.py | class ZipInfo.__slots__ Does not contain keyword 'filemode'. """ import zipfile file_zip = zipfile.ZipFile("test-one-dir.zip", mode='r') res = [] info = file_zip.infolist() print("info[0]", type(info[0]), info[0]) print("\n# ## Good") for inf in info: print("\ninf", type(inf), inf) res.append(( inf.filename, ## inf.filemode, inf.compress_type, inf.compress_size, inf.file_size)) for fileinfo in res: print("\n", fileinfo) print("\n# ## Bad") for inf in info: print("\ninf", type(inf), inf) res.append(( inf.filename, inf.filemode, inf.compress_type, inf.compress_size, inf.file_size)) for fileinfo in res: print("\n", fileinfo) ---------- components: Library (Lib) messages: 399006 nosy: G.Rakosy priority: normal severity: normal status: open title: ZipInfo crashes on filemode type: crash versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 10:08:28 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 05 Aug 2021 14:08:28 +0000 Subject: [issue36424] Pickle fails on frozen dataclass that has slots In-Reply-To: <1553527088.82.0.636469633332.issue36424@roundup.psfhosted.org> Message-ID: <1628172508.99.0.525595423448.issue36424@roundup.psfhosted.org> Andrei Kulakov added the comment: This was fixed in https://github.com/python/cpython/pull/25786 , and so can be closed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 11:42:54 2021 From: report at bugs.python.org (nyizel) Date: Thu, 05 Aug 2021 15:42:54 +0000 Subject: [issue44814] python 3.9.6 installation installs 0 modules In-Reply-To: <1627928538.73.0.0238112884083.issue44814@roundup.psfhosted.org> Message-ID: <1628178174.07.0.752232500291.issue44814@roundup.psfhosted.org> Change by nyizel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:15:08 2021 From: report at bugs.python.org (Manish Satwani) Date: Thu, 05 Aug 2021 16:15:08 +0000 Subject: [issue44842] String conversion of Path removes '/' from original url Message-ID: <1628180108.46.0.518546871425.issue44842@roundup.psfhosted.org> New submission from Manish Satwani : import pathlib p = pathlib.Path('adl://myblob.azuredatalakestore.net/local/abc/xyz') s = str(p) print(s) what you expect s to be?? There is a bug in path.Path.str(conversion to string) and it remove a slash s is 'adl:/myblob.azuredatalakestore.net/local/abc/xyz' <-- this is getting print....plz fix it ---------- components: Library (Lib) messages: 399008 nosy: manish.satwani priority: normal severity: normal status: open title: String conversion of Path removes '/' from original url type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:16:06 2021 From: report at bugs.python.org (Manish Satwani) Date: Thu, 05 Aug 2021 16:16:06 +0000 Subject: [issue44842] String conversion of Path removes '/' from original url In-Reply-To: <1628180108.46.0.518546871425.issue44842@roundup.psfhosted.org> Message-ID: <1628180166.57.0.940247161765.issue44842@roundup.psfhosted.org> Manish Satwani added the comment: import pathlib p = pathlib.Path('adl://myblob.azuredatalakestore.net/local/abc/xyz') s = str(p) print(s) what you expect s to be?? There is a bug in path.Path.str(conversion to string) and it remove a slash s is 'adl:/myblob.azuredatalakestore.net/local/abc/xyz' <-- this is getting print....plz fix it ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:16:21 2021 From: report at bugs.python.org (Bas van Beek) Date: Thu, 05 Aug 2021 16:16:21 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628180181.36.0.60336843583.issue44524@roundup.psfhosted.org> Change by Bas van Beek : ---------- pull_requests: +26108 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27614 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:16:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 05 Aug 2021 16:16:31 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628180191.52.0.659706826737.issue44838@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is a tricky one because the tokenizer doesn't see the enclosed parentheses because is actually closed (the second print has two ')' parentheses). This is tricky indeed because the parser is parsing the ( after the print as a group, not as a call, and indentation doesn't matter in the group. We can indeed revert the PR but I'm afraid that you can use this pattern to actually trigger a bunch of other custom error messages where they should not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:22:40 2021 From: report at bugs.python.org (Bas van Beek) Date: Thu, 05 Aug 2021 16:22:40 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628180560.65.0.766912409431.issue44524@roundup.psfhosted.org> Bas van Beek added the comment: All right, the `__name__` bug fix is up at https://github.com/python/cpython/pull/27614. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:29:39 2021 From: report at bugs.python.org (Andre Roberge) Date: Thu, 05 Aug 2021 16:29:39 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628180979.51.0.239064051026.issue44838@roundup.psfhosted.org> Andre Roberge added the comment: I have no idea how the parser works ... but when you do the test to identify if an 'else' is missing, could the fact that there is a colon instead of the expected 'else' be used to avoid misidentifying this case? Note: I am keenly aware of the difficulties in identifying possible cause of syntax errors and do appreciate the many improvements that have been done. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:30:00 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 05 Aug 2021 16:30:00 +0000 Subject: [issue44842] String conversion of Path removes '/' from original url In-Reply-To: <1628180108.46.0.518546871425.issue44842@roundup.psfhosted.org> Message-ID: <1628181000.98.0.446094891689.issue44842@roundup.psfhosted.org> Eric V. Smith added the comment: pathlib is not designed to support URIs, so this behavior is not surprising. You want to use a different library, maybe urllib. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:40:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 05 Aug 2021 16:40:57 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628181657.6.0.610665106154.issue44838@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Technically this example si more or less equivalent to: [ something, blech if 42: True [Bluch]] I wonder if the better fix here is just not to raise the rule if we find a ':', which is the only token that actually makes sense after 'if' expression ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:42:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 05 Aug 2021 16:42:15 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628181735.38.0.796686511797.issue44524@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am confusing. Why do these objects should have __name__ and __qualname__ attributes? What document specifies this? How are these attributes used? collections.abc.MutableSet and typing.MutableSet are different things. The former is a class, the latter is not a class. I don't know exact reasons, but it was intentional. We introduced __mro_entries__ for this (it was significant intervention in class creation mechanism). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:43:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 05 Aug 2021 16:43:27 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628181807.36.0.465107214421.issue44838@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +26109 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27615 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:47:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 05 Aug 2021 16:47:45 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628182065.03.0.703378748156.issue44838@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > but when you do the test to identify if an 'else' is missing, could the fact that there is a colon instead of the expected 'else' be used to avoid misidentifying this case? Yeah! That is what I was thinking. The key here is that the ':' is the only token that is valid after the construct, so anything else is a wrong 'if' expression, no matter what it is. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 12:48:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 05 Aug 2021 16:48:21 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628182101.78.0.341945086573.issue44838@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Opened https://github.com/python/cpython/pull/27615 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 13:29:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 05 Aug 2021 17:29:06 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628184546.49.0.584955769252.issue44838@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f5cbea6b1b5fc39cca377c6cc93f222916015fc4 by Pablo Galindo Salgado in branch 'main': bpo-44838: Refine the custom syntax errors for invalid 'if' expressions (GH-27615) https://github.com/python/cpython/commit/f5cbea6b1b5fc39cca377c6cc93f222916015fc4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 13:29:37 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 05 Aug 2021 17:29:37 +0000 Subject: [issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers In-Reply-To: <1622658712.23.0.244922352408.issue44291@roundup.psfhosted.org> Message-ID: <1628184577.91.0.781281235862.issue44291@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 13:31:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 05 Aug 2021 17:31:10 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628184670.66.0.196910725542.issue44838@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +26110 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27616 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 13:37:10 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 05 Aug 2021 17:37:10 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628185030.6.0.727079058076.issue44524@roundup.psfhosted.org> Ken Jin added the comment: @Serhiy a summary from what I understand. I hope this helps: > I am confused. Why do these objects should have __name__ and __qualname__ attributes? What document specifies this? I don't think any doc specifies this. The docs for __name__ and __qualname__ say they apply only to "name of the class, function, method, descriptor, or generator instance". The typing "types" are objects, not classes, so normally they wouldn't apply, but maybe there is an exception (see below). > How are these attributes used? According to OP, for logging/printing purposes. Initially, I was slightly against adding this. But I realized that it make sense for ABCs and concrete classes. PEP 585 says that the builtin types.GenericAlias is a "thin proxy type that forwards all method calls and attribute accesses to the bare origin type"[1] with some exceptions. typing._GenericAlias is supposed to behave similarly to builtin version. >>> list[int].__name__ 'list' >>> collections.abc.Callable[[int], str].__name__ 'Callable' Both typing.List[int].__name__ and typing.Callable[int].__name__ raised error before Yurii's PR. So I think it's good that we aligned typing's behavior and the builtin version. [1] https://www.python.org/dev/peps/pep-0585/#parameters-to-generics-are-available-at-runtime I just realized ?ukasz wrote PEP 585, so maybe he can shed some insight too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 13:55:31 2021 From: report at bugs.python.org (Pooia) Date: Thu, 05 Aug 2021 17:55:31 +0000 Subject: [issue44818] '\t' (tab) support In-Reply-To: <1628160227.2.0.146799449646.issue44818@roundup.psfhosted.org> Message-ID: Pooia added the comment: Awesome, thanks! On Thu, Aug 5, 2021 at 3:14 PM Erlend E. Aasland wrote: > > Erlend E. Aasland added the comment: > > > I guess Python can't support tab > > AFAIK, it was a deliberate decision during the Python 2 => Python 3 > transition. > > > [...] it sounds Gnu nano mix spaces and tabs! > > You can set up GNU nano to expand tabs: > > $ echo "set tabstospaces" >> ~/.nanorc > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 14:00:30 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Aug 2021 18:00:30 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628186430.41.0.187722338595.issue44838@roundup.psfhosted.org> miss-islington added the comment: New changeset b1bd16c2528295b8b28395827f6b589dccea0624 by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-44838: Refine the custom syntax errors for invalid 'if' expressions (GH-27615). (GH-27616) https://github.com/python/cpython/commit/b1bd16c2528295b8b28395827f6b589dccea0624 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 14:10:07 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Aug 2021 18:10:07 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1628187007.94.0.922145146512.issue43838@roundup.psfhosted.org> Raymond Hettinger added the comment: [Serhiy] > In particularly it allows to modify __dict__ of builtin types. This doesn't look like something that would happen accidentally. We've never had any bug reports about this occurring in the wild. [GvR] > Maybe we should not fix this then? That seems reasonable. In general, it is hard to completely wall-off instances against deliberate efforts to pry them open: >>> from types import MappingProxyType >>> import gc >>> orig = {1: 2} >>> proxy = MappingProxyType(orig) >>> refs = gc.get_referents(proxy) >>> refs [{1: 2}] >>> refs[0][1] = 3 >>> orig {1: 3} ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 14:15:29 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Aug 2021 18:15:29 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628187329.89.0.482724973015.issue44605@roundup.psfhosted.org> Raymond Hettinger added the comment: Do you all have preference for 1) expanding the range of use cases to cover metaclasses but incurring a performance hit for common cases, or 2) leaving it as-is and documenting that it doesn't work for metaclasses? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 14:19:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 05 Aug 2021 18:19:06 +0000 Subject: [issue44838] SyntaxError: New message "expected 'else' after 'if' expression" wrongly shown In-Reply-To: <1628160307.55.0.448348784951.issue44838@roundup.psfhosted.org> Message-ID: <1628187546.99.0.497379328816.issue44838@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 Thu Aug 5 14:22:52 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 05 Aug 2021 18:22:52 +0000 Subject: [issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6 In-Reply-To: <1628076093.82.0.287740145135.issue44828@roundup.psfhosted.org> Message-ID: <1628187772.25.0.057808500179.issue44828@roundup.psfhosted.org> Ned Deily added the comment: > I used brew.sh to install Python, which I think uses the universal installer As far as I know, Homebrew builds its own Python and Tk. > After I reinstall macOS, if you need further testing, i?m open to trying. Thanks. I think the next step would be to try to reproduce just using Tcl and Tk as this most likely is an issue in Tk rather than Python. It's also quite possible that the underlying problem will be fixed in a future Monterey beta. Alas, I don't have time to look further into this in the immediate future. Perhaps someone can follow up directly with the Tk folks. ---------- nosy: +culler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 14:26:50 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Aug 2021 18:26:50 +0000 Subject: [issue41946] Add concrete examples to os.path documentation In-Reply-To: <1601913967.48.0.506783023492.issue41946@roundup.psfhosted.org> Message-ID: <1628188010.6.0.038903058556.issue41946@roundup.psfhosted.org> Raymond Hettinger added the comment: Concrete examples for os.path are problematic because typical inputs and outputs vary across difference file systems. The point of os.path is to hide these differences. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 14:28:53 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 05 Aug 2021 18:28:53 +0000 Subject: [issue44843] Add CLI flag to disable hash randomization Message-ID: <1628188133.12.0.736934579893.issue44843@roundup.psfhosted.org> New submission from Filipe La?ns : There are select use-cases where hash randomization is undesirable, having a CLI option to switch it off would be very helpful. One example would be packaging, where hash randomization will make the bytecode unreproducible. Currently, we have to set PYTHONHASHSEED to a constant value. Having a CLI option (lets say -Z) would allow use to do python -Zm install artifact.whl instead of PYTHONHASHSEED=0 python -m install artifact.whl Which is something that I have to do lots of places. ---------- messages: 399026 nosy: FFY00 priority: normal severity: normal status: open title: Add CLI flag to disable hash randomization versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 14:37:20 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Aug 2021 18:37:20 +0000 Subject: [issue41946] Add concrete examples to os.path documentation In-Reply-To: <1601913967.48.0.506783023492.issue41946@roundup.psfhosted.org> Message-ID: <1628188640.72.0.125611356792.issue41946@roundup.psfhosted.org> Raymond Hettinger added the comment: If some examples are added, the should note which operating system is being used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 14:39:09 2021 From: report at bugs.python.org (Glyph Lefkowitz) Date: Thu, 05 Aug 2021 18:39:09 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628188749.14.0.736407475296.issue44605@roundup.psfhosted.org> Glyph Lefkowitz added the comment: > Do you all have preference for 1) expanding the range of use cases to cover metaclasses but incurring a performance hit for common cases, or 2) leaving it as-is and documenting that it doesn't work for metaclasses? If we do need the slow approach for the meta-type case, (i.e.: type(self).__lt__(other)) then why not decide on implementation at decoration time? The decorator has enough information to know if this strategy is necessary and can put different special methods in place. (But also, wouldn't 'from operator import lt ... lt(self, other)' be a bit faster, and also more general, just because it's doing specialized dispatch in C rather than an additional Python function call / method dispatch? I have not benchmarked myself, so please ignore if you've already tested this.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 14:53:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 05 Aug 2021 18:53:33 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628189613.74.0.748630735928.issue44524@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you Ken Jin. But it does not explain why objects which currently have __name__/__qualname__ is None should have these attribute. There is no builtin data type that corresponds to ClassVar, Final, Literal, Concatenate or TypeGuard. And (int | str) does not have these attributes. Would not be better to raise AttributeError instead of returning None? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 14:58:31 2021 From: report at bugs.python.org (Ray Luo) Date: Thu, 05 Aug 2021 18:58:31 +0000 Subject: [issue44844] The command line of launching Edge on Linux hangs Message-ID: <1628189911.42.0.278044129333.issue44844@roundup.psfhosted.org> New submission from Ray Luo : Launching Chrome on Linux from command line: $ export BROWSER=google-chrome; python -m webbrowser https://httpbin.org/delay/10 It can successfully launch Chrome with the specified web page opened in a new tab. And the console command line finishes BEFORE the web page being fully loaded in the browser. That is the desirable behavior. Launching Edge on Linux from command line: $ export BROWSER=microsoft-edge; python -m webbrowser https://httpbin.org/delay/10 The command line hangs until the Edge window is closed. That hanging symptom can be resolved by writing a deliberate script to webbrowser.register("...", None, webbrowser.BackgroundBrowser("microsoft-edge")) and then use that registered browser. But it was not obvious, and it took trial-and-error to reach that solution. Could it be possible to have the "BROWSER=microsoft-edge; python -m webbrowser https://httpbin.org/delay/10" work out of the box, without hanging? Is it because Edge is not currently predefined and handled inside webbrowser.py? It seems not an easy decision to add new browser into webbrowser.py, though, based on the 2nd and 3rd comments in this old issue: https://bugs.python.org/issue42330 ---------- components: Library (Lib) messages: 399030 nosy: rayluo priority: normal severity: normal status: open title: The command line of launching Edge on Linux hangs type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 15:08:02 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 05 Aug 2021 19:08:02 +0000 Subject: [issue44835] What does "Python for Windows will still be Python for DOS" mean? In-Reply-To: <1628138897.44.0.377615960798.issue44835@roundup.psfhosted.org> Message-ID: <1628190482.98.0.789983670748.issue44835@roundup.psfhosted.org> Steve Dower added the comment: Yep, it's just a thank you and acknowledgement that was in the installer, so I brought it forward. However, we removed it a couple of versions ago (with Mark's permission). So it's certainly not an issue that needs to be addressed now ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 15:11:38 2021 From: report at bugs.python.org (Jakub Wilk) Date: Thu, 05 Aug 2021 19:11:38 +0000 Subject: [issue22240] argparse support for "python -m module" in help In-Reply-To: <1408564751.42.0.897410433728.issue22240@psf.upfronthosting.co.za> Message-ID: <1628190698.7.0.931236013213.issue22240@roundup.psfhosted.org> Change by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 15:37:30 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 05 Aug 2021 19:37:30 +0000 Subject: [issue41946] Add concrete examples to os.path documentation In-Reply-To: <1601913967.48.0.506783023492.issue41946@roundup.psfhosted.org> Message-ID: <1628192250.28.0.906968050973.issue41946@roundup.psfhosted.org> Jack DeVries added the comment: > Some examples were added since this issue was created See bpo-35183 ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 15:48:34 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 05 Aug 2021 19:48:34 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628192914.02.0.952688145425.issue44830@roundup.psfhosted.org> Jack DeVries added the comment: For reference, it looks like Wayback Machine has a snapshot of the old article for reference: https://web.archive.org/web/20210613191914/https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines @mark.dickinson, do you feel like that new article is a good drop-in replacement for the old one? It is a bit different. I can open up a PR if so! ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 15:55:55 2021 From: report at bugs.python.org (Patrick Reader) Date: Thu, 05 Aug 2021 19:55:55 +0000 Subject: [issue44845] Allow keyword arguments in code.__new__ Message-ID: <1628193355.65.0.685014983693.issue44845@roundup.psfhosted.org> New submission from Patrick Reader : Per bpo-41263, code.__new__ now uses Argument Clinic. However, it still has a / marker which prevents the use of keyword arguments (https://github.com/python/cpython/pull/21426/files#diff-6f869eb8beb7cbe4bc6817584b99ad567f88962fa67f7beca25d009dc401234dR465). It seems entirely unnecessary to have this, so could it be removed to allow easier construction of code objects from user code, or is it there for some specific reason? I can do a PR - it's a 1 line change (+ clinic output changes) (+ tests?). I don't imagine backwards-compatibility is a concern here given it's implementation-specific and basically private. Note that prior to that fix, keyword arguments were allowed in the constructor but completely ignored. ---------- components: Interpreter Core messages: 399034 nosy: pxeger priority: normal severity: normal status: open title: Allow keyword arguments in code.__new__ type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:03:43 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 05 Aug 2021 20:03:43 +0000 Subject: [issue44697] Memory leak when asyncio.open_connection raise In-Reply-To: <1626875179.77.0.215331684735.issue44697@roundup.psfhosted.org> Message-ID: <1628193823.52.0.733016401267.issue44697@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 6.0 -> 7.0 pull_requests: +26111 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27617 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:05:54 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 05 Aug 2021 20:05:54 +0000 Subject: [issue44697] Memory leak when asyncio.open_connection raise In-Reply-To: <1626875179.77.0.215331684735.issue44697@roundup.psfhosted.org> Message-ID: <1628193954.61.0.886461003324.issue44697@roundup.psfhosted.org> Change by Jack DeVries : ---------- pull_requests: -26111 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:07:20 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 05 Aug 2021 20:07:20 +0000 Subject: [issue44679] unittest.mock.sentinel documentation typo In-Reply-To: <1626729328.44.0.624843688761.issue44679@roundup.psfhosted.org> Message-ID: <1628194040.2.0.177484055374.issue44679@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 2.0 -> 3.0 pull_requests: +26112 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27618 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:08:15 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 05 Aug 2021 20:08:15 +0000 Subject: [issue44679] unittest.mock.sentinel documentation typo In-Reply-To: <1626729328.44.0.624843688761.issue44679@roundup.psfhosted.org> Message-ID: <1628194095.55.0.841730901607.issue44679@roundup.psfhosted.org> Jack DeVries added the comment: @gaydayav I agree. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:15:07 2021 From: report at bugs.python.org (Manish Satwani) Date: Thu, 05 Aug 2021 20:15:07 +0000 Subject: [issue44842] String conversion of Path removes '/' from original url In-Reply-To: <1628180108.46.0.518546871425.issue44842@roundup.psfhosted.org> Message-ID: <1628194507.8.0.226644530293.issue44842@roundup.psfhosted.org> Manish Satwani added the comment: Thanks for the update Eric, if it is not designed to support URI it should tell to the user. It is very wired it just returns wrong data. You can detect it very well if user has specified URI or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:22:06 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 05 Aug 2021 20:22:06 +0000 Subject: [issue44844] The command line of launching Edge on Linux hangs In-Reply-To: <1628189911.42.0.278044129333.issue44844@roundup.psfhosted.org> Message-ID: <1628194926.67.0.0424099797588.issue44844@roundup.psfhosted.org> Steve Dower added the comment: Adding a new browser should be pretty easy, and it seems like that's all that is needed here. It has to go into a few places though to support each platform, and unfortunately it's only good for 3.11, and not any of the existing releases. ---------- keywords: +easy, newcomer friendly nosy: +steve.dower versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:27:13 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 05 Aug 2021 20:27:13 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1628195233.4.0.443124490945.issue33140@roundup.psfhosted.org> Jack DeVries added the comment: I'm pretty sure the 3.11 dev cycle started since this conversation, right? Can we introduce the deprecation warning now? Maybe something like what is in the attached diff? @andrei.avk, if it turns out that the time has come, you can go ahead and take the PR if you wish! ---------- nosy: +jack__d Added file: https://bugs.python.org/file50203/roughly_add_depr_warning.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:48:25 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Aug 2021 20:48:25 +0000 Subject: [issue44679] unittest.mock.sentinel documentation typo In-Reply-To: <1626729328.44.0.624843688761.issue44679@roundup.psfhosted.org> Message-ID: <1628196505.57.0.658147150751.issue44679@roundup.psfhosted.org> miss-islington added the comment: New changeset 938e84b4fa410f1a86f5e0708ebc3af6bb8efb0e by Jack DeVries in branch 'main': bpo-44679: [doc] fix typo in unittest.mock.rst (GH-27618) https://github.com/python/cpython/commit/938e84b4fa410f1a86f5e0708ebc3af6bb8efb0e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:48:31 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Aug 2021 20:48:31 +0000 Subject: [issue44679] unittest.mock.sentinel documentation typo In-Reply-To: <1626729328.44.0.624843688761.issue44679@roundup.psfhosted.org> Message-ID: <1628196511.14.0.130838788098.issue44679@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26113 pull_request: https://github.com/python/cpython/pull/27619 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:48:56 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 05 Aug 2021 20:48:56 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1628196536.88.0.391292206538.issue33140@roundup.psfhosted.org> Andrei Kulakov added the comment: Jack: I'm not sure if this eventual fix is worth doing.. it might cause issues for users to leave it as is, but can also cause issues to remove it even after deprecation period; I don't have a good feeling if one is more likely than the other, - so I'll have to leave it for others to review the PR; thanks for following up on this though! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:50:02 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Aug 2021 20:50:02 +0000 Subject: [issue44679] unittest.mock.sentinel documentation typo In-Reply-To: <1626729328.44.0.624843688761.issue44679@roundup.psfhosted.org> Message-ID: <1628196602.51.0.701859757867.issue44679@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26114 pull_request: https://github.com/python/cpython/pull/27620 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 16:52:00 2021 From: report at bugs.python.org (Mariatta) Date: Thu, 05 Aug 2021 20:52:00 +0000 Subject: [issue44679] unittest.mock.sentinel documentation typo In-Reply-To: <1626729328.44.0.624843688761.issue44679@roundup.psfhosted.org> Message-ID: <1628196720.93.0.828187072737.issue44679@roundup.psfhosted.org> Change by Mariatta : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 17:10:23 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 05 Aug 2021 21:10:23 +0000 Subject: [issue44679] unittest.mock.sentinel documentation typo In-Reply-To: <1626729328.44.0.624843688761.issue44679@roundup.psfhosted.org> Message-ID: <1628197823.62.0.259420975495.issue44679@roundup.psfhosted.org> miss-islington added the comment: New changeset 0a642d57736be6802c712bdbf2dcff39fe8a39b7 by Miss Islington (bot) in branch '3.10': bpo-44679: [doc] fix typo in unittest.mock.rst (GH-27618) https://github.com/python/cpython/commit/0a642d57736be6802c712bdbf2dcff39fe8a39b7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 17:36:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 05 Aug 2021 21:36:22 +0000 Subject: [issue44803] change tracemalloc.BaseFilter to an abstract class In-Reply-To: <1627828296.31.0.469663144509.issue44803@roundup.psfhosted.org> Message-ID: <1628199382.94.0.734078119683.issue44803@roundup.psfhosted.org> ?ukasz Langa added the comment: > if you ask me, I would change all of them The problem with adopting an ABC base class for each such use case is two-fold: - it changes the MRO putting the ABCMeta metaclass in which might make existing subclasses suddenly incompatible; and - is costly in terms of performance even if subclasses are still compatible. In other words, putting ABC in isn't a transparent operation. This is one reason why it wasn't included in asyncio code. Since we're not reacting to any breakage here, I'd feel best leaving this alone. Thanks for your care Anton! ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 18:10:06 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 05 Aug 2021 22:10:06 +0000 Subject: [issue44842] String conversion of Path removes '/' from original url In-Reply-To: <1628180108.46.0.518546871425.issue44842@roundup.psfhosted.org> Message-ID: <1628201406.92.0.302972243888.issue44842@roundup.psfhosted.org> Eric V. Smith added the comment: But that's a perfectly valid filename: $ mkdir -p adl://myblob.azuredatalakestore.net/local/abc/xyz $ ls -R adl: 'adl:': myblob.azuredatalakestore.net/ 'adl:/myblob.azuredatalakestore.net': local/ 'adl:/myblob.azuredatalakestore.net/local': abc/ 'adl:/myblob.azuredatalakestore.net/local/abc': xyz/ 'adl:/myblob.azuredatalakestore.net/local/abc/xyz': The pathlib module isn't going to guess whether you passed it a filename or URI of some sort, especially when it's a valid filename. That's the caller's job to get right. Removing the double slashes is a normal part of pathlib's behavior of normalizing paths, just as if you said from a bash shell "ls //etc//sysconfig", which will show the contents of "/etc/sysconfig". Although I'll admit I couldn't find this documented anywhere with a quick search. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 19:29:05 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 05 Aug 2021 23:29:05 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628206145.33.0.307122478051.issue44605@roundup.psfhosted.org> Raymond Hettinger added the comment: [Glyph] > why not decide on implementation at decoration time? We could do that and not incur performance issues. However, it would expand the API and double the size of the code. We've had no other reports about this issue since total_ordering() was added in Python 2.7, nor have there been any questions about it on StackOverflow. Do you think anyone other than yourself would use this feature? It seems like a rare niche use case, and the workaround is simple. For production code, I usually recommend writing out the other three methods (that is less magical, runs faster, easier to test, has fewer dependencies, and makes the tracebacks more readable. > (But also, wouldn't 'from operator import lt ... lt(self, other)' > be a bit faster, and also more general, The lt() function emulates the '<' operator, so we still have the problems with reflection that we were trying to avoid by calling the __lt__ method directly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 19:39:22 2021 From: report at bugs.python.org (Joel Puig Rubio) Date: Thu, 05 Aug 2021 23:39:22 +0000 Subject: [issue44846] zipfile: cannot create zip file from files with non-utf8 filenames Message-ID: <1628206762.04.0.365517684452.issue44846@roundup.psfhosted.org> New submission from Joel Puig Rubio : I'm attempting to make a script to create ZIP archives from files which filenames are encoded in Shift-JIS. However, Python seems to limit its filenames to ASCII or UTF-8, which means that attempting to archive said files will raise an exception. This is very inconvenient. joel at bliss:~/test$ python3 -m zipfile -c mojibake.zip . Traceback (most recent call last): File "/usr/lib/python3.8/zipfile.py", line 457, in _encodeFilenameFlags return self.filename.encode('ascii'), self.flag_bits UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-7: ordinal not in range(128) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/usr/lib/python3.8/zipfile.py", line 2441, in main() File "/usr/lib/python3.8/zipfile.py", line 2437, in main addToZip(zf, path, zippath) File "/usr/lib/python3.8/zipfile.py", line 2426, in addToZip addToZip(zf, File "/usr/lib/python3.8/zipfile.py", line 2421, in addToZip zf.write(path, zippath, ZIP_DEFLATED) File "/usr/lib/python3.8/zipfile.py", line 1775, in write with open(filename, "rb") as src, self.open(zinfo, 'w') as dest: File "/usr/lib/python3.8/zipfile.py", line 1517, in open return self._open_to_write(zinfo, force_zip64=force_zip64) File "/usr/lib/python3.8/zipfile.py", line 1614, in _open_to_write self.fp.write(zinfo.FileHeader(zip64)) File "/usr/lib/python3.8/zipfile.py", line 447, in FileHeader filename, flag_bits = self._encodeFilenameFlags() File "/usr/lib/python3.8/zipfile.py", line 459, in _encodeFilenameFlags return self.filename.encode('utf-8'), self.flag_bits | 0x800 UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-7: surrogates not allowed The zip command from the Linux Info-ZIP package is able to create the same archive with no issues, which I've attached to this issue. Here you can see how the proper filenames are shown in WinRAR once the right encoding is selected: https://i.imgur.com/TVcI95A.png The same should be seen on any computer using Shift-JIS as their locale. ---------- components: Library (Lib) files: mojibake.zip messages: 399049 nosy: joelpuig priority: normal severity: normal status: open title: zipfile: cannot create zip file from files with non-utf8 filenames versions: Python 3.8 Added file: https://bugs.python.org/file50204/mojibake.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 19:48:48 2021 From: report at bugs.python.org (Tobias Bergkvist) Date: Thu, 05 Aug 2021 23:48:48 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1628207328.47.0.372338723813.issue44689@roundup.psfhosted.org> Tobias Bergkvist added the comment: This makes a lot of sense now. Thank you so much for the thorough explanation Ned - and for highlighting where my assumptions were wrong! I didn?t realise I needed to specify MACOSX_DEPLOYMENT_TARGET to enable backwards compatibility. Is there a reason for not setting this to as old a version as possible by default when running ./configure? (Bigger binaries? Or something else?) If I understand correctly, the following two statements are now equivalent (in Python >= 3.9, but not in Python == 3.8), after the added Python-support for weak linking you mention: ``` if (__builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)) { // ... If (HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME) { // ... ``` From: https://github.com/python/cpython/blob/3d315c311676888201f4a3576e4ee3698684a3a2/Modules/_ctypes/callproc.c#L1452 And in order to support the deprecated case of building on an older MacOS-version, I would want to do something like the following: ``` #ifdef __APPLE__ #ifdef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH // leave current implementation as is #else // dynamic loading implementation #endif #endif ``` That way, dynamic loading will only be used when building on old MacOS, and we keep the current code path using weak linking when possible. This means we will still get useful compiler errors if for example Apple decides to suddenly remove the _dyld_shared_cache_contains_path symbol again in the future, or change its signature - rather than having to wait for the test suite to fail. It makes sense to prioritise good error reporting for the latest version of MacOS, since this will reduce the debugging time for CPython developers whenever Apple introduces new breaking changes to MacOS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 20:06:56 2021 From: report at bugs.python.org (Glyph Lefkowitz) Date: Fri, 06 Aug 2021 00:06:56 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628208416.83.0.787521407257.issue44605@roundup.psfhosted.org> Glyph Lefkowitz added the comment: > We could do that and not incur performance issues. However, it would expand the API and double the size of the code. If the preference is to not support this use-case, then I'd rather the decorator simply raise an exception and tell me this is going to be a problem so I can eagerly implement the workaround. > It seems like a rare niche use case, and the workaround is simple. It does seem like there are various times that one might want to make classes orderable, for example if they are bound to IDL objects or database tables; the use-case where I ran into this was something like that. > For production code, I usually recommend writing out the other three methods (that is less magical, runs faster, easier to test, has fewer dependencies, and makes the tracebacks more readable. Wait, is the suggestion here that @total_ordering is not suitable for production? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 21:23:14 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 06 Aug 2021 01:23:14 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1628212994.35.0.489117636064.issue33140@roundup.psfhosted.org> Jack DeVries added the comment: Yes, I definitely get that, but that's what the deprecation cycle is for. Certainly hold off on a PR until we see what @steve.dower thinks. I personally feel that having a function that can be introspected with ``dir`` but which should not be used is confusing, and rightfully pointed out as a wrinkle in the API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 5 22:18:19 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 06 Aug 2021 02:18:19 +0000 Subject: [issue40935] Links to Python3 docs for some libs return 404 In-Reply-To: <1591756890.13.0.690147132201.issue40935@roundup.psfhosted.org> Message-ID: <1628216299.46.0.0517924995877.issue40935@roundup.psfhosted.org> Andrei Kulakov added the comment: It looks like all the pages listed were updated with working links to current stable release docs, so this can be closed and if somebody finds more broken links, this issue can be reopened later. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 00:21:08 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Aug 2021 04:21:08 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628223668.32.0.00683432738482.issue44605@roundup.psfhosted.org> Raymond Hettinger added the comment: > If the preference is to not support this use-case ,,, I don't really have a preference. Was just letting you know the pros and cons. I'll put together a PR with the "type(self).__lt__(self, other)" substitutions. Let me know if that is the outcome you want. > Wait, is the suggestion here that @total_ordering > is not suitable for production? It works fine, but as noted in the docs, the indirect code isn't as good as just writing-out the methods by hand. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 01:42:57 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 06 Aug 2021 05:42:57 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1628228577.27.0.910697038562.issue43838@roundup.psfhosted.org> Brandt Bucher added the comment: I?m okay with closing as ?won?t fix?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 02:12:35 2021 From: report at bugs.python.org (Glyph Lefkowitz) Date: Fri, 06 Aug 2021 06:12:35 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628230355.53.0.890480233534.issue44605@roundup.psfhosted.org> Glyph Lefkowitz added the comment: My preference would be to fix it one way or another; the stdlib should be correct before it's performant. If, as you say, it's better to write the methods longhand anyway for ease of debugging, then it makes sense to write them out for performance, too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 02:46:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 06:46:25 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1628232385.25.0.518688694269.issue43838@roundup.psfhosted.org> Serhiy Storchaka added the comment: Good catch! Thank you Raymond for the third example. I though that it can be easily fixed by calling tp_traverse() for submapping: static int mappingproxy_traverse(PyObject *self, visitproc visit, void *arg) { mappingproxyobject *pp = (mappingproxyobject *)self; - Py_VISIT(pp->mapping); - return 0; + return Py_TYPE(pp->mapping)->tp_traverse(pp->mapping, visit, arg); } but it does not work. So I am okay with closing this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 02:56:59 2021 From: report at bugs.python.org (Graham Dumpleton) Date: Fri, 06 Aug 2021 06:56:59 +0000 Subject: [issue44847] ABCMeta.__subclasscheck__() doesn't support duck typing. Message-ID: <1628233019.39.0.0281534175475.issue44847@roundup.psfhosted.org> New submission from Graham Dumpleton : The Python standard library has two effective implementations of helpers for the ABCMeta class. A C implementation, and a pure Python version which is only used if the C implementation isn't available (perhaps for PyPy). * https://github.com/python/cpython/blob/3.9/Lib/abc.py#L89 * https://github.com/python/cpython/blob/3.9/Lib/_py_abc.py * https://github.com/python/cpython/blob/3.9/Modules/_abc.c These two implementations behave differently. Specifically, the ABCMeta.__subclasscheck__() implementation for the C version doesn't support duck typing for the subclass argument to issubclass() when this delegates to ABCMeta.__subclasscheck__(). The Python implementation for this has no problems though. In the pure Python version it uses isinstance(). * https://github.com/python/cpython/blob/3.9/Lib/_py_abc.py#L110 In the C implementation it uses PyType_Check() which doesn't give the same result. * https://github.com/python/cpython/blob/3.9/Modules/_abc.c#L610 The consequence of this is that transparent object proxies used as decorators on classes (eg., as wrapt uses) will break when the C implementation us used with an error of: # def __subclasscheck__(cls, subclass): # """Override for issubclass(subclass, cls).""" # > return _abc_subclasscheck(cls, subclass) # E TypeError: issubclass() arg 1 must be a class Example of tests from wrapt and how tests using C implementation must be disabled can be found at: * https://github.com/GrahamDumpleton/wrapt/blob/develop/tests/test_inheritance_py37.py If instead of using PyType_Check() the C implementation used PyObject_IsInstance() at that point it is possible that wrapt may then work if the remainder of the C implementation is true to how the pure Python version works (not been able to test if that is the case or not as yet). ---------- components: Library (Lib) messages: 399060 nosy: grahamd priority: normal severity: normal status: open title: ABCMeta.__subclasscheck__() doesn't support duck typing. type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 03:46:47 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 07:46:47 +0000 Subject: [issue38411] SQLITE_MISUSE race condition in sqlite3 is misleadingly raised as a binding error In-Reply-To: <1570547747.91.0.842919846552.issue38411@roundup.psfhosted.org> Message-ID: <1628236007.77.0.0751166496179.issue38411@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 04:08:14 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 08:08:14 +0000 Subject: [issue44848] Upgrade macOS and Windows installers to use SQLite 3.36.0 Message-ID: <1628237294.86.0.651703128522.issue44848@roundup.psfhosted.org> New submission from Erlend E. Aasland : Upgrade macOS and Windows installers to use SQLite 3.36.0. SQLite 3.36.0 was released June 18 2021. https://www.sqlite.org/releaselog/3_36_0.html ---------- components: Windows, macOS messages: 399061 nosy: erlendaasland, ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Upgrade macOS and Windows installers to use SQLite 3.36.0 type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 04:10:11 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 08:10:11 +0000 Subject: [issue44848] Upgrade macOS and Windows installers to use SQLite 3.36.0 In-Reply-To: <1628237294.86.0.651703128522.issue44848@roundup.psfhosted.org> Message-ID: <1628237411.47.0.797608133428.issue44848@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +26115 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27621 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 04:12:45 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 06 Aug 2021 08:12:45 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628237565.73.0.119567258933.issue44830@roundup.psfhosted.org> Mark Dickinson added the comment: > do you feel like that new article is a good drop-in replacement for the old one? No really, no. :-( I also now see that the new article has a (broken) link to the old article, which makes me think that maybe the removal of the old article was unintentional. We should probably find a way to report this upstream. I think I'd go for dropping the existing broken Mozilla URL and then possibly looking for other good sources. Perhaps solicit suggestions on discuss.python.org? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 04:13:02 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 08:13:02 +0000 Subject: [issue44848] Upgrade macOS and Windows installers to use SQLite 3.36.0 In-Reply-To: <1628237294.86.0.651703128522.issue44848@roundup.psfhosted.org> Message-ID: <1628237582.32.0.695988890845.issue44848@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26116 pull_request: https://github.com/python/cpython/pull/27622 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 04:51:29 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 08:51:29 +0000 Subject: [issue38411] SQLITE_MISUSE race condition in sqlite3 is misleadingly raised as a binding error In-Reply-To: <1570547747.91.0.842919846552.issue38411@roundup.psfhosted.org> Message-ID: <1628239889.23.0.664592135575.issue38411@roundup.psfhosted.org> Erlend E. Aasland added the comment: I've been trying to provoke this on my Mac (macOS 11.4) with Python 3.8 though 3.11 (dev) without success. Are you still able to reproduce this, Jack? If you can attach the output of python3.10 -m test.pythoninfo, I could try to set up a similar environment to reproduce the error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 06:33:20 2021 From: report at bugs.python.org (Xavier Morel) Date: Fri, 06 Aug 2021 10:33:20 +0000 Subject: [issue43526] Programmatic management of BytesWarning doesn't work for native triggers. In-Reply-To: <1615971785.71.0.488992120219.issue43526@roundup.psfhosted.org> Message-ID: <1628246000.54.0.560865955842.issue43526@roundup.psfhosted.org> Xavier Morel added the comment: Serhiy an other question (because I've encountered it *again*), do you think it'd be possible to split out the specific warning of stringifying (but *not* explicitely repr-ing) a bytes instance from everything else? There are use-cases for it, but I think it's rather error prone when a `bytes` unexpectedly finds itself mixed into either string or non-string data which stringify "normally" and generates what is often garbage output. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 06:40:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 10:40:46 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x Message-ID: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> New submission from STINNER Victor : Since build 655 (commit 6871fd0e8e5257f3ffebd1a1b2ca50e5f494e7f6), test_os failed on AMD64 FreeBSD Shared 3.x: https://buildbot.python.org/all/#/builders/483/builds/655 ====================================================================== ERROR: test_get_set_inheritable_o_path (test.test_os.FDInheritanceTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_os.py", line 3898, in test_get_set_inheritable_o_path os.set_inheritable(fd, True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 9] Bad file descriptor ---------- components: Tests messages: 399065 nosy: erlendaasland, lukasz.langa, pablogsal, vstinner priority: normal severity: normal status: open title: test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 06:42:14 2021 From: report at bugs.python.org (Antony Lee) Date: Fri, 06 Aug 2021 10:42:14 +0000 Subject: [issue44850] Could operator.methodcaller be optimized using LOAD_METHOD? Message-ID: <1628246534.03.0.387871214532.issue44850@roundup.psfhosted.org> New submission from Antony Lee : Currently, methodcaller is not faster than a plain lambda: ``` In [1]: class T: ...: a = 1 ...: def f(self): pass ...: In [2]: from operator import * In [3]: %%timeit t = T(); mc = methodcaller("f") ...: mc(t) ...: ...: 83.1 ns ? 0.862 ns per loop (mean ? std. dev. of 7 runs, 10000000 loops each) In [4]: %%timeit t = T(); mc = lambda x: x.f() ...: mc(t) ...: ...: 81.4 ns ? 0.0508 ns per loop (mean ? std. dev. of 7 runs, 10000000 loops each) ``` (on some machines, I find that it is even slower). Compare with attrgetter, which *is* faster: ``` In [5]: %%timeit t = T(); ag = attrgetter("a") ...: ag(t) ...: ...: 33.7 ns ? 0.0407 ns per loop (mean ? std. dev. of 7 runs, 10000000 loops each) In [6]: %%timeit t = T(); ag = lambda x: x.a ...: ag(t) ...: ...: 50.1 ns ? 0.057 ns per loop (mean ? std. dev. of 7 runs, 10000000 loops each) ``` Given that the operator module explicitly advertises itself as being "efficient"/"fast", it seems reasonable to try to optimize methodcaller. Looking at its C implementation, methodcaller currently uses PyObject_GetAttr followed by PyObject_Call; I wonder whether this can be optimized using a LOAD_METHOD-style approach to avoid the construction of the bound method (when applicable)? ---------- components: Library (Lib) messages: 399066 nosy: Antony.Lee priority: normal severity: normal status: open title: Could operator.methodcaller be optimized using LOAD_METHOD? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 06:42:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 10:42:35 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628246555.02.0.758172281882.issue44849@roundup.psfhosted.org> STINNER Victor added the comment: test_get_set_inheritable_o_path() also fails on: * AMD64 FreeBSD Shared 3.10 * AMD64 FreeBSD Shared 3.9 It smells more like a FreeBSD system update rather than a Python regression. ---------- nosy: +koobs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 06:53:58 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 06 Aug 2021 10:53:58 +0000 Subject: [issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None) In-Reply-To: <1628099391.12.0.0928824788179.issue44831@roundup.psfhosted.org> Message-ID: <1628247238.36.0.797122349252.issue44831@roundup.psfhosted.org> Steven D'Aprano added the comment: Confirmed on Windows with Python 3.9.6. ---------- nosy: +steven.daprano type: -> behavior versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 06:55:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 10:55:56 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628247356.67.0.188846626497.issue44849@roundup.psfhosted.org> STINNER Victor added the comment: On my FreeBSD 13 VM, the test is skipped: vstinner at freebsd$ ./python -m test -v test_os -m test_get_set_inheritable_o_path == CPython 3.11.0a0 (heads/main:938e84b4fa, Aug 6 2021, 10:46:32) [Clang 11.0.1 (git at github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3 == FreeBSD-13.0-RELEASE-amd64-64bit-ELF little-endian (...) test_get_set_inheritable_o_path (test.test_os.FDInheritanceTests) ... skipped 'need os.O_PATH' It seems like O_PATH was introduced in FreeBSD 14 CURRENT, but the test fails. Code of the test: @unittest.skipUnless(hasattr(os, 'O_PATH'), "need os.O_PATH") def test_get_set_inheritable_o_path(self): fd = os.open(__file__, os.O_PATH) self.addCleanup(os.close, fd) self.assertEqual(os.get_inheritable(fd), False) os.set_inheritable(fd, True) # <==== OSError: [Errno 9] Bad file descriptor self.assertEqual(os.get_inheritable(fd), True) os.set_inheritable(fd, False) self.assertEqual(os.get_inheritable(fd), False) os.set_inheritable() calls _Py_set_inheritable() whichs has multiple implementations: * ioctl(fd, FIONCLEX, NULL) * fcntl(fd, F_GETFD) + fcntl(fd, F_SETFD, new_flags) Linux has a special code path: #ifdef __linux__ if (errno == EBADF) { // On Linux, ioctl(FIOCLEX) will fail with EBADF for O_PATH file descriptors // Fall through to the fcntl() path } else #endif Maybe we should just enable now this code path on FreeBSD as well. == test.pythoninto of the last successful build 654 == datetime.datetime.now: 2021-08-01 01:15:06.918625 os.uname: posix.uname_result(sysname='FreeBSD', nodename='140-CURRENT-amd64-564d', release='14.0-CURRENT', version='FreeBSD 14.0-CURRENT #14 main-n245176-8742817ba62: Tue Mar 2 03:48:10 UTC 2021 root at 140-CURRENT-amd64:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG', machine='amd64') == test.pythoninto of the failed build 655 == datetime.datetime.now: 2021-08-04 09:56:34.287999 os.uname: posix.uname_result(sysname='FreeBSD', nodename='140-CURRENT-amd64-564d', release='14.0-CURRENT', version='FreeBSD 14.0-CURRENT #0 main-n248401-de0c7fbe280: Mon Aug 2 02:42:31 UTC 2021 root at 140-CURRENT-amd64-564d:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG', machine='amd64') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:05:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 11:05:29 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628247929.35.0.874017513381.issue44849@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +26117 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27623 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:07:47 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 06 Aug 2021 11:07:47 +0000 Subject: [issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None) In-Reply-To: <1628099391.12.0.0928824788179.issue44831@roundup.psfhosted.org> Message-ID: <1628248067.36.0.983326274074.issue44831@roundup.psfhosted.org> Steven D'Aprano added the comment: I've replicated this under Linux as well. def test(): start = time.time() end = datetime.datetime.now() start = datetime.datetime.fromtimestamp(start, None) assert end >= start Then run it in a loop: >>> for i in range(10000000): ... test() ... Traceback (most recent call last): File "", line 2, in File "", line 5, in test AssertionError >>> i 22 So while it is not as frequent as on Windows, it does occur on Linux as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:11:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 11:11:19 +0000 Subject: [issue44584] Deprecate thread debugging PYTHONTHREADDEBUG=1 In-Reply-To: <1625736189.01.0.129279218782.issue44584@roundup.psfhosted.org> Message-ID: <1628248279.02.0.326174410743.issue44584@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4d77691172aae81bdcbb0ea75839d0e896c43781 by Victor Stinner in branch 'main': bpo-44584: Deprecate PYTHONTHREADDEBUG env var (GH-27065) https://github.com/python/cpython/commit/4d77691172aae81bdcbb0ea75839d0e896c43781 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:11:20 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 11:11:20 +0000 Subject: [issue44584] Deprecate thread debugging PYTHONTHREADDEBUG=1 In-Reply-To: <1625736189.01.0.129279218782.issue44584@roundup.psfhosted.org> Message-ID: <1628248280.88.0.513100345628.issue44584@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +26118 pull_request: https://github.com/python/cpython/pull/27624 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:13:31 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Fri, 06 Aug 2021 11:13:31 +0000 Subject: [issue44851] Update bundled pip to 21.2.3 and setuptools to 57.4.0 Message-ID: <1628248411.95.0.443315719327.issue44851@roundup.psfhosted.org> New submission from Tzu-ping Chung : PR coming soon ---------- components: Distutils messages: 399072 nosy: dstufft, eric.araujo, uranusjr priority: normal severity: normal status: open title: Update bundled pip to 21.2.3 and setuptools to 57.4.0 versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:14:09 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Fri, 06 Aug 2021 11:14:09 +0000 Subject: [issue44851] Update bundled pip to 21.2.3 and setuptools to 57.4.0 In-Reply-To: <1628248411.95.0.443315719327.issue44851@roundup.psfhosted.org> Message-ID: <1628248449.67.0.527478991404.issue44851@roundup.psfhosted.org> Change by Tzu-ping Chung : ---------- keywords: +patch pull_requests: +26119 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27625 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:13:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 11:13:34 +0000 Subject: [issue44584] Deprecate thread debugging PYTHONTHREADDEBUG=1 In-Reply-To: <1625736189.01.0.129279218782.issue44584@roundup.psfhosted.org> Message-ID: <1628248414.19.0.0221354895056.issue44584@roundup.psfhosted.org> Change by STINNER Victor : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:22:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 11:22:12 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1628248932.64.0.714823624553.issue39355@roundup.psfhosted.org> STINNER Victor added the comment: Please go ahead. Anyone is free to propose a fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:33:15 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 11:33:15 +0000 Subject: [issue44584] Deprecate thread debugging PYTHONTHREADDEBUG=1 In-Reply-To: <1625736189.01.0.129279218782.issue44584@roundup.psfhosted.org> Message-ID: <1628249595.44.0.490082372679.issue44584@roundup.psfhosted.org> miss-islington added the comment: New changeset a11158ecef8cff795f7db8f4047cbd20cc9cf37e by Miss Islington (bot) in branch '3.10': bpo-44584: Deprecate PYTHONTHREADDEBUG env var (GH-27065) https://github.com/python/cpython/commit/a11158ecef8cff795f7db8f4047cbd20cc9cf37e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 07:53:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 11:53:34 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1628250814.07.0.286895773328.issue43853@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think it is worth to backport it to 3.9. It looks to me that it fixes also support of strings containing NUL. It would be nice to add corresponding tests for this. You can also add this in the NEWS entry for this issue. ---------- status: closed -> open versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:12:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 12:12:14 +0000 Subject: [issue43526] Programmatic management of BytesWarning doesn't work for native triggers. In-Reply-To: <1615971785.71.0.488992120219.issue43526@roundup.psfhosted.org> Message-ID: <1628251934.4.0.675214577466.issue43526@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am not against documenting the behavior of -b and BytesWarning clearly. I don't think that anyone would be against. Just somebody have to provide a PR. Explicitly repr-ing a bytes instance does not produce a warning, and never produced, so I don't understand what do you mean. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:14:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 12:14:30 +0000 Subject: [issue44584] Deprecate thread debugging PYTHONTHREADDEBUG=1 In-Reply-To: <1625736189.01.0.129279218782.issue44584@roundup.psfhosted.org> Message-ID: <1628252070.88.0.34277985978.issue44584@roundup.psfhosted.org> STINNER Victor added the comment: PYTHONTHREADDEBUG is now deprecated in Python 3.10, and planned for removal in 3.12. If someone finds it useful, we can reconsider to keep the feature, but maybe redirect the output to stderr rather than stdout. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:20:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 12:20:52 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1628252452.0.0.359028480924.issue44184@roundup.psfhosted.org> STINNER Victor added the comment: > Fix extended to the other branch (and backported to 3.10), and both parts backported to 3.9. I don't think it counts as a security issue, so not backporting to 3.8. Thanks Thomas, I missed this code path! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:23:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 06 Aug 2021 12:23:29 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628252609.16.0.148618756054.issue25782@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:25:19 2021 From: report at bugs.python.org (Tobias Bergkvist) Date: Fri, 06 Aug 2021 12:25:19 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1628252719.57.0.893103834319.issue44689@roundup.psfhosted.org> Tobias Bergkvist added the comment: I realised that I needed to define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME in the source file myself - as this is not defined after running the configure-script. I've updated the PR and its description to only focus on the legacy/deprecated approach on building on Catalina and running on Big Sur. Now a dynamic loading version of _dyld_shared_cache_contains_path is only used when compiling on MacOS < 11 (Catalina or older). And the weak-linking approach is used when HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH is defined (MacOS >= 11). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:28:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 12:28:08 +0000 Subject: [issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None) In-Reply-To: <1628099391.12.0.0928824788179.issue44831@roundup.psfhosted.org> Message-ID: <1628252888.93.0.779147670725.issue44831@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +belopolsky, p-ganssle, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:30:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 06 Aug 2021 12:30:17 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628253017.12.0.614653262916.issue25782@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +26120 pull_request: https://github.com/python/cpython/pull/27626 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:36:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 06 Aug 2021 12:36:50 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628253410.1.0.480524068403.issue25782@roundup.psfhosted.org> Irit Katriel added the comment: I added a third patch to the discussion. (It overlaps Dennis's suggestion, and I'm happy to close it in favour of a tweaked version of Dennis' patch, but I thought this would be the simplest way to say what I mean, and hopefully push the discussion along). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:39:05 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 12:39:05 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1628253545.94.0.525247639588.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26121 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27627 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:48:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 12:48:03 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628254083.53.0.0641782229602.issue44524@roundup.psfhosted.org> ?ukasz Langa added the comment: Serhiy, good question. As builtin generics return the base `__name__` for subscribed version, it makes sense to do the same for the versions in `typing`, especially if their unsubscribed versions provide `__name__`. As to "why even have `__name__` in the first place?", it's for introspection purposes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:50:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 06 Aug 2021 12:50:52 +0000 Subject: [issue40696] exception chain cycles cause hangs (was "Exception handling with "await" can hang in Python3.9.0b1") In-Reply-To: <1589962083.82.0.703924093729.issue40696@roundup.psfhosted.org> Message-ID: <1628254252.23.0.424993705159.issue40696@roundup.psfhosted.org> Irit Katriel added the comment: I think this can be closed now because the specific problem was fixed in PR20287 and the more general problem is the subject of issue25782. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:50:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 12:50:59 +0000 Subject: [issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH In-Reply-To: <1591712621.72.0.447782390229.issue40928@roundup.psfhosted.org> Message-ID: <1628254259.89.0.906432101895.issue40928@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 15d3c14df32a35ac69898a7852115722e30d7857 by Jack DeVries in branch 'main': bpo-40928: notify users running test_decimal on macOS of malloc warnings (GH-26783) https://github.com/python/cpython/commit/15d3c14df32a35ac69898a7852115722e30d7857 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:51:15 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 12:51:15 +0000 Subject: [issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH In-Reply-To: <1591712621.72.0.447782390229.issue40928@roundup.psfhosted.org> Message-ID: <1628254275.79.0.855467288917.issue40928@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26122 pull_request: https://github.com/python/cpython/pull/27628 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 08:58:27 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 12:58:27 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1628254707.19.0.361060056613.issue43853@roundup.psfhosted.org> Erlend E. Aasland added the comment: I'll add extra tests in a separate PR, so we can easily backport it to 3.10 and 3.9. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:01:05 2021 From: report at bugs.python.org (Larry Hastings) Date: Fri, 06 Aug 2021 13:01:05 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628254865.12.0.859464744687.issue25782@roundup.psfhosted.org> Change by Larry Hastings : ---------- nosy: -larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:03:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 13:03:46 +0000 Subject: [issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH In-Reply-To: <1591712621.72.0.447782390229.issue40928@roundup.psfhosted.org> Message-ID: <1628255026.73.0.810776110028.issue40928@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26123 pull_request: https://github.com/python/cpython/pull/27629 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:15:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 13:15:17 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628255717.96.0.225280170225.issue44849@roundup.psfhosted.org> STINNER Victor added the comment: New changeset c24896c0e3b32c8a9f614ef51366007b67d5c665 by Victor Stinner in branch 'main': bpo-44849: Fix os.set_inheritable() on FreeBSD 14 with O_PATH (GH-27623) https://github.com/python/cpython/commit/c24896c0e3b32c8a9f614ef51366007b67d5c665 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:17:21 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 13:17:21 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628255841.66.0.660659739184.issue44849@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26124 pull_request: https://github.com/python/cpython/pull/27630 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:17:56 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 13:17:56 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628255876.32.0.499821866092.issue44849@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26125 pull_request: https://github.com/python/cpython/pull/27631 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:35:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 13:35:45 +0000 Subject: [issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH In-Reply-To: <1591712621.72.0.447782390229.issue40928@roundup.psfhosted.org> Message-ID: <1628256945.35.0.595546803319.issue40928@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 693a661478036dc2c5b48e138dd09320a972c25a by ?ukasz Langa in branch '3.9': [3.9] bpo-40928: notify users running test_decimal on macOS of malloc warnings (GH-26783) (GH-27629) https://github.com/python/cpython/commit/693a661478036dc2c5b48e138dd09320a972c25a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:36:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 13:36:39 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628256999.19.0.488585271156.issue44524@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8bdf12e99a3dc7ada5f85bba79c2a9eb9931f5b0 by Bas van Beek in branch 'main': bpo-44524: Fix an issue wherein `_GenericAlias._name` was not properly set for specialforms (GH-27614) https://github.com/python/cpython/commit/8bdf12e99a3dc7ada5f85bba79c2a9eb9931f5b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:36:44 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 13:36:44 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628257004.69.0.096746773797.issue44524@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26126 pull_request: https://github.com/python/cpython/pull/27632 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:40:48 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 13:40:48 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628257248.31.0.131950526579.issue44849@roundup.psfhosted.org> miss-islington added the comment: New changeset 2ae2235c7a7627725df40c7875245cd17d90f39f by Miss Islington (bot) in branch '3.10': bpo-44849: Fix os.set_inheritable() on FreeBSD 14 with O_PATH (GH-27623) https://github.com/python/cpython/commit/2ae2235c7a7627725df40c7875245cd17d90f39f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:42:58 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 13:42:58 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628257378.34.0.116761617005.issue44849@roundup.psfhosted.org> miss-islington added the comment: New changeset 791c28a56f043618111a19377f8527326037230e by Miss Islington (bot) in branch '3.9': bpo-44849: Fix os.set_inheritable() on FreeBSD 14 with O_PATH (GH-27623) https://github.com/python/cpython/commit/791c28a56f043618111a19377f8527326037230e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 09:56:25 2021 From: report at bugs.python.org (Alexander Belopolsky) Date: Fri, 06 Aug 2021 13:56:25 +0000 Subject: [issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None) In-Reply-To: <1628099391.12.0.0928824788179.issue44831@roundup.psfhosted.org> Message-ID: <1628258185.92.0.835206613903.issue44831@roundup.psfhosted.org> Alexander Belopolsky added the comment: Can someone try to replicate this while disabling the C acceleration: import sys sys.modules[?_datetime?] = None (Before any other imports.) If anything, this is likely to be a problem with the C implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 10:28:43 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 06 Aug 2021 14:28:43 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628260123.24.0.745623306397.issue25782@roundup.psfhosted.org> Chris Jerdonek added the comment: Thanks, Irit. Can you show how your patch behaves using some representative examples (maybe using arrow examples from above)? And if it behaves differently from Dennis's patch, can you include an example showing that, too? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 10:47:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 06 Aug 2021 14:47:21 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628261241.04.0.337589756174.issue25782@roundup.psfhosted.org> Irit Katriel added the comment: Like Dennis' patch, mine changes PyErr_SetObject. The difference is that Dennis' patch gets rid of the cycle while mine leaves it as it is, just avoids hanging on it. So in this case: when trying to set the exception A on top of B -> C -> D -> E -> C -> ..., The result would be simply A -> B -> C -> D -> E -> C -> ..., As I said in msg391637, a pre-existing cycle is due to a bug somewhere, and I don't think PyErr_SetObject can or should try to fix that bug. Nonsense in, nonsense out. If we change it we probably just make it more nonsensical. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 10:49:17 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Aug 2021 14:49:17 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628261357.53.0.181930381003.issue44605@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +26127 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27633 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 10:55:29 2021 From: report at bugs.python.org (Jack O'Connor) Date: Fri, 06 Aug 2021 14:55:29 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628261729.89.0.598713005151.issue25782@roundup.psfhosted.org> Change by Jack O'Connor : ---------- nosy: -oconnor663 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 11:04:10 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 06 Aug 2021 15:04:10 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628262250.67.0.799713465362.issue25782@roundup.psfhosted.org> Chris Jerdonek added the comment: Yes, that seems like a good approach. And how about with Serhiy's example from above? > If there is a chain A -> B -> C -> D -> E, after assignment C.__context__ = A ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 11:14:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 06 Aug 2021 15:14:21 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628262861.24.0.584926461714.issue44849@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 11:18:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 06 Aug 2021 15:18:15 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628263095.04.0.275776325849.issue25782@roundup.psfhosted.org> Irit Katriel added the comment: Serhiy's patch is modifying a different part of this system - he changes the Exception object's SetContext to break cycles when they are first created. Dennis and I targeted the place where an exception is about to be raised and it gets a __context__ that may contain a cycle already. I think it's possible to take the more drastic step of preventing the cycles being created altogether, as Serhiy did. I would prefer that we raise an exception and refuse to create the cycle rather than try to fix it. I don't think we can come up with a meaningful fix to what is, really, a user bug. In any case, at the moment we have a situation where user bugs (like Issue40696) can cause the interpreter to hang, and if we need more time to decide about the full strategy, we should at least prevent the hang. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 11:24:32 2021 From: report at bugs.python.org (xrcg) Date: Fri, 06 Aug 2021 15:24:32 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1628263472.84.0.372129607506.issue43976@roundup.psfhosted.org> xrcg added the comment: What is the probability that custom site install schemes will be supported without requiring a patch before distutils is removed? ---------- nosy: +xrcg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 11:27:24 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Aug 2021 15:27:24 +0000 Subject: [issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None) In-Reply-To: <1628099391.12.0.0928824788179.issue44831@roundup.psfhosted.org> Message-ID: <1628263644.26.0.379861157873.issue44831@roundup.psfhosted.org> Raymond Hettinger added the comment: The cause of the problem is inconsistent rounding modes: end = datetime.datetime.now() # always rounds down start = datetime.datetime.fromtimestamp(start, None) # sometimes rounds_up >From the C code in Modules/_datetimemodule.c: * The fromtimestamp() code uses ROUND_HALF_EVEN which can round-up. * The datetime.now() code calls datetime_best_possible() which uses ROUND_FLOOR, always rounding down. ------------------------------- static PyObject * datetime_from_timestamp(PyObject *cls, TM_FUNC f, PyObject *timestamp, PyObject *tzinfo) { time_t timet; long us; if (_PyTime_ObjectToTimeval(timestamp, &timet, &us, _PyTime_ROUND_HALF_EVEN) == -1) return NULL; return datetime_from_timet_and_us(cls, f, timet, (int)us, tzinfo); } -------------------------------- static PyObject * datetime_datetime_now_impl(PyTypeObject *type, PyObject *tz) /*[clinic end generated code: output=b3386e5345e2b47a input=80d09869c5267d00]*/ { PyObject *self; /* Return best possible local time -- this isn't constrained by the * precision of a timestamp. */ if (check_tzinfo_subclass(tz) < 0) return NULL; self = datetime_best_possible((PyObject *)type, tz == Py_None ? _PyTime_localtime : _PyTime_gmtime, tz); if (self != NULL && tz != Py_None) { /* Convert UTC to tzinfo's zone. */ self = _PyObject_CallMethodId(tz, &PyId_fromutc, "N", self); } return self; } ------------------------ static PyObject * datetime_best_possible(PyObject *cls, TM_FUNC f, PyObject *tzinfo) { _PyTime_t ts = _PyTime_GetSystemClock(); time_t secs; int us; if (_PyTime_AsTimevalTime_t(ts, &secs, &us, _PyTime_ROUND_FLOOR) < 0) return NULL; assert(0 <= us && us <= 999999); return datetime_from_timet_and_us(cls, f, secs, us, tzinfo); } ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 11:28:17 2021 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 06 Aug 2021 15:28:17 +0000 Subject: [issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None) In-Reply-To: <1628099391.12.0.0928824788179.issue44831@roundup.psfhosted.org> Message-ID: <1628263697.27.0.00305107140218.issue44831@roundup.psfhosted.org> Paul Ganssle added the comment: I think this is a rounding issue. `time.time()` returns an epoch timestamp as a float and at the current epoch time, floats are spaced ~500ns apart. `datetime.datetime.now` does a floor division when rounding: https://github.com/python/cpython/blob/8bdf12e99a3dc7ada5f85bba79c2a9eb9931f5b0/Modules/_datetimemodule.c#L5056 `datetime.fromtimestamp` uses the standard banker's round (round above half, tie goes to the nearest even number): https://github.com/python/cpython/blob/8bdf12e99a3dc7ada5f85bba79c2a9eb9931f5b0/Modules/_datetimemodule.c#L5038-L5039 Presumably if we change these two to be consistent, this issue will go away. I am not entirely sure if anyone is relying on a particular rounding behavior for one or both of these, and I'm not sure which one is the right one to harmonize on. For now I'm going to say that we should target 3.11 on this, since it will change an existing observable behavior for at least one of these functions in a way that isn't necessarily going from "obviously wrong" to "obviously right", so I think we should be cautious and not change this in a patch release. ---------- versions: +Python 3.11 -Python 3.6, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 11:31:08 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Aug 2021 15:31:08 +0000 Subject: [issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None) In-Reply-To: <1628099391.12.0.0928824788179.issue44831@roundup.psfhosted.org> Message-ID: <1628263868.32.0.331961907414.issue44831@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 11:38:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 15:38:31 +0000 Subject: [issue44679] unittest.mock.sentinel documentation typo In-Reply-To: <1626729328.44.0.624843688761.issue44679@roundup.psfhosted.org> Message-ID: <1628264311.3.0.0427084990745.issue44679@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8c17db6cd4e29f922a195acdb5aff3ef9c2340e5 by Miss Islington (bot) in branch '3.9': bpo-44679: [doc] fix typo in unittest.mock.rst (GH-27618) (GH-27619) https://github.com/python/cpython/commit/8c17db6cd4e29f922a195acdb5aff3ef9c2340e5 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 11:44:19 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 06 Aug 2021 15:44:19 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628264659.09.0.759120693172.issue25782@roundup.psfhosted.org> Chris Jerdonek added the comment: That's okay. I didn't mean to suggest I thought your patch needed to handle that case or that we needed to decide it before moving forward. I was just wondering what would happen with your patch with it, even if it means a hang. Or were you saying that example can't arise in the code path you're modifying? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 12:16:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 06 Aug 2021 16:16:06 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628266566.26.0.40957386019.issue25782@roundup.psfhosted.org> Irit Katriel added the comment: My patch doesn't change that at all, so it will be the same as it is currently: the result is C -> A -> B -> C. (But with my patch if you try to raise something in the context of C, it won't hang.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 12:31:08 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Aug 2021 16:31:08 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628267468.1.0.36050825819.issue44756@roundup.psfhosted.org> Ned Deily added the comment: There was a previous attempt at adding a dependency on venv that ended up being reverted (Issue30487 and 122fc136b34e11906466851e77bb6959946467ee0). Over the years we have had a number of iterations of tweaking Doc/Makefile to balance ease of use (by providing the venv) with those of more advanced users who build docs as part of their automated processeses. I think what we had prior to this most recent change worked reasonably well for all. The previous process is clearly documented, for example in the Dev Guide (https://devguide.python.org/documenting/?highlight=venv#building-the-documentation) and does not strike me as very onerous. I appreciate the motivation behind this change but I really think there isn't a problem here that needs to be solved and I would support reverting the change for 3.9 and 3.10 and *perhaps* reconsider something for 3.11. ---------- nosy: +ned.deily priority: normal -> release blocker resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 12:34:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 16:34:02 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite Message-ID: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> New submission from ?ukasz Langa : Sometimes we have the following problem: - there are way too many deprecations raised from a given library to silence them one by one; - the deprecations are different between maintenance branches and we don't want to make tests between the branches hopelessly conflicting. In particular, there is such a case right now with asyncio in 3.9 vs. later branches. 3.8 deprecated the loop= argument in a bunch of functions but due to poor warning placement, most of them were silent. This is being fixed in BPO-44815 which would go out to users in 3.9.7 but that created 220 new warnings when running test_asyncion in regression tests. Fixing them one by one would be both tedious, and would make the 3.9 branch forever conflicting with newer branches in many asyncio test files. In 3.11 there's a new round of deprecations raised in test_asyncio, making the branches different. Moreover, those warnings are typically silenced by `assertWarns` context managers which should only be used when actually testing the warnings, *not* to silence irrelevant warnings. So, what the PR does is it introduces: - `support.ignore_deprecations_from("path.to.module", like=".*msg regex.*")`, and - `support.clear_ignored_deprecations()` The former adds a new filter to warnings, the message regex is mandatory. The latter removes only the filters that were added by the former, leaving all other filters alone. Example usage is in `test_support`, and later, should this be merged, will be in asyncio tests on the 3.9 branch. ---------- assignee: lukasz.langa components: Tests messages: 399102 nosy: lukasz.langa priority: normal severity: normal stage: patch review status: open title: Add ability to wholesale silence DeprecationWarnings while running the test suite type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 12:34:07 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Aug 2021 16:34:07 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628267647.87.0.969537516013.issue44756@roundup.psfhosted.org> Change by Ned Deily : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 12:38:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 16:38:17 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1628267897.66.0.538946975149.issue44852@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- keywords: +patch pull_requests: +26128 pull_request: https://github.com/python/cpython/pull/27634 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 12:54:10 2021 From: report at bugs.python.org (Joshua Root) Date: Fri, 06 Aug 2021 16:54:10 +0000 Subject: [issue44853] 3.1.10rc1 published md5 and size do not match for source archives Message-ID: <1628268850.54.0.892251234836.issue44853@roundup.psfhosted.org> New submission from Joshua Root : The download page lists the following: Filename md5 size Python-3.10.0rc1.tgz c051bf7a52a45cb0ec2cefbe915417e1 40764776 Python-3.10.0rc1.tar.xz 2861cdd4cf71c6425fde1fedc14bb283 28197832 The downloaded files instead have these properties: Python-3.10.0rc1.tgz d23c2a8228705b17e8414f1660e4bb73 24955561 Python-3.10.0rc1.tar.xz edd2eb2f7f4a932ed59196cbe373e5fb 18680452 The gpg signatures do verify ok however. The md5 and size listed for the macOS installer seem to be correct. I didn't check the Windows installers. ---------- components: Installation messages: 399103 nosy: jmr, pablogsal priority: normal severity: normal status: open title: 3.1.10rc1 published md5 and size do not match for source archives type: security versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 12:54:31 2021 From: report at bugs.python.org (Joshua Root) Date: Fri, 06 Aug 2021 16:54:31 +0000 Subject: [issue44853] 3.10.0rc1 published md5 and size do not match for source archives In-Reply-To: <1628268850.54.0.892251234836.issue44853@roundup.psfhosted.org> Message-ID: <1628268871.11.0.212831943896.issue44853@roundup.psfhosted.org> Change by Joshua Root : ---------- title: 3.1.10rc1 published md5 and size do not match for source archives -> 3.10.0rc1 published md5 and size do not match for source archives _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 12:57:50 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 16:57:50 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1628269070.66.0.586403682706.issue44852@roundup.psfhosted.org> ?ukasz Langa added the comment: For example, all that's needed to silence the 220 new warnings in all asyncio tests, is adding this in Lib/test/test_asyncio/__init__.py: ``` def setUpModule(): support.ignore_deprecations_from("asyncio.base_events", like=r".*loop argument.*") support.ignore_deprecations_from("asyncio.unix_events", like=r".*loop argument.*") support.ignore_deprecations_from("asyncio.futures", like=r".*loop argument.*") support.ignore_deprecations_from("asyncio.runners", like=r".*loop argument.*") support.ignore_deprecations_from("asyncio.subprocess", like=r".*loop argument.*") support.ignore_deprecations_from("asyncio.tasks", like=r".*loop argument.*") support.ignore_deprecations_from("test.test_asyncio.test_queues", like=r".*loop argument.*") support.ignore_deprecations_from("test.test_asyncio.test_tasks", like=r".*loop argument.*") def tearDownModule(): support.clear_ignored_deprecations() ``` Since the `__init__.py` file in question isn't a module that runs tests itself but only a package gathering many sub-modules, we need some boilerplate like: ``` def load_tests(loader, _, pattern): pkg_dir = os.path.dirname(__file__) suite = AsyncioTestSuite() return support.load_package_tests(pkg_dir, loader, suite, pattern) class AsyncioTestSuite(unittest.TestSuite): """A custom test suite that also runs setup/teardown for the whole package. Normally unittest only runs setUpModule() and tearDownModule() within each test module part of the test suite. Copying those functions to each file would be tedious, let's run this once and for all. """ def run(self, result, debug=False): try: setUpModule() super().run(result, debug=debug) finally: tearDownModule() ``` With that, all of asyncio tests silence unnecessary deprecation warnings. Additionally, testing for warnings with `warnings_helper.check_warnings()` or `assertWarns` still works just fine as those facilities temporarily disable filtering. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:08:38 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 17:08:38 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628269718.56.0.18616681261.issue44524@roundup.psfhosted.org> miss-islington added the comment: New changeset 36a2497093f0c66c2fb1667308691561c1bbe3f4 by Miss Islington (bot) in branch '3.10': bpo-44524: Fix an issue wherein `_GenericAlias._name` was not properly set for specialforms (GH-27614) https://github.com/python/cpython/commit/36a2497093f0c66c2fb1667308691561c1bbe3f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:09:10 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 17:09:10 +0000 Subject: [issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH In-Reply-To: <1591712621.72.0.447782390229.issue40928@roundup.psfhosted.org> Message-ID: <1628269750.64.0.261158805637.issue40928@roundup.psfhosted.org> miss-islington added the comment: New changeset a5d99632766b458b42f327e8bd0f82b0345c9a63 by Miss Islington (bot) in branch '3.10': bpo-40928: notify users running test_decimal on macOS of malloc warnings (GH-26783) https://github.com/python/cpython/commit/a5d99632766b458b42f327e8bd0f82b0345c9a63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:10:12 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 17:10:12 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628269812.04.0.442286371135.issue44524@roundup.psfhosted.org> ?ukasz Langa added the comment: Looks like we can re-close this again. Thanks for your quick reaction, Bas! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:10:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Aug 2021 17:10:39 +0000 Subject: [issue44853] 3.10.0rc1 published md5 and size do not match for source archives In-Reply-To: <1628268850.54.0.892251234836.issue44853@roundup.psfhosted.org> Message-ID: <1628269839.27.0.374948117772.issue44853@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ah, this is due to the fact that we needed to update the files due to the venv problem. I will update the file properties. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:13:42 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 17:13:42 +0000 Subject: [issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH In-Reply-To: <1591712621.72.0.447782390229.issue40928@roundup.psfhosted.org> Message-ID: <1628270022.02.0.840588653411.issue40928@roundup.psfhosted.org> ?ukasz Langa added the comment: Given that: - this is only surfacing in test_decimal on macOS; - the real solution to modify malloc has potential performance implications; and - silencing the spew isn't possible from within the test module I elected to accept Jack's patch to notify macOS users running regression tests of the harmless malloc spew. I don't think there's anything else to do here. Thanks all for your effort in investigating this! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:14:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Aug 2021 17:14:11 +0000 Subject: [issue44853] 3.10.0rc1 published md5 and size do not match for source archives In-Reply-To: <1628268850.54.0.892251234836.issue44853@roundup.psfhosted.org> Message-ID: <1628270051.25.0.283930178123.issue44853@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:14:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Aug 2021 17:14:05 +0000 Subject: [issue44853] 3.10.0rc1 published md5 and size do not match for source archives In-Reply-To: <1628268850.54.0.892251234836.issue44853@roundup.psfhosted.org> Message-ID: <1628270045.15.0.411693882086.issue44853@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Updated: Gzipped source tarball Source release d23c2a8228705b17e8414f1660e4bb73 24955561 SIG XZ compressed source tarball Source release edd2eb2f7f4a932ed59196cbe373e5fb 18680452 SIG ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:40:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 17:40:46 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628271646.68.0.826937084708.issue44756@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26129 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27635 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:44:56 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 06 Aug 2021 17:44:56 +0000 Subject: [issue37529] Mimetype module duplicates In-Reply-To: <1562680761.15.0.288138014947.issue37529@roundup.psfhosted.org> Message-ID: <1628271896.46.0.994790170863.issue37529@roundup.psfhosted.org> Andrei Kulakov added the comment: This was fixed in https://github.com/python/cpython/pull/26300 but wasn't backported. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:51:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 17:51:16 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628272276.26.0.239855644739.issue44605@roundup.psfhosted.org> ?ukasz Langa added the comment: IMO the PR should be accepted and have approved it accordingly. @total_ordering, as mentioned by Raymond, wasn't ever the most efficient way to implement ordering on a class. It is the most readable and easy way to get a correct implementation though so it's preferred where performance isn't the highest priority. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:57:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 17:57:07 +0000 Subject: [issue44851] Update bundled pip to 21.2.3 and setuptools to 57.4.0 In-Reply-To: <1628248411.95.0.443315719327.issue44851@roundup.psfhosted.org> Message-ID: <1628272627.28.0.676343136107.issue44851@roundup.psfhosted.org> ?ukasz Langa added the comment: As per https://www.python.org/dev/peps/pep-0453/#updating-the-private-copy-of-pip, we should be updating Python 3.9 as well. What do you think, Tzu-ping Chung? ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 13:57:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 17:57:46 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1628272666.99.0.783441515273.issue43853@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 8c07fef867707694c9f2fcee4d7a9563ad78ed14 by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-43853: Handle sqlite3_value_text() errors (GH-25422). (GH-27627) https://github.com/python/cpython/commit/8c07fef867707694c9f2fcee4d7a9563ad78ed14 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:00:04 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 18:00:04 +0000 Subject: [issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628272804.6.0.516388382082.issue44822@roundup.psfhosted.org> miss-islington added the comment: New changeset 2b1e713f877102bbca299f0f5d7db969d78db49f by Miss Islington (bot) in branch '3.10': bpo-44822: Don't truncate `str`s with embedded NULL chars returned by `sqlite3` UDF callbacks (GH-27588) https://github.com/python/cpython/commit/2b1e713f877102bbca299f0f5d7db969d78db49f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:07:16 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 18:07:16 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1628273236.27.0.476941497087.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:14:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 18:14:07 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628273647.72.0.0761384890447.issue44756@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 55fa87b1ef46bbb9db7612b2dc2dd7fb039d9bc3 by ?ukasz Langa in branch 'main': bpo-44756: [docs] revert automated virtual environment creation on `make html` (GH-27635) https://github.com/python/cpython/commit/55fa87b1ef46bbb9db7612b2dc2dd7fb039d9bc3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:14:09 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 18:14:09 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628273649.68.0.467788906475.issue44756@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26130 pull_request: https://github.com/python/cpython/pull/27636 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:18:53 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 18:18:53 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628273933.3.0.522423943753.issue44756@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26131 pull_request: https://github.com/python/cpython/pull/27637 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:20:29 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Fri, 06 Aug 2021 18:20:29 +0000 Subject: [issue44851] Update bundled pip to 21.2.3 and setuptools to 57.4.0 In-Reply-To: <1628248411.95.0.443315719327.issue44851@roundup.psfhosted.org> Message-ID: <1628274029.57.0.751992198922.issue44851@roundup.psfhosted.org> Tzu-ping Chung added the comment: I was not sure what the policy is and went with the two that accepts new features hoping someone would tell me I?m wrong :p So yeah, 3.9 should be added. ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:25:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 18:25:28 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1628274328.4.0.627207641933.issue44852@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are problems with clearing all ignored deprecation filters. We can want to ignore warnings in narrower or wider scope: per-method, per-class, per-module. We should use the warnings.catch_warnings() context manager for restoring filters in the correct scope. For example, use setUp/tearDown, setUpClass/tearDownClass, setUpModule/tearDownModule and save the context manager as an instance/class attribute or module global. def setUp(self): self.w = warnings.catch_warnings() self.w.__enter__() warnings.filterwarnings(...) def tearDown(): self.w.__exit__(None, None, None) It is hard to use any helper here because the code should be added in multiple places. Or use setUp/addCleanup, setUpClass/addClassCleanup, setUpModule/addModuleCleanup if you want to keep all code in one place: def setUp(self): w = warnings.catch_warnings() w.__enter__() self.addCleanup(w.__exit__, None, None, None) warnings.filterwarnings(...) The helper can call catch_warnings(), __enter__(), set filters and return a caller which calls __exit__(None, None, None): def setUp(self): self.addCleanup(some_helper(...)) For class and method scopes it would be convenient to use class and method decorators correspondingly. @ignore_some_warnings(...) def test_foo(self): ... @ignore_some_warnings(...) class BarTests(unittest.TestCase): ... ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:26:13 2021 From: report at bugs.python.org (Marc Culler) Date: Fri, 06 Aug 2021 18:26:13 +0000 Subject: [issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6 In-Reply-To: <1628187772.25.0.057808500179.issue44828@roundup.psfhosted.org> Message-ID: Marc Culler added the comment: I built Tcl and Tk 8.6 on Monterey beta (21A5294g) and I see this traceback in the Wish file dialog demo. Note that this is *not* an error. The file dialog works fine. This is a non-fatal NSInternalInconsistencyException which prints a traceback to stderr. It occurs within a call to [NSSavePanel runModal] which is entirely Apple code. The runModal method is not deprecated. Most likely, when Apple releases Monterey the assert command will have been removed, possibly replaced by a call to NSLog which writes information into a log file rather than print it to stderr. (NSLog itself prints to stderr when debugging is enabled.) Of course macOS apps run without stderr, so you will only see this traceback when running a python program from the terminal. (Any linux user who runs linux apps from the terminal is used to seeing lots of stderr messages in stderr. Try running okular from a terminal sometime. So we shouldn't complain too much.) Anyway, this looks harmless and the messages will almost surely go away in the production version. However, there are several new deprecations related to specifying preferred file types in a file dialog which I will address in Tk before Monterey is released. Beta releases are betas, even for macOS. - Marc On Thu, Aug 5, 2021 at 1:23 PM Ned Deily wrote: > > > Ned Deily added the comment: > > > I used brew.sh to install Python, which I think uses the universal installer > > As far as I know, Homebrew builds its own Python and Tk. > > > After I reinstall macOS, if you need further testing, i?m open to trying. > > Thanks. I think the next step would be to try to reproduce just using Tcl and Tk as this most likely is an issue in Tk rather than Python. It's also quite possible that the underlying problem will be fixed in a future Monterey beta. Alas, I don't have time to look further into this in the immediate future. Perhaps someone can follow up directly with the Tk folks. > > ---------- > nosy: +culler > > _______________________________________ > Python tracker > > _______________________________________ ---------- nosy: +Marc.Culler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:26:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 18:26:57 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1628274417.37.0.0841498765321.issue43853@roundup.psfhosted.org> Serhiy Storchaka added the comment: What about new tests and NEWS update? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:28:27 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 18:28:27 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1628274507.34.0.91157235587.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:28:56 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 18:28:56 +0000 Subject: [issue44839] Convert Python exceptions to appropriate SQLite error codes In-Reply-To: <1628164492.41.0.705893137688.issue44839@roundup.psfhosted.org> Message-ID: <1628274536.59.0.605348671937.issue44839@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 7d747f26e6cac9f6891d475f3443441ce947697b by Serhiy Storchaka in branch 'main': bpo-44839: Raise more specific errors in sqlite3 (GH-27613) https://github.com/python/cpython/commit/7d747f26e6cac9f6891d475f3443441ce947697b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:29:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 18:29:14 +0000 Subject: [issue44839] Convert Python exceptions to appropriate SQLite error codes In-Reply-To: <1628164492.41.0.705893137688.issue44839@roundup.psfhosted.org> Message-ID: <1628274554.15.0.96417718823.issue44839@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:32:31 2021 From: report at bugs.python.org (Marc Culler) Date: Fri, 06 Aug 2021 18:32:31 +0000 Subject: [issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6 In-Reply-To: <1628076093.82.0.287740145135.issue44828@roundup.psfhosted.org> Message-ID: <1628274751.36.0.431225734796.issue44828@roundup.psfhosted.org> Marc Culler added the comment: I should have mentioned that I tested on Intel hardware, not M1. I do not have access to an M1 Apple at this time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:37:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 18:37:22 +0000 Subject: [issue44854] Add .editorconfig to the root directory Message-ID: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> New submission from ?ukasz Langa : EditorConfig is a cross-editor configuration file that is pretty widely adopted: https://editorconfig.org/ Adding this to the root directory will allow editors that use the file to automatically format a few details which we already enforce with `make patchcheck`: - always put an empty line at the end of the file; - remove trailing whitespace; - disallow tabs in Python (PEP 8) and C (PEP 7) files. ---------- messages: 399123 nosy: lukasz.langa priority: normal severity: normal status: open title: Add .editorconfig to the root directory type: enhancement versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:39:42 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 18:39:42 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628275182.77.0.590575663381.issue44854@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- keywords: +patch pull_requests: +26132 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27638 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:42:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 18:42:35 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628275355.54.0.432600260792.issue44756@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 91f6d386691c060dfaa870d74b370e9c10eb8cd8 by Miss Islington (bot) in branch '3.9': bpo-44756: [docs] revert automated virtual environment creation on `make html` (GH-27635) (GH-27636) https://github.com/python/cpython/commit/91f6d386691c060dfaa870d74b370e9c10eb8cd8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:43:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 06 Aug 2021 18:43:07 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628275387.53.0.187209644374.issue33930@roundup.psfhosted.org> Irit Katriel added the comment: I've reproduced the segfault on 3.11 on a Mac. ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:47:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 06 Aug 2021 18:47:00 +0000 Subject: [issue33232] Segmentation fault in operator.attrgetter In-Reply-To: <1522939744.33.0.682650639539.issue33232@psf.upfronthosting.co.za> Message-ID: <1628275620.53.0.680527673514.issue33232@roundup.psfhosted.org> Irit Katriel added the comment: If there will be no objections I will close this in a couple of weeks. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:52:57 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 18:52:57 +0000 Subject: [issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628275977.57.0.387427562842.issue44822@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26133 pull_request: https://github.com/python/cpython/pull/27639 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:53:20 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 06 Aug 2021 18:53:20 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1628276000.97.0.788435091927.issue43976@roundup.psfhosted.org> Filipe La?ns added the comment: I find it very difficult. I would be a bit anxious merging the code this close to the final release, so I imagine the release managers would be much more. Anyway, this is the current state of this issue from my perspective: As far as I understand, progress is currently blocked because Matthias thinks this mechanism must allow Debian to replace all related downstream patches. I disagree with him in the way Debian is patching Python, which IMO is way too intrusive and fragile. Given that this vendor config will essentially shift the burden of supporting these modifications to the Python upstream, I don't think it would be a good idea to allow the modifications Debian wants in this config. For all other downstreams I have talked to, the proposal seems to be fine, though more testing would definitely be appreciated. I think that at this point, we could really use a core dev to help push this to the state of being able to get merged, because I don't think I can do that alone. I have already requested feedback from the community and the technical discussions on the PR went silent, so I do not see what else I can do :/ If needed, I would be available to brief anyone on my understanding of the issues and how this proposal handles that. So, any core dev, please feel free to reach out if you want to help move this forward. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 14:54:37 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 06 Aug 2021 18:54:37 +0000 Subject: [issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6 In-Reply-To: <1628076093.82.0.287740145135.issue44828@roundup.psfhosted.org> Message-ID: <1628276077.03.0.385833925327.issue44828@roundup.psfhosted.org> Ned Deily added the comment: Thanks for looking into this, Marc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:10:51 2021 From: report at bugs.python.org (xrcg) Date: Fri, 06 Aug 2021 19:10:51 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1628277051.32.0.40752313321.issue43976@roundup.psfhosted.org> xrcg added the comment: @FFY00: Thanks for the info. >From what I quickly read, 3.10 will only deprecate distutils, and the removal is scheduled for 3.12. Is that correct? If so, the impending release of 3.10 shouldn?t be a problem, as there are 2 more releases before distutils will be removed. Or does deprecating distutils cause problems other than warnings? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:16:02 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 19:16:02 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628277362.99.0.188910922275.issue44756@roundup.psfhosted.org> miss-islington added the comment: New changeset 1e9c9ca570ffe92dc6a60825c2f9c91865129b8f by Miss Islington (bot) in branch '3.10': bpo-44756: [docs] revert automated virtual environment creation on `make html` (GH-27635) https://github.com/python/cpython/commit/1e9c9ca570ffe92dc6a60825c2f9c91865129b8f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:20:00 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 06 Aug 2021 19:20:00 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1628277600.72.0.816034913614.issue43976@roundup.psfhosted.org> Filipe La?ns added the comment: Yes, but in the process of deprecating disutils, some internals were changed to stop relying on it. This will cause a lot of downstream patches to break. I you are not modifying CPython, you don't need to worry, but if you are, then you should have a look and figure out how/where to patch it now. As far as the public distutils API is concerned, everything will still the same until 3.12, just with deprecation warnings. Development has moved to [1] and it will eventually be merged into setuptools. [1] https://github.com/pypa/distutils ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:20:47 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 06 Aug 2021 19:20:47 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1628277647.37.0.69788596515.issue43976@roundup.psfhosted.org> Filipe La?ns added the comment: s/still/stay/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:24:15 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 19:24:15 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1628277855.69.0.631266807225.issue43853@roundup.psfhosted.org> Erlend E. Aasland added the comment: Serhiy, what's the preferred way to append to existing NEWS entries: should I update the existing NEWS entries tied to this issue, or add new entries (with the same bpo number)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:33:38 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 19:33:38 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628278418.36.0.823252990495.issue44605@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26134 pull_request: https://github.com/python/cpython/pull/27640 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:33:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Aug 2021 19:33:40 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628278420.09.0.312018197772.issue44605@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 1f7d64608b5c7f4c3d96b01b33e18ebf9dec8490 by Raymond Hettinger in branch 'main': bpo-44605: Teach @total_ordering() to work with metaclasses (GH-27633) https://github.com/python/cpython/commit/1f7d64608b5c7f4c3d96b01b33e18ebf9dec8490 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:33:42 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 19:33:42 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628278422.34.0.716934677453.issue44605@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26135 pull_request: https://github.com/python/cpython/pull/27641 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:43:18 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 19:43:18 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1628278998.96.0.557701639143.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26136 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27642 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:53:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 19:53:19 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1628279599.85.0.623368413339.issue44756@roundup.psfhosted.org> ?ukasz Langa added the comment: Revert done. Re-closing! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 15:58:10 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Aug 2021 19:58:10 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628279890.49.0.254379144164.issue44605@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset fde84170d06f74afd6f95d5b18cf3f733018191a by Miss Islington (bot) in branch '3.9': bpo-44605: Teach @total_ordering() to work with metaclasses (GH-27633) (GH-27641) https://github.com/python/cpython/commit/fde84170d06f74afd6f95d5b18cf3f733018191a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:05:27 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 20:05:27 +0000 Subject: [issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator. In-Reply-To: <1471070996.16.0.75939310279.issue27752@psf.upfronthosting.co.za> Message-ID: <1628280327.29.0.629351444492.issue27752@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26138 pull_request: https://github.com/python/cpython/pull/27644 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:05:23 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 20:05:23 +0000 Subject: [issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator. In-Reply-To: <1471070996.16.0.75939310279.issue27752@psf.upfronthosting.co.za> Message-ID: <1628280323.21.0.0638474234671.issue27752@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26137 pull_request: https://github.com/python/cpython/pull/27643 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:05:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 20:05:23 +0000 Subject: [issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator. In-Reply-To: <1471070996.16.0.75939310279.issue27752@psf.upfronthosting.co.za> Message-ID: <1628280323.57.0.175907049834.issue27752@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0ffdced3b64ba5886fcde64266a31a15712da284 by Jack DeVries in branch 'main': bpo-27752: improve documentation of csv.Dialect (GH-26795) https://github.com/python/cpython/commit/0ffdced3b64ba5886fcde64266a31a15712da284 ---------- message_count: 3.0 -> 4.0 nosy: +lukasz.langa, miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26137 pull_request: https://github.com/python/cpython/pull/27643 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:11:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Aug 2021 20:11:51 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628280711.72.0.155082358459.issue44605@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 66dd1a0e645f26b074547dccc92448169cb32410 by Miss Islington (bot) in branch '3.10': bpo-44605: Teach @total_ordering() to work with metaclasses (GH-27633) (GH-27640) https://github.com/python/cpython/commit/66dd1a0e645f26b074547dccc92448169cb32410 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:12:24 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 20:12:24 +0000 Subject: [issue44855] [DOC] some sqlite3 exceptions are not documented Message-ID: <1628280744.2.0.733600605983.issue44855@roundup.psfhosted.org> New submission from Erlend E. Aasland : sqlite3.InterfaceError, sqlite3.DataError, and sqlite3.InternalError are not documented. ---------- assignee: docs at python components: Documentation messages: 399139 nosy: docs at python, erlendaasland priority: normal severity: normal status: open title: [DOC] some sqlite3 exceptions are not documented _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:13:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 20:13:00 +0000 Subject: [issue44855] [DOC] some sqlite3 exceptions are not documented In-Reply-To: <1628280744.2.0.733600605983.issue44855@roundup.psfhosted.org> Message-ID: <1628280780.27.0.401183034555.issue44855@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +26139 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27645 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:14:15 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 06 Aug 2021 20:14:15 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1628280855.17.0.987230203948.issue44605@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:19:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 20:19:59 +0000 Subject: [issue44855] [doc] some sqlite3 exceptions are not documented In-Reply-To: <1628280744.2.0.733600605983.issue44855@roundup.psfhosted.org> Message-ID: <1628281199.97.0.73955183118.issue44855@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: [DOC] some sqlite3 exceptions are not documented -> [doc] some sqlite3 exceptions are not documented _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:26:01 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 20:26:01 +0000 Subject: [issue44855] [doc] some sqlite3 exceptions are not documented In-Reply-To: <1628280744.2.0.733600605983.issue44855@roundup.psfhosted.org> Message-ID: <1628281561.15.0.153558868443.issue44855@roundup.psfhosted.org> Erlend E. Aasland added the comment: Also, the documentation of sqlite3.Warning could be improved. Currently, it reads "A subclass of Exception". Suggesting to simply sync the descriptions of the exceptions with PEP 249. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:26:30 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 20:26:30 +0000 Subject: [issue44855] [doc] Complete the sqlite3 exception documentation In-Reply-To: <1628280744.2.0.733600605983.issue44855@roundup.psfhosted.org> Message-ID: <1628281590.57.0.13817734494.issue44855@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: [doc] some sqlite3 exceptions are not documented -> [doc] Complete the sqlite3 exception documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:31:58 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 20:31:58 +0000 Subject: [issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator. In-Reply-To: <1471070996.16.0.75939310279.issue27752@psf.upfronthosting.co.za> Message-ID: <1628281918.42.0.760616472484.issue27752@roundup.psfhosted.org> miss-islington added the comment: New changeset 2fd1f21db46b165cf603cf4524b4d14ab41ed1cc by Miss Islington (bot) in branch '3.10': bpo-27752: improve documentation of csv.Dialect (GH-26795) https://github.com/python/cpython/commit/2fd1f21db46b165cf603cf4524b4d14ab41ed1cc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:33:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 20:33:29 +0000 Subject: [issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator. In-Reply-To: <1471070996.16.0.75939310279.issue27752@psf.upfronthosting.co.za> Message-ID: <1628282009.92.0.0559522057551.issue27752@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 62bce24e32a9c754a23e758a32a7e0ca49602fc5 by Miss Islington (bot) in branch '3.9': bpo-27752: improve documentation of csv.Dialect (GH-26795) (GH-27644) https://github.com/python/cpython/commit/62bce24e32a9c754a23e758a32a7e0ca49602fc5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:34:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 20:34:41 +0000 Subject: [issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator. In-Reply-To: <1471070996.16.0.75939310279.issue27752@psf.upfronthosting.co.za> Message-ID: <1628282081.11.0.197723387969.issue27752@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for the patch, Jack! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:40:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 06 Aug 2021 20:40:12 +0000 Subject: [issue41779] add BLOB photo to sqlite3 python In-Reply-To: <1600063816.71.0.85406743494.issue41779@roundup.psfhosted.org> Message-ID: <1628282412.15.0.966957532005.issue41779@roundup.psfhosted.org> Andrei Kulakov added the comment: I believe this can be closed now.. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:41:07 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 06 Aug 2021 20:41:07 +0000 Subject: [issue41779] add BLOB photo to sqlite3 python In-Reply-To: <1600063816.71.0.85406743494.issue41779@roundup.psfhosted.org> Message-ID: <1628282467.87.0.740914990562.issue41779@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:44:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 20:44:24 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial In-Reply-To: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> Message-ID: <1628282664.05.0.1627216195.issue41576@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e9a6f1b78bf57d9f3f99547bd007d7cfc9724cfb by Thomas Grainger in branch 'main': bpo-41576: document BaseException in favor of bare except (GH-21917) https://github.com/python/cpython/commit/e9a6f1b78bf57d9f3f99547bd007d7cfc9724cfb ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:44:22 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 20:44:22 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial In-Reply-To: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> Message-ID: <1628282662.81.0.86533737668.issue41576@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26140 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27646 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 16:56:39 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 20:56:39 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial In-Reply-To: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> Message-ID: <1628283399.42.0.233813491701.issue41576@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: -erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:02:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 21:02:24 +0000 Subject: [issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628283744.68.0.0986832407125.issue44822@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset c352412123140e79dcce6188d17e3e6dbc3f4144 by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-44822: Don't truncate `str`s with embedded NULL chars returned by `sqlite3` UDF callbacks (GH-27588). (GH-27639) https://github.com/python/cpython/commit/c352412123140e79dcce6188d17e3e6dbc3f4144 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:02:31 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 06 Aug 2021 21:02:31 +0000 Subject: [issue44826] Specialize STORE_ATTR using PEP 659 machinery. In-Reply-To: <1628073282.4.0.475634168415.issue44826@roundup.psfhosted.org> Message-ID: <1628283751.91.0.0796978422171.issue44826@roundup.psfhosted.org> Terry J. Reedy added the comment: #44821 is fixed ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:03:57 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 06 Aug 2021 21:03:57 +0000 Subject: [issue44821] Instance dictionaries should be created eagerly In-Reply-To: <1628063836.31.0.548816977554.issue44821@roundup.psfhosted.org> Message-ID: <1628283837.24.0.405925210818.issue44821@roundup.psfhosted.org> Terry J. Reedy added the comment: Close this? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:08:39 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 21:08:39 +0000 Subject: [issue44822] [sqlite3] Do not truncate results of user functions and aggregates on the first NUL In-Reply-To: <1628065778.22.0.635299320358.issue44822@roundup.psfhosted.org> Message-ID: <1628284119.7.0.247849186313.issue44822@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks, Serhiy! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:11:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 21:11:24 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1628284284.87.0.916959008907.issue44852@roundup.psfhosted.org> ?ukasz Langa added the comment: Serhiy, if you take a look at the code, `clear_ignored_deprecations()` only clears the filters that were added by `ignore_deprecations_from()`. It doesn't touch other filters. Sure, we can abuse the context manager instead but this looks pretty busy: def setUp(self): self.w = warnings.catch_warnings() self.w.__enter__() warnings.filterwarnings(...) def tearDown(): self.w.__exit__(None, None, None) Making the API symmetrical is a good idea though, I'll look into that tomorrow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:14:43 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 06 Aug 2021 21:14:43 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial In-Reply-To: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> Message-ID: <1628284483.93.0.221545256194.issue41576@roundup.psfhosted.org> miss-islington added the comment: New changeset 699ee016af5736ffc80f68359617611a22b72943 by Miss Islington (bot) in branch '3.10': bpo-41576: document BaseException in favor of bare except (GH-21917) https://github.com/python/cpython/commit/699ee016af5736ffc80f68359617611a22b72943 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:15:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 21:15:38 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial In-Reply-To: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> Message-ID: <1628284538.22.0.283873900212.issue41576@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Thomas! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:17:23 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 06 Aug 2021 21:17:23 +0000 Subject: [issue25963] strptime not parsing some timezones In-Reply-To: <1451291533.28.0.979317956785.issue25963@psf.upfronthosting.co.za> Message-ID: <1628284643.12.0.327735847456.issue25963@roundup.psfhosted.org> Andrei Kulakov added the comment: This was fixed so can be closed. Current datetime docs have a footnote for %Z: ... strptime() only accepts certain values for %Z: any value in time.tzname for your machine?s locale the hard-coded values UTC and GMT ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:25:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 21:25:15 +0000 Subject: [issue42971] Some errnos for BSD/OSX are missing from errno module In-Reply-To: <1611089796.05.0.463787343348.issue42971@roundup.psfhosted.org> Message-ID: <1628285115.7.0.676116438655.issue42971@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:35:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 21:35:22 +0000 Subject: [issue42971] Some errnos for BSD/OSX are missing from errno module In-Reply-To: <1611089796.05.0.463787343348.issue42971@roundup.psfhosted.org> Message-ID: <1628285722.87.0.572975243589.issue42971@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 17c23167942498296f0bdfffe52e72d53d66d693 by Ronald Oussoren in branch 'main': bpo-42971: Add errno.EQFULL (macOS) (GH-24419) https://github.com/python/cpython/commit/17c23167942498296f0bdfffe52e72d53d66d693 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:36:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 06 Aug 2021 21:36:13 +0000 Subject: [issue42971] Some errnos for BSD/OSX are missing from errno module In-Reply-To: <1611089796.05.0.463787343348.issue42971@roundup.psfhosted.org> Message-ID: <1628285773.66.0.60240941196.issue42971@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for the patch, Ronald, and for the report, Enji! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 17:49:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 06 Aug 2021 21:49:28 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1628286568.81.0.349476870064.issue44852@roundup.psfhosted.org> Serhiy Storchaka added the comment: clear_ignored_deprecations() does not know whether filters were added in setUp(), setUpClass(), setUpModule() or just in a particular method. We should use teadDown*() or add*Cleanup() to clean up at appropriate level. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 18:24:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Aug 2021 22:24:15 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628288655.9.0.629205083766.issue44524@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately PR27614 and its backport has introduced reference leaks: ? ./python -m test test_typing -R : 0:00:00 load avg: 1.12 Run tests sequentially 0:00:00 load avg: 1.12 [1/1] test_typing beginning 9 repetitions 123456789 ......... test_typing leaked [29, 29, 29, 29] references, sum=116 test_typing leaked [10, 10, 10, 10] memory blocks, sum=40 test_typing failed (reference leak) == Tests result: FAILURE == 1 test failed: test_typing 1 re-run test: test_typing Total duration: 1.2 sec ---------- nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 18:24:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Aug 2021 22:24:43 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628288683.62.0.664226700312.issue44524@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: high -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 18:27:05 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 06 Aug 2021 22:27:05 +0000 Subject: [issue16379] SQLite error code not exposed to python In-Reply-To: <1351764878.68.0.13361347428.issue16379@psf.upfronthosting.co.za> Message-ID: <1628288825.67.0.126185422948.issue16379@roundup.psfhosted.org> Erlend E. Aasland added the comment: > What would it take to get this merged? I've rebased Aviv's PR (GH-1108) onto main and resolved the conflicts. If I get his blessing, I'll open a PR try to land this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 19:43:57 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 06 Aug 2021 23:43:57 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1628293437.79.0.836602435152.issue43976@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks Filipe for the summary. I was unsure the status. Even if we grant that Debian is too intrusive in its patching of distutils, it's Python and distutils that are making the change here, so it's not unreasonable for Python to maintain feature parity with the current regime. It's plausible that you or I could convince Matthias to adapt Debian to a less intrusive approach by adapting the whole Debian ecosystem to a new approach. I suspect achieving that change would be a bit of a challenge. The only other alternative I see is for distutils to provide some mechanism to enable Debian to achieve its current expectations without patching. It may not be necessary for CPython to support this mechanism. It may be the case that CPython can support the site install schemes, but that any additional customizations remain a contract between Setuptools/distutils. I'm unsure what implications that would have for other build systems not based on distutils, but presumably it would be up to those systems to support Debian. I suggest one of three courses here: 1. Convince Debian to drop their customizations. 2. Add support to the CPython customizations to support Debian. 3. Draft support for Setuptools/distutils to support Debian customizations and get confirmation from Debian that satisfies their needs. Are there any other options? What direction would you like to pursue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 19:46:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 06 Aug 2021 23:46:52 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628293612.25.0.936420606083.issue44524@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately given that the all refleak buildbots will start to fail and the fact that this got into the release candidate, per our buildbot policy (https://discuss.python.org/t/policy-to-revert-commits-on-buildbot-failure/404) we will be forced to revert 8bdf12e99a3dc7ada5f85bba79c2a9eb9931f5b0 and its backport to avoid masking other issues if this is not fixed in 24 hours. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 20:07:21 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 07 Aug 2021 00:07:21 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1628294841.2.0.56030095913.issue43976@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 20:25:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Aug 2021 00:25:31 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628295931.87.0.611165837716.issue44856@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 20:25:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Aug 2021 00:25:24 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() Message-ID: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Here: https://github.com/python/cpython/blob/17c23167942498296f0bdfffe52e72d53d66d693/Python/bltinmodule.c#L60-L88 Seems that new_base is not properly cleaned on the error paths ---------- messages: 399161 nosy: pablogsal priority: normal severity: normal status: open title: Possible reference leak in error paths of update_bases() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 20:25:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Aug 2021 00:25:29 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628295929.1.0.629688573998.issue44856@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 20:26:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Aug 2021 00:26:56 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628296016.85.0.848839870719.issue44856@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +26141 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27647 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 20:47:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 07 Aug 2021 00:47:26 +0000 Subject: [issue36881] isinstance raises TypeError for metaclass with metaclass=ABCMeta In-Reply-To: <1557541744.61.0.162387429511.issue36881@roundup.psfhosted.org> Message-ID: <1628297246.29.0.705779707454.issue36881@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 7.0 -> 8.0 pull_requests: +26142 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27648 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 20:53:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 07 Aug 2021 00:53:04 +0000 Subject: [issue36881] isinstance raises TypeError for metaclass with metaclass=ABCMeta In-Reply-To: <1557541744.61.0.162387429511.issue36881@roundup.psfhosted.org> Message-ID: <1628297584.14.0.0408888100425.issue36881@roundup.psfhosted.org> Irit Katriel added the comment: PR27648 fixes this, but it also breaks test_abc.test_issubclass_bad_arguments so it's not quite right. I don't know this area, but I think the problem is in the place the PR changes, and that the issue is due to this difference in the type of __subclasses__ between C and Meta2: >>> class C: pass ... >>> from abc import ABCMeta >>> class AbstractMeta(type, metaclass=ABCMeta): pass ... >>> class Meta2(AbstractMeta): pass ... >>> C.__subclasses__ >>> Meta2.__subclasses__ ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 21:20:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Aug 2021 01:20:35 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628299235.72.0.792787834448.issue44856@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Oh, damn, turns out that there is a ton of reference leaks in the error path of __build_class__ as well. These leaks have been since forever! Curiously I found about them when debugging https://bugs.python.org/issue44524 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 21:20:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Aug 2021 01:20:56 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() and __build_class__ In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628299256.32.0.725864266586.issue44856@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- title: Possible reference leak in error paths of update_bases() -> Possible reference leak in error paths of update_bases() and __build_class__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 21:21:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 07 Aug 2021 01:21:27 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628299287.57.0.580611176796.issue44524@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Wow, turns out the reference leak has been here since forever! I opened https://bugs.python.org/issue44856? to tackle it ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 21:59:10 2021 From: report at bugs.python.org (hai shi) Date: Sat, 07 Aug 2021 01:59:10 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1628301550.32.0.60482006665.issue42035@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +26143 pull_request: https://github.com/python/cpython/pull/27649 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 22:02:50 2021 From: report at bugs.python.org (Bob Blanchett) Date: Sat, 07 Aug 2021 02:02:50 +0000 Subject: [issue42297] [argparse] Bad error message formatting when using custom usage text In-Reply-To: <1604942759.08.0.272256214563.issue42297@roundup.psfhosted.org> Message-ID: <1628301770.3.0.609824767642.issue42297@roundup.psfhosted.org> Change by Bob Blanchett : ---------- nosy: +bobblanchett _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 22:20:59 2021 From: report at bugs.python.org (Cliff Cordeiro) Date: Sat, 07 Aug 2021 02:20:59 +0000 Subject: [issue44857] class member varibles assigned member functions create a circular reference Message-ID: <1628302859.95.0.618033141977.issue44857@roundup.psfhosted.org> New submission from Cliff Cordeiro : This class is not collected by the gc without a custom __del__ method to del or assign None to self.fn: import gc class Leak: def __init__(self): self.fn = self.x def x(self): pass gc.set_debug(gc.DEBUG_SAVEALL) l = Leak() del l gc.collect() for item in gc.garbage: print(item) ---------- components: Interpreter Core messages: 399165 nosy: cliff.cordeiro priority: normal severity: normal status: open title: class member varibles assigned member functions create a circular reference type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 22:34:55 2021 From: report at bugs.python.org (Cliff Cordeiro) Date: Sat, 07 Aug 2021 02:34:55 +0000 Subject: [issue44857] class member varibles assigned member functions create a circular reference In-Reply-To: <1628302859.95.0.618033141977.issue44857@roundup.psfhosted.org> Message-ID: <1628303695.46.0.880248452286.issue44857@roundup.psfhosted.org> Cliff Cordeiro added the comment: It looks like the collector does detect the cycle and that's why it ends up in garbage with gc.DEBUG_SAVEALL set. Sorry about that. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 22:35:35 2021 From: report at bugs.python.org (Kubilay Kocak) Date: Sat, 07 Aug 2021 02:35:35 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628303735.54.0.406813183638.issue44849@roundup.psfhosted.org> Kubilay Kocak added the comment: There was a recent worker update to latest CURRENT (14). I'll try to identify recent changes or changesets that may have affected behaviour and reference them here ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 22:45:25 2021 From: report at bugs.python.org (Kubilay Kocak) Date: Sat, 07 Aug 2021 02:45:25 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628304325.11.0.27228031858.issue44849@roundup.psfhosted.org> Kubilay Kocak added the comment: O_PATH support was added in FreeBSD CURRENT April 15: https://reviews.freebsd.org/D29323?id=86257 https://github.com/freebsd/freebsd-src/commit/8d9ed174f3afba5f114742447e622fc1173d4774 @Victor If the failure in this tests suggests either a bug in our implementation, or an incompatibility, please let me know/clarify so I can get our implementation polished ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 6 22:54:37 2021 From: report at bugs.python.org (Kubilay Kocak) Date: Sat, 07 Aug 2021 02:54:37 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628304877.36.0.635067153473.issue44849@roundup.psfhosted.org> Kubilay Kocak added the comment: Reference for Linux behaviour: filedesc: don't use ioctl(FIOCLEX) on Linux #62425 https://github.com/rust-lang/rust/pull/62425 Looks like we match the behaviour intentionally (or otherwise). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 00:51:45 2021 From: report at bugs.python.org (4-launchpad-kalvdans-no-ip-org) Date: Sat, 07 Aug 2021 04:51:45 +0000 Subject: [issue41001] Provide wrapper for eventfd In-Reply-To: <1592389368.35.0.695966020763.issue41001@roundup.psfhosted.org> Message-ID: <1628311905.77.0.596903710774.issue41001@roundup.psfhosted.org> Change by 4-launchpad-kalvdans-no-ip-org : ---------- nosy: +4-launchpad-kalvdans-no-ip-org _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 02:51:20 2021 From: report at bugs.python.org (meowmeowcat) Date: Sat, 07 Aug 2021 06:51:20 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information In-Reply-To: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> Message-ID: <1628319080.61.0.657046885742.issue44522@roundup.psfhosted.org> meowmeowcat added the comment: Thanks! Confirmed by: https://docs.python.org/3/library/codecs.html#error-handlers I'll open a PR for this. ---------- nosy: +meowmeowmeowcat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 03:39:13 2021 From: report at bugs.python.org (meowmeowcat) Date: Sat, 07 Aug 2021 07:39:13 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information In-Reply-To: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> Message-ID: <1628321953.49.0.751740792396.issue44522@roundup.psfhosted.org> Change by meowmeowcat : ---------- keywords: +patch pull_requests: +26144 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27650 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 03:55:34 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 07 Aug 2021 07:55:34 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1628322934.91.0.91863415257.issue43838@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 04:52:38 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 07 Aug 2021 08:52:38 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1628326358.54.0.73921980965.issue43838@roundup.psfhosted.org> Nick Coghlan added the comment: That resolution makes sense to me as well. Should we make a note in the documentation for https://docs.python.org/3/library/types.html#types.MappingProxyType that the "read-only" protection is to guard against *accidental* modification, not against active attempts to subvert the protection? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 06:10:29 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Aug 2021 10:10:29 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() and __build_class__ In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628331029.37.0.946003476506.issue44856@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +26145 pull_request: https://github.com/python/cpython/pull/27651 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 06:10:34 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Aug 2021 10:10:34 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() and __build_class__ In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628331034.28.0.202313295314.issue44856@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26146 pull_request: https://github.com/python/cpython/pull/27652 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 06:10:42 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 07 Aug 2021 10:10:42 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() and __build_class__ In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628331042.85.0.754010262041.issue44856@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a40675c659cd8c0699f85ee9ac31660f93f8c2f5 by Pablo Galindo Salgado in branch 'main': bpo-44856: Possible reference leak in error paths of update_bases() and __build_class__ (GH-27647) https://github.com/python/cpython/commit/a40675c659cd8c0699f85ee9ac31660f93f8c2f5 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 06:11:10 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Aug 2021 10:11:10 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() and __build_class__ In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628331070.41.0.011991358102.issue44856@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26147 pull_request: https://github.com/python/cpython/pull/27653 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 06:54:14 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 07 Aug 2021 10:54:14 +0000 Subject: [issue6820] Redefinition of HAVE_STRFTIME can cause compiler errors. In-Reply-To: <1251884386.05.0.339554390546.issue6820@psf.upfronthosting.co.za> Message-ID: <1628333654.09.0.807642099254.issue6820@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 07:01:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 07 Aug 2021 11:01:30 +0000 Subject: [issue19582] Tkinter is not working with Py_SetPath In-Reply-To: <1384427555.71.0.261717374261.issue19582@psf.upfronthosting.co.za> Message-ID: <1628334090.86.0.224979157014.issue19582@roundup.psfhosted.org> Irit Katriel added the comment: This is an old issue and I don't know if it's still relevant. The main problem with this issue is that there isn't enough information to understand what happened. What did you set the path to with Py_SetPath? The error message says it could not find in "C:/Python33/lib/tcl8.5 .... and so on" and then you say it works when you set the path in the env to something else: "set TCL_LIBRARY=C:\Python33\tcl\tcl8.5\" If you are still having problems with this in a current python version (>= 3.9), please create a new issue with full information on what you did in the program that didn't work. ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 07:11:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 07 Aug 2021 11:11:48 +0000 Subject: [issue21111] Add a new PyLong_AsUnsignedLongAndOverflow function In-Reply-To: <1396272396.7.0.644063349125.issue21111@psf.upfronthosting.co.za> Message-ID: <1628334708.18.0.0393667091071.issue21111@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 07:17:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 07 Aug 2021 11:17:44 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() and __build_class__ In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628335064.55.0.695902288912.issue44856@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ed718e9b07df06ea1abbe7b34c649e9d610adf86 by Miss Islington (bot) in branch '3.9': bpo-44856: Possible reference leak in error paths of update_bases() and __build_class__ (GH-27647) (GH-27651) https://github.com/python/cpython/commit/ed718e9b07df06ea1abbe7b34c649e9d610adf86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 07:17:43 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 07 Aug 2021 11:17:43 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() and __build_class__ In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628335063.18.0.490170459818.issue44856@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0a423096e8d8bbe22c0fb0904f7520387a8d4247 by Miss Islington (bot) in branch '3.8': bpo-44856: Possible reference leak in error paths of update_bases() and __build_class__ (GH-27647) (GH-27652) https://github.com/python/cpython/commit/0a423096e8d8bbe22c0fb0904f7520387a8d4247 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 07:20:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 07 Aug 2021 11:20:54 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628335254.9.0.578184235145.issue44524@roundup.psfhosted.org> ?ukasz Langa added the comment: Curiously, while the root cause for the refleaks is in BPO-44856, while hunting down how test_typing.py triggered them, I found that for a while now this exception has been kind of broken: >>> class C(Union[int, str]): ... ... Traceback (most recent call last): File "", line 1, in TypeError: __init__() takes 2 positional arguments but 4 were given >>> It's still a TypeError but the message is cryptic. This regressed in Python 3.9. In Python 3.8 and before, this used to be more descriptive: >>> class C(Union[int, str]): ... ... Traceback (most recent call last): File "", line 1, in File "/Users/ambv/.pyenv/versions/3.8.9/lib/python3.8/typing.py", line 317, in __new__ raise TypeError(f"Cannot subclass {cls!r}") TypeError: Cannot subclass Interestingly, after the Bas' last change, the exception is now yet different: >>> class C(Union[int, str]): ... ... Traceback (most recent call last): File "", line 1, in TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases This makes sense, the conflict is due to bases being (typing.Union, ) where "typing.Union" is really a _UnionGenericAlias since this is a subscripted Union (unlike bare "typing.Union" which is an instance of _SpecialForm). And in _GenericAlias' __mro_entries__ we're finding: https://github.com/python/cpython/blob/a40675c659cd8c0699f85ee9ac31660f93f8c2f5/Lib/typing.py#L1089-L1090 Clearly Ivan only intended _name to be used for shadowing builtins and ABCs. BTW, the "__init__() takes 2 positional arguments but 4 were given" is about _SpecialForm's __init__. It's called with 4 arguments through here in builtin___build_class__: https://github.com/python/cpython/blob/a40675c659cd8c0699f85ee9ac31660f93f8c2f5/Python/bltinmodule.c#L223-L224 This isn't high priority since the end result is a TypeError anyway, but it's something I will be investigating to make the error message sensible again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 07:21:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 07 Aug 2021 11:21:51 +0000 Subject: [issue10835] sys.executable default and altinstall In-Reply-To: <1294231894.7.0.0581440878919.issue10835@psf.upfronthosting.co.za> Message-ID: <1628335311.29.0.429735289912.issue10835@roundup.psfhosted.org> Irit Katriel added the comment: I can't reproduce this on 3.11, and I don't see a "progname" variable in Python/pythonrun.c. I will close this unless someone will indicate it is still relevant. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 07:22:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 07 Aug 2021 11:22:56 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628335376.68.0.211748662577.issue44524@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- priority: release blocker -> normal status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 07:23:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 07 Aug 2021 11:23:07 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628335387.86.0.040543256094.issue44524@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- assignee: -> lukasz.langa status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 08:50:43 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 07 Aug 2021 12:50:43 +0000 Subject: [issue44850] Could operator.methodcaller be optimized using LOAD_METHOD? In-Reply-To: <1628246534.03.0.387871214532.issue44850@roundup.psfhosted.org> Message-ID: <1628340643.14.0.185748795446.issue44850@roundup.psfhosted.org> Dennis Sweeney added the comment: Using _PyObject_GetMethod similarly to the way that LOAD_METHOD/CALL_METHOD does seems like a reasonable idea to me -- do you want to make a pull request? It would also be nice to see some microbenchmarks for the change once it's ready. ---------- nosy: +Dennis Sweeney type: -> performance versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 09:17:33 2021 From: report at bugs.python.org (R. David Murray) Date: Sat, 07 Aug 2021 13:17:33 +0000 Subject: [issue28973] [doc] The fact that multiprocess.Queue uses serialization should be documented. In-Reply-To: <1481726309.53.0.886951264774.issue28973@psf.upfronthosting.co.za> Message-ID: <1628342253.03.0.488255855728.issue28973@roundup.psfhosted.org> R. David Murray added the comment: Mentioning ids would be pretty much redundant with mentioning pickle. If it is pickled its id is going to change. I think Davin was suggesting that while the use of serialization is documented, it is not documented *consistently*. Everywhere serialization happens it should be mentioned in the docs. Regardless, a proposed doc PR is the way forward here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:02:24 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Sat, 07 Aug 2021 14:02:24 +0000 Subject: [issue44858] sysconfig's posix_user scheme has different platlib value to distutils' Message-ID: <1628344944.12.0.584247923318.issue44858@roundup.psfhosted.org> Change by Tzu-ping Chung : ---------- nosy: uranusjr priority: normal severity: normal status: open title: sysconfig's posix_user scheme has different platlib value to distutils' _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:03:22 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Aug 2021 14:03:22 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() and __build_class__ In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628345002.7.0.647277906144.issue44856@roundup.psfhosted.org> miss-islington added the comment: New changeset ac8f72cd3ffa24f53c558911947c42316865683c by Miss Islington (bot) in branch '3.10': bpo-44856: Possible reference leak in error paths of update_bases() and __build_class__ (GH-27647) https://github.com/python/cpython/commit/ac8f72cd3ffa24f53c558911947c42316865683c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:04:08 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Sat, 07 Aug 2021 14:04:08 +0000 Subject: [issue44858] sysconfig's posix_user scheme has different platlib value to distutils' Message-ID: <1628345048.49.0.190298405695.issue44858@roundup.psfhosted.org> New submission from Tzu-ping Chung : Submitted by accident; please ignore this, sorry for the noise. (I am going to submit this issue properly.) ---------- resolution: -> duplicate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:12:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 07 Aug 2021 14:12:16 +0000 Subject: [issue44856] Possible reference leak in error paths of update_bases() and __build_class__ In-Reply-To: <1628295924.58.0.701091485763.issue44856@roundup.psfhosted.org> Message-ID: <1628345536.91.0.225393775209.issue44856@roundup.psfhosted.org> ?ukasz Langa added the comment: Confirmed this fixed refleaks in test_typing. Backported to all branches listed on the issue. Thanks for super-effective debugging and the fix, Pablo! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:14:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Aug 2021 14:14:16 +0000 Subject: [issue44859] Improve some sqlite3 errors Message-ID: <1628345656.7.0.124562565005.issue44859@roundup.psfhosted.org> New submission from Serhiy Storchaka : * MemoryError is now raised instead of sqlite3.Warning when memory is not enough for encoding statement to UTF-8 in Connection.__call__() and Cursor.execute(). * UnicodEncodeError is now raised instead of sqlite3.Warning when statement contains surrogate characters in Connection.__call__() and Cursor.execute(). * TypeError is now raised instead of ValueError for non-string script in Cursor.execute(). * ValueError is now raised for script containing NUL instead of truncating it in Cursor.execute(). * Correctly handled exceptions raised when getting boolean value of the result of the progress handler to bool. Also added many tests which cover different exceptional cases. ---------- components: Extension Modules messages: 399183 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: Improve some sqlite3 errors versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:16:03 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 07 Aug 2021 14:16:03 +0000 Subject: [issue44850] Could operator.methodcaller be optimized using LOAD_METHOD? In-Reply-To: <1628246534.03.0.387871214532.issue44850@roundup.psfhosted.org> Message-ID: <1628345763.41.0.392352416752.issue44850@roundup.psfhosted.org> Dennis Sweeney added the comment: For what it's worth, in my benchmarks on 3.11, methodcaller was already a bit faster than lambda: #################### Builtin calls #################### PS > .\python.bat -m pyperf timeit -s "from operator import methodcaller as mc" -s "reverse_it = mc('reverse')" -s "arr = []" "reverse_it(arr)" Running Release|x64 interpreter... ..................... Mean +- std dev: 84.3 ns +- 1.9 ns PS >.\python.bat -m pyperf timeit -s "reverse_it = lambda x: x.reverse()" -s "arr = []" "reverse_it(arr)" Running Release|x64 interpreter... ..................... Mean +- std dev: 95.5 ns +- 2.9 ns #################### Python calls #################### PS > .\python.bat -m pyperf timeit -s "from operator import methodcaller as mc" -s "reverse_it = mc('reverse')" -s "class A: reverse = lambda self: None" -s "arr=A()" "reverse_it(arr)" Running Release|x64 interpreter... ..................... Mean +- std dev: 140 ns +- 4 ns PS > .\python.bat -m pyperf timeit -s "reverse_it = lambda x: x.reverse()" -s "class A: reverse = lambda self: None" -s "arr=A()" "reverse_it(arr)" Running Release|x64 interpreter... ..................... Mean +- std dev: 159 ns +- 4 ns ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:23:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Aug 2021 14:23:44 +0000 Subject: [issue44859] Improve some sqlite3 errors In-Reply-To: <1628345656.7.0.124562565005.issue44859@roundup.psfhosted.org> Message-ID: <1628346224.32.0.871156598747.issue44859@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is also a problem with the sqlite3.InterfaceError raised when bind parameters with message "Error binding parameter XXX - probably unsupported type." It is raised not only for unsupported types, but: * For too large integers (outside of the range of signed 64-bit integers). * For too large strings and blobs with size <= INT_MAX but larger than the SQLite limit (1_000_000_000 by default). But OverflowError is raised for size >= INT_MAX. * When memory error or any other error occurred inside SQLite. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:29:18 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Sat, 07 Aug 2021 14:29:18 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user Message-ID: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> New submission from Tzu-ping Chung : On POSIX, the user scheme has a different 'platlib' location between distutils and sysconfig, dispite the comment claiming they should be the same. This can be reproduced on Fedora 34's stock Python 3.9: $ docker run -it --rm -h=p fedora:34 bash ... [root at p /]# yum install python3 -y ... [root at p /]# type python3 python3 is hashed (/usr/bin/python3) [root at p /]# python3 -V Python 3.9.6 [root at p /]# python3.9 -q >>> from distutils.command.install import install >>> from distutils.dist import Distribution >>> c = install(Distribution()) >>> c.user = True >>> c.finalize_options() >>> c.install_platlib '/root/.local/lib/python3.9/site-packages' >>> import sysconfig >>> sysconfig.get_path('platlib', 'posix_user') '/root/.local/lib64/python3.9/site-packages' This issue was introduced by the sys.platlibdir value, and its usage in distutils and sysconfig. sysconfig sets posix_user's lib paths like this: 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', 'platlib': '{userbase}/{platlibdir}/python{py_version_short}/site-packages', https://github.com/python/cpython/blob/a40675c659cd8c0699f85ee9ac31660f93f8c2f5/Lib/sysconfig.py#L100-L108 But distutils naively sets both to the same value that does not account for platlibdir: 'purelib': '$usersite', 'platlib': '$usersite', https://github.com/python/cpython/blob/a40675c659cd8c0699f85ee9ac31660f93f8c2f5/Lib/distutils/command/install.py#L68-L87 causing the mismatch, dispite the comment above clearly indicating the values are supposed to be the same. This was introduced in bpo-1294959 which changed the platlib template to depend on sys.platlibdir, so a mismatch happens when the value of sys.platlibdir is not 'lib'. (Adding frenzy and vstinner to the nosy list since you introduced the comment in distutils and the sys.platlibdir change, respectively.) ---------- components: Distutils messages: 399186 nosy: dstufft, eric.araujo, frenzy, uranusjr, vstinner priority: normal severity: normal status: open title: sysconfig's posix_user scheme has different platlib value to distutils's unix_user versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:33:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Aug 2021 14:33:09 +0000 Subject: [issue44859] Improve some sqlite3 errors In-Reply-To: <1628345656.7.0.124562565005.issue44859@roundup.psfhosted.org> Message-ID: <1628346789.06.0.626645922895.issue44859@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26148 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27654 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:34:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Aug 2021 14:34:44 +0000 Subject: [issue44859] Improve some sqlite3 errors In-Reply-To: <1628345656.7.0.124562565005.issue44859@roundup.psfhosted.org> Message-ID: <1628346884.97.0.325619468902.issue44859@roundup.psfhosted.org> Serhiy Storchaka added the comment: Entries 3 and 4 are about Cursor.executescript(), not Cursor.execute(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:56:08 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Sat, 07 Aug 2021 14:56:08 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1628348168.8.0.875738046276.issue44860@roundup.psfhosted.org> Change by Tzu-ping Chung : ---------- keywords: +patch pull_requests: +26149 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27655 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:57:05 2021 From: report at bugs.python.org (Sebastian Bank) Date: Sat, 07 Aug 2021 14:57:05 +0000 Subject: [issue44861] csv.writer stopped to quote values with escapechar with csv.QUOTE_MINIMAL in Python 3.10 Message-ID: <1628348225.56.0.708449688444.issue44861@roundup.psfhosted.org> New submission from Sebastian Bank : AFAICT there was an undocumented change in behaviour related to the fix of https://bugs.python.org/issue12178 (also reported in https://bugs.python.org/issue12178#msg397440): Python 3.9 quotes values with escapechar: ``` import csv import io kwargs = {'escapechar': '\\'} value = 'spam\\eggs' print(value) with io.StringIO() as buf: writer = csv.writer(buf, **kwargs) writer.writerow([value]) line = buf.getvalue() print(line.strip()) with io.StringIO(line) as buf: reader = csv.reader(buf, **kwargs) (new_value,), = reader print(new_value) spam\eggs "spam\eggs" spameggs ``` - quotes escapechar - fails to double the escapechar (https://bugs.python.org/issue12178) >From https://docs.python.org/3/library/csv.html#csv.QUOTE_MINIMAL > only quote those fields which contain special characters > such as delimiter, quotechar or any of the characters in > lineterminator. The previous behaviour seems incorrect because escapechar is not explicitly mentioned, but at the same time the docs says 'such as'. The new might better matching the name 'minimal', but at the same time one might regard 'quote when in doubt' as a safer behaviour for the default quoting rule. Python 3.10: https://github.com/python/cpython/blob/5c0eed7375fdd791cc5e19ceabfab4170ad44062/Lib/test/test_csv.py#L207-L208 See also https://github.com/xflr6/csv23/actions/runs/1027687524 ---------- components: Library (Lib) messages: 399188 nosy: ebreck, taleinat, xflr6 priority: normal severity: normal status: open title: csv.writer stopped to quote values with escapechar with csv.QUOTE_MINIMAL in Python 3.10 type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:56:49 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Sat, 07 Aug 2021 14:56:49 +0000 Subject: [issue44858] sysconfig's posix_user scheme has different platlib value to distutils' In-Reply-To: <1628345048.49.0.190298405695.issue44858@roundup.psfhosted.org> Message-ID: <1628348209.19.0.855467281624.issue44858@roundup.psfhosted.org> Change by Tzu-ping Chung : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:58:34 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 07 Aug 2021 14:58:34 +0000 Subject: [issue40912] _PyOS_SigintEvent is never closed on Windows In-Reply-To: <1591641593.68.0.465410581538.issue40912@roundup.psfhosted.org> Message-ID: <1628348314.08.0.0305566054669.issue40912@roundup.psfhosted.org> Dong-hee Na added the comment: @vstinner https://github.com/python/cpython/blob/ae0a2b756255629140efcbe57fc2e714f0267aa3/Modules/signalmodule.c#L1743 Since _PySignal_Fini close the handle, IMHO we can close this issue. Is there any corner case to handle this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 10:59:51 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Sat, 07 Aug 2021 14:59:51 +0000 Subject: [issue38671] pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist In-Reply-To: <1572774931.11.0.993470333259.issue38671@roundup.psfhosted.org> Message-ID: <1628348391.8.0.701399507884.issue38671@roundup.psfhosted.org> Tzu-ping Chung added the comment: I think this can be closed now that the PRs are all merged? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 11:10:44 2021 From: report at bugs.python.org (Sebastian Bank) Date: Sat, 07 Aug 2021 15:10:44 +0000 Subject: [issue44861] csv.writer stopped to quote values with escapechar with csv.QUOTE_MINIMAL in Python 3.10 In-Reply-To: <1628348225.56.0.708449688444.issue44861@roundup.psfhosted.org> Message-ID: <1628349044.04.0.552517194346.issue44861@roundup.psfhosted.org> Sebastian Bank added the comment: IIUC there is no way to work around this from client/downstream code (to get the olf 3.6 to 3.9 behaviour), so this might break assertions on the output of `csv.writer` for users of `escapechar` whenever the data to be written contains the escapcechar (e.g. calculating a hash/checksum). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 11:17:32 2021 From: report at bugs.python.org (Mark Shannon) Date: Sat, 07 Aug 2021 15:17:32 +0000 Subject: [issue44840] Nested if/else gets phantom else trace again (3.10) In-Reply-To: <1628169100.37.0.353483963834.issue44840@roundup.psfhosted.org> Message-ID: <1628349452.37.0.205456148608.issue44840@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +26150 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27656 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 11:19:46 2021 From: report at bugs.python.org (Xavier Morel) Date: Sat, 07 Aug 2021 15:19:46 +0000 Subject: [issue43526] Programmatic management of BytesWarning doesn't work for native triggers. In-Reply-To: <1615971785.71.0.488992120219.issue43526@roundup.psfhosted.org> Message-ID: <1628349586.87.0.922007185483.issue43526@roundup.psfhosted.org> Xavier Morel added the comment: > I am not against documenting the behavior of -b and BytesWarning clearly. I don't think that anyone would be against. Just somebody have to provide a PR. Right but what about the ability to enable warning on stringification without enabling the warning on comparison? There are packages / situations where comparing strings and bytes makes a lot of sense (e.g. use string and byte versions of data as keys in the same dict), but I think stringifying bytes rarely if ever does. > Explicitly repr-ing a bytes instance does not produce a warning, and never produced, so I don't understand what do you mean. Well that's absolutely ideal as I did not check if it did, just wanted to be clear that I wasn't looking for a warning in that case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 11:24:36 2021 From: report at bugs.python.org (Xavier Morel) Date: Sat, 07 Aug 2021 15:24:36 +0000 Subject: [issue43526] Programmatic management of BytesWarning doesn't work for native triggers. In-Reply-To: <1615971785.71.0.488992120219.issue43526@roundup.psfhosted.org> Message-ID: <1628349876.0.0.836541592091.issue43526@roundup.psfhosted.org> Xavier Morel added the comment: And though I did not check, I expect the `-b` flag exists mostly because of the performance impact of the warning any time bytes are checked for equality, but surely that impact would be limited and probably not very relevant for the stringification of bytes and that could (eventually) be moved out of the `-b` flag and to the regular warnings system? I recall Inada-san tends to be quite involved in BytesWarning, is adding people to the nosy list something that's done or is it in bad taste? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 11:58:11 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 07 Aug 2021 15:58:11 +0000 Subject: [issue44851] Update bundled pip to 21.2.3 and setuptools to 57.4.0 In-Reply-To: <1628248411.95.0.443315719327.issue44851@roundup.psfhosted.org> Message-ID: <1628351891.81.0.138420994776.issue44851@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26151 pull_request: https://github.com/python/cpython/pull/27657 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 12:20:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Aug 2021 16:20:47 +0000 Subject: [issue43526] Programmatic management of BytesWarning doesn't work for native triggers. In-Reply-To: <1615971785.71.0.488992120219.issue43526@roundup.psfhosted.org> Message-ID: <1628353247.89.0.0229562956124.issue43526@roundup.psfhosted.org> Serhiy Storchaka added the comment: > And though I did not check, I expect the `-b` flag exists mostly because of the performance impact of the warning any time bytes are checked for equality, but surely that impact would be limited and probably not very relevant for the stringification of bytes and that could (eventually) be moved out of the `-b` flag and to the regular warnings system? If working Python 3 program suddenly became emitting BytesWarning it will confuse users. Finally we will get rid of the -b option and BytesWarning. str() for bytes object will be equal to repr(), without warnings and errors. If you want to change it, use -b. Maybe introducing PYTHONBYTESWARNING will help. But I do not think we should change the behavior for these who do not ask for it specially if it will differ from the future behavior. > Right but what about the ability to enable warning on stringification without enabling the warning on comparison? I think it would work. But it is significant amount of work (add corresponding C API, parsing and copying code, documentation, tests), and for small benefit. Would not be better to filter out warnings by message? I think that adding PYTHONBYTESWARNING can help you. ---------- nosy: +methane, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 12:53:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 07 Aug 2021 16:53:42 +0000 Subject: [issue44861] csv.writer stopped to quote values with escapechar with csv.QUOTE_MINIMAL in Python 3.10 In-Reply-To: <1628348225.56.0.708449688444.issue44861@roundup.psfhosted.org> Message-ID: <1628355222.19.0.972977177112.issue44861@roundup.psfhosted.org> Serhiy Storchaka added the comment: The 3.9 behavior is incorrect: write 'spam\\eggs', read 'spameggs'. The 3.10 behavior is correct: write 'spam\\eggs', read 'spam\\eggs'. What is your problem exactly? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 13:33:06 2021 From: report at bugs.python.org (Eryk Sun) Date: Sat, 07 Aug 2021 17:33:06 +0000 Subject: [issue10835] sys.executable default and altinstall In-Reply-To: <1294231894.7.0.0581440878919.issue10835@psf.upfronthosting.co.za> Message-ID: <1628357586.48.0.505399593874.issue10835@roundup.psfhosted.org> Eryk Sun added the comment: In 3.2, the default program name on non-Windows systems was changed to "python3" (see bpo-15020). In 3.5, the code was moved into Python/pylifecycle.c (see bpo-22869). Between 3.7 and 3.8, the initialization code was rewritten (see PEP 587). Currently it's set in config_init_program_name() in Python/initconfig.c. On POSIX systems, calculate_which() in Modules/getpath.c searches PATH to resolve the name if it has no path separator. For example: $ bash -c 'exec -a "" python -c "import sys; print(repr(sys.executable))"' '/home/someone/.local/bin/python3' The default "python3" program name isn't used if C argv[0] is non-empty, in which case calculate_which() may or may not find the given program name: $ bash -c 'exec -a "ls" python -c "import sys; print(repr(sys.executable))"' '/usr/bin/ls' $ bash -c 'exec -a "py" python -c "import sys; print(repr(sys.executable))"' '' In Windows, the default program name is "python", but this isn't relevant for sys.executable, which is based on GetModuleFileNameW(NULL, ...) instead. This is similar to using readlink("/proc/self/exe", ...) in Linux, except the loader in Windows, and thus GetModuleFileNameW(), does not resolve symlinks in the file path. ---------- nosy: +eryksun status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 14:34:20 2021 From: report at bugs.python.org (=?utf-8?q?Vin=C3=ADcius_Gubiani_Ferreira?=) Date: Sat, 07 Aug 2021 18:34:20 +0000 Subject: [issue44862] [docs] make "Deprecated since version {deprecated}, will be removed in version {removed}" translation available Message-ID: <1628361260.67.0.944506647918.issue44862@roundup.psfhosted.org> New submission from Vin?cius Gubiani Ferreira : If we access https://docs.python.org/3.8/library/asyncio-queue.html#asyncio.Queue we can see the text Make Deprecated since version 3.8, will be removed in version 3.10 is perfectly visible in english. However if we change the language to pt-br by using the link https://docs.python.org/pt-br/3.8/library/asyncio-queue.html#asyncio.Queue We can see that the whole page is in brazilian portuguese, except that text, and we are not able to translate it in anyway that is visible in the page. What should we do in CPython so we can translate this string? ---------- assignee: docs at python components: Documentation messages: 399197 nosy: docs at python, vini.g.fer priority: normal severity: normal status: open title: [docs] make "Deprecated since version {deprecated}, will be removed in version {removed}" translation available type: enhancement versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 15:03:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 07 Aug 2021 19:03:47 +0000 Subject: [issue22452] addTypeEqualityFunc is not used in assertListEqual In-Reply-To: <1411297928.75.0.716793613355.issue22452@psf.upfronthosting.co.za> Message-ID: <1628363027.62.0.221133221074.issue22452@roundup.psfhosted.org> Irit Katriel added the comment: I've closed issue44819 as a duplicate of this. ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 15:03:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 07 Aug 2021 19:03:39 +0000 Subject: [issue44819] assertSequenceEqual does not use _getAssertEqualityFunc In-Reply-To: <1628022280.67.0.522628726203.issue44819@roundup.psfhosted.org> Message-ID: <1628363019.58.0.977588919445.issue44819@roundup.psfhosted.org> Irit Katriel added the comment: Closing as duplicate of issue22452. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 15:04:05 2021 From: report at bugs.python.org (Zachary Ware) Date: Sat, 07 Aug 2021 19:04:05 +0000 Subject: [issue33232] Segmentation fault in operator.attrgetter In-Reply-To: <1522939744.33.0.682650639539.issue33232@psf.upfronthosting.co.za> Message-ID: <1628363045.36.0.665621528823.issue33232@roundup.psfhosted.org> Zachary Ware added the comment: 3.5 is now EOL, so this is definitely out of date :) ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 15:04:47 2021 From: report at bugs.python.org (Samodya Abey) Date: Sat, 07 Aug 2021 19:04:47 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics Message-ID: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> New submission from Samodya Abey : TypedDict PEP-589 says: A TypedDict cannot inherit from both a TypedDict type and a non-TypedDict base class. So the current implementation has: `if type(base) is not _TypedDictMeta: raise TypeError(...)` This restricts the user from defining generic TypedDicts in the natural class based syntax: `class Pager(TypedDict, Generic[T]): ...` Although PEP 589 doesn't explicitly state generic support, I believe it is complete in covering the specification even if generics were involved (at least for the class based syntax). I have tried putting together a PEP from guidance of typing-sig . There is not much new contributions by that draft, except for specifying the alternative syntax and being more explicit about Generics. So I'm wondering if it would be possible to relax the constraint: TypedDict inheritance to include Generic. In my point of view `Generic` is more of a mixin, so it doesn't go against the PEP 589. Or is this change big enough to warrant a PEP? ---------- components: Library (Lib) messages: 399201 nosy: sransara priority: normal severity: normal status: open title: Allow TypedDict to inherit from Generics type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 15:05:52 2021 From: report at bugs.python.org (Roundup Robot) Date: Sat, 07 Aug 2021 19:05:52 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1628363152.92.0.467845077598.issue44863@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +26152 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27663 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 15:15:33 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 07 Aug 2021 19:15:33 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628363733.13.0.336583477463.issue44854@roundup.psfhosted.org> Terry J. Reedy added the comment: I presume 'root directory' mean the repository directory. I would have to think about supporting this in IDLE. It already, I believe (or will), enforces the two whitespace rules when saving and defaults to 4-space indents for first lines of statements. Enforcing that for repository .py and .c files would be good, but there is currently no mechanism for per-file settings. I did not see anything in the EditorConfig guide about what happens when .editorconfig does not start with root = true and another file is found. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 15:33:07 2021 From: report at bugs.python.org (Xavier Morel) Date: Sat, 07 Aug 2021 19:33:07 +0000 Subject: [issue43526] Programmatic management of BytesWarning doesn't work for native triggers. In-Reply-To: <1615971785.71.0.488992120219.issue43526@roundup.psfhosted.org> Message-ID: <1628364787.12.0.259934381701.issue43526@roundup.psfhosted.org> Xavier Morel added the comment: > If working Python 3 program suddenly became emitting BytesWarning it will confuse users. Oh yeah no I meant making it a normal warning, without needing the `-b` flag, not enabling it by default. Because controlling / configuring warnings can be done programmatically and dynamically from inside the program, but in my understanding -b is either set or unset when calling it, if you're not setting it you're SOL. Or so I understand, I didn't find any switch accessible from inside the Python program. > I think it would work. But it is significant amount of work (add corresponding C API, parsing and copying code, documentation, tests) Wouldn't it just be removing the check on `-b` in the tp_str slot of bytes and bytearray? > and for small benefit. Would not be better to filter out warnings by message? Well yes and no, my issue remains the one from the beginning: it's quite easy to unexpectedly stringify bytes, which usually isn't what's desired. Ensuring that doesn't happen requires making sure every developer and environment (non-production at least) does run python with -b to enable the warning, which is not as easy as the software being able to set that internally (which is doable for various deprecation warnings and friends). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 16:53:17 2021 From: report at bugs.python.org (Sebastian Bank) Date: Sat, 07 Aug 2021 20:53:17 +0000 Subject: [issue44861] csv.writer stopped to quote values with escapechar with csv.QUOTE_MINIMAL in Python 3.10 In-Reply-To: <1628348225.56.0.708449688444.issue44861@roundup.psfhosted.org> Message-ID: <1628369597.45.0.985581414066.issue44861@roundup.psfhosted.org> Sebastian Bank added the comment: The 3.9 behaviour is write: "spam\eggs" The 3.10 behaviour is write: spam\\eggs I think at least the change in csv.QUOTE_MINIMAL behviour should be documented (maybe adding hint to avoid the `escapechar` option for consistent output). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 18:48:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 07 Aug 2021 22:48:42 +0000 Subject: [issue40899] Document exceptions raised by importlib.import In-Reply-To: <1591528094.81.0.814829435189.issue40899@roundup.psfhosted.org> Message-ID: <1628376522.15.0.888951759892.issue40899@roundup.psfhosted.org> Irit Katriel added the comment: ModuleNotFoundError is a subclass of ImportError, so it's probably enough to just document the functions as raising ImportError on failure, as in the case of https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module. ---------- keywords: +easy nosy: +iritkatriel versions: +Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 20:30:07 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 08 Aug 2021 00:30:07 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628382607.61.0.783493992274.issue44830@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- keywords: +patch nosy: +orsenthil nosy_count: 3.0 -> 4.0 pull_requests: +26153 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27664 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 22:11:25 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 08 Aug 2021 02:11:25 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628388685.58.0.683897243594.issue44830@roundup.psfhosted.org> Jack DeVries added the comment: I created a discourse thread for people to propose alternatives:: https://discuss.python.org/t/alternate-article-for-how-to-wite-good-bug-report/10040 It's be a good idea to merge @orsenthil's PR which just removes the broken link right away. Then, we can keep this bpo open until we have consensus on an alternative. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 23:18:13 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 08 Aug 2021 03:18:13 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628392693.45.0.390343229315.issue44830@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset ebecffdb6d5fffa4249f9a813f1fc1915926feb5 by Senthil Kumaran in branch 'main': bpo-44830 - Remove the broken Broken Mozilla devguide link. (GH-27664) https://github.com/python/cpython/commit/ebecffdb6d5fffa4249f9a813f1fc1915926feb5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 23:18:20 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 08 Aug 2021 03:18:20 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628392700.57.0.0496242429757.issue44830@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26154 pull_request: https://github.com/python/cpython/pull/27665 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 23:23:42 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 08 Aug 2021 03:23:42 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628393022.14.0.363217002177.issue44830@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- pull_requests: +26155 pull_request: https://github.com/python/cpython/pull/27666 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 7 23:44:15 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 08 Aug 2021 03:44:15 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628394255.45.0.285680159547.issue44830@roundup.psfhosted.org> Senthil Kumaran added the comment: New changeset 6a6bcf16370beff2e0d1a034661654d5c335b5ee by Miss Islington (bot) in branch '3.9': bpo-44830 - Remove the broken Broken Mozilla devguide link. (GH-27664) (GH-27665) https://github.com/python/cpython/commit/6a6bcf16370beff2e0d1a034661654d5c335b5ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 00:11:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 08 Aug 2021 04:11:12 +0000 Subject: [issue41645] Typo First Page of Documentation In-Reply-To: <1598465724.17.0.0409144165682.issue41645@roundup.psfhosted.org> Message-ID: <1628395872.9.0.00891014288409.issue41645@roundup.psfhosted.org> Andrei Kulakov added the comment: +1 for '... and uses a simple but effective approach ..' ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 01:41:23 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 08 Aug 2021 05:41:23 +0000 Subject: [issue41645] Typo First Page of Documentation In-Reply-To: <1598465724.17.0.0409144165682.issue41645@roundup.psfhosted.org> Message-ID: <1628401283.7.0.0809230614338.issue41645@roundup.psfhosted.org> Terry J. Reedy added the comment: This is not worth much more energy. Let's either add 'uses' or 'it uses' or close as 'works for me'. Lukasz, do you have a vote either way? I don't care which of us does a PR if we go that way. ---------- nosy: +lukasz.langa versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 01:50:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Aug 2021 05:50:00 +0000 Subject: [issue44859] Improve some sqlite3 errors In-Reply-To: <1628345656.7.0.124562565005.issue44859@roundup.psfhosted.org> Message-ID: <1628401800.49.0.819798179501.issue44859@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 0eec6276fdcdde5221370d92b50ea95851760c72 by Serhiy Storchaka in branch 'main': bpo-44859: Improve error handling in sqlite3 and and raise more accurate exceptions. (GH-27654) https://github.com/python/cpython/commit/0eec6276fdcdde5221370d92b50ea95851760c72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 04:42:38 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A9r=C3=A9mie_Detrey?=) Date: Sun, 08 Aug 2021 08:42:38 +0000 Subject: [issue44864] [argparse] Do not translate user-provided strings in `ArgumentParser.add_subparsers()` Message-ID: <1628412158.14.0.0114857952802.issue44864@roundup.psfhosted.org> New submission from J?r?mie Detrey : Dear all, In the `argparse` module, the `ArgumentParser.add_subparsers()` method may call the `_()` translation function on user-provided strings. See e.g. 3.9/Lib/argparse.py:1776 and 3.9/Lib/argparse.py:L1777: def add_subparsers(self, **kwargs): # [...] if 'title' in kwargs or 'description' in kwargs: title = _(kwargs.pop('title', 'subcommands')) description = _(kwargs.pop('description', None)) When elements `'title'` and/or `'description'` are set in `kwargs`, they will be popped from the dictionary and then fed to `_()`. However, these are user-provided strings, and it seems to me that translating them should be the user's responsibility. This seems to be the expected behavior for all other user-provided strings in the `argparse` module: see e.g. the `ArgumentParser`'s `description` parameter (in 3.9/Lib/argparse.py:1704 then 3.9/Lib/argparse.py:1312), which never gets translated by the `argparse` module. However, the default title string `'subcommands'` should still be localized. Therefore, I'd suggest restricting the call to `_()` to this string only, as in the following: title = kwargs.pop('title', _('subcommands')) description = kwargs.pop('description', None) I'll submit a pull request with this change. Kind regards, J?r?mie. ---------- components: Library (Lib) messages: 399212 nosy: jdetrey priority: normal severity: normal status: open title: [argparse] Do not translate user-provided strings in `ArgumentParser.add_subparsers()` type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 04:50:02 2021 From: report at bugs.python.org (Roundup Robot) Date: Sun, 08 Aug 2021 08:50:02 +0000 Subject: [issue44864] [argparse] Do not translate user-provided strings in `ArgumentParser.add_subparsers()` In-Reply-To: <1628412158.14.0.0114857952802.issue44864@roundup.psfhosted.org> Message-ID: <1628412602.22.0.421931764703.issue44864@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +26156 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27667 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 06:37:02 2021 From: report at bugs.python.org (Marc Mueller) Date: Sun, 08 Aug 2021 10:37:02 +0000 Subject: [issue43532] Add keyword-only fields to dataclasses In-Reply-To: <1616002761.92.0.652624260802.issue43532@roundup.psfhosted.org> Message-ID: <1628419022.73.0.0133371462475.issue43532@roundup.psfhosted.org> Change by Marc Mueller : ---------- nosy: +cdce8p _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 06:38:09 2021 From: report at bugs.python.org (Marc Mueller) Date: Sun, 08 Aug 2021 10:38:09 +0000 Subject: [issue43994] change representation of match as / capture as `Name(..., ctx=Store())` In-Reply-To: <1619822991.2.0.658600538684.issue43994@roundup.psfhosted.org> Message-ID: <1628419089.42.0.273572174818.issue43994@roundup.psfhosted.org> Change by Marc Mueller : ---------- nosy: +cdce8p _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 06:48:30 2021 From: report at bugs.python.org (Amir Mohamadi) Date: Sun, 08 Aug 2021 10:48:30 +0000 Subject: [issue41556] hostname verification fails if hostname starts with literal IPv4 In-Reply-To: <1597483503.9.0.826978747102.issue41556@roundup.psfhosted.org> Message-ID: <1628419710.2.0.362612592564.issue41556@roundup.psfhosted.org> Amir Mohamadi added the comment: Seems to be solved by https://github.com/openssl/openssl/pull/16201. I guess we can close this issue. ---------- nosy: +Amir _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 09:34:47 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A9r=C3=A9mie_Detrey?=) Date: Sun, 08 Aug 2021 13:34:47 +0000 Subject: [issue16786] argparse doesn't offer localization interface for "version" action In-Reply-To: <1356527998.28.0.00679479762722.issue16786@psf.upfronthosting.co.za> Message-ID: <1628429687.28.0.215712550073.issue16786@roundup.psfhosted.org> J?r?mie Detrey added the comment: Dear all, As commented on PR 12711 (https://github.com/python/cpython/pull/12711#pullrequestreview-724899323), there is a slight issue with the proposed patch, as it translates the `--version` help string as soon as the `argparse` module is imported (at which point the programmer might not have correctly initialized the `gettext` global domain yet). The suggested modification of PR 12711 should fix this, so that the translation only happens when an instance of `_VersionAction` is actually created: ``` diff a/Lib/argparse.py b/Lib/argparse.py --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -1042,7 +1042,9 @@ def __init__(self, version=None, dest=SUPPRESS, default=SUPPRESS, - help="show program's version number and exit"): + help=None): + if help is None: + help = _("show program's version number and exit") super(_VersionAction, self).__init__( option_strings=option_strings, dest=dest, ``` However, I'm not sure I understand correctly Pavel's comment as to why merging this patch would make some old programs lose their translation for this string: since `argparse` does not itself provide any translation, it is up to the programmers to provide `gettext` translations for `argparse` strings as well. Adding the call to `_()` here seems harmless to me: - if a program already has a `gettext` translation string for "show program's version number and exit", it will be used, as expected; - otherwise, if it hasn't (and relies on other mechanisms to translate this string), the string will remain untranslated, and the "custom" translation mechanisms will be able to process it as before. In any case, my guess is that localized programs already explicitly pass a localized help string to the `_VersionAction` constructor in order to circumvent the nonlocalized default help string: ``` parser.add_argument('-V', action='version', version='%(prog)s 3.9', help=_("show program's version number and exit")) ``` These programs should also remain completely unaffected by this change. Thanks! Kind regards, J?r?mie. ---------- nosy: +jdetrey _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 09:35:06 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A9r=C3=A9mie_Detrey?=) Date: Sun, 08 Aug 2021 13:35:06 +0000 Subject: [issue16786] argparse doesn't offer localization interface for "version" action In-Reply-To: <1356527998.28.0.00679479762722.issue16786@psf.upfronthosting.co.za> Message-ID: <1628429706.54.0.231898552875.issue16786@roundup.psfhosted.org> Change by J?r?mie Detrey : ---------- versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 09:35:18 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 08 Aug 2021 13:35:18 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628429718.56.0.288199038119.issue44830@roundup.psfhosted.org> Jack DeVries added the comment: @mark.dickinson, Steven D'Aprano suggested just linking to the wayback machine on discuss.python.org. What do you think of that? https://discuss.python.org/t/alternate-article-for-how-to-wite-good-bug-report/10040/2?u=jdevries3133 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 10:12:29 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A9r=C3=A9mie_Detrey?=) Date: Sun, 08 Aug 2021 14:12:29 +0000 Subject: [issue44865] [argparse] Missing translations Message-ID: <1628431949.27.0.450799323412.issue44865@roundup.psfhosted.org> New submission from J?r?mie Detrey : Dear all, There are a few strings in the `argparse` module which are not translatable through the `gettext` API. Some have already been reported: - the "--version" help text at 3.9/Lib/argparse.py:1105 (reported in issue 16786, fixed by PR 12711); - the "default" help text at 3.9/Lib/argparse.py:697 (reported in 33775, fixed by PR 12711). However, some others remain: - the "default" help text for `BooleanOptionalAction` at 3.9/Lib/argparse.py:878 (which, incidentally, will be duplicated when used with `ArgumentDefaultsHelpFormatter`); - the "argument %(argument_name)s: %(message)s" error message at 3.9/Lib/argparse.py:751; - the formatted section heading at 3.9/Lib/argparse.py:225: if the heading itself is translatable, the string "%(heading)s:" is not. More precisely, the colon right after the heading might also require localization, as some languages (e.g., French) typeset colons with a preceding non-breaking space (i.e., "%(heading)s?:"). (Okay, I'll admit that this is nitpicking!) I'll submit a pull request with proposed fixes for these strings. Kind regards, J?r?mie. ---------- components: Library (Lib) messages: 399216 nosy: jdetrey priority: normal severity: normal status: open title: [argparse] Missing translations type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 10:13:35 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A9r=C3=A9mie_Detrey?=) Date: Sun, 08 Aug 2021 14:13:35 +0000 Subject: [issue33775] argparse: the word 'default' (in help) is not marked as translatable In-Reply-To: <1528236755.92.0.592728768989.issue33775@psf.upfronthosting.co.za> Message-ID: <1628432015.85.0.394618466254.issue33775@roundup.psfhosted.org> Change by J?r?mie Detrey : ---------- versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 10:40:55 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A9r=C3=A9mie_Detrey?=) Date: Sun, 08 Aug 2021 14:40:55 +0000 Subject: [issue44865] [argparse] Missing translations In-Reply-To: <1628431949.27.0.450799323412.issue44865@roundup.psfhosted.org> Message-ID: <1628433655.04.0.816683921394.issue44865@roundup.psfhosted.org> Change by J?r?mie Detrey : ---------- keywords: +patch pull_requests: +26157 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27668 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 11:54:51 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Sun, 08 Aug 2021 15:54:51 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628438091.72.0.545090861241.issue44830@roundup.psfhosted.org> Senthil Kumaran added the comment: @Jack, if you review this backport - https://github.com/python/cpython/pull/27666 , I can merge this PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 12:27:29 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Sun, 08 Aug 2021 16:27:29 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628440049.33.0.273834375446.issue25782@roundup.psfhosted.org> Chris Jerdonek added the comment: > the result is C -> A -> B -> C Did you mean C -> A -> B? By the way, if you applied to this example your reasoning that PyErr_SetObject shouldn't try to fix user bugs, should this example instead be C -> A -> B -> C -> ... (leaving the cycle as is but just not hanging)? Is it not being changed then because the reasoning doesn't apply, or because we're restricted in what we can do by backwards compatibility? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 12:52:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 08 Aug 2021 16:52:45 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628441565.88.0.227113641881.issue25782@roundup.psfhosted.org> Irit Katriel added the comment: > > the result is C -> A -> B -> C > Did you mean C -> A -> B? No, I meant C -> A -> B -> C -> A .... the cycle remains unchanged. > By the way, if you applied to this example your reasoning that PyErr_SetObject shouldn't try to fix user bugs, should this example instead be C -> A -> B -> C -> ... (leaving the cycle as is but just not hanging)? Yes, exactly, see above. > Is it not being changed then because the reasoning doesn't apply, or because we're restricted in what we can do by backwards compatibility? The reason for leaving the cycle unchanged is not backwards compatibility, it's that this function cannot break the cycle in a meaningful way (this is why it's hard to agree on how it should do that). It can't be that A happened in the context of B at the same time that B happened in the context of A. So a cycle means there was a bug somewhere, and the exception's history is corrupt, so changing it will only make it more corrupt and harder to debug. Note that PyErr_SetObject avoids creating cycles, so the cycle was not created by someone catching an exception e and doing "raise e". It was caused by some other code tampering with the __context__ in an incorrect way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 13:00:57 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Sun, 08 Aug 2021 17:00:57 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628442057.93.0.455191387171.issue25782@roundup.psfhosted.org> Chris Jerdonek added the comment: > No, I meant C -> A -> B -> C -> A .... Oh, good. I support your reasoning and approach, by the way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 13:15:33 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Sun, 08 Aug 2021 17:15:33 +0000 Subject: [issue40696] Exception handling with "await" can hang in Python3.9.0b1 In-Reply-To: <1589962083.82.0.703924093729.issue40696@roundup.psfhosted.org> Message-ID: <1628442933.53.0.0431030341941.issue40696@roundup.psfhosted.org> Chris Jerdonek added the comment: Okay, I'll close the issue and update it to reflect that it was restricted to the narrower, originally reported issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: exception chain cycles cause hangs (was "Exception handling with "await" can hang in Python3.9.0b1") -> Exception handling with "await" can hang in Python3.9.0b1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 13:23:53 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 08 Aug 2021 17:23:53 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1628443433.23.0.558319736246.issue44830@roundup.psfhosted.org> Jack DeVries added the comment: I'm pretty much a novice, Senthil, so I don't know how much a review from me is worth but removing the broken link seems best! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 13:32:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Aug 2021 17:32:47 +0000 Subject: [issue42053] fwalk: incorrect boolean test for non-fd arguments In-Reply-To: <1602869505.61.0.789643368245.issue42053@roundup.psfhosted.org> Message-ID: <1628443967.25.0.136996030589.issue42053@roundup.psfhosted.org> Serhiy Storchaka added the comment: I confirm that fwalk() does not support integer first argument. This check is misleading. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 13:33:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Aug 2021 17:33:38 +0000 Subject: [issue42053] fwalk: incorrect boolean test for non-fd arguments In-Reply-To: <1602869505.61.0.789643368245.issue42053@roundup.psfhosted.org> Message-ID: <1628444018.18.0.309435728719.issue42053@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26158 pull_request: https://github.com/python/cpython/pull/27669 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 13:49:51 2021 From: report at bugs.python.org (John Joseph Morelli) Date: Sun, 08 Aug 2021 17:49:51 +0000 Subject: [issue44866] Inconsistent Behavior of int() Message-ID: <1628444991.92.0.991529189283.issue44866@roundup.psfhosted.org> New submission from John Joseph Morelli : I first noticed this and reported it on the W3 Schools Tutorial, the section entitled "Add Two Numbers with User Input" There were many behaviors that I did not understand, but for this bug report, I will state that the input statements present seem to return a string and under most situations will return an error if the user inputs a real number like 2.8. However, under a very specific situation, it will truncate 2.8 to 2 without error. After further investigation, I believe the following session in the IDLE's output window and editor illustrates this inconsistent behavior. Note that I have added comments after copying the session here... >>> print(x) #want to ensure new session has x as undefined Traceback (most recent call last): File "", line 1, in print(x) NameError: name 'x' is not defined # confirmed x is undefined >>> x="2" # define x as the string "2" >>> print(x) 2 >>> print(type(x)) # confirm that x is a string value of "2" >>> y=int(x) # convert string value of "2" to integer of 2 - # according to documentation this should work - see "If x is not a # number or if base is given, then x must be a string, bytes, or # bytearray instance representing an integer literal in radix base." # at link --> https://docs.python.org/3.9/library/functions.html#int >>> print(type(y)) # ensure y is type int >>> print(y) 2 >>> z=x+".8" # create z to be the concatenation of two strings "2" and ".8" = "2.8", a string representation of the real number 2.8 >>> print(z) 2.8 >>> print(type(z)) # ensure z is a string >>> aa=int(z) # convert z to an integer (as descried in the link # above, this should NOT work Traceback (most recent call last): File "", line 1, in aa=int(z) ValueError: invalid literal for int() with base 10: '2.8' >>> w="2.8" # Define w directly as the string value of 2.8 = "2.8" >>> bb=int(w) # This should also produce an error Traceback (most recent call last): File "", line 1, in bb=int(w) ValueError: invalid literal for int() with base 10: '2.8' >>> a='2.8' >>> b=int(a) Traceback (most recent call last): File "", line 1, in b=int(a) ValueError: invalid literal for int() with base 10: '2.8' >>> print(type(a)) # Ensure a is a string >>> w="2" >>> bb=int(w) >>> print(bb) 2 >>> print(type(bb)) >>> test=int(input("What is test value? ")) #lets try inputting a # real number but as an argument to int and assigning it to test What is test value? 2.8 # this should not work either Traceback (most recent call last): File "", line 1, in test=int(input("What is test value? ")) ValueError: invalid literal for int() with base 10: '2.8' >>> # So everything here is working as expected, but... Here is code from the IDLE editor... a file called testinput1.py x = int(1) y = input("Type a number: ") print(type(y)) int_y = int(2.8) #conver y to an integer 2 and assign to int_y z = int("3") print(x) print(y) print(int_y) print(z) # I can find no documentation to suggest this should work, but it does. Here is the output in IDLE's shell Type a number: 2.8 1 2.8 2 3 Now, if I immediately go into the shell while the variables remain untouched and defined... >>> a=int(y) # Correctly, this produces the expected error Traceback (most recent call last): File "", line 1, in a=int(y) ValueError: invalid literal for int() with base 10: '2.8' After extensive testing, I conclude that after input, you may immediately apply the int() function to the resulting string, but you quickly lose that ability, resulting in the expected error. I can find no documentation to explain this behavior. If I am not overlooking something, I think this should either be in the documentation of the function int(), if it is intended to behaviour this way, or as a bug, should be corrected. NOTE, I just started learning Pytyon this weekend, so I may be just ignorant of the behavior, but I have searched a good bit and found nothing suggesting this is how int() should behalf. I have also not studied the other constructor functions. ---------- assignee: docs at python components: Build, Documentation, IDLE, Library (Lib), Windows files: function_int_08Aug21.txt messages: 399224 nosy: TheDoctor165, docs at python, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware priority: normal severity: normal status: open title: Inconsistent Behavior of int() type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50205/function_int_08Aug21.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 14:03:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Aug 2021 18:03:36 +0000 Subject: [issue44866] Inconsistent Behavior of int() In-Reply-To: <1628444991.92.0.991529189283.issue44866@roundup.psfhosted.org> Message-ID: <1628445816.22.0.167936523308.issue44866@roundup.psfhosted.org> Serhiy Storchaka added the comment: Following your long example, it seems to me that all works as you expected. Raise an exception if you expect exception, and does raise it if you expect no exception. I may miss something, what exactly does not work as you expected? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 14:04:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Aug 2021 18:04:15 +0000 Subject: [issue42053] fwalk: incorrect boolean test for non-fd arguments In-Reply-To: <1602869505.61.0.789643368245.issue42053@roundup.psfhosted.org> Message-ID: <1628445855.32.0.112121900303.issue42053@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 2b496e79293a8b80e8ba0e514e186b3b1467b64b by Serhiy Storchaka in branch 'main': bpo-42053: Remove misleading check in os.fwalk() (GH-27669) https://github.com/python/cpython/commit/2b496e79293a8b80e8ba0e514e186b3b1467b64b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 14:04:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Aug 2021 18:04:38 +0000 Subject: [issue42053] fwalk: incorrect boolean test for non-fd arguments In-Reply-To: <1602869505.61.0.789643368245.issue42053@roundup.psfhosted.org> Message-ID: <1628445878.13.0.295409738124.issue42053@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 14:10:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Aug 2021 18:10:35 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628446235.08.0.721226085166.issue25782@roundup.psfhosted.org> Serhiy Storchaka added the comment: My argument is the loop creation should be prevented at first place. PyErr_SetObject() is not the only C code that can hang or overflow the stack when iterate a loop. Preventing creation of the loop will fix all other code that iterate the __context__ chain. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 14:13:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 08 Aug 2021 18:13:55 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628446435.08.0.4498715046.issue25782@roundup.psfhosted.org> Irit Katriel added the comment: > My argument is the loop creation should be prevented at first place. I agree, but avoiding the hang is higher priority. > Preventing creation of the loop will fix all other code that iterate the __context__ chain. There could still be a cycles involving both __context__ and __cause__ links. This is why the traceback code uses a visited set to detect cycles. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 14:16:45 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 08 Aug 2021 18:16:45 +0000 Subject: [issue44866] Inconsistent Behavior of int() In-Reply-To: <1628444991.92.0.991529189283.issue44866@roundup.psfhosted.org> Message-ID: <1628446605.12.0.35528528281.issue44866@roundup.psfhosted.org> Dennis Sweeney added the comment: You typed `int_y = int(2.8)`, so you passed the floating point number 2.8, which the int() function rounds down to 2. On the other hand when y had the string value '2.8'. The int(y) call tried to parse an integer out of the string, but failed since there were numbers after the decimal point. Passing a float rounds down: >>> int(2.8) 2 Passing a string with numbers after the decimal raises ValueError: >>> int('2.8') ValueError: invalid literal for int() with base 10: '2.8' Passing a string of digits without a decimal correctly parses an integer: >>> int('42') 42 Note that the input() function always returns a string, so input() can return '2.8', but not 2.8. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 14:35:31 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Sun, 08 Aug 2021 18:35:31 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628447731.58.0.689325708271.issue25782@roundup.psfhosted.org> Chris Jerdonek added the comment: > Preventing creation of the loop will fix all other code that iterate the __context__ chain. We can still do / discuss that following Irit's proposed change, which is an improvement, IMO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 14:58:29 2021 From: report at bugs.python.org (Nick Guenther) Date: Sun, 08 Aug 2021 18:58:29 +0000 Subject: [issue28022] SSL releated deprecation for 3.6 In-Reply-To: <1473347942.69.0.310193437319.issue28022@psf.upfronthosting.co.za> Message-ID: <1628449109.02.0.753390831824.issue28022@roundup.psfhosted.org> Nick Guenther added the comment: Hello everyone, and thank you as usual for all your hard work keeping the python ecosystem going. I saw that the start of this thread said it was going to > - make ftplib, imaplib, nntplib, pop3lib, smtplib etc. validate certs by default. but this hasn't been done, at least not for imaplib. imaplib is still calling the undocumented "ssl._create_stdlib_context": https://github.com/python/cpython/blob/2b496e79293a8b80e8ba0e514e186b3b1467b64b/Lib/imaplib.py#L1320 which is actually "ssl._create_unverified_context": https://github.com/python/cpython/blob/2b496e79293a8b80e8ba0e514e186b3b1467b64b/Lib/ssl.py#L842 which is indeed unverified: despite defaulting to PROTOCOL_TLS_CLIENT, which "enables CERT_REQUIRED and check_hostname by default.", it overrides that by setting check_hostname=False: https://github.com/python/cpython/blob/2b496e79293a8b80e8ba0e514e186b3b1467b64b/Lib/ssl.py#L811 To demonstrate, check out this tester script: $ cat a.py import os, imaplib with imaplib.IMAP4_SSL(os.environ.get('HOSTNAME')) as S: print(S.login(os.environ.get('USERNAME'), os.environ.get('PASSWORD'))) $ HOSTNAME=46.23.90.174 USERNAME=test1 PASSWORD=test1test1 python3 a.py ('OK', [b'Logged in']) I don't have a cert for 46.23.90.174 (no one will give out certs for IPs!), so this is wrong! In order to actually enable verification you need to know the incantation. It's not that long but it is subtle and frighteningly easy to get wrong. Here it is: $ cat a.py import os, ssl, imaplib ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ctx.load_default_certs() with imaplib.IMAP4_SSL(os.environ.get('HOSTNAME'), ssl_context=ctx) as S: print(S.login(os.environ.get('USERNAME'), os.environ.get('PASSWORD'))) $ HOSTNAME=46.23.90.174 USERNAME=test1 PASSWORD=test1test1 python3 a.py Traceback (most recent call last): File "a.py", line 6, in with imaplib.IMAP4_SSL(os.environ.get('HOSTNAME'), ssl_context=ctx) as S: File "/usr/lib/python3.6/imaplib.py", line 1288, in __init__ IMAP4.__init__(self, host, port) File "/usr/lib/python3.6/imaplib.py", line 198, in __init__ self.open(host, port) File "/usr/lib/python3.6/imaplib.py", line 1301, in open IMAP4.open(self, host, port) File "/usr/lib/python3.6/imaplib.py", line 299, in open self.sock = self._create_socket() File "/usr/lib/python3.6/imaplib.py", line 1293, in _create_socket server_hostname=self.host) File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket _context=self, _session=session) File "/usr/lib/python3.6/ssl.py", line 817, in __init__ self.do_handshake() File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake self._sslobj.do_handshake() File "/usr/lib/python3.6/ssl.py", line 694, in do_handshake match_hostname(self.getpeercert(), self.server_hostname) File "/usr/lib/python3.6/ssl.py", line 327, in match_hostname % (hostname, ', '.join(map(repr, dnsnames)))) ssl.CertificateError: hostname '46.23.90.174' doesn't match either of 'comms.kousu.ca', 'comms3.kousu.ca' I can see from this thread there were some concerns about breaking people's self-signed certs back in 2016. But it's five years later now and letsencrypt is super common now, and most servers and clients are enforcing TLS, especially when credentials are involved. Could this be revisited? Thanks for any attention you have gifted to this :) ---------- nosy: +kousu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 15:02:33 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 08 Aug 2021 19:02:33 +0000 Subject: [issue44866] Inconsistent Behavior of int() In-Reply-To: <1628444991.92.0.991529189283.issue44866@roundup.psfhosted.org> Message-ID: <1628449353.67.0.373483523793.issue44866@roundup.psfhosted.org> Steven D'Aprano added the comment: John, there's no need to establish every feature in Python that you are **not** questioning. Please focus on the behaviour that you think is a bug. Pretty much nothing in your example before the line "So everything here is working as expected" is necessary. We're experienced Python users, some of us have been using Python for 20 years or more. We know how int() operates, you don't have to teach us. What you have done is confuse the string '2.8' and the float 2.8, which is easy enough to do as a beginner. The critical error is this line: int_y = int(2.8) #conver y to an integer 2 and assign to int_y But that's not converting the variable `y` to an integer, it is converting the float 2.8 to an integer. 2.8 is already a number, and calling int(2.8) drops the fractional part leaving 2 as expected. Had you tried `int_y = int(y)` instead (y being a string) you would have got the exact error you were expecting. It takes a little while to completely understand the differences between strings, ints, floats, literal numbers like 2.8 versus strings like "2.8", but that will come with some practice. In future, rather than posting on the bug tracker, please consider asking questions on one of the many forums where volunteers will answer your questions and leave the bug tracker for actual bugs. (Hint: there are many tens of thousands of Python programmers with collectively thousands of years of experience with the language. As a beginner with only a few days experience, you are highly unlikely to spot a bug that everyone else has missed.) You can try the Python Discussion area: https://discuss.python.org/ or the Python-List or Tutor mailing lists: https://mail.python.org/mailman/listinfo/python-list https://mail.python.org/mailman/listinfo/tutor Good luck! ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 15:03:53 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 08 Aug 2021 19:03:53 +0000 Subject: [issue44866] Inconsistent Behavior of int() In-Reply-To: <1628444991.92.0.991529189283.issue44866@roundup.psfhosted.org> Message-ID: <1628449433.46.0.262108163052.issue44866@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 15:11:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 08 Aug 2021 19:11:50 +0000 Subject: [issue44866] Inconsistent Behavior of int() In-Reply-To: <1628444991.92.0.991529189283.issue44866@roundup.psfhosted.org> Message-ID: <1628449910.81.0.169550026514.issue44866@roundup.psfhosted.org> Terry J. Reedy added the comment: John, for next time, please read https://stackoverflow.com/help/minimal-reproducible-example ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 15:16:15 2021 From: report at bugs.python.org (Guo Ci Teo) Date: Sun, 08 Aug 2021 19:16:15 +0000 Subject: [issue44867] types.MappingProxyType and collections.defaultdict Message-ID: <1628450175.86.0.732506438572.issue44867@roundup.psfhosted.org> New submission from Guo Ci Teo : `types.MappingProxyType` is documented as 'Read-only proxy of a mapping'. But if used with a `collections.defaultdict` mapping, it can modify the underlying mapping. ``` import collections, types dd = collections.defaultdict(set) mpt = types.MappingProxyType(dd) mpt['__getitem__'] # key inserted mpt.get('get') # key not inserted print(dd.items()) # dict_items([('__getitem__', set())]) ``` ---------- components: Library (Lib) messages: 399234 nosy: guoci priority: normal severity: normal status: open title: types.MappingProxyType and collections.defaultdict type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 15:17:15 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 08 Aug 2021 19:17:15 +0000 Subject: [issue28022] SSL releated deprecation for 3.6 In-Reply-To: <1473347942.69.0.310193437319.issue28022@psf.upfronthosting.co.za> Message-ID: <1628450235.66.0.843800320693.issue28022@roundup.psfhosted.org> Christian Heimes added the comment: The part with "make ftplib, imaplib, nntplib, pop3lib, smtplib etc. validate certs by default" was not implemented. These modules still default to unverified connections. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 15:31:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 08 Aug 2021 19:31:10 +0000 Subject: [issue44866] Inconsistent Behavior of int() In-Reply-To: <1628444991.92.0.991529189283.issue44866@roundup.psfhosted.org> Message-ID: <1628451070.31.0.943841169606.issue44866@roundup.psfhosted.org> Serhiy Storchaka added the comment: I understand your confusion John. The fact is that int() serves two functions. If argument is a number, it truncates it to an integer. If argument is a string, it parses the string representation of integer (not necessary decimal). For details see https://docs.python.org/3/library/functions.html#int . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 16:18:13 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 08 Aug 2021 20:18:13 +0000 Subject: [issue44868] misleading error about fd / follow_symlinks from os.stat() Message-ID: <1628453893.12.0.662297515485.issue44868@roundup.psfhosted.org> New submission from Andrei Kulakov : (note the actual relevant code is in posixmodule.c) os.stat() error can be confusing and misleading when given an fd and with follow_symlinks=False: ValueError: stat: cannot use fd and follow_symlinks together It's less bad when os.stat() is used directly because the user would look at the signature and would have provided the follow_symlinks=False directly, but it's confusing when used indirectly by other function. I've ran into this when reviewing https://github.com/python/cpython/pull/27524 list(os.fwalk(1)) /usr/local/Cellar/python at 3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py in fwalk(top, topdown, onerror, follow_symlinks, dir_fd) 467 # lstat()/open()/fstat() trick. 468 if not follow_symlinks: --> 469 orig_st = stat(top, follow_symlinks=False, dir_fd=dir_fd) 470 topfd = open(top, O_RDONLY, dir_fd=dir_fd) 471 try: ValueError: stat: cannot use fd and follow_symlinks together ---- A few things are confusing here: I did not use follow_symlinks argument; I can see from traceback that the arg is used but set to False, which is the usual meaning of "do not use follow_symlinks". In addition, fwalk() can probably check that `top` arg is a string and raise an error stating that it should be a string if it's not. If that's done, this issue will no longer happen for current code anywhere in os module, but stat(follow_symlinks=False) is also used in shutil and pathlib (I didn't check if fd may be passed in those cases), but also in 3rd party libraries. So I think it would be clearer to rephrase the error to say stat: cannot use fd and follow_symlinks set to False or NULL together (adding NULL as it may be used from C code). ---------- components: C API, Library (Lib) messages: 399237 nosy: andrei.avk priority: normal severity: normal status: open title: misleading error about fd / follow_symlinks from os.stat() type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 16:19:44 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 08 Aug 2021 20:19:44 +0000 Subject: [issue44867] types.MappingProxyType and collections.defaultdict In-Reply-To: <1628450175.86.0.732506438572.issue44867@roundup.psfhosted.org> Message-ID: <1628453984.32.0.359616153039.issue44867@roundup.psfhosted.org> Raymond Hettinger added the comment: > `types.MappingProxyType` is documented as > 'Read-only proxy of a mapping'. But if used with a > `collections.defaultdict` mapping, it can modify > the underlying mapping. Technically, the underlying mapping is modifying itself. That is allowed. Also, there isn't really anything that the mapping proxy can do about it. All MappingProxy can do it forward calls to methods that are usually non-mutating. ---------- assignee: -> rhettinger nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 16:20:23 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 08 Aug 2021 20:20:23 +0000 Subject: [issue44868] misleading error about fd / follow_symlinks from os.stat() In-Reply-To: <1628453893.12.0.662297515485.issue44868@roundup.psfhosted.org> Message-ID: <1628454023.68.0.474941208509.issue44868@roundup.psfhosted.org> Andrei Kulakov added the comment: > In addition, fwalk() can probably check that `top` arg is a string and raise an error stating that it should be a string if it's not. I should clarify that fwalk() cannot accept an fd as the `top` arg, see https://bugs.python.org/issue42053 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 16:22:06 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 08 Aug 2021 20:22:06 +0000 Subject: [issue41645] Typo First Page of Documentation In-Reply-To: <1598465724.17.0.0409144165682.issue41645@roundup.psfhosted.org> Message-ID: <1628454126.61.0.10053911944.issue41645@roundup.psfhosted.org> Raymond Hettinger added the comment: To my ears, the sentence reads nicely. I vote for leaving it as is. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 16:52:03 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 08 Aug 2021 20:52:03 +0000 Subject: [issue44859] Improve some sqlite3 errors In-Reply-To: <1628345656.7.0.124562565005.issue44859@roundup.psfhosted.org> Message-ID: <1628455923.6.0.442527211171.issue44859@roundup.psfhosted.org> Erlend E. Aasland added the comment: * sqlite3.ProgrammingError is raised for SQLITE_MISUSE. IMO, sqlite3.InterfaceError, is more appropriate. * In case of too large integer values, OverflowError is raised on bind, but sqlite3.DataError is raised on UDF return. Using sqlite3.DataError in both cases would be more aligned with PEP 249. * Too long strings/blobs raise OverflowError. Consider raising sqlite3.DataError instead. * For non-contiguous (blob) buffers, we overwrite the BufferError with ValueError. Instead of overwriting BufferError, we should consider chaining with sqlite3.DataError. * Consider raising sqlite3.Warning when nan is implicitly converted to NULL by SQLite * In pysqlite_statement_create(), consider raising sqlite3.ProgrammingError iso. sqlite3.Warning when more than one statement is executed * In pysqlite_statement_create(), consider raising sqlite3.DataError iso. ValueError for queries with null characters ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 17:41:06 2021 From: report at bugs.python.org (Carol Willing) Date: Sun, 08 Aug 2021 21:41:06 +0000 Subject: [issue41645] Typo First Page of Documentation In-Reply-To: <1598465724.17.0.0409144165682.issue41645@roundup.psfhosted.org> Message-ID: <1628458866.5.0.672577916073.issue41645@roundup.psfhosted.org> Carol Willing added the comment: I've run the two sentences through Grammarly's checker. No errors were flagged for the sentence in question. Let's leave "as is". Thanks to all who discussed this issue. ---------- nosy: +willingc resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 18:34:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 08 Aug 2021 22:34:57 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628462097.99.0.77252284137.issue25782@roundup.psfhosted.org> Irit Katriel added the comment: Note that my PR can (and should) be backported, while a change in the semantics of __context__ assignment, I'm not sure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 18:41:00 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Sun, 08 Aug 2021 22:41:00 +0000 Subject: [issue22240] argparse support for "python -m module" in help In-Reply-To: <1408564751.42.0.897410433728.issue22240@psf.upfronthosting.co.za> Message-ID: <1628462460.6.0.00495562011724.issue22240@roundup.psfhosted.org> Nils Kattenbeck added the comment: I implemented the logic and adjusted the existing tests to have a fixed program name. I also fixed the build error by changing how zip files are detected. Based on you comment Nick you however even had a different idea. Currently I check if __spec__.__loader__ is a zip loader but if I understood correct you suggest the check if __spec__.__location__ is a proper subdir of sys.argv[0]? https://github.com/septatrix/cpython/compare/main...septatrix:enhance/argparse-prog-name. When I have some more time I will check whether mocking works and otherwise checkout test.support.script_helper or making the function accept spec/argv0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 19:07:54 2021 From: report at bugs.python.org (Bupjae Lee) Date: Sun, 08 Aug 2021 23:07:54 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information In-Reply-To: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> Message-ID: <1628464074.04.0.356162409554.issue44522@roundup.psfhosted.org> Bupjae Lee added the comment: I just noticed that very next sentence, "These private code points will then be turned back...", also needs to be fixed. Suggested fix: "These surrogate code units will then be turned back..." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 21:02:48 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 09 Aug 2021 01:02:48 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1628470968.48.0.266116138088.issue44544@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- pull_requests: +26159 pull_request: https://github.com/python/cpython/pull/27671 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 21:27:09 2021 From: report at bugs.python.org (hai shi) Date: Mon, 09 Aug 2021 01:27:09 +0000 Subject: [issue44864] [argparse] Do not translate user-provided strings in `ArgumentParser.add_subparsers()` In-Reply-To: <1628412158.14.0.0114857952802.issue44864@roundup.psfhosted.org> Message-ID: <1628472429.74.0.515647533903.issue44864@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 21:28:44 2021 From: report at bugs.python.org (hai shi) Date: Mon, 09 Aug 2021 01:28:44 +0000 Subject: [issue44865] [argparse] Missing translations In-Reply-To: <1628431949.27.0.450799323412.issue44865@roundup.psfhosted.org> Message-ID: <1628472524.06.0.550622590554.issue44865@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 22:23:03 2021 From: report at bugs.python.org (Eesa Ibrahim Khokhar) Date: Mon, 09 Aug 2021 02:23:03 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> Message-ID: <1628475783.85.0.498925247813.issue44765@roundup.psfhosted.org> Eesa Ibrahim Khokhar added the comment: Thanks for the tip! I just saw that the docs at the above URL are now updated. Thanks again! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 23:30:23 2021 From: report at bugs.python.org (Eduardo Morales) Date: Mon, 09 Aug 2021 03:30:23 +0000 Subject: [issue44869] MacOS Monterrey malloc issue Message-ID: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> New submission from Eduardo Morales : Running on MacOS Monterrey throws following error: ```malloc: *** error for object 0x7ffb5ea1a120: pointer being freed was not allocatedPython(4899,0x1061a8600)``` This started happening right after upgrading to the new MacOS Beta. ---------- messages: 399247 nosy: edumorlom priority: normal severity: normal status: open title: MacOS Monterrey malloc issue versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 23:31:39 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 09 Aug 2021 03:31:39 +0000 Subject: [issue43585] perf_counter() returns computers uptime In-Reply-To: <1616344693.53.0.493745901493.issue43585@roundup.psfhosted.org> Message-ID: <1628479899.98.0.887603078745.issue43585@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- resolution: -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 23:33:17 2021 From: report at bugs.python.org (Eduardo Morales) Date: Mon, 09 Aug 2021 03:33:17 +0000 Subject: [issue44869] MacOS Monterrey malloc issue In-Reply-To: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> Message-ID: <1628479997.76.0.875599850726.issue44869@roundup.psfhosted.org> Eduardo Morales added the comment: I am not sure how to reproduce it, I think it's being caused by an imported library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 8 23:33:56 2021 From: report at bugs.python.org (Eduardo Morales) Date: Mon, 09 Aug 2021 03:33:56 +0000 Subject: [issue44869] MacOS Monterrey malloc issue In-Reply-To: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> Message-ID: <1628480036.66.0.399808126474.issue44869@roundup.psfhosted.org> Eduardo Morales added the comment: These are the libraries that I'm using: ``` ibm-db~=3.0.4 Flask~=2.0.1 pandas~=1.2.5 requests~=2.25.1 flask_basicauth~=0.2.0 schedule~=1.1.0 ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 03:45:49 2021 From: report at bugs.python.org (meowmeowcat) Date: Mon, 09 Aug 2021 07:45:49 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information In-Reply-To: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> Message-ID: <1628495149.76.0.508152267606.issue44522@roundup.psfhosted.org> meowmeowcat added the comment: Oh, I missed this too. I'll fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 03:52:43 2021 From: report at bugs.python.org (meowmeowcat) Date: Mon, 09 Aug 2021 07:52:43 +0000 Subject: [issue44869] MacOS Monterrey malloc issue In-Reply-To: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> Message-ID: <1628495563.86.0.292547002263.issue44869@roundup.psfhosted.org> Change by meowmeowcat : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 04:46:38 2021 From: report at bugs.python.org (Maximilian Hils) Date: Mon, 09 Aug 2021 08:46:38 +0000 Subject: [issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default In-Reply-To: <1575327804.72.0.272027136625.issue38956@roundup.psfhosted.org> Message-ID: <1628498798.15.0.431821911595.issue38956@roundup.psfhosted.org> Change by Maximilian Hils : ---------- nosy: +mhils nosy_count: 5.0 -> 6.0 pull_requests: +26160 pull_request: https://github.com/python/cpython/pull/27672 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 05:19:28 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 09 Aug 2021 09:19:28 +0000 Subject: [issue44840] Nested if/else gets phantom else trace again (3.10) In-Reply-To: <1628169100.37.0.353483963834.issue44840@roundup.psfhosted.org> Message-ID: <1628500768.51.0.535455851347.issue44840@roundup.psfhosted.org> Mark Shannon added the comment: New changeset b854557b49083d8625a433eb36aacb0c87d67c52 by Mark Shannon in branch 'main': bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to after CFG optimization. (GH-27656) https://github.com/python/cpython/commit/b854557b49083d8625a433eb36aacb0c87d67c52 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 05:38:24 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 09 Aug 2021 09:38:24 +0000 Subject: [issue44840] Nested if/else gets phantom else trace again (3.10) In-Reply-To: <1628169100.37.0.353483963834.issue44840@roundup.psfhosted.org> Message-ID: <1628501904.59.0.0968294743451.issue44840@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +26161 pull_request: https://github.com/python/cpython/pull/27673 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 05:40:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 09 Aug 2021 09:40:29 +0000 Subject: [issue44826] Specialize STORE_ATTR using PEP 659 machinery. In-Reply-To: <1628073282.4.0.475634168415.issue44826@roundup.psfhosted.org> Message-ID: <1628502029.18.0.00957740201023.issue44826@roundup.psfhosted.org> Mark Shannon added the comment: New changeset ac75f6bdd4748b3378dd321f862d13aa1898f77a by Mark Shannon in branch 'main': bpo-44826: Specialize STORE_ATTR (GH-27590) https://github.com/python/cpython/commit/ac75f6bdd4748b3378dd321f862d13aa1898f77a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 05:54:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Aug 2021 09:54:51 +0000 Subject: [issue44840] Nested if/else gets phantom else trace again (3.10) In-Reply-To: <1628169100.37.0.353483963834.issue44840@roundup.psfhosted.org> Message-ID: <1628502891.9.0.170695047539.issue44840@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 762ef85f441cdec002cb4e812b9e77ae5033e571 by Mark Shannon in branch '3.10': bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to after CFG optimization. (GH-27656) (#27673) https://github.com/python/cpython/commit/762ef85f441cdec002cb4e812b9e77ae5033e571 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 06:05:34 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 10:05:34 +0000 Subject: [issue32695] tarfile.open() raises TypeError when using compresslevel parameter with LZMA In-Reply-To: <1517152925.99.0.467229070634.issue32695@psf.upfronthosting.co.za> Message-ID: <1628503534.88.0.310234635685.issue32695@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset eb2d4a66ff07aa6e51cfaaa31afed31addf76936 by Zackery Spytz in branch 'main': bpo-32695: Docs and tests for compresslevel and preset kwargs in tarfile (GH-21470) https://github.com/python/cpython/commit/eb2d4a66ff07aa6e51cfaaa31afed31addf76936 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 06:05:43 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 10:05:43 +0000 Subject: [issue32695] tarfile.open() raises TypeError when using compresslevel parameter with LZMA In-Reply-To: <1517152925.99.0.467229070634.issue32695@psf.upfronthosting.co.za> Message-ID: <1628503543.89.0.471296250547.issue32695@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26162 pull_request: https://github.com/python/cpython/pull/27674 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 06:06:09 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 10:06:09 +0000 Subject: [issue32695] tarfile.open() raises TypeError when using compresslevel parameter with LZMA In-Reply-To: <1517152925.99.0.467229070634.issue32695@psf.upfronthosting.co.za> Message-ID: <1628503569.58.0.695298625506.issue32695@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26163 pull_request: https://github.com/python/cpython/pull/27675 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 06:30:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 10:30:26 +0000 Subject: [issue32695] tarfile.open() raises TypeError when using compresslevel parameter with LZMA In-Reply-To: <1517152925.99.0.467229070634.issue32695@psf.upfronthosting.co.za> Message-ID: <1628505026.96.0.213716580739.issue32695@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ede221e51796f3f5471278aabd9105870f79dfb5 by Miss Islington (bot) in branch '3.9': bpo-32695: Docs and tests for compresslevel and preset kwargs in tarfile (GH-21470) (GH-27674) https://github.com/python/cpython/commit/ede221e51796f3f5471278aabd9105870f79dfb5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 06:30:07 2021 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 09 Aug 2021 10:30:07 +0000 Subject: [issue44840] Nested if/else gets phantom else trace again (3.10) In-Reply-To: <1628169100.37.0.353483963834.issue44840@roundup.psfhosted.org> Message-ID: <1628505007.44.0.518037937666.issue44840@roundup.psfhosted.org> Ned Batchelder added the comment: This fix looks good, thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 06:30:34 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 10:30:34 +0000 Subject: [issue32695] tarfile.open() raises TypeError when using compresslevel parameter with LZMA In-Reply-To: <1517152925.99.0.467229070634.issue32695@psf.upfronthosting.co.za> Message-ID: <1628505034.12.0.912923750708.issue32695@roundup.psfhosted.org> miss-islington added the comment: New changeset d5c8ad24716d146ffa025e09dad85e5a1bac5c77 by Miss Islington (bot) in branch '3.10': bpo-32695: Docs and tests for compresslevel and preset kwargs in tarfile (GH-21470) https://github.com/python/cpython/commit/d5c8ad24716d146ffa025e09dad85e5a1bac5c77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 06:39:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 10:39:27 +0000 Subject: [issue32695] tarfile.open() raises TypeError when using compresslevel parameter with LZMA In-Reply-To: <1517152925.99.0.467229070634.issue32695@psf.upfronthosting.co.za> Message-ID: <1628505567.77.0.512065898635.issue32695@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 07:17:46 2021 From: report at bugs.python.org (meowmeowcat) Date: Mon, 09 Aug 2021 11:17:46 +0000 Subject: [issue44702] Fix weakref doc In-Reply-To: <1626899456.99.0.316409007045.issue44702@roundup.psfhosted.org> Message-ID: <1628507866.4.0.583603663447.issue44702@roundup.psfhosted.org> meowmeowcat added the comment: Thanks! I agree with what you said here. I'll open a PR for this with your fix suggestion. ---------- nosy: +meowmeowmeowcat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 07:32:04 2021 From: report at bugs.python.org (meowmeowcat) Date: Mon, 09 Aug 2021 11:32:04 +0000 Subject: [issue44702] Fix weakref doc In-Reply-To: <1626899456.99.0.316409007045.issue44702@roundup.psfhosted.org> Message-ID: <1628508724.87.0.423736428156.issue44702@roundup.psfhosted.org> Change by meowmeowcat : ---------- keywords: +patch pull_requests: +26164 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27676 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 07:45:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Aug 2021 11:45:36 +0000 Subject: [issue44840] Nested if/else gets phantom else trace again (3.10) In-Reply-To: <1628169100.37.0.353483963834.issue44840@roundup.psfhosted.org> Message-ID: <1628509536.81.0.808769768932.issue44840@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 Mon Aug 9 07:49:52 2021 From: report at bugs.python.org (Christian Degenkolb) Date: Mon, 09 Aug 2021 11:49:52 +0000 Subject: [issue44870] email.message_from_bytes not working on BytesIO() object Message-ID: <1628509792.47.0.257700542933.issue44870@roundup.psfhosted.org> New submission from Christian Degenkolb : Hi, the following minimal working example of the problem from io import BytesIO from os import read import email fp = BytesIO() with open('mail.eml', 'rb') as f: filecontent = f.read() print("type(filecontent)= ", type(filecontent)) fp.write(filecontent) mailobj = email.message_from_bytes(fp) produces the following exception $ python testparser.py type(filecontent)= Traceback (most recent call last): File "testparser.py", line 16, in mailobj = email.message_from_bytes(fp) File "/usr/lib/python3.8/email/__init__.py", line 46, in message_from_bytes return BytesParser(*args, **kws).parsebytes(s) File "/usr/lib/python3.8/email/parser.py", line 122, in parsebytes text = text.decode('ASCII', errors='surrogateescape') AttributeError: '_io.BytesIO' object has no attribute 'decode' This is a python 3.8.10 on an Ubuntu 20.04 LTS installed from the packages. The documentation for message_from_bytes https://docs.python.org/3.10/library/email.parser.html#email.message_from_bytes mentions bytes-like objects which links to https://docs.python.org/3.10/glossary.html#term-bytes-like-object and references object of type byte. Shouldn't this work with BytesIO()? A'm I missing something? with regards Christian ---------- components: email messages: 399259 nosy: barry, cd311, r.david.murray priority: normal severity: normal status: open title: email.message_from_bytes not working on BytesIO() object type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 08:01:56 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 12:01:56 +0000 Subject: [issue44702] Fix weakref doc In-Reply-To: <1626899456.99.0.316409007045.issue44702@roundup.psfhosted.org> Message-ID: <1628510516.4.0.132831134878.issue44702@roundup.psfhosted.org> miss-islington added the comment: New changeset 03e5647ab07c7d2a05094fc3b5ed6eba6fc01349 by meowmeowmeowcat in branch 'main': bpo-44702: Remove ambiguity in sentence (GH-27676) https://github.com/python/cpython/commit/03e5647ab07c7d2a05094fc3b5ed6eba6fc01349 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 08:30:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Aug 2021 12:30:52 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1628512252.23.0.820691114901.issue42035@roundup.psfhosted.org> STINNER Victor added the comment: PyType_GetName() is a nice addition, thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 09:11:33 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 09 Aug 2021 13:11:33 +0000 Subject: [issue44870] email.message_from_bytes not working on BytesIO() object In-Reply-To: <1628509792.47.0.257700542933.issue44870@roundup.psfhosted.org> Message-ID: <1628514693.73.0.3045492864.issue44870@roundup.psfhosted.org> Eric V. Smith added the comment: Use filecontent.getvalue(): https://docs.python.org/3/library/io.html#io.BytesIO.getvalue ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 09:14:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Aug 2021 13:14:27 +0000 Subject: [issue40912] _PyOS_SigintEvent is never closed on Windows In-Reply-To: <1591641593.68.0.465410581538.issue40912@roundup.psfhosted.org> Message-ID: <1628514867.15.0.155730737565.issue40912@roundup.psfhosted.org> STINNER Victor added the comment: Fixed by bpo-41686: commit 0ae323b87f1bed64a7fa70f5a41a5800aca032cc Author: Victor Stinner Date: Tue Nov 17 18:15:20 2020 +0100 bpo-41686: Always create the SIGINT event on Windows (GH-23344) bpo-41686, bpo-41713: On Windows, the SIGINT event, _PyOS_SigintEvent(), is now created even if Python is configured to not install signal handlers (PyConfig.install_signal_handlers=0 or Py_InitializeEx(0)). Changes: * Move global variables initialization from signal_exec() to _PySignal_Init() to clarify that they are global variables cleared by _PySignal_Fini(). * _PySignal_Fini() now closes sigint_event. * IntHandler is no longer a global variable. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 09:17:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Aug 2021 13:17:18 +0000 Subject: [issue44849] test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x In-Reply-To: <1628246446.17.0.0445752107297.issue44849@roundup.psfhosted.org> Message-ID: <1628515038.42.0.189790514614.issue44849@roundup.psfhosted.org> STINNER Victor added the comment: AMD64 FreeBSD Shared 3.x is back to green: test_os.test_get_set_inheritable_o_path() now pass on FreeBSD CURRENT ;-) My fix works as expected. I simply used the same fix than for Linux. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 09:22:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Aug 2021 13:22:02 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628515322.38.0.464650018544.issue33930@roundup.psfhosted.org> STINNER Victor added the comment: Correctness matters more than performance for 1 nanosecond. IMO a fix like attached bpo-33930.patch looks like the good approach to fix the crash. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 09:24:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 09 Aug 2021 13:24:08 +0000 Subject: [issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault In-Reply-To: <1626020381.6.0.201295772935.issue44598@roundup.psfhosted.org> Message-ID: <1628515448.09.0.468184790587.issue44598@roundup.psfhosted.org> STINNER Victor added the comment: tongxiaoge: Without more information, we cannot help you. See Christian's questions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 09:30:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 09 Aug 2021 13:30:33 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628515833.41.0.854221673842.issue33930@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +26165 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27678 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:15:04 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 14:15:04 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information In-Reply-To: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> Message-ID: <1628518504.14.0.611922895402.issue44522@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26166 pull_request: https://github.com/python/cpython/pull/27681 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:14:54 2021 From: report at bugs.python.org (Andrei Zene) Date: Mon, 09 Aug 2021 14:14:54 +0000 Subject: [issue44871] Threading memory leak Message-ID: <1628518494.18.0.597101898312.issue44871@roundup.psfhosted.org> New submission from Andrei Zene : In an application where we were handling incoming requests in new threads, we noticed that the memory usage grew over time. After trying to understand what's going on, i was able to reproduce this with a smaller python script that i've attached. What we do: - start a thread - the thread allocates some memory - at some point later we join the thread Notice that this seems to be more like a race-condition because it doesn't reproduce without adding some delays between the creation of different threads. I've added a comment in the file that basically commenting one time.sleep makes the leak to not reproduce anymore. On the other side, I was able to reproduce this consistently with every version of python on mulitple systems but only on Linux. On windows it doesn't reproduce. ---------- files: threading_leak.py messages: 399267 nosy: andzn priority: normal severity: normal status: open title: Threading memory leak type: performance versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50206/threading_leak.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:15:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 14:15:02 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information In-Reply-To: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> Message-ID: <1628518502.88.0.893843470161.issue44522@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b05e9b63fcfcd4bd7a6434fa9f9a7028d12f91c4 by meowmeowmeowcat in branch 'main': bpo-44522: Fix inaccurate information in open() function (GH-27650) https://github.com/python/cpython/commit/b05e9b63fcfcd4bd7a6434fa9f9a7028d12f91c4 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:15:12 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 14:15:12 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information In-Reply-To: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> Message-ID: <1628518512.56.0.66340011102.issue44522@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26167 pull_request: https://github.com/python/cpython/pull/27682 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:25:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 14:25:19 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628519119.84.0.207841633275.issue44854@roundup.psfhosted.org> ?ukasz Langa added the comment: > I did not see anything in the EditorConfig guide about what happens when .editorconfig does not start with root = true and another file is found. Good question. The docs do mention this but the information is scattered across the website. The key points are: > EditorConfig files are read top to bottom and the most recent rules found take precedence. Properties from matching EditorConfig sections are applied in the order they were read, so properties in closer files take precedence. > When opening a file, EditorConfig plugins look for a file named .editorconfig in the directory of the opened file and in every parent directory. A search for .editorconfig files will stop if the root filepath is reached or an EditorConfig file with root=true is found. In other words, unless root=True is specified, the editor will keep looking for .editorconfig also in parent directories as well and composing the config from all files it found. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:35:14 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 14:35:14 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information In-Reply-To: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> Message-ID: <1628519714.82.0.314247423548.issue44522@roundup.psfhosted.org> miss-islington added the comment: New changeset c79aa427c0b0c8a09e5c22a5420baf837054f509 by Miss Islington (bot) in branch '3.10': bpo-44522: Fix inaccurate information in open() function (GH-27650) https://github.com/python/cpython/commit/c79aa427c0b0c8a09e5c22a5420baf837054f509 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:39:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 14:39:39 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information In-Reply-To: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> Message-ID: <1628519979.46.0.382009789388.issue44522@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 037ef8d6d9cc8225d6db0305cee2d8d0ee5bee74 by Miss Islington (bot) in branch '3.9': bpo-44522: Fix inaccurate information in open() function (GH-27650) (GH-27682) https://github.com/python/cpython/commit/037ef8d6d9cc8225d6db0305cee2d8d0ee5bee74 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:40:25 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 14:40:25 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information In-Reply-To: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> Message-ID: <1628520025.85.0.271225306986.issue44522@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, meowmeowcat! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:45:25 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Mon, 09 Aug 2021 14:45:25 +0000 Subject: [issue44851] Update bundled pip to 21.2.3 and setuptools to 57.4.0 In-Reply-To: <1628248411.95.0.443315719327.issue44851@roundup.psfhosted.org> Message-ID: <1628520325.03.0.228951044602.issue44851@roundup.psfhosted.org> Change by Tzu-ping Chung : ---------- pull_requests: +26168 pull_request: https://github.com/python/cpython/pull/27658 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:47:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 14:47:15 +0000 Subject: [issue44851] Update bundled pip to 21.2.3 and setuptools to 57.4.0 In-Reply-To: <1628248411.95.0.443315719327.issue44851@roundup.psfhosted.org> Message-ID: <1628520435.76.0.611507032957.issue44851@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Tzu-ping Chung! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:57:19 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 09 Aug 2021 14:57:19 +0000 Subject: [issue44821] Instance dictionaries should be created eagerly In-Reply-To: <1628063836.31.0.548816977554.issue44821@roundup.psfhosted.org> Message-ID: <1628521039.69.0.700651987588.issue44821@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:58:07 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 09 Aug 2021 14:58:07 +0000 Subject: [issue44207] Add a version number to Python functions In-Reply-To: <1621612378.09.0.0247616387464.issue44207@roundup.psfhosted.org> Message-ID: <1628521087.99.0.0956979870587.issue44207@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 10:58:46 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 09 Aug 2021 14:58:46 +0000 Subject: [issue44338] Port LOAD_GLOBAL to adaptive interpreter In-Reply-To: <1623089094.6.0.928459069961.issue44338@roundup.psfhosted.org> Message-ID: <1628521126.35.0.320063872401.issue44338@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:12:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 16:12:13 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros Message-ID: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> New submission from Irit Katriel : Py_TRASHCAN_SAFE_BEGIN/END are the old macros, and they are currently broken (see Issue40608). We should use Py_TRASHCAN_BEGIN/END instead. ---------- components: Interpreter Core messages: 399274 nosy: iritkatriel priority: normal severity: normal status: open title: FrameObject uses the old trashcan macros versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:14:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 16:14:17 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628525657.86.0.416518431771.issue44872@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26169 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27683 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:23:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 16:23:01 +0000 Subject: [issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes In-Reply-To: <1595786356.19.0.0772009953039.issue41402@roundup.psfhosted.org> Message-ID: <1628526181.09.0.166229106432.issue41402@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:28:56 2021 From: report at bugs.python.org (Matej Cepl) Date: Mon, 09 Aug 2021 16:28:56 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1628526536.32.0.659675487096.issue44022@roundup.psfhosted.org> Matej Cepl added the comment: Is there a CVE for this? ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:35:39 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Mon, 09 Aug 2021 16:35:39 +0000 Subject: [issue44871] Threading memory leak In-Reply-To: <1628518494.18.0.597101898312.issue44871@roundup.psfhosted.org> Message-ID: <1628526939.52.0.315209476427.issue44871@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Memory leak/high usage on copy in different thread _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:42:51 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 09 Aug 2021 16:42:51 +0000 Subject: [issue44873] base64 RFC4648 test cases Message-ID: <1628527371.14.0.0350168122984.issue44873@roundup.psfhosted.org> New submission from Andrei Kulakov : RFC 4648 [1] has added a list of encoding test cases -- see section 10 of the RFC. It might be nice to add a test function that is a direct copy of these test cases. This will make conformance to this RFC clearer (actually right now we don't state conformance with 4648 in the docs except for b32 hex encode/decode, but I'm planning to update the docs in a separate issue). This will also let us easily keep test cases in sync with future updates in the RFC. The tests are similar to what we already have except our test cases go from '' => 'abc', and their test cases from '' => 'foobar' (by adding a character at a time in succession). [also some of our test cases go from '' to 'abcde', so a bit inconsistent.] I've confirmed that all of their test cases pass with Python dev branch code. I can put up a PR if this sounds good. [1] https://datatracker.ietf.org/doc/html/rfc4648.html ---------- components: Library (Lib) messages: 399276 nosy: andrei.avk priority: normal severity: normal status: open title: base64 RFC4648 test cases type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:45:38 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 16:45:38 +0000 Subject: [issue38840] incorrect __all__ list in multiprocessing.managers module In-Reply-To: <1574115502.48.0.329816372934.issue38840@roundup.psfhosted.org> Message-ID: <1628527538.62.0.806487698481.issue38840@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26171 pull_request: https://github.com/python/cpython/pull/27685 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:45:33 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 16:45:33 +0000 Subject: [issue38840] incorrect __all__ list in multiprocessing.managers module In-Reply-To: <1574115502.48.0.329816372934.issue38840@roundup.psfhosted.org> Message-ID: <1628527533.46.0.49171673923.issue38840@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26170 pull_request: https://github.com/python/cpython/pull/27684 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:45:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 16:45:45 +0000 Subject: [issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes In-Reply-To: <1595786356.19.0.0772009953039.issue41402@roundup.psfhosted.org> Message-ID: <1628527545.03.0.508705028162.issue41402@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b33186bc43bb5aaf652dd9d093a08fdde796d499 by Johannes Reiff in branch 'main': bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631) https://github.com/python/cpython/commit/b33186bc43bb5aaf652dd9d093a08fdde796d499 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:45:50 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 16:45:50 +0000 Subject: [issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes In-Reply-To: <1595786356.19.0.0772009953039.issue41402@roundup.psfhosted.org> Message-ID: <1628527550.6.0.851307658401.issue41402@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26172 pull_request: https://github.com/python/cpython/pull/27686 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:45:56 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 16:45:56 +0000 Subject: [issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes In-Reply-To: <1595786356.19.0.0772009953039.issue41402@roundup.psfhosted.org> Message-ID: <1628527556.78.0.282712683856.issue41402@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26173 pull_request: https://github.com/python/cpython/pull/27687 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:45:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 16:45:02 +0000 Subject: [issue38840] incorrect __all__ list in multiprocessing.managers module In-Reply-To: <1574115502.48.0.329816372934.issue38840@roundup.psfhosted.org> Message-ID: <1628527502.68.0.322744755618.issue38840@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d0978761118856e8ca8ea7b162a6585b8da83df9 by Zackery Spytz in branch 'main': bpo-38840: Incorrect __all__ in multiprocessing.managers (GH-18034) https://github.com/python/cpython/commit/d0978761118856e8ca8ea7b162a6585b8da83df9 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:54:41 2021 From: report at bugs.python.org (meowmeowcat) Date: Mon, 09 Aug 2021 16:54:41 +0000 Subject: [issue44508] asyncio: document failure mode for loop.call_soon_threadsafe In-Reply-To: <1624622415.86.0.725571040455.issue44508@roundup.psfhosted.org> Message-ID: <1628528081.36.0.60207808854.issue44508@roundup.psfhosted.org> Change by meowmeowcat : ---------- keywords: +patch nosy: +meowmeowmeowcat nosy_count: 4.0 -> 5.0 pull_requests: +26174 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27688 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 12:57:05 2021 From: report at bugs.python.org (meowmeowcat) Date: Mon, 09 Aug 2021 16:57:05 +0000 Subject: [issue44508] asyncio: document failure mode for loop.call_soon_threadsafe In-Reply-To: <1624622415.86.0.725571040455.issue44508@roundup.psfhosted.org> Message-ID: <1628528225.22.0.23908523623.issue44508@roundup.psfhosted.org> meowmeowcat added the comment: Thanks! I've opened a PR for this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 13:11:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 17:11:46 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628529106.33.0.583682910541.issue44872@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 7d14fdb03c3e8384c01da1b21647ce837ed6a29c by Irit Katriel in branch 'main': bpo-44872: use new trashcan macros in framobject.c (#27683) https://github.com/python/cpython/commit/7d14fdb03c3e8384c01da1b21647ce837ed6a29c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 13:17:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Aug 2021 17:17:50 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628529470.87.0.226697742123.issue44854@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka nosy_count: 2.0 -> 3.0 pull_requests: +26175 pull_request: https://github.com/python/cpython/pull/27689 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 13:20:54 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 09 Aug 2021 17:20:54 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628529654.41.0.146899603719.issue25782@roundup.psfhosted.org> Nikita Sobolev added the comment: There's also a similar case with python3.9: ```python >>> class MyError(Exception): ... ... ... >>> e = MyError('e') >>> e.__context__ = e >>> >>> try: ... raise e ... except MyError: ... print('done') ... done # hangs after this ^C^Z ``` The same code works with python3.8 We got hit by this in RustPython: https://github.com/RustPython/RustPython/pull/2820 ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 13:31:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 17:31:18 +0000 Subject: [issue38840] incorrect __all__ list in multiprocessing.managers module In-Reply-To: <1574115502.48.0.329816372934.issue38840@roundup.psfhosted.org> Message-ID: <1628530278.2.0.719663562607.issue38840@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 40b353bc079b990cf0d6259a5720fb9729c1b81e by Miss Islington (bot) in branch '3.9': bpo-38840: Incorrect __all__ in multiprocessing.managers (GH-18034) (GH-27684) https://github.com/python/cpython/commit/40b353bc079b990cf0d6259a5720fb9729c1b81e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 13:39:13 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 17:39:13 +0000 Subject: [issue38840] incorrect __all__ list in multiprocessing.managers module In-Reply-To: <1574115502.48.0.329816372934.issue38840@roundup.psfhosted.org> Message-ID: <1628530753.62.0.843390871073.issue38840@roundup.psfhosted.org> miss-islington added the comment: New changeset 8ece98a7e418c3c68a4c61bc47a2d0931b59a889 by Miss Islington (bot) in branch '3.10': bpo-38840: Incorrect __all__ in multiprocessing.managers (GH-18034) https://github.com/python/cpython/commit/8ece98a7e418c3c68a4c61bc47a2d0931b59a889 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 13:39:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 17:39:45 +0000 Subject: [issue38840] incorrect __all__ list in multiprocessing.managers module In-Reply-To: <1574115502.48.0.329816372934.issue38840@roundup.psfhosted.org> Message-ID: <1628530785.23.0.624022962347.issue38840@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 14:24:58 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 18:24:58 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628533498.78.0.235390507566.issue44872@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +26176 pull_request: https://github.com/python/cpython/pull/27690 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 14:33:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Aug 2021 18:33:02 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628533982.27.0.325372536443.issue44854@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 058fb35b57ca8c5063d16ec818e668b3babfea65 by Serhiy Storchaka in branch 'main': bpo-44854: Remove trailing whitespaces (GH-27689) https://github.com/python/cpython/commit/058fb35b57ca8c5063d16ec818e668b3babfea65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 14:37:02 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 18:37:02 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628534222.86.0.748489754335.issue44872@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +26177 pull_request: https://github.com/python/cpython/pull/27691 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 14:39:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 18:39:22 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628534362.47.0.518194959986.issue44872@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 14:39:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 18:39:37 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628534377.72.0.587391094999.issue44872@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 14:49:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 18:49:25 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628534965.02.0.763916829772.issue44872@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +26178 pull_request: https://github.com/python/cpython/pull/27692 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 14:58:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 18:58:05 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END Message-ID: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> New submission from Irit Katriel : The old trashcan macros - Py_TRASHCAN_SAFE_BEGIN/END are unsafe (see Issue40608). They were removed from the limited C API in 3.9: https://github.com/python/cpython/blob/main/Doc/whatsnew/3.9.rst#removed-1 They should be removed altogether, in favour of Py_TRASHCAN_BEGIN/END. Since they are not documented, I think this would be done by changing the comment before their definition in Include/cpython/object.h. ---------- components: Interpreter Core messages: 399285 nosy: iritkatriel priority: normal severity: normal status: open title: Deprecate Py_TRASHCAN_SAFE_BEGIN/END versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 15:03:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 19:03:16 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1628535796.39.0.0346688534507.issue44874@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +lukasz.langa, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 15:03:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 19:03:52 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1628535832.29.0.481243874848.issue44874@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26179 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27693 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 15:14:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 19:14:17 +0000 Subject: [issue22330] PyOS_mystricmp is broken In-Reply-To: <1409735069.35.0.121112016094.issue22330@psf.upfronthosting.co.za> Message-ID: <1628536457.21.0.122533647817.issue22330@roundup.psfhosted.org> Irit Katriel added the comment: This was fixed under Issue 41524. ---------- nosy: +iritkatriel resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> PyOS_mystricmp advances pointers too far _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 15:30:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 19:30:03 +0000 Subject: [issue7615] unicode_escape codec does not escape quotes In-Reply-To: <1262316507.32.0.63969926675.issue7615@psf.upfronthosting.co.za> Message-ID: <1628537403.67.0.395812476288.issue7615@roundup.psfhosted.org> Irit Katriel added the comment: Looks like this has been fixed by now: >>> print(u'a\'b"c\'\'\'d"""e'.encode('unicode_escape')) b'a\'b"c\'\'\'d"""e' Let me know if there is a reason not to close this issue. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 15:45:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 09 Aug 2021 19:45:44 +0000 Subject: [issue7615] unicode_escape codec does not escape quotes In-Reply-To: <1262316507.32.0.63969926675.issue7615@psf.upfronthosting.co.za> Message-ID: <1628538344.3.0.68870049672.issue7615@roundup.psfhosted.org> Serhiy Storchaka added the comment: Nothing was changed. Backslashes in your output are backslashes in the bytes object repr. >>> print('a\'b"c\'\'\'d"""e'.encode('unicode_escape').decode()) a'b"c'''d"""e ---------- nosy: +serhiy.storchaka status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 16:06:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 20:06:19 +0000 Subject: [issue7615] unicode_escape codec does not escape quotes In-Reply-To: <1262316507.32.0.63969926675.issue7615@psf.upfronthosting.co.za> Message-ID: <1628539579.18.0.0335046467683.issue7615@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: out of date -> versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.6, Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 16:57:37 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 09 Aug 2021 20:57:37 +0000 Subject: [issue44859] Improve some sqlite3 errors In-Reply-To: <1628345656.7.0.124562565005.issue44859@roundup.psfhosted.org> Message-ID: <1628542657.5.0.0808245701537.issue44859@roundup.psfhosted.org> Erlend E. Aasland added the comment: Also, for SQLite 3.7.17 and above, we should raise sqlite3.Warning for error codes SQLITE_NOTICE and SQLITE_WARNING. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 17:01:35 2021 From: report at bugs.python.org (Mateusz Piotrowski) Date: Mon, 09 Aug 2021 21:01:35 +0000 Subject: [issue29077] build failure when enabling dtrace on FreeBSD In-Reply-To: <1482779942.39.0.346100216113.issue29077@psf.upfronthosting.co.za> Message-ID: <1628542895.48.0.45261963028.issue29077@roundup.psfhosted.org> Change by Mateusz Piotrowski <0mp at FreeBSD.org>: ---------- nosy: +0mp versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 17:03:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 21:03:07 +0000 Subject: [issue33426] [doc] Behavior of os.path.join does not match documentation In-Reply-To: <1525459146.45.0.682650639539.issue33426@psf.upfronthosting.co.za> Message-ID: <1628542987.38.0.239855465941.issue33426@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: Behavior of os.path.join does not match documentation -> [doc] Behavior of os.path.join does not match documentation versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 17:51:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 21:51:18 +0000 Subject: [issue14853] test_file.py depends on sys.stdin being unseekable In-Reply-To: <1337367006.89.0.99847274779.issue14853@psf.upfronthosting.co.za> Message-ID: <1628545878.8.0.218077079909.issue14853@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +iritkatriel nosy_count: 7.0 -> 8.0 pull_requests: +26180 pull_request: https://github.com/python/cpython/pull/27694 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 17:52:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 21:52:38 +0000 Subject: [issue14853] test_file.py depends on sys.stdin being unseekable In-Reply-To: <1337367006.89.0.99847274779.issue14853@psf.upfronthosting.co.za> Message-ID: <1628545958.25.0.684642571068.issue14853@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:04:06 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 09 Aug 2021 22:04:06 +0000 Subject: [issue44859] Improve some sqlite3 errors In-Reply-To: <1628345656.7.0.124562565005.issue44859@roundup.psfhosted.org> Message-ID: <1628546646.16.0.218388479879.issue44859@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26181 pull_request: https://github.com/python/cpython/pull/27695 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:33:48 2021 From: report at bugs.python.org (George King) Date: Mon, 09 Aug 2021 22:33:48 +0000 Subject: [issue44875] Update dis.findlinestarts documentaiton to reflect new usage of `co_lines` (PEP 626) Message-ID: <1628548428.41.0.569263847778.issue44875@roundup.psfhosted.org> New submission from George King : `dis.findlinestarts()` has been changed to use the no `co_lines()` function. (Blame indicates commit 877df851c3e by Mark Shannon.) However the docs currently state that it uses the older `co_firstlineno` and `co_lnotab`: https://docs.python.org/3.10/library/dis.html#dis.findlinestarts. My cursory understanding of `dis.py` internals is that `get_instructions` relies on `findlinestarts`, implying that both of these APIs are going to return different line numbers than they did previously. I am perfectly fine with this, and hopeful that the PEP 626 changes will improve tool accuracy. At minimum the `dis` docs should be updated. I also suggest that some kind of note about this be added to the PEP 626 text, because the way it reads now suggests that it avoids breakage by creating the new `co_lines` API. However it seems that users of the higher level dis APIs are going to see subtly different behavior. FWIW I am fine with the change, and I hope this doesn't instigate a reversion to the old behavior. `lnotabs` semantics were very cryptic and seemed rather broken when I attempted to use it years ago. I am revisiting an experimental code coverage tool in part because of the PEP. ---------- assignee: docs at python components: Documentation messages: 399290 nosy: Mark.Shannon, docs at python, gwk priority: normal severity: normal status: open title: Update dis.findlinestarts documentaiton to reflect new usage of `co_lines` (PEP 626) versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:34:38 2021 From: report at bugs.python.org (George King) Date: Mon, 09 Aug 2021 22:34:38 +0000 Subject: [issue44875] Update dis.findlinestarts documentaiton to reflect new usage of `co_lines` (PEP 626) In-Reply-To: <1628548428.41.0.569263847778.issue44875@roundup.psfhosted.org> Message-ID: <1628548478.97.0.369160626164.issue44875@roundup.psfhosted.org> George King added the comment: I should also mention that my reading was not exhaustive, so there may be other docs that need updating as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:35:06 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 22:35:06 +0000 Subject: [issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes In-Reply-To: <1595786356.19.0.0772009953039.issue41402@roundup.psfhosted.org> Message-ID: <1628548506.25.0.227604363488.issue41402@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 395f4c7fbfb89b8724a4abf84410b5e1e374932d by Miss Islington (bot) in branch '3.9': bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631) (GH-27687) https://github.com/python/cpython/commit/395f4c7fbfb89b8724a4abf84410b5e1e374932d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:35:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 09 Aug 2021 22:35:55 +0000 Subject: [issue39498] Signpost security considerations in library In-Reply-To: <1580361272.17.0.099312904306.issue39498@roundup.psfhosted.org> Message-ID: <1628548555.83.0.730747675878.issue39498@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c5c5326d4799fe4ae566aff32ed3461af95859cc by Anthony Shaw in branch 'main': bpo-39498 Start linking the security warnings in the stdlib modules (GH-18272) https://github.com/python/cpython/commit/c5c5326d4799fe4ae566aff32ed3461af95859cc ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:36:20 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 22:36:20 +0000 Subject: [issue39498] Signpost security considerations in library In-Reply-To: <1580361272.17.0.099312904306.issue39498@roundup.psfhosted.org> Message-ID: <1628548580.09.0.883959230359.issue39498@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26182 pull_request: https://github.com/python/cpython/pull/27696 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:38:35 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 22:38:35 +0000 Subject: [issue14853] test_file.py depends on sys.stdin being unseekable In-Reply-To: <1337367006.89.0.99847274779.issue14853@psf.upfronthosting.co.za> Message-ID: <1628548715.13.0.757200069.issue14853@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26183 pull_request: https://github.com/python/cpython/pull/27697 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:38:40 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 22:38:40 +0000 Subject: [issue14853] test_file.py depends on sys.stdin being unseekable In-Reply-To: <1337367006.89.0.99847274779.issue14853@psf.upfronthosting.co.za> Message-ID: <1628548720.48.0.991507605094.issue14853@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26184 pull_request: https://github.com/python/cpython/pull/27698 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:38:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 09 Aug 2021 22:38:29 +0000 Subject: [issue14853] test_file.py depends on sys.stdin being unseekable In-Reply-To: <1337367006.89.0.99847274779.issue14853@psf.upfronthosting.co.za> Message-ID: <1628548709.65.0.403426530346.issue14853@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 8ed183391241f0c73e7ba7f42b1d49fc02985f7b by Irit Katriel in branch 'main': bpo-14853: add back the stdin test, skip if stdin is redirected (GH-27694) https://github.com/python/cpython/commit/8ed183391241f0c73e7ba7f42b1d49fc02985f7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:39:26 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 22:39:26 +0000 Subject: [issue39498] Signpost security considerations in library In-Reply-To: <1580361272.17.0.099312904306.issue39498@roundup.psfhosted.org> Message-ID: <1628548766.22.0.911566708541.issue39498@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26185 pull_request: https://github.com/python/cpython/pull/27699 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 18:58:31 2021 From: report at bugs.python.org (Joel Gibson) Date: Mon, 09 Aug 2021 22:58:31 +0000 Subject: [issue44876] .replace functions in datetime do not call __new__ Message-ID: <1628549911.12.0.643069299871.issue44876@roundup.psfhosted.org> New submission from Joel Gibson : I've come here while investigating a segfault when datetime.replace(...) was called with a Pandas Timestamp object: https://github.com/pandas-dev/pandas/issues/42305 The Python implementation of datetime.replace https://github.com/python/cpython/blob/03e5647ab07c7d2a05094fc3b5ed6eba6fc01349/Lib/datetime.py#L1823 is polymorphic, in the sense that if a custom object like pd.Timestamp is passed in, a pd.Timestamp will come out rather than a datetime. This works just fine (copying and using Python code makes this segfault disappear). The C implementation is also polymorphic https://github.com/python/cpython/blob/03e5647ab07c7d2a05094fc3b5ed6eba6fc01349/Modules/_datetimemodule.c#L5845 but I think that something in the C implementation is wrong: eventually tp_alloc gets called for the passed type, but never tp_new, and then afterwards the custom type is treated just like a regular datetime. In the pd.Timestamp case, there are some extra fields that only get set in the __new__ method, leading to a segfault later when they're accessed. I'm not familiar enough with the C/CPython interface (especially object setup and initialisation) to tell where a fix for this should go, I would assume that the line https://github.com/python/cpython/blob/03e5647ab07c7d2a05094fc3b5ed6eba6fc01349/Modules/_datetimemodule.c#L5872 should be replaced by a call to PyObject_new(Py_TYPE(self), ...), or something similar. This also affects date.replace and time.replace. ---------- components: Library (Lib) messages: 399295 nosy: joelgibson priority: normal severity: normal status: open title: .replace functions in datetime do not call __new__ type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 19:37:14 2021 From: report at bugs.python.org (Quellyn Snead) Date: Mon, 09 Aug 2021 23:37:14 +0000 Subject: [issue44877] Python > 3.7 build fails with IBM XL compiler Message-ID: <1628552233.98.0.792897981293.issue44877@roundup.psfhosted.org> New submission from Quellyn Snead : Python 3.8 and above fails to build with the IBM XL compiler on Power9 platforms. ## System and Environment Information ``` $ arch ppc64le ``` ``` $ echo $CC xlc -F/projects/opt/ppc64le/ibm/xlc-16.1.1.7/xlC/16.1.1/etc/xlc.cfg.rhel.7.8.gcc.8.3.0.cuda.10.1 ``` ``` $ xlc --version IBM XL C/C++ for Linux, V16.1.1 (5725-C73, 5765-J13) Version: 16.01.0001.0007 ``` ## Test Procedure ``` $ git clone git at github.com:quellyn/cpython.git $ cd cpython $ checkout 3.8 $ ./configure --with-pydebug $ make -j2 | tee -a make.out ``` I tested for 3.7, 3.8, 3.9, 3.10, and master. In all cases the `make` failed for versions 3.8+. I've attached both the `config.log` and the make output logs for all. - Power9 architecture (ppc64le) - IBM XL C/C++ 16.1.1.7 Python 3.7 builds without issue. ---------- components: Installation files: cpython.tar.gz messages: 399296 nosy: quellyn priority: normal severity: normal status: open title: Python > 3.7 build fails with IBM XL compiler type: compile error versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50207/cpython.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 19:44:25 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 09 Aug 2021 23:44:25 +0000 Subject: [issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes In-Reply-To: <1595786356.19.0.0772009953039.issue41402@roundup.psfhosted.org> Message-ID: <1628552665.85.0.852855373549.issue41402@roundup.psfhosted.org> miss-islington added the comment: New changeset a3185da26f8c818907c297d92c533deaa96f40fd by Miss Islington (bot) in branch '3.10': bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631) https://github.com/python/cpython/commit/a3185da26f8c818907c297d92c533deaa96f40fd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 20:00:57 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 10 Aug 2021 00:00:57 +0000 Subject: [issue36700] base64 has old references that should be updated In-Reply-To: <1555957992.77.0.818777064587.issue36700@roundup.psfhosted.org> Message-ID: <1628553657.32.0.490481275409.issue36700@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 4.0 -> 5.0 pull_requests: +26186 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27700 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 9 21:27:06 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 10 Aug 2021 01:27:06 +0000 Subject: [issue32884] Adding the ability for getpass to print asterisks when password is typed In-Reply-To: <1519122533.37.0.467229070634.issue32884@psf.upfronthosting.co.za> Message-ID: <1628558826.62.0.484177276338.issue32884@roundup.psfhosted.org> Andrei Kulakov added the comment: Unfortunately modern laptop keyboards have almost no key travel and barely any tactile feedback [*]. Users on such keyboards really do need feedback for each key pressed. Not providing an option for such feedback is in effect forcing users to choose maximally weak password. [*] worse, a large proportion of MBP keyboards produced in the last few years have the notoriously bad 'butterfly' key design that occasionally duplicates and swallows keypresses. Yes, a trillion dollar company can't make a functional keyboard. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 03:51:36 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 07:51:36 +0000 Subject: [issue39498] Signpost security considerations in library In-Reply-To: <1580361272.17.0.099312904306.issue39498@roundup.psfhosted.org> Message-ID: <1628581896.06.0.0299735629181.issue39498@roundup.psfhosted.org> miss-islington added the comment: New changeset d657da8155cc9611b901ea052f3eac28f99122b4 by Miss Islington (bot) in branch '3.10': bpo-39498 Start linking the security warnings in the stdlib modules (GH-18272) https://github.com/python/cpython/commit/d657da8155cc9611b901ea052f3eac28f99122b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 03:51:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 07:51:37 +0000 Subject: [issue39498] Signpost security considerations in library In-Reply-To: <1580361272.17.0.099312904306.issue39498@roundup.psfhosted.org> Message-ID: <1628581897.72.0.749021597186.issue39498@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset fcbe8c63d78b5dd59470b5808d898b87d8ba0350 by Miss Islington (bot) in branch '3.9': bpo-39498 Start linking the security warnings in the stdlib modules (GH-18272) (GH-27699) https://github.com/python/cpython/commit/fcbe8c63d78b5dd59470b5808d898b87d8ba0350 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 03:52:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 07:52:07 +0000 Subject: [issue39498] Signpost security considerations in library In-Reply-To: <1580361272.17.0.099312904306.issue39498@roundup.psfhosted.org> Message-ID: <1628581927.62.0.623351465438.issue39498@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 03:52:58 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 07:52:58 +0000 Subject: [issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes In-Reply-To: <1595786356.19.0.0772009953039.issue41402@roundup.psfhosted.org> Message-ID: <1628581978.46.0.0388231160035.issue41402@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Johannes! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 03:55:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 07:55:49 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628582149.4.0.11574129811.issue44872@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b019ffed5debb13358a946a8e2d20594c7c181f3 by Irit Katriel in branch '3.8': bpo-44872: use new trashcan macros in framobject.c (GH-27683) (GH-27692) https://github.com/python/cpython/commit/b019ffed5debb13358a946a8e2d20594c7c181f3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 03:55:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 07:55:46 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628582146.03.0.189598372669.issue44872@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ede1dc416de5eece02170e03387dc8496c2d00ae by Irit Katriel in branch '3.9': bpo-44872: use new trashcan macros in framobject.c (GH-27683) (GH-27691) https://github.com/python/cpython/commit/ede1dc416de5eece02170e03387dc8496c2d00ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 03:56:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 07:56:18 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628582178.13.0.768161060179.issue44872@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e9ec71ad2c7a1c83f03e172ba7c9f534912b8ba6 by Irit Katriel in branch '3.10': bpo-44872: use new trashcan macros in framobject.c (GH-27683) (GH-27690) https://github.com/python/cpython/commit/e9ec71ad2c7a1c83f03e172ba7c9f534912b8ba6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 03:56:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 07:56:46 +0000 Subject: [issue44872] FrameObject uses the old trashcan macros In-Reply-To: <1628525533.23.0.954402533507.issue44872@roundup.psfhosted.org> Message-ID: <1628582206.33.0.402162742493.issue44872@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Irit! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 04:19:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 08:19:41 +0000 Subject: [issue33349] 2to3 fails to parse async generators in non-async functions In-Reply-To: <1524574965.95.0.682650639539.issue33349@psf.upfronthosting.co.za> Message-ID: <1628583581.29.0.035400735432.issue33349@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 04:31:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 08:31:09 +0000 Subject: [issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library In-Reply-To: <1524445447.99.0.682650639539.issue33337@psf.upfronthosting.co.za> Message-ID: <1628584269.25.0.570711857078.issue33337@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- Removed message: https://bugs.python.org/msg374253 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:00:11 2021 From: report at bugs.python.org (Ivan Marton) Date: Tue, 10 Aug 2021 09:00:11 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1628586011.3.0.535246252938.issue40469@roundup.psfhosted.org> Ivan Marton added the comment: The assumed behaviour of TimedRotatingFileHandler is to rotate log files older than configured. Even when the script is executed multiple times. self.rolloverAt (the variable that defines when the rollover should be performed) is set after each rollover and right after initializing the file handler instance. If the instance is initialized once (like in your script) and a rollover is performed without having the object destroyed, the logger works fine, the rollover is done and the next round is scheduled properly. The case is not so lucky if the script runs multiple time or the logger itself is initialized multiple times during one execution. In this case, since the MTIME is read each time when the TimedRotatingFileHandler's init is called, and the file is modified (by having a new line added to the end of the file). The next execution will read the new MTIME and will never perform any rollover. I've slightly modified your example script to demonstrate these use-cases. Example 1: Log a single line with the script, but execute it multiple times with delays between the execution! In bash: for i in {1..101}; do python log_40469_single.py $i; sleep 30; done Example 2: Log multiple lines, but reinitiate the logger object between the events! See log_40469_new_instance.py ---------- Added file: https://bugs.python.org/file50208/log_40469_new_instance.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:00:20 2021 From: report at bugs.python.org (Ivan Marton) Date: Tue, 10 Aug 2021 09:00:20 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1628586020.63.0.214351058296.issue40469@roundup.psfhosted.org> Change by Ivan Marton : Added file: https://bugs.python.org/file50209/log_40469_single.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:12:41 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 10 Aug 2021 09:12:41 +0000 Subject: [issue44877] Python > 3.7 build fails with IBM XL compiler In-Reply-To: <1628552233.98.0.792897981293.issue44877@roundup.psfhosted.org> Message-ID: <1628586761.6.0.388714457797.issue44877@roundup.psfhosted.org> Eric V. Smith added the comment: Rather than have us wading through all of the output, can you summarize the problem? After a brief look I don't see any actual compiler errors. In make.out_3.9, at least, it looks like "generate-posix-vars failed", but I can't see why. What does ./python -E -S -m sysconfig --generate-posix-vars produce? Also, I'm not sure what the ".9" and ".10" files are supposed to be. Maybe accidentally included? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:32:36 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 09:32:36 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1628587956.71.0.70066331468.issue33479@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26188 pull_request: https://github.com/python/cpython/pull/27705 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:32:25 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 09:32:25 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1628587945.07.0.130895730097.issue33479@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6b37d0d5300813de31d66df1c77dad7e1027e4d8 by Terry Jan Reedy in branch 'main': bpo-33479: Remove unqualified tkinter threadsafe claim. (GH-6990) https://github.com/python/cpython/commit/6b37d0d5300813de31d66df1c77dad7e1027e4d8 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:33:03 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 09:33:03 +0000 Subject: [issue33349] 2to3 fails to parse async generators in non-async functions In-Reply-To: <1524574965.95.0.682650639539.issue33349@psf.upfronthosting.co.za> Message-ID: <1628587983.67.0.246296939123.issue33349@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26190 pull_request: https://github.com/python/cpython/pull/27703 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:32:58 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 09:32:58 +0000 Subject: [issue33349] 2to3 fails to parse async generators in non-async functions In-Reply-To: <1524574965.95.0.682650639539.issue33349@psf.upfronthosting.co.za> Message-ID: <1628587978.56.0.803088846824.issue33349@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26189 pull_request: https://github.com/python/cpython/pull/27702 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:32:30 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 09:32:30 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1628587950.7.0.947285331847.issue33479@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26187 pull_request: https://github.com/python/cpython/pull/27704 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:36:19 2021 From: report at bugs.python.org (Mateusz Piotrowski) Date: Tue, 10 Aug 2021 09:36:19 +0000 Subject: [issue29077] build failure when enabling dtrace on FreeBSD In-Reply-To: <1482779942.39.0.346100216113.issue29077@psf.upfronthosting.co.za> Message-ID: <1628588179.95.0.48499357144.issue29077@roundup.psfhosted.org> Mateusz Piotrowski <0mp at FreeBSD.org> added the comment: Patch for the FreeBSD Ports to fix the build failure: https://reviews.freebsd.org/D31489 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:37:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 09:37:33 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628588253.78.0.66832182256.issue25782@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d5c217475c4957a8084ac3f92ae012ece5edc7cb by Irit Katriel in branch 'main': bpo-25782: avoid hang in PyErr_SetObject when current exception has a cycle in its context chain (GH-27626) https://github.com/python/cpython/commit/d5c217475c4957a8084ac3f92ae012ece5edc7cb ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:37:35 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 09:37:35 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628588255.1.0.645950727043.issue25782@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 14.0 -> 15.0 pull_requests: +26191 pull_request: https://github.com/python/cpython/pull/27706 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:37:41 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 09:37:41 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628588261.06.0.527463000101.issue25782@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26192 pull_request: https://github.com/python/cpython/pull/27707 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:51:22 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 10 Aug 2021 09:51:22 +0000 Subject: [issue44826] Specialize STORE_ATTR using PEP 659 machinery. In-Reply-To: <1628073282.4.0.475634168415.issue44826@roundup.psfhosted.org> Message-ID: <1628589082.21.0.683492358291.issue44826@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +26193 pull_request: https://github.com/python/cpython/pull/27708 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:55:13 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 09:55:13 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1628589313.73.0.208173189992.issue33479@roundup.psfhosted.org> miss-islington added the comment: New changeset 2e1fef541c4a0a227af7bf1b59bfbccd3fb1a45e by Miss Islington (bot) in branch '3.10': bpo-33479: Remove unqualified tkinter threadsafe claim. (GH-6990) https://github.com/python/cpython/commit/2e1fef541c4a0a227af7bf1b59bfbccd3fb1a45e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 05:58:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 09:58:09 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1628589489.03.0.935315175193.issue33479@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c7dfbd2f413eb76cdbd44f44d698e9a399fdcbd5 by Miss Islington (bot) in branch '3.9': bpo-33479: Remove unqualified tkinter threadsafe claim. (GH-6990) (GH-27705) https://github.com/python/cpython/commit/c7dfbd2f413eb76cdbd44f44d698e9a399fdcbd5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 06:24:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 10 Aug 2021 10:24:26 +0000 Subject: [issue32750] lib2to3 log_error method behavior is inconsitent with documentation In-Reply-To: <1517596667.28.0.467229070634.issue32750@psf.upfronthosting.co.za> Message-ID: <1628591066.84.0.98418770543.issue32750@roundup.psfhosted.org> Irit Katriel added the comment: If I understand correctly, this is not about an observed bug but about a confusion about which log_error function is being called. Can we close this or is there something to do here? ---------- nosy: +iritkatriel resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 06:25:06 2021 From: report at bugs.python.org (Mateusz Piotrowski) Date: Tue, 10 Aug 2021 10:25:06 +0000 Subject: [issue32599] Add dtrace hook for PyCFunction_Call In-Reply-To: <1516383576.04.0.467229070634.issue32599@psf.upfronthosting.co.za> Message-ID: <1628591106.1.0.0589837652893.issue32599@roundup.psfhosted.org> Change by Mateusz Piotrowski <0mp at FreeBSD.org>: ---------- nosy: +0mp _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 06:28:57 2021 From: report at bugs.python.org (meowmeowcat) Date: Tue, 10 Aug 2021 10:28:57 +0000 Subject: [issue39658] Include user scripts folder to PATH on Windows In-Reply-To: <1581891148.96.0.449800548141.issue39658@roundup.psfhosted.org> Message-ID: <1628591337.13.0.392978096349.issue39658@roundup.psfhosted.org> Change by meowmeowcat : ---------- components: +Windows -Installation nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 06:49:19 2021 From: report at bugs.python.org (meowmeowcat) Date: Tue, 10 Aug 2021 10:49:19 +0000 Subject: [issue39658] Include user scripts folder to PATH on Windows In-Reply-To: <1581891148.96.0.449800548141.issue39658@roundup.psfhosted.org> Message-ID: <1628592559.17.0.402712612897.issue39658@roundup.psfhosted.org> Change by meowmeowcat : ---------- nosy: +meowmeowmeowcat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 07:09:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 11:09:03 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628593743.88.0.954962470592.issue25782@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6f4cdeddb97532144f93ca37b8b21451f445c7bf by Miss Islington (bot) in branch '3.9': bpo-25782: avoid hang in PyErr_SetObject when current exception has a cycle in its context chain (GH-27626) (GH-27707) https://github.com/python/cpython/commit/6f4cdeddb97532144f93ca37b8b21451f445c7bf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 07:11:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Aug 2021 11:11:00 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1628593860.62.0.895308613487.issue44860@roundup.psfhosted.org> STINNER Victor added the comment: sys.platlibdir was introduced to install libraries in /usr/lib64 rather than /usr/lib. I'm not sure if it should be used to install libraries in $HOME/.local/lib64 rather than $HOME/.local/lib. Previously, Fedora already used $HOME/.local/lib and $HOME/.local/lib64 is not in the sys.path. Does the site module add $HOME/.local/lib64 to sys.path if it exists? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 07:28:26 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Tue, 10 Aug 2021 11:28:26 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1628594906.82.0.196284791401.issue44860@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 08:10:15 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Tue, 10 Aug 2021 12:10:15 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1628597415.98.0.497418419427.issue44860@roundup.psfhosted.org> Tzu-ping Chung added the comment: > I'm not sure if it should be used to install libraries in $HOME/.local/lib64 rather than $HOME/.local/lib. Previously, Fedora already used $HOME/.local/lib and $HOME/.local/lib64 is not in the sys.path. This was also briefly discussed in bpo-1294959, but did not go through since ?changing posix_user should have no impact on end users?. > Does the site module add $HOME/.local/lib64 to sys.path if it exists? It does not, only lib is checked right now. https://github.com/python/cpython/blob/c7ea1e3dcea6fbc9842463ce2b785b43501b1eaa/Lib/site.py#L288-L298 ---- There are two possible solutions from what I can tell. We could just make posix_user match posix_prefix and always respect sys.platlibdir. This could be confusing to existing Python 3.9 users however since many of them already pip-installed things into ~/.local/lib and this would make their user-site packages split in two locations. The other would be to restore the pre-3.9 behaviour in sysconfig to use lib instead of depending on sys.platlibdir. I don?t know who uses sysconfig right now and can?t say what would break, but for pip this would be less disruptive since it currently installs things into ~/.local/ib (provided by distutils). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 08:41:18 2021 From: report at bugs.python.org (Andre Roberge) Date: Tue, 10 Aug 2021 12:41:18 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1628599278.63.0.0758590477133.issue34013@roundup.psfhosted.org> Andre Roberge added the comment: Python 3.10.0rc1 ... >>> print hello world! File "", line 1 print hello world! ^^^^^^^^^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma? The hint given is not exactly helpful ... (This example was in a discussion on Twitter https://twitter.com/cfbolz/status/1425036431974715400 about a previous handling of this invalid syntax case where it was mentioned that pypy verifies that the suggestion it makes actually yields syntactically valid code.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 08:47:46 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Tue, 10 Aug 2021 12:47:46 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1628599666.87.0.40404300908.issue44860@roundup.psfhosted.org> Miro Hron?ok added the comment: Installing to ~/.local/lib works, installing to ~/.local/lib64 breaks things, as it is not on sys.path. I agree that restoring the pre-3.9 behavior in sysconfig to use lib instead of depending on sys.platlibdir is a better fix, at least for 3.9 and 3.10. We can redesign things in 3.11 (but I wouldn't). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 08:51:26 2021 From: report at bugs.python.org (meowmeowcat) Date: Tue, 10 Aug 2021 12:51:26 +0000 Subject: [issue40899] Document exceptions raised by importlib.import In-Reply-To: <1591528094.81.0.814829435189.issue40899@roundup.psfhosted.org> Message-ID: <1628599886.75.0.242700204419.issue40899@roundup.psfhosted.org> Change by meowmeowcat : ---------- keywords: +patch nosy: +meowmeowmeowcat nosy_count: 3.0 -> 4.0 pull_requests: +26194 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27709 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 08:52:40 2021 From: report at bugs.python.org (meowmeowcat) Date: Tue, 10 Aug 2021 12:52:40 +0000 Subject: [issue40899] Document exceptions raised by importlib.import In-Reply-To: <1591528094.81.0.814829435189.issue40899@roundup.psfhosted.org> Message-ID: <1628599960.14.0.846766454621.issue40899@roundup.psfhosted.org> meowmeowcat added the comment: Thanks! I've opened a PR for this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 08:58:43 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 10 Aug 2021 12:58:43 +0000 Subject: [issue40899] Document exceptions raised by importlib.import In-Reply-To: <1591528094.81.0.814829435189.issue40899@roundup.psfhosted.org> Message-ID: <1628600323.8.0.95567449739.issue40899@roundup.psfhosted.org> Ronald Oussoren added the comment: Note that importlib.import_module, and the import statement itself, can raise an arbitrary exception when that exception is raised while executing the module body. This is easily observed by creating a module that just raises an error in its body: # t.py 1/0 # EOF ``importlib.import_module("t")`` will raise ZeroDivisionError. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 09:10:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 13:10:01 +0000 Subject: [issue14853] test_file.py depends on sys.stdin being unseekable In-Reply-To: <1337367006.89.0.99847274779.issue14853@psf.upfronthosting.co.za> Message-ID: <1628601001.52.0.374967084588.issue14853@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 897c87045c7435254fd330c6ea48204f056e4afc by Miss Islington (bot) in branch '3.9': bpo-14853: add back the stdin test, skip if stdin is redirected (GH-27694) (GH-27698) https://github.com/python/cpython/commit/897c87045c7435254fd330c6ea48204f056e4afc ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 09:11:30 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 10 Aug 2021 13:11:30 +0000 Subject: [issue44869] MacOS Monterrey malloc issue In-Reply-To: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> Message-ID: <1628601090.12.0.821153628082.issue44869@roundup.psfhosted.org> Ronald Oussoren added the comment: I'm afraid we cannot do a lot with the information you provided. I've just ran a full test run for a copy of 3.10rc1 installed using the universal2 installer and that doesn't have problem. One way to find more information about what's going on is to use fault handler (e.g. PYTHONFAULTHANDLER=1 python3.10 ...), although that will just print a Python stack trace when the executable crashes. Alternatively use a debugger to look at the C stack. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 09:15:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 10 Aug 2021 13:15:04 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1628601304.49.0.614271519859.issue34013@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: If we change the priority of the error messages, which is unclear if is easily possible, the error will suggest that print hello should be parenthesized as print (hello) Which if corrected will leave the "world" part out as a call followed to a name, and here the comma suggestion is a valid concern. I understand the willingness to have a better error here, but I am not sure what we can improve here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 09:42:38 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 10 Aug 2021 13:42:38 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. Message-ID: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> New submission from Mark Shannon : On entering the interpreter (_PyEval_EvalFrameDefault) we need to check for tracing in order to record the call. However, we don't do this cleanly resulting in slow dispatch to the non-quickened instruction on every call/next. ---------- assignee: Mark.Shannon messages: 399324 nosy: Mark.Shannon priority: normal severity: normal status: open title: Clumsy dispatching on interpreter entry. type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 09:47:27 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 13:47:27 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628603246.99.0.906923716211.issue25782@roundup.psfhosted.org> miss-islington added the comment: New changeset d86bbe3cff0abefc13e5462cca1fb3344d4a5b52 by Miss Islington (bot) in branch '3.10': bpo-25782: avoid hang in PyErr_SetObject when current exception has a cycle in its context chain (GH-27626) https://github.com/python/cpython/commit/d86bbe3cff0abefc13e5462cca1fb3344d4a5b52 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 09:51:04 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Tue, 10 Aug 2021 13:51:04 +0000 Subject: [issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user In-Reply-To: <1628346558.35.0.0800108572532.issue44860@roundup.psfhosted.org> Message-ID: <1628603464.04.0.242327841217.issue44860@roundup.psfhosted.org> Tzu-ping Chung added the comment: I?ve updated the linked PR to change sysconfig instead to not use sys.platlibdir when generating the posix_user scheme. This means posix_user would behave the same in 3.9+ as 3.8 and prior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 09:58:48 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 10 Aug 2021 13:58:48 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1628603928.13.0.278853219146.issue44524@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +26195 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27710 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 10:28:16 2021 From: report at bugs.python.org (chen-y0y0) Date: Tue, 10 Aug 2021 14:28:16 +0000 Subject: [issue44879] How to insert newline characters as normal characters while input()? Message-ID: <1628605696.03.0.149874041325.issue44879@roundup.psfhosted.org> New submission from chen-y0y0 : # ? know, if ? press enter key while input(), the method will be completed and return a str value. # ? am trying to insert newline characters as normal characters while input() method. # The ?normal characters? means: # 1. It can be deleted by backspace(?\x7b?) or EOF or delete key. # 2. It can be interprered as a normal byte. # ? tried by the readline module, it did work. But it may crash, like: # Traceback (most recent call last): # File "", line 1, in # SyntaxError: multiple statements found while compiling a single statement ---------- components: Argument Clinic, FreeBSD, IO, Interpreter Core, Windows messages: 399327 nosy: koobs, larry, paul.moore, prasechen, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: How to insert newline characters as normal characters while input()? type: crash versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 10:28:29 2021 From: report at bugs.python.org (meowmeowcat) Date: Tue, 10 Aug 2021 14:28:29 +0000 Subject: [issue40899] Document exceptions raised by importlib.import In-Reply-To: <1591528094.81.0.814829435189.issue40899@roundup.psfhosted.org> Message-ID: <1628605709.38.0.931462689785.issue40899@roundup.psfhosted.org> meowmeowcat added the comment: Oh, I didn't realize that. Then maybe we don't need to document ImportError in https://docs.python.org/3/library/importlib.html#importlib.import_module? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 10:30:23 2021 From: report at bugs.python.org (Larry Hastings) Date: Tue, 10 Aug 2021 14:30:23 +0000 Subject: [issue44879] How to insert newline characters as normal characters while input()? In-Reply-To: <1628605696.03.0.149874041325.issue44879@roundup.psfhosted.org> Message-ID: <1628605823.06.0.107781897525.issue44879@roundup.psfhosted.org> Larry Hastings added the comment: This is not a bug, you are asking for programming help. Please don't use the Python issue tracker for programming help. You won't get any, you'll just waste people's time. ---------- components: -Argument Clinic, FreeBSD, IO, Interpreter Core, Windows nosy: -koobs, paul.moore, prasechen, steve.dower, tim.golden, zach.ware resolution: -> not a bug stage: -> resolved status: open -> closed type: crash -> versions: -Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 10:31:07 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 14:31:07 +0000 Subject: [issue14853] test_file.py depends on sys.stdin being unseekable In-Reply-To: <1337367006.89.0.99847274779.issue14853@psf.upfronthosting.co.za> Message-ID: <1628605867.79.0.423235670876.issue14853@roundup.psfhosted.org> miss-islington added the comment: New changeset 4e0147ec50aa62315c5a9aa7c88c181f57aadf42 by Miss Islington (bot) in branch '3.10': bpo-14853: add back the stdin test, skip if stdin is redirected (GH-27694) https://github.com/python/cpython/commit/4e0147ec50aa62315c5a9aa7c88c181f57aadf42 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 10:47:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 14:47:45 +0000 Subject: [issue14853] test_file.py depends on sys.stdin being unseekable In-Reply-To: <1337367006.89.0.99847274779.issue14853@psf.upfronthosting.co.za> Message-ID: <1628606865.39.0.415074699399.issue14853@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Irit! ? ? ? ---------- assignee: ezio.melotti -> iritkatriel resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 10:54:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 14:54:45 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628607285.41.0.669043435102.issue25782@roundup.psfhosted.org> ?ukasz Langa added the comment: Serhiy, I'm not closing this yet in case you'd like to finish implementing your PR. If not, feel free to close. ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 10:55:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 14:55:29 +0000 Subject: [issue33349] 2to3 fails to parse async generators in non-async functions In-Reply-To: <1524574965.95.0.682650639539.issue33349@psf.upfronthosting.co.za> Message-ID: <1628607329.35.0.963311316033.issue33349@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Zsolt! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 11:09:12 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 10 Aug 2021 15:09:12 +0000 Subject: [issue40899] Document exceptions raised by importlib.import In-Reply-To: <1591528094.81.0.814829435189.issue40899@roundup.psfhosted.org> Message-ID: <1628608152.62.0.646438036303.issue40899@roundup.psfhosted.org> Ronald Oussoren added the comment: Good question. Hopefully one of the documentation or importlib experts can chime in about that. I may also have uncovered a new issue in importlib ;-) Personally I'd say that documenting raising ImportError is still useful because that's the common exception, and an exception that's not mentioned in the rest of the documentation for importlib. That does require a careful formulation to avoid implying that this the only exception that can be raised. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 11:57:13 2021 From: report at bugs.python.org (Quellyn Snead) Date: Tue, 10 Aug 2021 15:57:13 +0000 Subject: [issue44877] Python > 3.7 build fails with IBM XL compiler In-Reply-To: <1628552233.98.0.792897981293.issue44877@roundup.psfhosted.org> Message-ID: <1628611033.9.0.52611736718.issue44877@roundup.psfhosted.org> Quellyn Snead added the comment: Hi Eric, Looks like I didn't get the full output captured before. Sorry about that. The error appears when I run the make command: ``` [quellyn at cn2020 cpython]$ make -j ./python -E -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi Fatal Python error: take_gil: NULL tstate Python runtime state: preinitialized Current thread 0x0000200000045fe0 (most recent call first): /bin/sh: line 5: 79067 Segmentation fault (core dumped) ./python -E -S -m sysconfig --generate-posix-vars generate-posix-vars failed make: *** [pybuilddir.txt] Error 1 ``` P.S. The tarball I attached before contains the configure and make output for tests on multiple python version branches. I differentiated them by adding a version identifier suffix (_3.7, _3.8, _3.9, _3.10, _3.11) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:24:09 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 10 Aug 2021 16:24:09 +0000 Subject: [issue44880] Document code.replace() Message-ID: <1628612649.5.0.768299740297.issue44880@roundup.psfhosted.org> New submission from Irit Katriel : Core.replace was added in issue37032. Needs to be documented. ---------- messages: 399336 nosy: iritkatriel, vstinner priority: normal severity: normal status: open title: Document code.replace() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:25:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 10 Aug 2021 16:25:18 +0000 Subject: [issue44880] Document code.replace() In-Reply-To: <1628612649.5.0.768299740297.issue44880@roundup.psfhosted.org> Message-ID: <1628612718.27.0.256322091094.issue44880@roundup.psfhosted.org> Irit Katriel added the comment: See https://github.com/numpy/numpy/pull/19638#issuecomment-896124351 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:25:33 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 10 Aug 2021 16:25:33 +0000 Subject: [issue44880] Document code.replace() In-Reply-To: <1628612649.5.0.768299740297.issue44880@roundup.psfhosted.org> Message-ID: <1628612733.81.0.657791995762.issue44880@roundup.psfhosted.org> Batuhan Taskaya added the comment: See: https://github.com/python/cpython/pull/17776 ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:25:34 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 10 Aug 2021 16:25:34 +0000 Subject: [issue1294959] Add sys.platlibdir and configure --with-platlibdir to use /usr/lib64 on Fedora and SuSE Message-ID: <1628612734.98.0.486539788786.issue1294959@roundup.psfhosted.org> ?ric Araujo added the comment: Follow-up: #44860 is removing platlibdir from posix_user scheme ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:31:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 16:31:08 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628613068.22.0.121321493119.issue44854@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c0ab59f7de1906feee21c057ad433fad924d1e38 by ?ukasz Langa in branch 'main': bpo-44854: Add .editorconfig file to help enforce `make patchcheck` (GH-27638) https://github.com/python/cpython/commit/c0ab59f7de1906feee21c057ad433fad924d1e38 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:38:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 10 Aug 2021 16:38:43 +0000 Subject: [issue44880] Document code.replace() In-Reply-To: <1628612649.5.0.768299740297.issue44880@roundup.psfhosted.org> Message-ID: <1628613523.55.0.648263481804.issue44880@roundup.psfhosted.org> Irit Katriel added the comment: Ah thanks. I didn?t see that. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:43:22 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 16:43:22 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628613802.74.0.0366812542118.issue44854@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26196 pull_request: https://github.com/python/cpython/pull/27714 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:43:35 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 16:43:35 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628613815.15.0.903423056839.issue44854@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26197 pull_request: https://github.com/python/cpython/pull/27712 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:44:37 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 16:44:37 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628613877.29.0.557168751268.issue44854@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26198 pull_request: https://github.com/python/cpython/pull/27713 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:48:43 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 10 Aug 2021 16:48:43 +0000 Subject: [issue39658] Include user scripts folder to PATH on Windows In-Reply-To: <1581891148.96.0.449800548141.issue39658@roundup.psfhosted.org> Message-ID: <1628614123.48.0.0738392283085.issue39658@roundup.psfhosted.org> Steve Dower added the comment: Seems reasonable, contributions welcome. I think it is not possible to add it as part of a per-machine install, since there's no way to specify a user folder in the system key (environment variables are not expanded as you might assume). ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 12:51:54 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 10 Aug 2021 16:51:54 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. In-Reply-To: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> Message-ID: <1628614314.28.0.911282117159.issue44878@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +26199 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27715 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 13:06:26 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 17:06:26 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628615186.08.0.618326562604.issue44854@roundup.psfhosted.org> miss-islington added the comment: New changeset a6808c6378ccfd732285ee20319658ac29eacf4c by Miss Islington (bot) in branch '3.10': bpo-44854: Add .editorconfig file to help enforce `make patchcheck` (GH-27638) https://github.com/python/cpython/commit/a6808c6378ccfd732285ee20319658ac29eacf4c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 13:06:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 10 Aug 2021 17:06:56 +0000 Subject: [issue44880] Document code.replace() In-Reply-To: <1628612649.5.0.768299740297.issue44880@roundup.psfhosted.org> Message-ID: <1628615216.41.0.672182142892.issue44880@roundup.psfhosted.org> STINNER Victor added the comment: It's documented at: https://docs.python.org/dev/library/types.html#types.CodeType.replace ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 13:09:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 17:09:03 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628615343.02.0.668518334275.issue44854@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7f88aeadc19b1d3ece4723efb240e6d6753570b9 by Miss Islington (bot) in branch '3.8': bpo-44854: Add .editorconfig file to help enforce `make patchcheck` (GH-27638) (GH-27713) https://github.com/python/cpython/commit/7f88aeadc19b1d3ece4723efb240e6d6753570b9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 13:22:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 17:22:23 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628616143.83.0.15770817731.issue44854@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d27e2f4d118e7a9909b6a3e5da06c5ff95806a85 by Miss Islington (bot) in branch '3.9': bpo-44854: Add .editorconfig file to help enforce `make patchcheck` (GH-27638) (GH-27714) https://github.com/python/cpython/commit/d27e2f4d118e7a9909b6a3e5da06c5ff95806a85 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 13:24:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 10 Aug 2021 17:24:08 +0000 Subject: [issue44854] Add .editorconfig to the root directory In-Reply-To: <1628275042.37.0.932347169049.issue44854@roundup.psfhosted.org> Message-ID: <1628616248.79.0.0449325507379.issue44854@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks everybody for review! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 13:48:35 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 10 Aug 2021 17:48:35 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1628617715.76.0.287351128555.issue39452@roundup.psfhosted.org> Jack DeVries added the comment: Hi All, I'm pinging everyone here on the bpo because my GitHub PR has been through a lot of revision and review. Maybe it's close to being ready to merge (I hope)! Feel free to take a look if you are interested: https://github.com/python/cpython/pull/26883 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 14:48:16 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 10 Aug 2021 18:48:16 +0000 Subject: [issue44877] Python > 3.7 build fails with IBM XL compiler In-Reply-To: <1628552233.98.0.792897981293.issue44877@roundup.psfhosted.org> Message-ID: <1628621296.06.0.906554191006.issue44877@roundup.psfhosted.org> Jack DeVries added the comment: There is a related failure message in the file name ".9" in the tarball (line 175): ./python -E -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi Fatal Python error: _PyMem_DebugMalloc: Python memory allocator called without holding the GIL Python runtime state: preinitialized Current thread 0x0000200000045fe0 (most recent call first): /bin/sh: line 5: 122035 Aborted (core dumped) ./python -E -S -m sysconfig --generate-posix-vars generate-posix-vars failed ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 14:50:28 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 10 Aug 2021 18:50:28 +0000 Subject: [issue44877] Python > 3.7 build fails with IBM XL compiler In-Reply-To: <1628552233.98.0.792897981293.issue44877@roundup.psfhosted.org> Message-ID: <1628621428.65.0.781199786265.issue44877@roundup.psfhosted.org> Eric V. Smith added the comment: > P.S. The tarball I attached before contains the configure and make output for tests on multiple python version branches. I differentiated them by adding a version identifier suffix (_3.7, _3.8, _3.9, _3.10, _3.11) I was referring to the two files named exactly ".9" and ".10", which are hidden by default by the shell, since they begin with dots. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 14:52:58 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 10 Aug 2021 18:52:58 +0000 Subject: [issue44877] Python > 3.7 build fails with IBM XL compiler In-Reply-To: <1628552233.98.0.792897981293.issue44877@roundup.psfhosted.org> Message-ID: <1628621578.37.0.424009114024.issue44877@roundup.psfhosted.org> Eric V. Smith added the comment: As to the actual problem, I think you're going to need to get out a debugger and at least get a stack trace. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 15:16:09 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 10 Aug 2021 19:16:09 +0000 Subject: [issue44877] Python > 3.7 build fails with IBM XL compiler In-Reply-To: <1628621578.37.0.424009114024.issue44877@roundup.psfhosted.org> Message-ID: Jack DeVries added the comment: I'm sure you are aware of this, but also note that the issue could be in pandas or ibm-db, which include C extensions. I'm pretty sure those are the only two dependencies you listed there that have C dependencies. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 15:17:34 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 10 Aug 2021 19:17:34 +0000 Subject: [issue44877] Python > 3.7 build fails with IBM XL compiler In-Reply-To: <1628621578.37.0.424009114024.issue44877@roundup.psfhosted.org> Message-ID: Jack DeVries added the comment: Woah, oops, nevermind! I was confusing this with a different bpo in my head. Sorry for the noise! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 15:18:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 10 Aug 2021 19:18:12 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1628623092.55.0.15228210221.issue34013@roundup.psfhosted.org> Terry J. Reedy added the comment: I think that this was properly closed after the last fix. There are multiple issues at play: 1. These parts of the Zen: "Special cases aren't special enough to break the rules. Although practicality beats purity. ... In the face of ambiguity, refuse the temptation to guess." 2. The fact that a parser only reads and checks *python* syntax, while we humans have to make a special effort to avoid semantics. The latter is especially true when the semantic is a special-case computing trope. Even if an identifier is semantically recognized as a function, its signature (call syntax) is specific to the function and is not part of python syntax. 3. The that with PEG parsing, there is no exact failure point. (Pablo just documented the PEG parser. But, Pablo, where is it? Not in HOWTO or index.) This is especially true when there are multiple errors, as in Andre's example. As long as we only had one special case hint, which depended on the semantic knowledge that 'print' is almost certainly meant to mean print with the builtin function with a known call syntax, it was fairly easy to get the hint right, and in 3.11 we still have >>> print """jsfl sf ... sjflsfj l ... sjflsjf ... sjfs fj ... sjlsfjlsjg ... """ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? But we now have more hints, and "print Hello world!" is syntactically the same as "a b c!", which gives the same error message. Even if the first identifier is recognized as a function, and parenthesis are added, the result would be syntactically identical to "print(b c!)". At this point, it is syntactically ambiguous whether the fixed argument should be a string "'b c!'" or comma list "b, c". Both are possible for print, but not all functions. The 'correct' fix on only 'obvious' when we add knowledge of the semantics 'Hello, 'world', and '!' and the history of their concatenation, 'Hello world!' (but sometimes without '!' or capitalization, or with replacing 'world'), in computing, and especially in the teaching of beginners in a particular language. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 16:25:56 2021 From: report at bugs.python.org (Mark Roseman) Date: Tue, 10 Aug 2021 20:25:56 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1628627156.37.0.705772315958.issue33479@roundup.psfhosted.org> Change by Mark Roseman : ---------- pull_requests: +26200 pull_request: https://github.com/python/cpython/pull/27717 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 16:42:01 2021 From: report at bugs.python.org (Quellyn Snead) Date: Tue, 10 Aug 2021 20:42:01 +0000 Subject: [issue44877] Python > 3.7 build fails with IBM XL compiler In-Reply-To: <1628552233.98.0.792897981293.issue44877@roundup.psfhosted.org> Message-ID: <1628628121.72.0.0607236069473.issue44877@roundup.psfhosted.org> Quellyn Snead added the comment: > As to the actual problem, I think you're going to need to get out a debugger and at least get a stack trace. Here's my attempt: $ gdb ./python GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "ppc64le-redhat-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /vast/home/quellyn/GIT/cpython/python...done. (gdb) set args -E -S -m sysconfig --generate-posix-vars (gdb) run Starting program: /vast/home/quellyn/GIT/cpython/./python -E -S -m sysconfig --generate-posix-vars [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Fatal Python error: take_gil: NULL tstate Python runtime state: preinitialized Current thread 0x0000200000045fe0 (most recent call first): Program received signal SIGSEGV, Segmentation fault. 0x00000000105a3870 in ?? () Missing separate debuginfos, use: debuginfo-install nss-softokn-freebl-3.53.1-6.el7_9.ppc64le (gdb) bt #0 0x00000000105a3870 in ?? () #1 0x000000001021c3a0 in dump_traceback (fd=2, tstate=0x105a3870, write_header=0) at Python/traceback.c:805 #2 0x000000001021c620 in _Py_DumpTracebackThreads (fd=2, interp=0x105a2b90, current_tstate=0x105a3870) at Python/traceback.c:915 #3 0x00000000101ee2ac in _Py_FatalError_DumpTracebacks (fd=2, interp=0x0, tstate=0x105a3870) at Python/pylifecycle.c:1981 #4 0x00000000101ee800 in fatal_error (prefix=0x0, msg=0x1041c7b4 "take_gil: NULL tstate", status=-1) at Python/pylifecycle.c:2159 #5 0x00000000101ee8b0 in Py_FatalError (msg=0x1041c7b4 "take_gil: NULL tstate") at Python/pylifecycle.c:2193 #6 0x000000001017ff04 in take_gil (ceval=0x1055c178 <_PyRuntime+584>, tstate=0x0) at Python/ceval_gil.h:187 #7 0x0000000010191db4 in PyEval_InitThreads () at Python/ceval.c:213 #8 0x00000000101f3490 in pycore_create_interpreter (runtime=0x1055bf30 <_PyRuntime>, config=0x105a2c40, interp_p=0x7fffffffd3c0) at Python/pylifecycle.c:550 #9 0x00000000101f35e0 in pyinit_config (runtime=0x1055bf30 <_PyRuntime>, interp_p=0x7fffffffd918, config=0x7fffffffd5f0) at Python/pylifecycle.c:674 #10 0x00000000101f3b38 in pyinit_core (runtime=0x1055bf30 <_PyRuntime>, src_config=0x7fffffffdac0, interp_p=0x7fffffffd918) at Python/pylifecycle.c:858 #11 0x00000000101f3dc4 in Py_InitializeFromConfig (config=0x7fffffffdac0) at Python/pylifecycle.c:1031 #12 0x000000001002409c in pymain_init (args=0x7fffffffde50) at Modules/main.c:78 ---Type to continue, or q to quit--- #13 0x000000001002428c in pymain_main (args=0x7fffffffde50) at Modules/main.c:710 #14 0x0000000010024394 in Py_BytesMain (argc=6, argv=0x7fffffffe2d8) at Modules/main.c:743 #15 0x0000000010021e18 in main (argc=6, argv=0x7fffffffe2d8) at ./Programs/python.c:16 (gdb) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 17:07:59 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Tue, 10 Aug 2021 21:07:59 +0000 Subject: [issue44881] Consider integration of GC_UNTRACK with TRASHCAN Message-ID: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> New submission from Neil Schemenauer : The fix for bpo-33930 includes a somewhat mysterious comment: // The Py_TRASHCAN mechanism requires that we be able to // call PyObject_GC_UnTrack twice on an object. I wonder if we can just integrate the untrack into the body of the trashcan code. Then, the explicit call to untrack in the dealloc function body can be removed. That removes the risk of incorrectly using the macro version. I suspect the reason this was not done originally is because the original trashcan mechanism did not use the GC header pointers to store objects. Now, any object that uses the trashcan *must* be a GC object. ---------- messages: 399356 nosy: nascheme priority: normal severity: normal stage: needs patch status: open title: Consider integration of GC_UNTRACK with TRASHCAN type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 17:13:16 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Tue, 10 Aug 2021 21:13:16 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628629996.73.0.740559164223.issue33930@roundup.psfhosted.org> Neil Schemenauer added the comment: I'm thinking that the explicit call to PyObject_GC_UnTrack should be made unnecessary by integrating it into the trashcan code. That way, we avoid someone else running into this kind of bug in the future. See bpo-44881. ---------- nosy: +nascheme _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 17:28:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 10 Aug 2021 21:28:41 +0000 Subject: [issue44881] Consider integration of GC_UNTRACK with TRASHCAN In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628630921.67.0.77146644625.issue44881@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: We probably will need a new set of macros because these macros are public IIRC correctly. Although as PyObject_GC_UnTrack has a check, we probably can just absorb it and let backwards compat work by being idempotent if called twice ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 17:49:40 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Tue, 10 Aug 2021 21:49:40 +0000 Subject: [issue44881] Consider integration of GC_UNTRACK with TRASHCAN In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628632180.74.0.0952306775734.issue44881@roundup.psfhosted.org> Change by Neil Schemenauer : ---------- keywords: +patch pull_requests: +26201 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27718 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 18:02:12 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Tue, 10 Aug 2021 22:02:12 +0000 Subject: [issue44881] Consider integration of GC_UNTRACK with TRASHCAN In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628632932.87.0.172171377817.issue44881@roundup.psfhosted.org> Neil Schemenauer added the comment: Extensions that call PyObject_GC_UnTrack before calling Py_TRASHCAN_BEGIN will still work, they will just take a very minor performance hit. I don't think it is worth the trouble to introduce new macros for that reason. Extensions that really care about performance can wrap the call in a Python version ifdef. There is an issue if someone writes and tests their extension with the new API, i.e. without having the explicit PyObject_GC_UnTrack() call in their dealloc method. If they compile with an older Python, they likely get a crash. If they compile with asserts enable, they would get an assert fail in _PyTrash_thread_deposit_object, i.e.: _PyObject_ASSERT(op, !_PyObject_GC_IS_TRACKED(op)); I guess that's an argument for new macros. ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 18:06:12 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Tue, 10 Aug 2021 22:06:12 +0000 Subject: [issue44881] Consider integration of GC_UNTRACK with TRASHCAN In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628633172.76.0.652519069791.issue44881@roundup.psfhosted.org> Neil Schemenauer added the comment: For examples of bugs caused by forgetting the untrack calls, see bpo-31095. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 18:22:25 2021 From: report at bugs.python.org (Samwyse) Date: Tue, 10 Aug 2021 22:22:25 +0000 Subject: [issue44882] add .rollback() for in-place filters Message-ID: <1628634145.27.0.557852545267.issue44882@roundup.psfhosted.org> New submission from Samwyse : Sometimes bad things happen when processing an in-place filter, leaving an empty or incomplete input file and a backup file that needs to recovered. The FileInput class has all the information needed to do this, but it is in private instance variables. A .rollback() method could close the current file and rename the backup file to its original name. For example: for line in fileinput.input(inplace=True): try: ... except SomeError: fileinput.rollback(close=False) # continue with next file A simplistic implementation could be: def rollback(self, close=True): if self._backupfilename: os.rename(self._backupfilename, self.filename) self._backupfilename = None if close: self.close() else: self.nextfile() ---------- components: Library (Lib) messages: 399361 nosy: samwyse priority: normal severity: normal status: open title: add .rollback() for in-place filters type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 18:25:20 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 10 Aug 2021 22:25:20 +0000 Subject: [issue44445] Add `site-include` install scheme path in sysconfig In-Reply-To: <1623942208.43.0.621445516609.issue44445@roundup.psfhosted.org> Message-ID: <1628634320.61.0.698603697729.issue44445@roundup.psfhosted.org> Filipe La?ns added the comment: distutils will install the headers to {base}/include/python{py_version_short}{abiflags}/{dist_name}, and I think probably the best option would be to do the same. So, I think we could add a site-include scheme like I described and have the installers append a directory with the distribution name to it. I think it would be reasonable to put all headers in a shared directory, site-include, given that we make sure the installers put them in a subdirectory for each distribution. About standardizing pkg-config-like metadata, I don't think that's a great idea, as it would not replace the mechanisms you mentioned. It might replace some, but not all, as there could always be a use-case that needs more information or interaction than what our standard may provide. Does this make sense to you? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 18:29:22 2021 From: report at bugs.python.org (Samwyse) Date: Tue, 10 Aug 2021 22:29:22 +0000 Subject: [issue44882] add FileInput.rollback() for in-place filters In-Reply-To: <1628634145.27.0.557852545267.issue44882@roundup.psfhosted.org> Message-ID: <1628634562.25.0.354424665764.issue44882@roundup.psfhosted.org> Change by Samwyse : ---------- title: add .rollback() for in-place filters -> add FileInput.rollback() for in-place filters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 18:43:49 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 10 Aug 2021 22:43:49 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1628635429.97.0.51057334742.issue43976@roundup.psfhosted.org> Filipe La?ns added the comment: Hi Jason, thank you. I already tried 1), but could not convince Matthias on an alternative way to achieve the result that Debian wants. If you want, maybe you and I could try restarting those discussions. 2) is fine, but I am not the one that will me maintaining it, so it is a question for the core devs. I mean, I could commit to working on it and dealing with issues, but I am not a core dev, so it would always need to involve someone else. 3) does not really make sense as of the distutils deprecation. What needs to be patched are the install schemes, which are now outside distutils/setuptools. I had hoped that we were able to have the mechanism proposed here in 3.10, so that people could just replace their distutils patches with it, but it was not possible. I am not sure how to proceed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 19:13:59 2021 From: report at bugs.python.org (xrcg) Date: Tue, 10 Aug 2021 23:13:59 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1628637239.8.0.721568209422.issue43976@roundup.psfhosted.org> xrcg added the comment: I haven?t read everything in this convo, but it looks like the changes proposed here cover all known downstream users other than Debian. Is that correct? Would these changes break Debian?s customizations substantially more than they?ll already be broken by the distutils deprecation refactoring? If not, and if you don?t want to support the customizations that Debian wants, why not proceed with this enhancement to cover every other case, then deal with Debian later? In the short term, and possible for the long term, Debian can continue to patch the install routine, just in the new appropriate places to patch it. Debian wants something no one else wants, so they have to put in extra effort. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 19:17:56 2021 From: report at bugs.python.org (xrcg) Date: Tue, 10 Aug 2021 23:17:56 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1628637476.15.0.535011918913.issue43976@roundup.psfhosted.org> xrcg added the comment: s/possible/possibly/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 19:34:39 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 23:34:39 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628638479.71.0.0311495136919.issue33930@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 12.0 -> 13.0 pull_requests: +26202 pull_request: https://github.com/python/cpython/pull/27719 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 19:34:56 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 10 Aug 2021 23:34:56 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628638496.45.0.751983384039.issue33930@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26203 pull_request: https://github.com/python/cpython/pull/27720 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 19:34:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 10 Aug 2021 23:34:40 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628638480.16.0.508842242799.issue33930@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset bfc2d5a5c4550ab3a2fadeb9459b4bd948ff61a2 by Pablo Galindo Salgado in branch 'main': bpo-33930: Fix segfault with deep recursion when cleaning method objects (GH-27678) https://github.com/python/cpython/commit/bfc2d5a5c4550ab3a2fadeb9459b4bd948ff61a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 19:38:25 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Tue, 10 Aug 2021 23:38:25 +0000 Subject: [issue44881] Consider integration of GC_UNTRACK with TRASHCAN In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628638705.72.0.705451001049.issue44881@roundup.psfhosted.org> Neil Schemenauer added the comment: Since C99 is now allowed, perhaps we should suggest that declarations go after Py_TRASHCAN_BEGIN, e.g. mytype_dealloc(mytype *p) { Py_TRASHCAN_BEGIN(p, mytype_dealloc) ... declarations go here ... ... The body of the deallocator goes here, including all calls ... ... to Py_DECREF on contained objects. ... Py_TRASHCAN_END // there should be no code after this } The only dealloc method that doesn't fit this pattern is subtype_dealloc() and that's because the object might not be a GC object. Given the pattern, it occurs to me that that _Py_Dealloc() could do the trashcan begin/end work. However, the authors of the dealloc methods would have to realize the special rules of the trashcan (e.g. no returns from the dealloc method body). Also, there would be some overhead added to _Py_Dealloc() to check if the trashcan is supported. E.g. checking a type flag. Another idea would be to add a new slot for the method, e.g. tp_dealloc_trash. Then, _Py_Dealloc() could check if it exists and if so do the trashcan begin/end dance around it. That would still add some overhead to _Py_Dealloc() so I think the current macros are the best approach. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 10 23:07:44 2021 From: report at bugs.python.org (Elvis Pranskevichus) Date: Wed, 11 Aug 2021 03:07:44 +0000 Subject: [issue44883] configure --with-openssl-rpath=DIR too eager about existence of DIR Message-ID: <1628651264.32.0.578906783546.issue44883@roundup.psfhosted.org> New submission from Elvis Pranskevichus : https://bugs.python.org/issue43466 added a way to set OpenSSL rpath explicitly via --with-openssl-rpath=DIR, which is cool! However, the current configuration code checks for the presence of the specified directory eagerly, which breaks setups where both OpenSSL and Python are being built at the same time, but not necessarily installed to the runtime location (think omnibus debs). Unless there's a good reason why an eager check is needed, I think it should be dropped to ease packaging. ---------- assignee: christian.heimes components: Installation, SSL messages: 399368 nosy: Elvis.Pranskevichus, christian.heimes priority: normal severity: normal status: open title: configure --with-openssl-rpath=DIR too eager about existence of DIR versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 00:21:12 2021 From: report at bugs.python.org (meowmeowcat) Date: Wed, 11 Aug 2021 04:21:12 +0000 Subject: [issue40899] Document exceptions raised by importlib.import In-Reply-To: <1591528094.81.0.814829435189.issue40899@roundup.psfhosted.org> Message-ID: <1628655672.15.0.923292633111.issue40899@roundup.psfhosted.org> meowmeowcat added the comment: Maybe we can add something like: ``` If the module cannot be imported,:exc:`ImportError` is usually raised. .. note:: Sometimes other errors are raised if the module cannot be imported successfully. See https://docs.python.org/3/library/exceptions.html for more information. ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 00:39:12 2021 From: report at bugs.python.org (meowmeowcat) Date: Wed, 11 Aug 2021 04:39:12 +0000 Subject: [issue40899] Document exceptions raised by importlib.import In-Reply-To: <1591528094.81.0.814829435189.issue40899@roundup.psfhosted.org> Message-ID: <1628656752.63.0.20841840894.issue40899@roundup.psfhosted.org> meowmeowcat added the comment: > ``importlib.import_module("t")`` will raise ZeroDivisionError. I've tested ``__import__`` with the same code, and it will raise ZeroDivisionError too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 01:43:18 2021 From: report at bugs.python.org (francois-xavier callewaert) Date: Wed, 11 Aug 2021 05:43:18 +0000 Subject: [issue44884] logging Formatter behavior when using msecs and braces : '{' Message-ID: <1628660598.09.0.631024760388.issue44884@roundup.psfhosted.org> New submission from francois-xavier callewaert : ``` >>> import logging >>> logging.getLogger().handlers[0].setFormatter(logging.Formatter(fmt='{asctime} {message}', style='{')) >>> logging.error("hello") 2021-08-11 01:04:54,972 hello ``` Wait. I come from a place where we use '.' as a decimal separator ... ``` >>> logging.getLogger().handlers[0].setFormatter(logging.Formatter(fmt='{asctime}.{msecs:03.0f} {message}', style='{', datefmt="%Y-%m-%d %H:%M:%S")) >>> logging.error("hello") 2021-08-11 01:06:27.471 hello ``` All very reasonable. I know my date time formatting and my brace formatting so I'm good or am I ... ``` >>> import time, math >>> for i in range(2500): a= (lambda : (time.sleep(0.0004), (logging.error("Whaaat!") )if math.modf(time.time())[0]>0.9995 else 0))() ... 2021-08-11 01:26:40.1000 Whaaat! ``` You'll hopefully agree that formatting a msecs as 1000 is plain wrong. Can I get around this ? the best / simplest, I've found is ``` >>> logging.Formatter.default_msec_format = "%s.%03d" >>> logging.getLogger().handlers[0].setFormatter(logging.Formatter(fmt='{asctime} {message}', style='{')) >>> for i in range(2500): a= (lambda : (time.sleep(0.0004), (logging.error("Now that's ok") )if math.modf(time.time())[0]>0.9995 else 0))() ... 2021-08-11 01:33:46.999 Now that's ok ``` Having to rely / teach /learn about "Old string formatting" in 2021 is not ideal. Can you suggest something better ? or would it be palatable to make a "careful" modification in logging/__init__.py (see below) ? replace ``` self.msecs = (ct - int(ct)) * 1000 ``` by ``` self.msecs = math.floor((ct - int(ct)) * 1000) #requires importing math ``` or ``` self.msecs = int((ct - int(ct)) * 1000) + 0.0 ``` ---------- components: Library (Lib) messages: 399371 nosy: fxcallewaert priority: normal severity: normal status: open title: logging Formatter behavior when using msecs and braces : '{' type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 03:59:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 11 Aug 2021 07:59:02 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format Message-ID: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Given this code: print(f"Here is that pesky {xxx/2:.3f} again") The traceback prints: Traceback (most recent call last): File "/home/pablogsal/github/python/main/lel.py", line 1, in print(f"Here is that pesky {xxx/2:.3f} again") ^^^ NameError: name 'xxx' is not defined Removing the formatting part ":.3f" makes it work as expected ---------- components: Interpreter Core messages: 399372 nosy: BTaskaya, ammar2, pablogsal priority: normal severity: normal status: open title: Incorrect exception highlighting for fstring format type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 04:32:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Aug 2021 08:32:28 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628670748.77.0.669628370027.issue33930@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 15f0a45b2822607f2c38685a72d06f050e24b215 by Miss Islington (bot) in branch '3.9': bpo-33930: Fix segfault with deep recursion when cleaning method objects (GH-27678) (GH-27720) https://github.com/python/cpython/commit/15f0a45b2822607f2c38685a72d06f050e24b215 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 04:32:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Aug 2021 08:32:48 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628670768.36.0.975034020604.issue33930@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d6d2d549972422ccc6fa335ebf9907e4b3d71817 by Miss Islington (bot) in branch '3.10': bpo-33930: Fix segfault with deep recursion when cleaning method objects (GH-27678) (GH-27719) https://github.com/python/cpython/commit/d6d2d549972422ccc6fa335ebf9907e4b3d71817 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 04:33:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Aug 2021 08:33:31 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628670811.02.0.756641887838.issue33930@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for the fix Augusto Goulart and Pablo! I close the issue. Pablo asked in PR 27678 if a Python 3.8 Release Manager (Lukasz) wants a backport to 3.8. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 04:38:49 2021 From: report at bugs.python.org (Thomas Trummer) Date: Wed, 11 Aug 2021 08:38:49 +0000 Subject: [issue44886] asyncio: create_datagram_endpoint() does not return a DatagramTransport Message-ID: <1628671129.22.0.924495128156.issue44886@roundup.psfhosted.org> New submission from Thomas Trummer : According to the documentation[1] loop.create_datagram_endpoint() returns an asyncio.DatagramTransport. However on Windows this is not the case when the ProactorEventLoop is used (which seems to be the default since Python 3.8). This is a problem because a DatagramProtocol subclass needs a downcast in order to satisfy the type system (or mypy for that matter). [1] https://docs.python.org/3/library/asyncio-protocol.html#asyncio.DatagramTransport --- # Will print: False import asyncio class EchoServerProtocol(asyncio.DatagramProtocol): def connection_made(self, transport): print(type(transport), isinstance(transport, asyncio.DatagramTransport)) async def main(): transport, protocol = await asyncio.get_running_loop().create_datagram_endpoint( lambda: EchoServerProtocol(), local_addr=('127.0.0.1', 9999)) try: await asyncio.sleep(5) finally: transport.close() asyncio.run(main()) ---------- components: asyncio messages: 399376 nosy: Thomas Trummer, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio: create_datagram_endpoint() does not return a DatagramTransport versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 05:04:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 09:04:53 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628672693.69.0.278804352271.issue33930@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- nosy: +lukasz.langa nosy_count: 13.0 -> 14.0 pull_requests: +26204 pull_request: https://github.com/python/cpython/pull/27721 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 05:36:12 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 11 Aug 2021 09:36:12 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. In-Reply-To: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> Message-ID: <1628674572.12.0.28647159352.issue44878@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +26205 pull_request: https://github.com/python/cpython/pull/27725 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 05:36:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Aug 2021 09:36:59 +0000 Subject: [issue44881] Consider integration of GC_UNTRACK with TRASHCAN In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628674619.27.0.962756928917.issue44881@roundup.psfhosted.org> STINNER Victor added the comment: Please don't add new macros. The TRASHCAN C API is already complex enough. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 05:42:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Aug 2021 09:42:32 +0000 Subject: [issue44881] Consider integration of GC_UNTRACK with TRASHCAN In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628674952.54.0.987559316799.issue44881@roundup.psfhosted.org> STINNER Victor added the comment: Moreover, before making any change, I would suggest by starting with documenting the existing trashcan C API. Right now, there is no documentation in Doc/c-api/. Documentation can be copied from Include/cpython/object.h. Last year, I modified the trashcan API to hide implementation details. There were also issues with the stable ABI... thing which is unclear to me, since the trashcan C API is excluded from the limited C API. Well, I excluded it. Previously, it was part of it, but it did not work with the limited C API. commit 0fa4f43db086ac3459811cca4ec5201ffbee694a Author: Victor Stinner Date: Wed Feb 5 12:23:27 2020 +0100 bpo-39542: Exclude trashcan from the limited C API (GH-18362) Exclude trashcan mechanism from the limited C API: it requires access to PyTypeObject and PyThreadState structure fields, whereas these structures are opaque in the limited C API. The trashcan mechanism never worked with the limited C API. Move it from object.h to cpython/object.h. commit 38965ec5411da60d312b59be281f3510d58e0cf1 Author: Victor Stinner Date: Fri Mar 13 16:51:52 2020 +0100 bpo-39947: Hide implementation detail of trashcan macros (GH-18971) Py_TRASHCAN_BEGIN_CONDITION and Py_TRASHCAN_END macro no longer access PyThreadState attributes, but call new private _PyTrash_begin() and _PyTrash_end() functions which hide implementation details. commit db532a09990c837ec1348e6e6bd2719f5d4a8216 Author: Victor Stinner Date: Wed Jun 23 15:51:47 2021 +0200 bpo-39947: Remove old private trashcan C API functions (GH-26869) Remove 4 C API private trashcan functions which were only kept for the backward compatibility of the stable ABI with Python 3.8 and older, since the trashcan API was not usable with the limited C API on Python 3.8 and older. The trashcan API was excluded from the limited C API in Python 3.9. Removed functions: * _PyTrash_deposit_object() * _PyTrash_destroy_chain() * _PyTrash_thread_deposit_object() * _PyTrash_thread_destroy_chain() The trashcan C API was never usable with the limited C API, since old trashcan macros accessed directly PyThreadState members like "_tstate->trash_delete_nesting", whereas the PyThreadState structure is opaque in the limited C API. Exclude also the PyTrash_UNWIND_LEVEL constant from the C API. The trashcan C API was modified in Python 3.9 by commit 38965ec5411da60d312b59be281f3510d58e0cf1 and in Python 3.10 by commit ed1a5a5baca8f61e9a99c5be3adc16b1801514fe to hide implementation details. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 05:43:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Aug 2021 09:43:05 +0000 Subject: [issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628674985.15.0.101081212094.issue44881@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Consider integration of GC_UNTRACK with TRASHCAN -> Consider integration of PyObject_GC_UnTrack() with the trashcan C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 05:46:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Aug 2021 09:46:27 +0000 Subject: [issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628675187.27.0.467857243213.issue44881@roundup.psfhosted.org> STINNER Victor added the comment: > Now, any object that uses the trashcan *must* be a GC object. It would be nice to add an assertion in _PyTrash_begin(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 06:04:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 10:04:26 +0000 Subject: [issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15 Message-ID: <1628676266.46.0.173635281643.issue44887@roundup.psfhosted.org> New submission from ?ukasz Langa : (I'm still investigating at the moment whether something changed in my environment.) Running the following right now hangs on test_input_tty for me: ./python.exe -m test test_builtin test_builtin -v This fails on all branches up to and including 3.7, so I assume this is environment-specific unless it's a regression due to a change that was backported all the way back to 3.7, which is out of the question as the last functional commit on 3.7 was back in June. Things I tried so far: - rebooting; - using another terminal app (I use iTerm2 by default, tried Terminal.app too); - another shell (I use fish by default, tried bash 5.0 as well); - a non-pydebug build (I use pydebug builds by default to run -R:) The test in question is using deadline if available and `sysconfig.get_config_vars()['HAVE_LIBREADLINE']` returns 1. I'll be trying to check if that works for me next. ---------- messages: 399380 nosy: lukasz.langa priority: low severity: normal stage: test needed status: open title: test_input_tty hangs when run multiple times in the same process on macOS 10.15 versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 06:25:50 2021 From: report at bugs.python.org (Nick Coghlan) Date: Wed, 11 Aug 2021 10:25:50 +0000 Subject: [issue44800] Code readability: rename interpreter frames to execution frames In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1628677550.27.0.0983795222608.issue44800@roundup.psfhosted.org> Nick Coghlan added the comment: Mark raised some valid concerns with the proposed naming convention over on the PR: * the proposed names make it sound like there are genuinely two kinds of frame, when the actual relationship is between a frame's data storage and a Python object providing an interface to that storage * _PyExecFrame looks like an actual Python type name, so we probably want something more like "Py_buffer" (where the lowercase name is intended to indicate that the struct isn't a full Python type) Mark offered "activation record" as a possible name, but I'm going to see how "_Py_framedata" looks first (with "fdata" as the abbreviated form, since "fd" is so frequently used to mean "file descriptor") I'm also going to see how the PR looks if both the frame and frame data struct keep their existing field prefixes - it may be that changing variable names will be enough to avoid ambiguity, in which case leaving the field names alone genuinely reduces code churn. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 06:44:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 10:44:10 +0000 Subject: [issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15 In-Reply-To: <1628676266.46.0.173635281643.issue44887@roundup.psfhosted.org> Message-ID: <1628678650.84.0.79958116241.issue44887@roundup.psfhosted.org> ?ukasz Langa added the comment: Hynek confirmed on Big Sur with Python 3.9.5 from asdf that test_input_tty hangs, too, if ran for the second time in the same process. Moreover, readline is not it. First of all, it's libedit on macOS: ? ll /usr/lib/libreadline.dylib lrwxr-xr-x 1 root wheel 15B Feb 2 2020 /usr/lib/libreadline.dylib -> libedit.3.dylib So Python uses that by default: >>> import readline >>> readline._READLINE_LIBRARY_VERSION 'EditLine wrapper' >>> readline._READLINE_RUNTIME_VERSION 1026 >>> readline._READLINE_VERSION 1026 Unless you instruct it to use readline (for example by providing "-I$(brew --prefix readline)/include" to CFLAGS and "-L$(brew --prefix readline)/lib" to LDFLAGS before running ./configure): >>> import readline >>> readline._READLINE_LIBRARY_VERSION '8.1' >>> readline._READLINE_RUNTIME_VERSION 2049 >>> readline._READLINE_VERSION 2049 The hang is the same in both cases. Next course of action, checking if it's not due to fork shenanigans in _run_child(): https://github.com/python/cpython/blob/1841c70f2bdab9d29c1c74a8afffa45d5555af98/Lib/test/test_builtin.py#L2001 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 06:48:22 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 11 Aug 2021 10:48:22 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. In-Reply-To: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> Message-ID: <1628678902.42.0.351770087715.issue44878@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 3f3d5dcac336463bd0eed64ba0bd7666ff2da1e1 by Mark Shannon in branch 'main': bpo-44878: _PyEval_EvalFrameDefault readability improvements (GH-27725) https://github.com/python/cpython/commit/3f3d5dcac336463bd0eed64ba0bd7666ff2da1e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 07:00:40 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 11 Aug 2021 11:00:40 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. In-Reply-To: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> Message-ID: <1628679640.6.0.399636742642.issue44878@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +26206 pull_request: https://github.com/python/cpython/pull/27726 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 07:29:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 11:29:10 +0000 Subject: [issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15 In-Reply-To: <1628676266.46.0.173635281643.issue44887@roundup.psfhosted.org> Message-ID: <1628681350.67.0.381652236315.issue44887@roundup.psfhosted.org> ?ukasz Langa added the comment: Parent process hangs on: * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00007fff6741181e libsystem_kernel.dylib`read + 10 frame #1: 0x000000010226a117 python.exe`_Py_read(fd=3, buf=0x00007f8d24009840, count=8192) at fileutils.c:1744:13 frame #2: 0x00000001022f1335 python.exe`_io_FileIO_readinto_impl(self=0x0000000103b284d0, buffer=0x00007ffeedcbe928) at fileio.c:645:9 frame #3: 0x00000001022f063e python.exe`_io_FileIO_readinto(self=0x0000000103b284d0, arg=0x0000000102f5d090) at fileio.c.h:205:20 frame #4: 0x00000001020050e9 python.exe`method_vectorcall_O(func=0x00000001026fd970, args=0x00007ffeedcbeaf0, nargsf=2, kwnames=0x0000000000000000) at descrobject.c:462:24 frame #5: 0x0000000101ff323d python.exe`_PyObject_VectorcallTstate(tstate=0x00007f8d20d04f00, callable=0x00000001026fd970, args=0x00007ffeedcbeaf0, nargsf=2, kwnames=0x0000000000000000) at abstract.h:114:11 frame #6: 0x0000000101ff30c9 python.exe`PyObject_VectorcallMethod(name=0x00000001026fcbe0, args=0x00007ffeedcbeaf0, nargsf=2, kwnames=0x0000000000000000) at call.c:770:24 frame #7: 0x00000001022f92a0 python.exe`PyObject_CallMethodOneArg(self=0x0000000103b284d0, name=0x00000001026fcbe0, arg=0x0000000102f5d090) at abstract.h:204:12 where "name" in frame #7 is the "readinto" method of <_io.FileIO name=3 mode='rb' closefd=True> and "arg" is . Child process hangs on: * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00007fff67413bf6 libsystem_kernel.dylib`write + 10 frame #1: 0x000000010226a3e0 python.exe`_Py_write_impl(fd=2, buf=0x00007ffeedcbcbcb, count=1, gil_held=0) at fileutils.c:1813:17 frame #2: 0x000000010226a535 python.exe`_Py_write_noraise(fd=2, buf=0x00007ffeedcbcbcb, count=1) at fileutils.c:1871:12 frame #3: 0x0000000102257834 python.exe`_Py_DumpASCII(fd=2, text=0x0000000102a1bed0) at traceback.c:1002:13 frame #4: 0x0000000102258ba5 python.exe`dump_frame(fd=2, frame=0x00000001025dbba8) at traceback.c:1035:9 frame #5: 0x00000001022579fa python.exe`dump_traceback(fd=2, tstate=0x00007f8d20d04f00, write_header=0) at traceback.c:1084:9 frame #6: 0x0000000102257bc6 python.exe`_Py_DumpTracebackThreads(fd=2, interp=0x00007f8d2281b010, current_tstate=0x00007f8d20d04f00) at traceback.c:1186:9 frame #7: 0x0000000102311dc3 python.exe`faulthandler_dump_traceback(fd=2, all_threads=1, interp=0x00007f8d2281b010) at faulthandler.c:245:15 frame #8: 0x000000010231224b python.exe`faulthandler_user(signum=14) at faulthandler.c:843:5 frame #9: 0x00007fff674c85fd libsystem_platform.dylib`_sigtramp + 29 frame #10: 0x00007fff6741435f libsystem_kernel.dylib`__ioctl + 11 frame #11: 0x00007fff6741434b libsystem_kernel.dylib`ioctl + 150 frame #12: 0x00007fff6734ad63 libsystem_c.dylib`tcsetattr + 111 frame #13: 0x0000000103c772ee libreadline.8.dylib`_set_tty_settings + 28 frame #14: 0x0000000103c76d87 libreadline.8.dylib`rl_prep_terminal + 683 frame #15: 0x0000000103c88ce9 libreadline.8.dylib`_rl_callback_newline + 51 frame #16: 0x0000000103c5ae75 readline.cpython-311d-darwin.so`readline_until_enter_or_signal(prompt="prompt", signal=0x00007ffeedcbd63c) at readline.c:1318:5 frame #17: 0x0000000103c58637 readline.cpython-311d-darwin.so`call_readline(sys_stdin=0x00007fff8d9c8d90, sys_stdout=0x00007fff8d9c8e28, prompt="prompt") at readline.c:1396:9 frame #18: 0x0000000101fad9b6 python.exe`PyOS_Readline(sys_stdin=0x00007fff8d9c8d90, sys_stdout=0x00007fff8d9c8e28, prompt="prompt") at myreadline.c:391:14 frame #19: 0x00000001021a071d python.exe`builtin_input_impl(module=0x000000010268c0b0, prompt=0x00000001027a0400) at bltinmodule.c:2188:13 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 07:31:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 11:31:55 +0000 Subject: [issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15 In-Reply-To: <1628676266.46.0.173635281643.issue44887@roundup.psfhosted.org> Message-ID: <1628681515.94.0.112158732223.issue44887@roundup.psfhosted.org> ?ukasz Langa added the comment: This might be a long-standing problem. I haven't encountered it before because I was always running -R: with -j and in this case the test is skipped: test_input_tty (test.test_builtin.PtyTests) ... skipped 'stdin and stdout must be ttys' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 07:35:40 2021 From: report at bugs.python.org (Tee KOBAYASHI) Date: Wed, 11 Aug 2021 11:35:40 +0000 Subject: [issue44888] ssl.OP_LEGACY_SERVER_CONNECT missing Message-ID: <1628681740.09.0.0670758507991.issue44888@roundup.psfhosted.org> New submission from Tee KOBAYASHI : Please implement ssl.OP_LEGACY_SERVER_CONNECT constant that corresponds to SSL_OP_LEGACY_SERVER_CONNECT in C. This is required to make OpenSSL 3.0.0 behave like 1.1.1. ---------- assignee: christian.heimes components: SSL messages: 399386 nosy: christian.heimes, xtkoba priority: normal severity: normal status: open title: ssl.OP_LEGACY_SERVER_CONNECT missing _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 08:41:10 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 11 Aug 2021 12:41:10 +0000 Subject: [issue25782] CPython hangs on error __context__ set to the error itself In-Reply-To: <1449076441.38.0.963505882098.issue25782@psf.upfronthosting.co.za> Message-ID: <1628685670.05.0.329574582764.issue25782@roundup.psfhosted.org> Dong-hee Na added the comment: > Serhiy, I'm not closing this yet in case you'd like to finish implementing your PR. If not, feel free to close. I check that PR 20543 makes CPython works correctly with msg399281 code. ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 08:43:20 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 11 Aug 2021 12:43:20 +0000 Subject: [issue44889] Specialize LOAD_METHOD with PEP 659 adaptive interpreter Message-ID: <1628685800.71.0.329647990646.issue44889@roundup.psfhosted.org> New submission from Ken Jin : Possible specializations: - LOAD_METHOD_CACHED Cache the method. We only need to check that type(o) and o.__dict__ was not modified. - LOAD_METHOD_CLASS For classmethods. Less speedup expected. - LOAD_METHOD_MODULE For module methods. Uncommon (<10%). Please see https://github.com/faster-cpython/ideas/issues/81 for more details. ---------- components: Interpreter Core messages: 399388 nosy: kj priority: normal severity: normal status: open title: Specialize LOAD_METHOD with PEP 659 adaptive interpreter versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 08:46:20 2021 From: report at bugs.python.org (Gautam Chaudhuri) Date: Wed, 11 Aug 2021 12:46:20 +0000 Subject: [issue16580] [doc] Add examples to int.to_bytes and int.from_bytes In-Reply-To: <1354217109.61.0.534443148437.issue16580@psf.upfronthosting.co.za> Message-ID: <1628685980.22.0.227620882146.issue16580@roundup.psfhosted.org> Gautam Chaudhuri added the comment: I've rewritten woparry's patch so that it targets the current codebase as well as fixing the issues that Mark mentioned. It appears that the range checks on `to_bytes` have already been added to the documentation so I haven't added those. Should a separate issue be raised for the behaviour of `int.from_bytes(b'', , signed=True')`? I think it's out of scope for this issue. ---------- nosy: +quantum Added file: https://bugs.python.org/file50210/issue16580.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 08:48:50 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 11 Aug 2021 12:48:50 +0000 Subject: [issue44889] Specialize LOAD_METHOD with PEP 659 adaptive interpreter In-Reply-To: <1628685800.71.0.329647990646.issue44889@roundup.psfhosted.org> Message-ID: <1628686130.07.0.184087083122.issue44889@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +26207 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 08:57:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 11 Aug 2021 12:57:41 +0000 Subject: [issue44637] Quoting issue on header Reply-To In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org> Message-ID: <1628686661.11.0.441472237269.issue44637@roundup.psfhosted.org> STINNER Victor added the comment: I change the issue type to security. The bug can be abused to send emails to the wrong email address. ---------- nosy: +vstinner type: behavior -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 09:02:19 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 11 Aug 2021 13:02:19 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. In-Reply-To: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> Message-ID: <1628686939.78.0.670051377778.issue44878@roundup.psfhosted.org> Mark Shannon added the comment: New changeset f66d00fdd7e9a333accc6bf0e37173051aaa55d0 by Mark Shannon in branch 'main': bpo-44878: Remove the switch from the main interpreter loop when using computed gotos. (GH-27726) https://github.com/python/cpython/commit/f66d00fdd7e9a333accc6bf0e37173051aaa55d0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 09:08:34 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 11 Aug 2021 13:08:34 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. In-Reply-To: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> Message-ID: <1628687314.5.0.249318118816.issue44878@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +26208 pull_request: https://github.com/python/cpython/pull/27727 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 09:30:41 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 11 Aug 2021 13:30:41 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628688641.62.0.594089631315.issue44885@roundup.psfhosted.org> Guido van Rossum added the comment: (I originally reported this.) ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 09:39:30 2021 From: report at bugs.python.org (Julien Castiaux) Date: Wed, 11 Aug 2021 13:39:30 +0000 Subject: [issue44637] Quoting issue on header Reply-To In-Reply-To: <1628686661.11.0.441472237269.issue44637@roundup.psfhosted.org> Message-ID: Julien Castiaux added the comment: Hello David, Victor, Thank you for the triage, it reminds me about this issue. David, the solution I tried last month was wrong, it was breaking (for good reasons) tons of unittests. It seems to me that there is indeed no other solution than to bloat the re-folding function a bit more and to fix the dbquotes there as your last email suggested. I agree with you that the code will be even messier, honestly I spent quite some time understanding the _refold_parse_tree function and I don't feel like patching it. Regards, On 11.08.21 14:57, STINNER Victor wrote: > STINNER Victor added the comment: > > I change the issue type to security. The bug can be abused to send emails to the wrong email address. > > ---------- > nosy: +vstinner > type: behavior -> security > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 09:59:53 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 11 Aug 2021 13:59:53 +0000 Subject: [issue24955] webbrowser broken on Mac OS X when using the BROWSER variable In-Reply-To: <1440842500.82.0.168118984503.issue24955@psf.upfronthosting.co.za> Message-ID: <1628690393.56.0.838620816196.issue24955@roundup.psfhosted.org> Andrei Kulakov added the comment: Also see https://bugs.python.org/issue42255 Hugo: can you convert the patch to a PR? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 10:26:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 14:26:18 +0000 Subject: [issue41494] Adds window resizing support to Lib/pty.py [ SIGWINCH ] In-Reply-To: <1596712223.19.0.204047363548.issue41494@roundup.psfhosted.org> Message-ID: <1628691978.63.0.516935506526.issue41494@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Soumendra. Not resolved but superseded by a different issue has its own indicators on BPO. ---------- nosy: +lukasz.langa resolution: -> out of date status: open -> closed superseder: -> Lib/pty.py major revision _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 10:53:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 14:53:07 +0000 Subject: [issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15 In-Reply-To: <1628676266.46.0.173635281643.issue44887@roundup.psfhosted.org> Message-ID: <1628693587.13.0.729386703049.issue44887@roundup.psfhosted.org> ?ukasz Langa added the comment: Amazingly, excluding every other test function with a bunch of `-i` patterns still makes it hang when ran twice. On the other hand, only including the test function with `-m` works fine. This is very weird. Looking further. Semi-relatedly, I found BPO-26228, could reproduce it, and finished an open PR on it. While those are separate issues, I'm hoping to solve them both. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:01:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 11 Aug 2021 15:01:15 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628694075.92.0.566310829651.issue44885@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The problem lies here: https://github.com/python/cpython/blob/f66d00fdd7e9a333accc6bf0e37173051aaa55d0/Parser/string_parser.c#L374-L389 The problem is that the strstr call will fail because the string containing the expression doesn't have the formatting part in it, so the offsets never get corrected. ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:10:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 15:10:48 +0000 Subject: [issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15 In-Reply-To: <1628676266.46.0.173635281643.issue44887@roundup.psfhosted.org> Message-ID: <1628694648.23.0.128425578796.issue44887@roundup.psfhosted.org> ?ukasz Langa added the comment: I found the high-level reason why test_builtin hangs: it runs doctests as well. What's the root cause? I don't know yet. But to confirm, I can also hang the tests by running: $ python3.9 -m test test_doctest test_builtin -v Now to discover what it is that doctest does... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:13:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 11 Aug 2021 15:13:10 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628694790.75.0.854809187579.issue44885@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Actually, this has even more problems. Because we are using strstr to find the start of the expression in the parent string, if the expression is repeated the offsets are incorrectly generated: For example: print(f"Here is that {xxx} pesky {xxx} again") This produces: ... FormattedValue( value=Name( id='xxx', ctx=Load(), lineno=1, col_offset=22, end_lineno=1, end_col_offset=25), ... FormattedValue( value=Name( id='xxxx', ctx=Load(), lineno=1, col_offset=22, end_lineno=1, end_col_offset=25), ... while print(f"Here is that {xxx} pesky {xxxx} again") (different variables) produces: ... FormattedValue( value=Name( id='xxx', ctx=Load(), lineno=1, col_offset=22, end_lineno=1, end_col_offset=25), ... FormattedValue( value=Name( id='xxxx', ctx=Load(), lineno=1, col_offset=34, end_lineno=1, end_col_offset=38), ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:24:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 11 Aug 2021 15:24:44 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628695484.6.0.453944440226.issue44885@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ha, we have test that knows is broken: https://github.com/python/cpython/blob/f66d00fdd7e9a333accc6bf0e37173051aaa55d0/Lib/test/test_fstring.py#L217 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:32:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 11 Aug 2021 15:32:36 +0000 Subject: [issue44890] Enable serialisation stats collection when Py_Debug Message-ID: <1628695956.18.0.391304040066.issue44890@roundup.psfhosted.org> New submission from Irit Katriel : Always collect stats under Py_Debug, which makes them available through the python api. Printing at interpreter exit is still disabled by default. ---------- components: Interpreter Core messages: 399401 nosy: iritkatriel priority: normal severity: normal status: open title: Enable serialisation stats collection when Py_Debug type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:32:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 11 Aug 2021 15:32:54 +0000 Subject: [issue44890] Enable specialization stats collection when Py_Debug In-Reply-To: <1628695956.18.0.391304040066.issue44890@roundup.psfhosted.org> Message-ID: <1628695974.99.0.0424052398867.issue44890@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Enable serialisation stats collection when Py_Debug -> Enable specialization stats collection when Py_Debug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:33:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 11 Aug 2021 15:33:15 +0000 Subject: [issue44890] Enable specialization stats collection when in Py_DEBUG In-Reply-To: <1628695956.18.0.391304040066.issue44890@roundup.psfhosted.org> Message-ID: <1628695995.78.0.285645701956.issue44890@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Enable specialization stats collection when Py_Debug -> Enable specialization stats collection when in Py_DEBUG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:35:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 15:35:46 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628696146.12.0.614041657849.issue33930@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 09d814b3833c2c852f4f233297b4561028782d2a by ?ukasz Langa in branch '3.8': [3.8] bpo-33930: Fix segfault with deep recursion when cleaning method objects (GH-27678) (GH-27721) https://github.com/python/cpython/commit/09d814b3833c2c852f4f233297b4561028782d2a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:39:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 11 Aug 2021 15:39:17 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628696357.74.0.230746069088.issue44885@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +26209 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27729 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:52:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 15:52:03 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628697123.67.0.896353398175.issue33930@roundup.psfhosted.org> ?ukasz Langa added the comment: Apparently we've got ourselves refleaks with the patches. It doesn't always reproduce but put test_exceptions -R: in a loop in 3.10 and soon enough you'll get: 0:00:00 load avg: 4.47 Run tests sequentially 0:00:00 load avg: 4.47 [1/1] test_exceptions beginning 9 repetitions 123456789 ......... test_exceptions leaked [2, 2, 2, 2] references, sum=8 test_exceptions leaked [2, 2, 2, 2] memory blocks, sum=8 test_exceptions failed (reference leak) in 59.6 sec == Tests result: FAILURE == 1 test failed: test_exceptions It's much harder to reproduce on 3.9 and 3.8 because test_exceptions has fewer tests and at least on my MBP finishes twice as fast. I ran 3.9 in a loop for an hour and no refleak. ---------- resolution: fixed -> stage: resolved -> patch review status: closed -> open versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 11:57:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 15:57:33 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628697453.57.0.832908468335.issue33930@roundup.psfhosted.org> ?ukasz Langa added the comment: Interestingly, I can't reproduce the refleaks on `main` either, only on 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 12:11:17 2021 From: report at bugs.python.org (Mike Crowe) Date: Wed, 11 Aug 2021 16:11:17 +0000 Subject: [issue41710] Timeout is affected by jumps in system time In-Reply-To: <1599208494.85.0.752607116191.issue41710@roundup.psfhosted.org> Message-ID: <1628698277.88.0.445178390594.issue41710@roundup.psfhosted.org> Mike Crowe added the comment: glibc v2.30 onwards provides sem_clockwait which can wait on either CLOCK_MONOTONIC or CLOCK_REALTIME. I failed to notice that https://sourceware.org/bugzilla/show_bug.cgi?id=14717 existed until today. :( ---------- nosy: +mikecrowe _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 12:11:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 16:11:23 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1628698283.51.0.153735774259.issue33479@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.10, Python 3.11 -Python 2.7, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 12:25:00 2021 From: report at bugs.python.org (Eduardo Morales) Date: Wed, 11 Aug 2021 16:25:00 +0000 Subject: [issue44869] MacOS Monterrey malloc issue In-Reply-To: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> Message-ID: <1628699100.32.0.71217549577.issue44869@roundup.psfhosted.org> Eduardo Morales added the comment: I've been able to tackle the issue down and reported it to the library. Although I'm not sure if it's a Python or library issue. https://github.com/ibmdb/python-ibmdb/issues/648 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 12:29:30 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Aug 2021 16:29:30 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1628699370.7.0.286943794506.issue33479@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26210 pull_request: https://github.com/python/cpython/pull/27730 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 12:29:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 16:29:26 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1628699366.68.0.32732722862.issue33479@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 08caf2d5d4a9994976e9eafaf345b5a1a4012a81 by Mark Roseman in branch 'main': bpo-33479: Add architecture and threading model sections to Tkinter module docs (GH-27717) https://github.com/python/cpython/commit/08caf2d5d4a9994976e9eafaf345b5a1a4012a81 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 12:37:50 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 16:37:50 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628699870.77.0.83813643229.issue33930@roundup.psfhosted.org> ?ukasz Langa added the comment: I gotta run for the day. The shortest way for me to reproduce is to focus on the tests that were added in 3.10 and shortening the repetitions a little: $ time ./python.exe -E -Wd -m test test_exceptions -R3:3 -m 'test_attribute*' -m 'test_getattr*' -m 'test_lineno*' -m 'test_name_error*' -m 'test_recursion*' -m 'test_no_hang*' 0:00:00 load avg: 5.92 Run tests sequentially 0:00:00 load avg: 5.92 [1/1] test_exceptions beginning 6 repetitions 123456 ...... test_exceptions leaked [2, 2, 2] references, sum=6 test_exceptions leaked [2, 2, 2] memory blocks, sum=6 test_exceptions failed (reference leak) == Tests result: FAILURE == 1 test failed: test_exceptions 1 re-run test: test_exceptions Total duration: 11.8 sec Tests result: FAILURE 12.13 real 11.44 user 0.61 sys ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 12:44:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 16:44:31 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628700271.97.0.682570231475.issue33930@roundup.psfhosted.org> ?ukasz Langa added the comment: (BTW, with this command, it is indeed possible to trigger the ref leak on `main` as well, which makes it somewhat less scary.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 12:45:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 11 Aug 2021 16:45:00 +0000 Subject: [issue44890] Enable specialization stats collection when in Py_DEBUG In-Reply-To: <1628695956.18.0.391304040066.issue44890@roundup.psfhosted.org> Message-ID: <1628700300.03.0.703462776784.issue44890@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26211 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27731 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 13:16:28 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Aug 2021 17:16:28 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1628702188.45.0.914378451509.issue33479@roundup.psfhosted.org> miss-islington added the comment: New changeset 2666d702e49aa0e4975553bec2e92ca4a2dba4ea by Miss Islington (bot) in branch '3.10': bpo-33479: Add architecture and threading model sections to Tkinter module docs (GH-27717) https://github.com/python/cpython/commit/2666d702e49aa0e4975553bec2e92ca4a2dba4ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 14:48:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 11 Aug 2021 18:48:28 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628707708.07.0.681640474561.issue33930@roundup.psfhosted.org> Irit Katriel added the comment: It seems to have been introduced by https://github.com/python/cpython/pull/27626 I don't see how the code change could have introduced a leak. Maybe the new tests exposed a pre-existing leak? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 14:50:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 18:50:07 +0000 Subject: [issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15 In-Reply-To: <1628676266.46.0.173635281643.issue44887@roundup.psfhosted.org> Message-ID: <1628707807.57.0.464866844073.issue44887@roundup.psfhosted.org> ?ukasz Langa added the comment: The doctest runner sets an output redirecting debugger, which subclasses Pdb, around actually running the doctest. This action causes the hang. New finding, we can hang the test with test_pdb too: $ python3.9 -m test test_pdb test_builtin -v ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 15:41:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 19:41:28 +0000 Subject: [issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15 In-Reply-To: <1628676266.46.0.173635281643.issue44887@roundup.psfhosted.org> Message-ID: <1628710888.13.0.67246251384.issue44887@roundup.psfhosted.org> ?ukasz Langa added the comment: It *is* readline-related after all O_O Commenting out this section in Pdb.__init__ makes the issue go away: https://github.com/python/cpython/blob/64a7812c170f5d46ef16a1517afddc7cd92c5240/Lib/pdb.py#L234-L239 time ./python.exe -E -Wd -m test test_builtin test_builtin 0:00:00 load avg: 2.12 Run tests sequentially 0:00:00 load avg: 2.12 [1/2] test_builtin 0:00:00 load avg: 2.12 [2/2] test_builtin == Tests result: SUCCESS == All 2 tests OK. Total duration: 1.3 sec Tests result: SUCCESS 1.56 real 1.42 user 0.10 sys I'll be continuing on this tomorrow to find the root cause. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 16:01:19 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Wed, 11 Aug 2021 20:01:19 +0000 Subject: [issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str` Message-ID: <1628712079.84.0.245411182001.issue44891@roundup.psfhosted.org> New submission from Nikita Sobolev : While working on `RustPython` (original issue: https://github.com/RustPython/RustPython/issues/2840), I've noticed that `tuple` in CPython has explicit tests that `id` does not change when multiplied by `1`, related: - https://github.com/python/cpython/blob/64a7812c170f5d46ef16a1517afddc7cd92c5240/Lib/test/seq_tests.py#L322 - https://github.com/python/cpython/blob/64a7812c170f5d46ef16a1517afddc7cd92c5240/Lib/test/seq_tests.py#L286-L287 But, I cannot find similar tests for `str` and `bytes` which also have the same behavior: - `str`: https://github.com/python/cpython/blob/64a7812c170f5d46ef16a1517afddc7cd92c5240/Objects/unicodeobject.c#L12709-L12710 - `bytes`: https://github.com/python/cpython/blob/64a7812c170f5d46ef16a1517afddc7cd92c5240/Objects/bytesobject.c#L1456-L1458 Code: ```python >>> b = b'abc' >>> id(b), id(b * 1), id(b) == id(b * 1) (4491073360, 4491073360, True) >>> s = 'abc' >>> id(s), id(s * 1), id(s) == id(s * 1) (4489513776, 4489513776, True) ``` If tests are indeed missing and should be added, I would love to contribute them. ---------- components: Tests messages: 399414 nosy: sobolevn priority: normal severity: normal status: open title: Tests for `id(a) == id(a * 1)` for `bytes` and `str` type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 16:32:21 2021 From: report at bugs.python.org (Diego Ramirez) Date: Wed, 11 Aug 2021 20:32:21 +0000 Subject: [issue44892] Percentage character (%) inside a comment is badly recognized when using configparser Message-ID: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> New submission from Diego Ramirez : On the Pip GitHub issue tracker (https://github.com/pypa/pip/issues/10348), a user reported a strange behaviour when using a config file (setup.cfg) on its project. The config file had a percentage character ("%") inside a commentary. But the module "configparser" failed with traceback: configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: "%' in string formatting We consider that the character was badly recognized as a part of the file, when it was just a part of an inline comment. Is there any way to fix this bug? ---------- components: Library (Lib) messages: 399415 nosy: DiddiLeija priority: normal severity: normal status: open title: Percentage character (%) inside a comment is badly recognized when using configparser type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 16:48:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 11 Aug 2021 20:48:35 +0000 Subject: [issue30952] [Windows] include Math extension in SQlite In-Reply-To: <1500324019.46.0.539377026115.issue30952@psf.upfronthosting.co.za> Message-ID: <1628714915.95.0.885602380078.issue30952@roundup.psfhosted.org> Erlend E. Aasland added the comment: This was fixed in bpo-42686. Closing as duplicate. ---------- nosy: +erlendaasland resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> include built-in Math functions in SQLite to 3.35.0 of march 2021 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 17:01:29 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 11 Aug 2021 21:01:29 +0000 Subject: [issue35398] SQLite incorrect row count for UPDATE In-Reply-To: <1543890465.67.0.788709270274.issue35398@psf.upfronthosting.co.za> Message-ID: <1628715689.43.0.430826599714.issue35398@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-36859. ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 17:02:17 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 11 Aug 2021 21:02:17 +0000 Subject: [issue36859] sqlite3 dml statement detection does not account for CTEs In-Reply-To: <1557356904.4.0.529350025795.issue36859@roundup.psfhosted.org> Message-ID: <1628715737.37.0.097269104604.issue36859@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-35398 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 17:33:03 2021 From: report at bugs.python.org (Ronny Pfannschmidt) Date: Wed, 11 Aug 2021 21:33:03 +0000 Subject: [issue44893] importlib.metadata Entrypoint has a broken _asdict Message-ID: <1628717583.56.0.19105113048.issue44893@roundup.psfhosted.org> New submission from Ronny Pfannschmidt : due to ``` def __iter__(self): """ Supply iter so one may construct dicts of EntryPoints easily. """ return iter((self.name, self)) ``` the default namedtuple asdict method is broken instead of returning the fields, recursive objects are returned as ``` (Pdb) v EntryPoint(name='.git', value='setuptools_scm.git:parse', group='setuptools_scm.parse_scm') (Pdb) v._asdict() {'name': '.git', 'value': EntryPoint(name='.git', value='setuptools_scm.git:parse', group='setuptools_scm.parse_scm')} (Pdb) type(v) (Pdb) ---------- components: Library (Lib) messages: 399419 nosy: Ronny.Pfannschmidt priority: normal severity: normal status: open title: importlib.metadata Entrypoint has a broken _asdict type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 18:22:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 22:22:00 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1628720520.07.0.253995987031.issue26228@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 81ab8db235580317edcb0e559cd4c983f70883f5 by Zephyr Shannon in branch 'main': bpo-26228: Fix pty EOF handling (GH-12049) https://github.com/python/cpython/commit/81ab8db235580317edcb0e559cd4c983f70883f5 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 18:22:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 22:22:32 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1628720552.8.0.879712793595.issue26228@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 18:22:37 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 11 Aug 2021 22:22:37 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1628720557.58.0.712516391312.issue26228@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26212 pull_request: https://github.com/python/cpython/pull/27732 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 18:35:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 11 Aug 2021 22:35:26 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628721326.6.0.0602094830661.issue33930@roundup.psfhosted.org> ?ukasz Langa added the comment: Entirely possible, Irit. We've had just this sort of case just last week! See: https://bugs.python.org/issue44524#msg399157 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 19:16:42 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 11 Aug 2021 23:16:42 +0000 Subject: [issue44845] Allow keyword arguments in code.__new__ In-Reply-To: <1628193355.65.0.685014983693.issue44845@roundup.psfhosted.org> Message-ID: <1628723802.36.0.708835058608.issue44845@roundup.psfhosted.org> Raymond Hettinger added the comment: Generally, construction time is faster if the arguments are positional only. Also, this isn't a method that people typically call directly ? it is only quasi-public because the layout of the codestring is implementation dependent and changes every now and then. Given that it is essentially private, there is no benefit to exposing keyword argument calls. Thanks for the suggestion, but I don't think it makes things better for users. ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 19:56:49 2021 From: report at bugs.python.org (Xiaoling Bao) Date: Wed, 11 Aug 2021 23:56:49 +0000 Subject: [issue44894] HTTP request handler should check sys.stderr for None before use for logging Message-ID: <1628726209.14.0.0889982500329.issue44894@roundup.psfhosted.org> New submission from Xiaoling Bao : This is about HTTP server library (found on Windows with python 3.9, not sure other platforms). In file Lib\http\server.py, we define: class BaseHTTPRequestHandler(...): def log_message(self, format, *args): sys.stderr.write(...) In certain cases, sys.stderr could be None and thus this function call will throw exception. My use case: I created an XMLRPC server (SimpleXMLRPCRequestHandler derives from BaseHTTPRequestHandler) within a Windows service. I guess with that combination, sys.stderr will be None. When this issue happens, the client got empty response and not much error log for debugging. I can upload sample source code files if needed. ---------- components: Library (Lib) messages: 399423 nosy: xiaolingbao priority: normal severity: normal status: open title: HTTP request handler should check sys.stderr for None before use for logging versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 20:13:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 00:13:38 +0000 Subject: [issue44895] refleak test failure in test_exceptions Message-ID: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> New submission from Irit Katriel : For background see https://bugs.python.org/issue33930#msg399403 iritkatriel at Irits-MBP cpython % repeat 10 ./python.exe -m test -R 3:3 test_exceptions -m test_no_hang_on_context_chain_cycle2 -m test_recursion_normalizing_infinite_exception -m test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory 0:00:00 load avg: 2.32 Run tests sequentially 0:00:00 load avg: 2.32 [1/1] test_exceptions beginning 6 repetitions 123456 ...... == Tests result: SUCCESS == 1 test OK. Total duration: 5.9 sec Tests result: SUCCESS 0:00:00 load avg: 2.22 Run tests sequentially 0:00:00 load avg: 2.22 [1/1] test_exceptions beginning 6 repetitions 123456 ...... == Tests result: SUCCESS == 1 test OK. Total duration: 5.8 sec Tests result: SUCCESS 0:00:00 load avg: 2.20 Run tests sequentially 0:00:00 load avg: 2.20 [1/1] test_exceptions beginning 6 repetitions 123456 ...... == Tests result: SUCCESS == 1 test OK. Total duration: 5.8 sec Tests result: SUCCESS 0:00:00 load avg: 2.17 Run tests sequentially 0:00:00 load avg: 2.17 [1/1] test_exceptions beginning 6 repetitions 123456 ...... test_exceptions leaked [6, 6, 4] references, sum=16 test_exceptions leaked [6, 6, 4] memory blocks, sum=16 test_exceptions failed (reference leak) == Tests result: FAILURE == 1 test failed: test_exceptions 1 re-run test: test_exceptions Total duration: 5.9 sec Tests result: FAILURE 0:00:00 load avg: 2.08 Run tests sequentially 0:00:00 load avg: 2.08 [1/1] test_exceptions beginning 6 repetitions 123456 ...... test_exceptions leaked [6, 6, 6] references, sum=18 test_exceptions leaked [6, 6, 6] memory blocks, sum=18 test_exceptions failed (reference leak) == Tests result: FAILURE == 1 test failed: test_exceptions 1 re-run test: test_exceptions Total duration: 5.8 sec Tests result: FAILURE 0:00:00 load avg: 2.39 Run tests sequentially 0:00:00 load avg: 2.39 [1/1] test_exceptions beginning 6 repetitions 123456 ...... test_exceptions leaked [6, 6, 6] references, sum=18 test_exceptions leaked [6, 6, 6] memory blocks, sum=18 test_exceptions failed (reference leak) == Tests result: FAILURE == 1 test failed: test_exceptions 1 re-run test: test_exceptions Total duration: 6.0 sec Tests result: FAILURE 0:00:00 load avg: 2.36 Run tests sequentially 0:00:00 load avg: 2.36 [1/1] test_exceptions beginning 6 repetitions 123456 ...... test_exceptions leaked [6, 6, 6] references, sum=18 test_exceptions leaked [6, 6, 6] memory blocks, sum=18 test_exceptions failed (reference leak) == Tests result: FAILURE == 1 test failed: test_exceptions 1 re-run test: test_exceptions Total duration: 6.0 sec Tests result: FAILURE 0:00:00 load avg: 2.31 Run tests sequentially 0:00:00 load avg: 2.31 [1/1] test_exceptions beginning 6 repetitions 123456 ...... == Tests result: SUCCESS == 1 test OK. Total duration: 6.3 sec Tests result: SUCCESS 0:00:00 load avg: 2.20 Run tests sequentially 0:00:00 load avg: 2.20 [1/1] test_exceptions beginning 6 repetitions 123456 ...... test_exceptions leaked [6, 6, 6] references, sum=18 test_exceptions leaked [6, 6, 6] memory blocks, sum=18 test_exceptions failed (reference leak) == Tests result: FAILURE == 1 test failed: test_exceptions 1 re-run test: test_exceptions Total duration: 6.1 sec Tests result: FAILURE 0:00:00 load avg: 2.35 Run tests sequentially 0:00:00 load avg: 2.35 [1/1] test_exceptions ---------- components: Interpreter Core messages: 399424 nosy: iritkatriel priority: normal severity: normal status: open title: refleak test failure in test_exceptions versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 20:14:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 00:14:32 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628727272.28.0.53198303233.issue33930@roundup.psfhosted.org> Irit Katriel added the comment: I've narrowed it down a bit more and created issue44895. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 20:19:22 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 12 Aug 2021 00:19:22 +0000 Subject: [issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628727562.59.0.832233627755.issue44881@roundup.psfhosted.org> Neil Schemenauer added the comment: I was thinking about this more today and I think the better fix is to actually build the trashcan mechanism into _Py_Dealloc(). Requiring that types opt-in to the trashcan mechanism by using the trashcan macros is not ideal. First, the trashcan macros are a bit tricky to use correctly. Second, every "container" type is potentially a part of a long ref chain and could blow up the stack on deallocation (i.e. triggered from DECREF). So, for correctness/robustness, every type that supports cyclic GC should get trashcan-style deallocation. We would have to find a way to do this without incurring a (significant) performance hit. Also, it would have to be done without breaking C extensions. Ideally they would get trashcan-style deallocation without any source code changes. I'm not sure if that can be done but I'm hopeful it's possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 21:26:20 2021 From: report at bugs.python.org (Kai Xia) Date: Thu, 12 Aug 2021 01:26:20 +0000 Subject: [issue44896] Issue with unparse in ast module Message-ID: <1628731580.95.0.847749574283.issue44896@roundup.psfhosted.org> New submission from Kai Xia : I was trying to construct an ast object dynamically and I think I can identify some potential issue. With the following snippet: ``` #!/usr/bin/env python3 import ast import sys print(sys.version) good = ast.Assign( targets=[ast.Name(id="hello", ctx=ast.Store())], value=ast.Constant(value="world"), lineno=1 ) print(ast.unparse(good)) bad = ast.Assign( targets=[ast.Name(id="hello", ctx=ast.Store())], value=ast.Constant(value="world"), ) print(ast.unparse(bad)) ``` On my box the output looks like: ``` 3.9.6 (default, Jun 29 2021, 05:25:02) [Clang 12.0.5 (clang-1205.0.22.9)] hello = 'world' Traceback (most recent call last): File "/Users/xiaket/py.py", line 19, in print(ast.unparse(bad)) File "/usr/local/Cellar/python at 3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ast.py", line 1572, in unparse return unparser.visit(ast_obj) File "/usr/local/Cellar/python at 3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ast.py", line 801, in visit self.traverse(node) File "/usr/local/Cellar/python at 3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ast.py", line 795, in traverse super().visit(node) File "/usr/local/Cellar/python at 3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ast.py", line 407, in visit return visitor(node) File "/usr/local/Cellar/python at 3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ast.py", line 858, in visit_Assign if type_comment := self.get_type_comment(node): File "/usr/local/Cellar/python at 3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ast.py", line 786, in get_type_comment comment = self._type_ignores.get(node.lineno) or node.type_comment AttributeError: 'Assign' object has no attribute 'lineno' ``` As I can understand, when we need to construct the Assign object, we'll need to provide two keyword arguments, targets and value. We don't need to provide the `lineno` as it should be an attribute of the statement node. Also, if we don't run `unparse` against the object, apparently it works fine. I think in the `get_type_comment` method, we are making the assumption that the lineno is set automatically, this is true when we are parsing python source code as string. But when we are creating the object from scratch, we don't have that `lineno` attribute and it will fail. ---------- components: Library (Lib) messages: 399427 nosy: xiaket priority: normal severity: normal status: open title: Issue with unparse in ast module type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 21:33:31 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 12 Aug 2021 01:33:31 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628732011.2.0.719848540876.issue33930@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- nosy: +benjamin.peterson nosy_count: 14.0 -> 15.0 pull_requests: +26213 pull_request: https://github.com/python/cpython/pull/27733 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 21:33:46 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 12 Aug 2021 01:33:46 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1628732026.44.0.118874719695.issue42560@roundup.psfhosted.org> Mark Roseman added the comment: I was having a peek at the main tkinter doc page again and would like to take a broader crack at it. I think most of what is there now (life preserver/reference) needs to be substantially reworked or trimmed. I think exhaustive description of all methods etc. is unrealistic given the magnitude of the job and variation between versions, but it seems reasonable that the doc page would help identify what tkinter API to use, how to find out what it's parameters and options are (interactively), and if needed how to figure out the corresponding Tcl command so things can be looked up in the Tcl/Tk docs and in general map from Tcl to Python. Ultimately, if the tkinter docs can get people started and point them to the right places to learn more (including things like the TkDocs tutorial or Shipman ref, the Tcl/Tk man pages) I'd call it a win. Right now it's a big muddle, and one that too easily becomes out-of-date. ---------- nosy: +markroseman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 21:56:50 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 12 Aug 2021 01:56:50 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628733410.73.0.80793271794.issue33930@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset f08e6d1bb3c5655f184af88c6793e90908bb6338 by Benjamin Peterson in branch 'main': bpo-33930: Fix typo in the test name. (#27733) https://github.com/python/cpython/commit/f08e6d1bb3c5655f184af88c6793e90908bb6338 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 21:57:01 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 12 Aug 2021 01:57:01 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628733421.71.0.162491187134.issue33930@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26215 pull_request: https://github.com/python/cpython/pull/27735 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 21:56:56 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 12 Aug 2021 01:56:56 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628733416.72.0.336833471027.issue33930@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26214 pull_request: https://github.com/python/cpython/pull/27734 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 22:02:12 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 12 Aug 2021 02:02:12 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628733732.8.0.102147069516.issue33930@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- pull_requests: +26216 pull_request: https://github.com/python/cpython/pull/27736 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 22:17:31 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Thu, 12 Aug 2021 02:17:31 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628734651.35.0.384122775017.issue33930@roundup.psfhosted.org> Benjamin Peterson added the comment: New changeset d7f5796a1ec7ba223f6a844d7580559abef05238 by Miss Islington (bot) in branch '3.8': bpo-33930: Fix typo in the test name. (GH-27735) https://github.com/python/cpython/commit/d7f5796a1ec7ba223f6a844d7580559abef05238 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 22:20:29 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 12 Aug 2021 02:20:29 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628734829.14.0.259112420086.issue33930@roundup.psfhosted.org> miss-islington added the comment: New changeset f7635f0e542c916bfd62542e7b60ee23ff681d0d by Miss Islington (bot) in branch '3.9': [3.9] bpo-33930: Fix typo in the test name. (GH-27733) (GH-27734) https://github.com/python/cpython/commit/f7635f0e542c916bfd62542e7b60ee23ff681d0d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 22:32:23 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 12 Aug 2021 02:32:23 +0000 Subject: [issue44893] importlib.metadata Entrypoint has a broken _asdict In-Reply-To: <1628717583.56.0.19105113048.issue44893@roundup.psfhosted.org> Message-ID: <1628735543.52.0.195399820251.issue44893@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 22:52:34 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 12 Aug 2021 02:52:34 +0000 Subject: [issue44893] importlib.metadata Entrypoint has a broken _asdict In-Reply-To: <1628717583.56.0.19105113048.issue44893@roundup.psfhosted.org> Message-ID: <1628736754.47.0.874409539483.issue44893@roundup.psfhosted.org> Jason R. Coombs added the comment: I'll probably fix the issue in importlib_metadata first (https://github.com/python/importlib_metadata/issues/337). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 23:20:35 2021 From: report at bugs.python.org (Diego Ramirez) Date: Thu, 12 Aug 2021 03:20:35 +0000 Subject: [issue44892] configparser fails when the file contains a "%" inside a commentary In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1628738435.62.0.52611064294.issue44892@roundup.psfhosted.org> Change by Diego Ramirez : ---------- title: Percentage character (%) inside a comment is badly recognized when using configparser -> configparser fails when the file contains a "%" inside a commentary _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 11 23:44:40 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 12 Aug 2021 03:44:40 +0000 Subject: [issue44173] Stored (uncompressed) ZipExtFile in zipfile can be seekable at lower cost In-Reply-To: <1621391319.87.0.895694633998.issue44173@roundup.psfhosted.org> Message-ID: <1628739880.53.0.766834731669.issue44173@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +alanmcintyre, serhiy.storchaka, twouters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 00:24:16 2021 From: report at bugs.python.org (JuniorJPDJ) Date: Thu, 12 Aug 2021 04:24:16 +0000 Subject: [issue44173] Stored (uncompressed) ZipExtFile in zipfile can be seekable at lower cost In-Reply-To: <1621391319.87.0.895694633998.issue44173@roundup.psfhosted.org> Message-ID: <1628742256.6.0.536700487803.issue44173@roundup.psfhosted.org> Change by JuniorJPDJ : ---------- pull_requests: +26217 pull_request: https://github.com/python/cpython/pull/27737 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 02:12:33 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 12 Aug 2021 06:12:33 +0000 Subject: [issue44897] Integrate trashcan mechanism into _Py_Dealloc Message-ID: <1628748753.21.0.569730676893.issue44897@roundup.psfhosted.org> New submission from Neil Schemenauer : This is a WIP/proof-of-concept of doing away with Py_TRASHCAN_BEGIN and Py_TRASHCAN_END and instead integrating the functionality into _Py_Dealloc. There are a few advantages: - all container objects have the risk of overflowing the C stack if a long reference chain of them is created and then deallocated. So, to be safe, the tp_dealloc methods for those objects should be protected from overflowing the stack. - the Py_TRASHCAN_BEGIN and Py_TRASHCAN_END macros are hard to understand and a bit hard to use correctly. Making the mechanism internal avoids confusion. The code can be slightly simplified as well. This proof-of-concept seems to pass tests but it will need some careful review. The exact rules related to calling GC Track/Untrack are subtle and this changes things a bit. I.e. tp_dealloc is called with GC objects already untracked. For 3rd party extensions, they are calling PyObject_GC_UnTrack() and so I believe they should still work. The fact that PyObject_CallFinalizerFromDealloc() wants GC objects to definitely be tracked is a bit of a mystery to me (there is an assert to check that). I changed the code to track objects if they are not already tracked but I'm not sure that's correct. There could be a performance hit, due to the _PyType_IS_GC() test that was added to the _Py_Dealloc() function. For non-GC objects, that's going to be a new branch and I'm worried it might hurt a bit. OTOH, maybe it's just in the noise. Profiling will need to be done. ---------- components: Interpreter Core messages: 399433 nosy: nascheme priority: normal severity: normal stage: patch review status: open title: Integrate trashcan mechanism into _Py_Dealloc type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 02:35:45 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 12 Aug 2021 06:35:45 +0000 Subject: [issue44897] Integrate trashcan mechanism into _Py_Dealloc In-Reply-To: <1628748753.21.0.569730676893.issue44897@roundup.psfhosted.org> Message-ID: <1628750145.4.0.74895275532.issue44897@roundup.psfhosted.org> Change by Neil Schemenauer : ---------- keywords: +patch pull_requests: +26218 pull_request: https://github.com/python/cpython/pull/27738 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 02:38:42 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Thu, 12 Aug 2021 06:38:42 +0000 Subject: [issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628750322.83.0.657484808565.issue44881@roundup.psfhosted.org> Neil Schemenauer added the comment: I wrote a proof-of-concept as bpo-44897. PR 27718 (this issue) might a slightly better performance but I like the other one better because it doesn't expose so much implementation detail to extension types. Either of them require careful review before merging. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 05:10:34 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 12 Aug 2021 09:10:34 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628759434.73.0.601967499613.issue44895@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 05:45:35 2021 From: report at bugs.python.org (russiavk) Date: Thu, 12 Aug 2021 09:45:35 +0000 Subject: [issue44898] Path.read_bytes() failed when path contains chinese character Message-ID: <1628761535.09.0.889249928246.issue44898@roundup.psfhosted.org> New submission from russiavk : Path.read_bytes() failed when this path contains chinese character ---------- components: IO messages: 399435 nosy: russiavk priority: normal severity: normal status: open title: Path.read_bytes() failed when path contains chinese character type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 05:49:39 2021 From: report at bugs.python.org (russiavk) Date: Thu, 12 Aug 2021 09:49:39 +0000 Subject: [issue44898] Path.read_bytes() failed when path contains chinese character In-Reply-To: <1628761535.09.0.889249928246.issue44898@roundup.psfhosted.org> Message-ID: <1628761779.95.0.967404064211.issue44898@roundup.psfhosted.org> russiavk added the comment: It give me error :FileNotFoundError [errno 2] No such file or directory ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 06:00:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Aug 2021 10:00:41 +0000 Subject: [issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628762441.48.0.238063396437.issue44881@roundup.psfhosted.org> STINNER Victor added the comment: The problem of PyObject_GC_UnTrack() is just the most visible effect of the trashcan mecanism: tp_dealloc can be called twice, and this is *not* expected by the tp_dealloc API. Putting trashcan mecanism outside tp_dealloc can allow to make sure that tp_dealloc is called exactly once. _Py_Dealloc() sounds like a good candidate, but I didn't check if it's the only way to call tp_dealloc. Are there other places where tp_dealloc is called *directly*? Using military grade regex, I found the following functions calling tp_dealloc: grep 'dealloc[) ]*([a-zA-Z]\+)' */*.c * _Py_Dealloc() obviously * _PyTrash_thread_destroy_chain() * subtype_dealloc() * Modules/_testcapimodule.c: check_pyobject_freed_is_freed() <= unit test, it can be ignored So if we move the trashcan usage inside functions, 3 functions must be modified: * _Py_Dealloc() * _PyTrash_thread_destroy_chain() * subtype_dealloc() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 06:26:49 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 12 Aug 2021 10:26:49 +0000 Subject: [issue44898] Path.read_bytes() failed when path contains chinese character In-Reply-To: <1628761535.09.0.889249928246.issue44898@roundup.psfhosted.org> Message-ID: <1628764009.07.0.694858354241.issue44898@roundup.psfhosted.org> Steven D'Aprano added the comment: How did you enter the Chinese characters? It works for me: >>> filename = 'Beijing ???' >>> with open(filename, 'w') as f: ... f.write('data') ... 4 >>> from pathlib import Path >>> p = Path(filename) >>> p.read_bytes() b'data' Please provide a *minimal reproducible example* https://stackoverflow.com/help/minimal-reproducible-example http://www.sscce.org/ ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 06:27:28 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 12 Aug 2021 10:27:28 +0000 Subject: [issue44898] Path.read_bytes() failed when path contains chinese character In-Reply-To: <1628761535.09.0.889249928246.issue44898@roundup.psfhosted.org> Message-ID: <1628764048.99.0.546818157849.issue44898@roundup.psfhosted.org> Steven D'Aprano added the comment: Also, we need to know the version of Python and your OS. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 06:35:14 2021 From: report at bugs.python.org (meowmeowcat) Date: Thu, 12 Aug 2021 10:35:14 +0000 Subject: [issue44898] Path.read_bytes() failed when path contains chinese character In-Reply-To: <1628761535.09.0.889249928246.issue44898@roundup.psfhosted.org> Message-ID: <1628764514.4.0.112815324744.issue44898@roundup.psfhosted.org> Change by meowmeowcat : ---------- nosy: +meowmeowmeowcat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 06:47:46 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 12 Aug 2021 10:47:46 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. In-Reply-To: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> Message-ID: <1628765266.84.0.755773156121.issue44878@roundup.psfhosted.org> Mark Shannon added the comment: New changeset a530a9538f3f444bebd2d2b71fe5f2e747e76d73 by Mark Shannon in branch 'main': bpo-44878: Remove loop from interpreter. All dispatching is done by gotos. (GH-27727) https://github.com/python/cpython/commit/a530a9538f3f444bebd2d2b71fe5f2e747e76d73 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 06:54:43 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 12 Aug 2021 10:54:43 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. In-Reply-To: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> Message-ID: <1628765683.6.0.656635710063.issue44878@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 07:00:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Aug 2021 11:00:13 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628766013.71.0.422965475808.issue44895@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 07:10:42 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 12 Aug 2021 11:10:42 +0000 Subject: [issue44859] Improve some sqlite3 errors In-Reply-To: <1628345656.7.0.124562565005.issue44859@roundup.psfhosted.org> Message-ID: <1628766642.45.0.537791851911.issue44859@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Also, for SQLite 3.7.17 and above, we should raise sqlite3.Warning for error codes SQLITE_NOTICE and SQLITE_WARNING. Er, forget that. Neither are returned by any SQLite C interface, at the moment. They can (currently) only be used as the first argument to sqlite3_log(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 07:15:14 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 12 Aug 2021 11:15:14 +0000 Subject: [issue44890] Enable specialization stats collection when in Py_DEBUG In-Reply-To: <1628695956.18.0.391304040066.issue44890@roundup.psfhosted.org> Message-ID: <1628766914.13.0.201124898939.issue44890@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 8ac0886091c27bf4b6bb0a9b571e174b554d31a4 by Irit Katriel in branch 'main': bpo-44890: collect specialization stats if Py_DEBUG (GH-27731) https://github.com/python/cpython/commit/8ac0886091c27bf4b6bb0a9b571e174b554d31a4 ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 07:18:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 11:18:06 +0000 Subject: [issue44890] Enable specialization stats collection when in Py_DEBUG In-Reply-To: <1628695956.18.0.391304040066.issue44890@roundup.psfhosted.org> Message-ID: <1628767086.37.0.282610142316.issue44890@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 07:43:12 2021 From: report at bugs.python.org (Marko Tuononen) Date: Thu, 12 Aug 2021 11:43:12 +0000 Subject: [issue44899] tarfile: add support for creating an archive of potentially changing files Message-ID: <1628768592.88.0.0306570478346.issue44899@roundup.psfhosted.org> New submission from Marko Tuononen : I have a use case where I need to create a tar archive from a collection of potentially changing files. I need to use system resources sparingly and because of that it is not possible to first make a copy of the files. Current state of the tarfile library: Creating a tar archive is interrupted with an OSError "unexpected end of data" (example below), if any of the files changes when it is collected. Using the tarfile library in streaming mode does not work either. You might find this bug report relevant: https://bugs.python.org/issue26877 File "/usr/lib64/python3.7/tarfile.py", line 1946, in add self.addfile(tarinfo, f) File "/usr/lib64/python3.7/tarfile.py", line 1974, in addfile copyfileobj(fileobj, self.fileobj, tarinfo.size, bufsize=bufsize) File "/usr/lib64/python3.7/tarfile.py", line 249, in copyfileobj raise exception("unexpected end of data") OSError: unexpected end of data Target state of the tarfile library: Creating a tar archive is not interrupted even if a file changes while collected. The tarfile library's add() method would just return an exit value indicating that some files were changed while being archived. See e.g. how GNU tar handles similar situation: https://man7.org/linux/man-pages/man1/tar.1.html#RETURN_VALUE ---------- components: Library (Lib) messages: 399443 nosy: marko-tuononen priority: normal severity: normal status: open title: tarfile: add support for creating an archive of potentially changing files type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 07:44:41 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 12 Aug 2021 11:44:41 +0000 Subject: [issue44900] Implement superinstructions Message-ID: <1628768681.09.0.627092423081.issue44900@roundup.psfhosted.org> New submission from Mark Shannon : PEP 659 quickening provides a mechanism for replacing instructions. We should exploit this to implement superinstructions when quickening. See https://github.com/faster-cpython/ideas/issues/16 ---------- messages: 399444 nosy: Mark.Shannon priority: normal severity: normal status: open title: Implement superinstructions type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 07:46:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 11:46:47 +0000 Subject: [issue44890] Enable specialization stats collection when in Py_DEBUG In-Reply-To: <1628695956.18.0.391304040066.issue44890@roundup.psfhosted.org> Message-ID: <1628768807.26.0.0375510168919.issue44890@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +26219 pull_request: https://github.com/python/cpython/pull/27740 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 08:36:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 12 Aug 2021 12:36:30 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1628771790.37.0.167433361902.issue26228@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 5d444434ad4e1943a88c9d3aadd300fd0f05dab7 by Miss Islington (bot) in branch '3.10': bpo-26228: Fix pty EOF handling (GH-12049) (GH-27732) https://github.com/python/cpython/commit/5d444434ad4e1943a88c9d3aadd300fd0f05dab7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 08:37:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 12 Aug 2021 12:37:09 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1628771829.63.0.177279951359.issue26228@roundup.psfhosted.org> ?ukasz Langa added the comment: This is now merged. Thanks for all input, everyone! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 09:04:30 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 12 Aug 2021 13:04:30 +0000 Subject: [issue44900] Implement superinstructions In-Reply-To: <1628768681.09.0.627092423081.issue44900@roundup.psfhosted.org> Message-ID: <1628773470.68.0.178835703572.issue44900@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +26220 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27741 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 09:33:02 2021 From: report at bugs.python.org (Christian Buhtz) Date: Thu, 12 Aug 2021 13:33:02 +0000 Subject: [issue44901] Info about used pickle protocol used by multiprocessing.Queue Message-ID: <1628775182.23.0.332446987158.issue44901@roundup.psfhosted.org> New submission from Christian Buhtz : I read some of the PEPs about pickeling. But I would not say that I understood everything. Of course I checked the docu about multiprocessing.Queue. Currently it is not clear for me which pickle protocol is used by multiprocessing.Queue. Maybe I missed something in the docu or the docu can be improved? - Is there a fixed default - maybe different between the Python versions? - Or is the pickle protocol version dynamicly selected depending on the kind/type/size of data put() into the Queue? Is there a way to find out at runtime which protocol version is used for a specific Queue instance with a specific piece of data? Background: I use Python 3.7 and 3.9 with Pandas 1.3.5. I parallelize work with hugh(?) pandas.DataFrame objects. I simply cut them into pieces (on row axis) which number is limited to the machines CPU cores (minus 1). The cutting happens several times in my sripts because for some things I need the data as one complete DataFrame. Just for example here is one of such pieces which is given to a worker by argument and send back via Queue - 7 workers! RangeIndex: 226687 entries, 0 to 226686 Data columns (total 38 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 HASH_ .... .... 37 NAME_ORG 226687 non-null object dtypes: datetime64[ns](6), float64(1), int64(1), object(30) memory usage: 65.7+ MB I am a bit "scared" that Python wasting my CPU time and does some compression on that data. ;) I just want to get a better idea what is done in the background. ---------- messages: 399447 nosy: buhtz priority: normal severity: normal status: open title: Info about used pickle protocol used by multiprocessing.Queue versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 09:41:00 2021 From: report at bugs.python.org (meowmeowcat) Date: Thu, 12 Aug 2021 13:41:00 +0000 Subject: [issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS' Message-ID: <1628775660.76.0.290058998171.issue44902@roundup.psfhosted.org> New submission from meowmeowcat : Changing 'Mac OS X'/'OS X' to 'macOS' in docs. https://www.python.org has already changed to 'macOS'. ---------- assignee: docs at python components: Documentation messages: 399448 nosy: docs at python, meowmeowmeowcat priority: normal severity: normal status: open title: [Doc] Changing 'Mac OS X'/'OS X' to 'macOS' type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 09:44:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Aug 2021 13:44:23 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628775863.9.0.871256572864.issue44895@roundup.psfhosted.org> STINNER Victor added the comment: I fail to reproduce the issue on Linux on the 3.10 branch. I interrupted the job after 20 minutes: $ ./python -m test -R 3:3 test_exceptions -m test_no_hang_on_context_chain_cycle2 -m test_recursion_normalizing_infinite_exception -m test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory -F -j1 (...) 0:21:38 load avg: 2.01 [134] test_exceptions passed beginning 6 repetitions 123456 ...... I tested the commit 5d444434ad4e1943a88c9d3aadd300fd0f05dab7. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 09:59:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 13:59:55 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628776795.37.0.18289947771.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: I see it on Mac but not windows. Running the test with -v or adding prints makes the leak go away. I?m suspecting that one of the recursion tests fails to clear an exception or something like that. Removing any one of the tests makes it stop failing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:02:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 14:02:39 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628776959.44.0.660128901134.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: Victor, if the ?cycle2 test is hanging then you need the change in PR27626. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:17:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Aug 2021 14:17:03 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628777823.0.0.793740163321.issue44895@roundup.psfhosted.org> STINNER Victor added the comment: I am not more lucky in the main branch. I ran it for 30 minutes and it didn't fail. $ ./python -m test -R 3:3 test_exceptions -m test_no_hang_on_context_chain_cycle2 -m test_recursion_normalizing_infinite_exception -m test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory -F -j1 (...) 0:31:15 load avg: 1.88 [184] test_exceptions passed beginning 6 repetitions 123456 ...... ^C Kill process group == Tests result: INTERRUPTED == Test suite interrupted by signal SIGINT. 184 tests OK. Total duration: 31 min 19 sec Tests result: INTERRUPTED I tested commit 8ac0886091c27bf4b6bb0a9b571e174b554d31a4. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:18:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Aug 2021 14:18:27 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628777907.41.0.329147196848.issue44895@roundup.psfhosted.org> STINNER Victor added the comment: > Victor, if the ?cycle2 test is hanging then you need the change in PR27626. That's the commit d5c217475c4957a8084ac3f92ae012ece5edc7cb. My main branch is up to date (commit 8ac0886091c27bf4b6bb0a9b571e174b554d31a4), it includes the commit d5c217475c4957a8084ac3f92ae012ece5edc7cb. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:20:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 14:20:48 +0000 Subject: [issue44890] Enable specialization stats collection when in Py_DEBUG In-Reply-To: <1628695956.18.0.391304040066.issue44890@roundup.psfhosted.org> Message-ID: <1628778048.71.0.0790551937044.issue44890@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 789a6af29f531f78abd2e2f6af80084ccabf80b1 by Irit Katriel in branch 'main': bpo-44890: Fix AMD build error (GH-27740) https://github.com/python/cpython/commit/789a6af29f531f78abd2e2f6af80084ccabf80b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:21:00 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 12 Aug 2021 14:21:00 +0000 Subject: [issue44901] Info about used pickle protocol used by multiprocessing.Queue In-Reply-To: <1628775182.23.0.332446987158.issue44901@roundup.psfhosted.org> Message-ID: <1628778060.16.0.904220030431.issue44901@roundup.psfhosted.org> Eric V. Smith added the comment: Because this is a usage question and not a bug, you'll get more help using the python-list mailing list or Stack Overflow, or some other Q&A forum. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:21:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 14:21:37 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628778097.69.0.513083595468.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: I don't know why you need to kill it. It's not a long test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:23:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 12 Aug 2021 14:23:43 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628778223.59.0.47298874301.issue44895@roundup.psfhosted.org> STINNER Victor added the comment: > I see it on Mac but not windows. Aha, maybe there is something specific on Mac which triggers an exact code path to trigger to bug. I already saw bugs like that. You can try to play with gc.set_threshold() to change how garbage collection is triggered. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:33:56 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 12 Aug 2021 14:33:56 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1628778836.39.0.227080824868.issue42560@roundup.psfhosted.org> Mark Roseman added the comment: Here are my broad suggestions for improvement (each of these would turn into a separate PR). Thoughts for/against each? 1. 'See also' section: use this to guide people to what they need. update to point out challenge of finding material given age etc., clearer what to use each resource for, update as needed (e.g. later editions of books) 2. Tkinter modules section: add ttk up front (i.e. usually use tkinter and tkinter.ttk), fill in a couple missing ones, move import/Tk() to later section (example or ref) 3. Architecture (was recently added). Merge in (and improve) material from how Tk and Tkinter are related, drop Tix from here 4. Replace life preserver with: 4a. Updated hello world example: use ttk and grid, explain each call 4b. How to introspect (figure out commands, arguments, and options... some of this is e.g. now in the reference section) so when don't have exact docs on something can figure out how to find answers 4c. Bridge from Tcl/Tk documentation: rewrite of 'quick look' and 'mapping' sections, more a list of how key concepts are realized in Tkinter, such as widget hierarchy. Less example based, more factual/reference oriented. 5. 'Handy reference' section: drop most of what's there now, replace with lists of classes (e.g. widgets), general methods available on all widgets (grid, bind, winfo*, etc.), organized into categories. Likely without (most) arguments or options, or descriptions. There have been a few starts on this including the PR that Mason did here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:39:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 14:39:45 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628779185.69.0.0121716222605.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: > I don't know why you need to kill it. It's not a long test. Ah I see, -F. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:38:45 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 12 Aug 2021 14:38:45 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1628779125.49.0.0262871440983.issue42560@roundup.psfhosted.org> Change by Mark Roseman : ---------- nosy: +lukasz.langa, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:42:25 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 12 Aug 2021 14:42:25 +0000 Subject: [issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS' In-Reply-To: <1628775660.76.0.290058998171.issue44902@roundup.psfhosted.org> Message-ID: <1628779345.86.0.463692564266.issue44902@roundup.psfhosted.org> Jack DeVries added the comment: oops, the link was mutilated... maybe this will help:: ```` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:41:54 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 12 Aug 2021 14:41:54 +0000 Subject: [issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS' In-Reply-To: <1628775660.76.0.290058998171.issue44902@roundup.psfhosted.org> Message-ID: <1628779314.85.0.439230996757.issue44902@roundup.psfhosted.org> Jack DeVries added the comment: I've done it. See the changes here: https://github.com/python/cpython/compare/main...jdevries3133:bpo-44902-macOS I'll hold off on a PR pending some feedback on whether this change is desirable. Also, I did not make changes to whatsnew documents, because they were presumably referring to OS X accurately at the time they were written. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:52:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 14:52:17 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628779937.99.0.139030131425.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: The problem disappears if I add a gc.collect() loop at the beginning of the new test: diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 79798ecf05..e0aeac9d10 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -1014,6 +1014,7 @@ def cycle(): def test_no_hang_on_context_chain_cycle2(self): # See issue 25782. Cycle at head of context chain. + while gc.collect(): pass class A(Exception): pass ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 10:44:55 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 12 Aug 2021 14:44:55 +0000 Subject: [issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS' In-Reply-To: <1628775660.76.0.290058998171.issue44902@roundup.psfhosted.org> Message-ID: <1628779495.52.0.128214876132.issue44902@roundup.psfhosted.org> Jack DeVries added the comment: Ok, that was no help... I'll just upload the diff. ---------- keywords: +patch Added file: https://bugs.python.org/file50211/os_x_to_macos_fix.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 11:10:31 2021 From: report at bugs.python.org (ban) Date: Thu, 12 Aug 2021 15:10:31 +0000 Subject: [issue15533] subprocess.Popen(cwd) documentation: Posix vs Windows In-Reply-To: <1343886272.5.0.825552125397.issue15533@psf.upfronthosting.co.za> Message-ID: <1628781031.89.0.923058345482.issue15533@roundup.psfhosted.org> ban added the comment: >> "In particular, the function looks for executable (or for the >> first item in args) relative to cwd if the executable path is >> a relative path." > > For POSIX, this should be stated as a "relative path without a slash in > it" or a "relative path without a directory in it". An unqualified > filename is a relative path that won't be resolved against `cwd`, > unless there's a "." entry in PATH. While I don't understand the wording proposed (that seem backwards to me?), I do think it would be important to fix this. I just got puzzled and spent some effort writing a workaround *not to look in cwd* for a bare command name, before I got so skeptical I actually tried empirically what Python would do -- and see the behavior was sensible and `cwd` was taken into account *only if the executable had a path component in it*. Any other behavior is annoying IMO as it means using a `cwd` *requires* one to pass in an absolute path to the executable not to risk running an unexpected executable, which basically makes support for looking up executable in the system PATH unusable if using a `cwd`. It would also be somewhat inconsistent with the idea that `cwd` only *changes* the current directory prior to execution, as it would suggest the behavior is not the same when using `cwd=None` and `cwd=os.getcwd()`. So I'd suggest amending the wording in some way, maybe something like "In particular, the function looks for executable (or for the first item in args) relative to cwd if the executable has an explicit relative path." or something like that, possibly even dropping in an example. The problem with the current wording is that usually an unqualified name *is* a relative path, whereas here one should somehow understand that it means "if it has a path component and that path component is relative", or the more down-to-earthy "if the executable starts with './' or '../'". ---------- nosy: +ban _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 11:22:38 2021 From: report at bugs.python.org (PySimpleGUI) Date: Thu, 12 Aug 2021 15:22:38 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? Message-ID: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> New submission from PySimpleGUI : Some time ago I noticed that the Python documentation has a list of GUI packages that are not part of the Python standard library. https://docs.python.org/3/library/othergui.html The title of the page I'm talking about says: Other Graphical User Interface Packages Major cross-platform (Windows, macOS, Unix-like) GUI toolkits are available for Python: What are the criteria for being listed? PySimpleGUI has more monthly installs than Kivy & WxPython. They're not due to being bundled with a Linux distribution. There is another page with a longer list: https://docs.python.org/3/faq/gui.html ---------- assignee: docs at python components: Documentation messages: 399465 nosy: PySimpleGUI, docs at python priority: normal severity: normal status: open title: [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 11:40:59 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 12 Aug 2021 15:40:59 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1628782859.14.0.803882825478.issue44903@roundup.psfhosted.org> Zachary Ware added the comment: Frankly, we should probably just remove that page, or replace it with a generic "Many other GUI toolkits can be found on PyPI" message. ---------- nosy: +mdk, zach.ware versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 11:53:23 2021 From: report at bugs.python.org (=?utf-8?q?Sim=C3=A3o_Afonso?=) Date: Thu, 12 Aug 2021 15:53:23 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1628783603.24.0.821204623112.issue42560@roundup.psfhosted.org> Change by Sim?o Afonso : ---------- nosy: +simao.afonso _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 12:06:03 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 12 Aug 2021 16:06:03 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1628784363.9.0.221280761617.issue44903@roundup.psfhosted.org> Terry J. Reedy added the comment: The direct answer is that you open an issue like you did, make an argument, as you did, and then submit a pull request. But we certainly do not need two redundant lists. The Othergui page has a link to https://wiki.python.org/moin/GuiProgramming which is not gated and where PySimpleGUI *is* listed. I think that coredev should get out of the business of maintaining curated GUI lists. I agree that the restricted Othergui page should be deleted (and any reference thereto removed) and think that the list on the faq should be replaced by a reference to the Wiki and to PyPI. Zach, can you prepare a PR? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 12:13:09 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 12 Aug 2021 16:13:09 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1628784789.07.0.105613281627.issue44903@roundup.psfhosted.org> Zachary Ware added the comment: I don't have the bandwidth to do so at the moment, but am willing to review one :) ---------- keywords: +easy, newcomer friendly stage: -> needs patch type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 12:13:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 12 Aug 2021 16:13:40 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628784820.13.0.301252776492.issue44885@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8e832fb2a2cb54d7262148b6ec15563dffb48d63 by Pablo Galindo Salgado in branch 'main': bpo-44885: Correct the ast locations of f-strings with format specs and repeated expressions (GH-27729) https://github.com/python/cpython/commit/8e832fb2a2cb54d7262148b6ec15563dffb48d63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 12:21:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 12 Aug 2021 16:21:08 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628785268.62.0.435797641985.issue44885@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +26221 pull_request: https://github.com/python/cpython/pull/27743 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 12:25:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 12 Aug 2021 16:25:58 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628785558.05.0.0236786478158.issue44885@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +26222 pull_request: https://github.com/python/cpython/pull/27744 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 12:30:04 2021 From: report at bugs.python.org (Xiaoling Bao) Date: Thu, 12 Aug 2021 16:30:04 +0000 Subject: [issue44894] HTTP request handler should check sys.stderr for None before use for logging In-Reply-To: <1628726209.14.0.0889982500329.issue44894@roundup.psfhosted.org> Message-ID: <1628785804.13.0.510253886415.issue44894@roundup.psfhosted.org> Xiaoling Bao added the comment: It looks https://bugs.python.org/issue43348 has the same root cause as this one. When running with pythonservice.exe or pythonw.exe, sys.stderr will be None and thus causing crash when logging messages (calling sys.stderr.write). ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 12:41:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 12 Aug 2021 16:41:25 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628786485.39.0.277082248513.issue44885@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset c28c2e1cb0dd5fc8b17514e2c4ee17415af733a4 by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-44885: Correct the ast locations of f-strings with format specs and repeated expressions (GH-27729) (GH-27743) https://github.com/python/cpython/commit/c28c2e1cb0dd5fc8b17514e2c4ee17415af733a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 12:42:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 12 Aug 2021 16:42:19 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628786539.3.0.55342026269.issue44885@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 Thu Aug 12 12:44:38 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Thu, 12 Aug 2021 16:44:38 +0000 Subject: [issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str` In-Reply-To: <1628712079.84.0.245411182001.issue44891@roundup.psfhosted.org> Message-ID: <1628786678.27.0.177420047703.issue44891@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +26223 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27745 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 12:59:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 16:59:53 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628787593.56.0.0683674209167.issue44895@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26224 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27746 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 13:37:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 17:37:31 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628789851.43.0.378530211709.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: This fails (test_recursion_normalizing_with_no_memory is not needed): ./python.exe -m test -R 3:3 test_exceptions -m test_no_hang_on_context_chain_cycle2 -m test_recursion_normalizing_infinite_exception -m test_recursion_in_except_handler ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 13:40:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 12 Aug 2021 17:40:33 +0000 Subject: [issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS' In-Reply-To: <1628775660.76.0.290058998171.issue44902@roundup.psfhosted.org> Message-ID: <1628790033.05.0.0642904621083.issue44902@roundup.psfhosted.org> Serhiy Storchaka added the comment: Isn't it a duplicate of issue41203? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 13:43:41 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 12 Aug 2021 17:43:41 +0000 Subject: [issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS' In-Reply-To: <1628775660.76.0.290058998171.issue44902@roundup.psfhosted.org> Message-ID: <1628790221.5.0.275019060006.issue44902@roundup.psfhosted.org> Jack DeVries added the comment: Oh yeah, sorry, it looks like this can be closed as duplicate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 13:46:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 12 Aug 2021 17:46:49 +0000 Subject: [issue44885] Incorrect exception highlighting for fstring format In-Reply-To: <1628668742.09.0.246164919692.issue44885@roundup.psfhosted.org> Message-ID: <1628790409.8.0.426448600473.issue44885@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 4b86c9c5146c339c689830619be9d29b8f7bf417 by Pablo Galindo Salgado in branch '3.9': [3.9] bpo-44885: Correct the ast locations of f-strings with format specs and repeated expressions (GH-27729) (GH-27744) https://github.com/python/cpython/commit/4b86c9c5146c339c689830619be9d29b8f7bf417 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 13:59:23 2021 From: report at bugs.python.org (Mason Ginter) Date: Thu, 12 Aug 2021 17:59:23 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1628791163.96.0.722969881504.issue42560@roundup.psfhosted.org> Mason Ginter added the comment: Those changes sound great to me, Mark. I've been busy with work and don't think I'll have the time to implement those changes. If you or someone else would like to work on this, I would gladly let you take over. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 14:23:43 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 12 Aug 2021 18:23:43 +0000 Subject: [issue43392] Optimize repeated calls to `__import__()` In-Reply-To: <1614804530.16.0.0156925953016.issue43392@roundup.psfhosted.org> Message-ID: <1628792623.12.0.710951869797.issue43392@roundup.psfhosted.org> miss-islington added the comment: New changeset 03648a2a91f9f1091cd21bd4cd6ca092ddb25640 by Germ?n M?ndez Bravo in branch 'main': bpo-43392: Optimize repeated calls to `__import__()` (GH-24735) https://github.com/python/cpython/commit/03648a2a91f9f1091cd21bd4cd6ca092ddb25640 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 14:24:32 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 12 Aug 2021 18:24:32 +0000 Subject: [issue43392] Optimize repeated calls to `__import__()` In-Reply-To: <1614804530.16.0.0156925953016.issue43392@roundup.psfhosted.org> Message-ID: <1628792672.93.0.928615862894.issue43392@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- components: +Interpreter Core resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> performance versions: +Python 3.11 -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 15:18:19 2021 From: report at bugs.python.org (E. Paine) Date: Thu, 12 Aug 2021 19:18:19 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1628795899.18.0.0960666628913.issue42560@roundup.psfhosted.org> E. Paine added the comment: Thank you for looking at this in great detail Mark and that all seems like a very useful set of changes! I've got a few more specific comments below, but they're mostly just small details. 2. I'd personally prefer alphabetical order (except Tix, which should be last because it's deprecated) with a note before / elsewhere that a tkinter / tkinter.ttk combination is generally be the best way to create GUIs (perhaps in with the hello world example?). 3. IMO this is suited better grouped with the other Tcl/Tk bridge documentation. I agree we should probably remove Tix from this section, since we're trying to dissuade people from using it. 5. This sounds very reasonable. The accompanying description and list of kwargs was what concerned me, but this sounds easily maintainable. Maybe we could group e.g. the winfo methods and link directly to the version-independent Tk man page for those (https://www.tcl.tk/man/tcl/TkCmd/winfo.html - so we don't need to keep changing the links)? ---------- components: +Tkinter versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 15:21:42 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 12 Aug 2021 19:21:42 +0000 Subject: [issue15533] subprocess.Popen(cwd) documentation: Posix vs Windows In-Reply-To: <1343886272.5.0.825552125397.issue15533@psf.upfronthosting.co.za> Message-ID: <1628796102.07.0.107342957161.issue15533@roundup.psfhosted.org> Eryk Sun added the comment: > I don't understand the wording proposed (that seem backwards to me?) Thanks. Looks like I inverted the logic of the quoted paragraph. It should have been a "relative path with a slash in it" is resolved against the current working directory, not "without a slash". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 16:02:31 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 12 Aug 2021 20:02:31 +0000 Subject: [issue41930] Wrap sqlite3_serialize API in sqlite3 module In-Reply-To: <1601813111.02.0.183059099502.issue41930@roundup.psfhosted.org> Message-ID: <1628798551.15.0.42340633909.issue41930@roundup.psfhosted.org> Erlend E. Aasland added the comment: I've been fiddling with this between others projects lately; the PR is mostly ready. The only remaining issue is how to include this in the Connection object: - The serialize API was added as a compile-time option (SQLITE_ENABLE_DESERIALIZE) in SQLite 3.23.0 - The serialize API was included by default from SQLite 3.36.0, but can be disabled using the SQLITE_OMIT_DESERIALIZE compile-time option. Solution 1: enable the Python sqlite3 serialize API if SQLITE_VERSION_NUMBER >= 3023000 and force people to build their SQLite library _with_ SQLITE_ENABLE_DESERIALIZE defined for SQLite versions 3.23.0 through 3.35.x and _without_ SQLITE_OMIT_DESERIALIZE defined for SQLite versions 3.36.0 and onward. Solution 2: enable the Python sqlite3 serialize API if SQLITE_VERSION_NUMBER >= 3036000 and force people to build their SQLite library _without_ SQLITE_OMIT_DESERIALIZE defined. Solution 3: build the Python sqlite3 serialize API as a "sub module" to _sqlite3 (for example _sqlite3._serialize) and add conditionally add it to sqlite3.Connection in Lib/sqlite3/__init__.py or Lib/sqlite3/dbapi2.py. Solution 4: try to autodetect SQLite compile-time options in setup.py, autogenerate a sqlite-config.h header file, and conditionally enable the API based on that. I suggest solution 2, as it adds little code (low maintenance), and will require no or minimal changes to the devguide, because (wild guess) in most cases SQLITE_OMIT_DESERIALIZE will not be a widely used compile-time option. (For the python.org macOS and Windows installers, this will not be a problem, because we control the SQLite compile-time options.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 16:05:13 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 12 Aug 2021 20:05:13 +0000 Subject: [issue44873] base64 RFC4648 test cases In-Reply-To: <1628527371.14.0.0350168122984.issue44873@roundup.psfhosted.org> Message-ID: <1628798713.58.0.912396885039.issue44873@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch pull_requests: +26225 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27747 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 16:22:40 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 12 Aug 2021 20:22:40 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1628799760.19.0.266484052217.issue41322@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 8.0 -> 9.0 pull_requests: +26226 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27748 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 16:27:28 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 12 Aug 2021 20:27:28 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1628800048.91.0.663969788068.issue40469@roundup.psfhosted.org> Vinay Sajip added the comment: > The assumed behaviour of TimedRotatingFileHandler is to rotate log files older than configured. Even when the script is executed multiple times. Ah, but is it? The purpose of TimedRotatingFileHandler is to rotate files based on time intervals, and is normally assumed to be for long-running processes (where the rotation allows one to focus on logs output during a period of interest). What's the practical, real-world use-case for the example scripts you added? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 17:16:41 2021 From: report at bugs.python.org (Tomasz Rzepecki) Date: Thu, 12 Aug 2021 21:16:41 +0000 Subject: [issue44904] Erroneous behaviour for abstract class properties Message-ID: <1628803001.12.0.882298478545.issue44904@roundup.psfhosted.org> New submission from Tomasz Rzepecki : Subclassing an abc with an abstract class property yields to unexpected behaviour: the class property is called, and an abstract class may be erroneously considered concrete. See https://stackoverflow.com/a/68763572/4434666 for details. ---------- files: bug_report.py messages: 399482 nosy: rzepecki.t priority: normal severity: normal status: open title: Erroneous behaviour for abstract class properties type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50212/bug_report.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 17:30:37 2021 From: report at bugs.python.org (Artem) Date: Thu, 12 Aug 2021 21:30:37 +0000 Subject: [issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError In-Reply-To: <1574201186.66.0.441437608856.issue38856@roundup.psfhosted.org> Message-ID: <1628803837.22.0.489668258617.issue38856@roundup.psfhosted.org> Artem added the comment: Python 3.9.6 Linux same issue. ---------- nosy: +seer versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 18:22:23 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 12 Aug 2021 22:22:23 +0000 Subject: [issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str` In-Reply-To: <1628712079.84.0.245411182001.issue44891@roundup.psfhosted.org> Message-ID: <1628806943.3.0.189633724235.issue44891@roundup.psfhosted.org> Dennis Sweeney added the comment: Perhaps it would be better to convert existing such tests to @cpython_only, since as far as I know, id() and `is` are implementation-defined for immutable objects. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 18:41:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 12 Aug 2021 22:41:28 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628808088.68.0.0581797771016.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: My smallest failing example so far: def test_recursion_in_except_handler(self): self.test_no_hang_on_context_chain_cycle2() def set_relative_recursion_limit(n): depth = 1 while True: try: sys.setrecursionlimit(depth) except RecursionError: depth += 1 else: break sys.setrecursionlimit(depth+n) def recurse_in_body_and_except(): try: recurse_in_body_and_except() except: recurse_in_body_and_except() recursionlimit = sys.getrecursionlimit() try: set_relative_recursion_limit(10) try: recurse_in_body_and_except() except RecursionError: pass else: self.fail("Should have raised a RecursionError") finally: sys.setrecursionlimit(recursionlimit) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 19:48:29 2021 From: report at bugs.python.org (Tomasz Rzepecki) Date: Thu, 12 Aug 2021 23:48:29 +0000 Subject: [issue44905] Abstract instance and class attributes for abstract base classes Message-ID: <1628812109.02.0.042736265222.issue44905@roundup.psfhosted.org> New submission from Tomasz Rzepecki : There seems to be no way to transparently make an abstract base class enforce instance attributes for subclasses (without creating a custom metaclass, see e.g. https://newbedev.com/python-abstract-class-shall-force-derived-classes-to-initialize-variable-in-init). The analogous problem for enforcing *class* attributes in subclasses can be solved by creating an abstract class property (which can then be overridden by a class attribute), but this feels like a hack and possibly a bug (see https://bugs.python.org/issue44904 for a related bug). The corresponding "solution" for instance attributes does not work (see attached file), and probably rightly so. This seems like an oversight to me. ---------- files: example.py messages: 399486 nosy: rzepecki.t priority: normal severity: normal status: open title: Abstract instance and class attributes for abstract base classes type: enhancement versions: Python 3.9 Added file: https://bugs.python.org/file50213/example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 19:49:27 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 12 Aug 2021 23:49:27 +0000 Subject: [issue38656] mimetypes for python 3.7.5 fails to detect matroska video In-Reply-To: <1572548711.23.0.824957089431.issue38656@roundup.psfhosted.org> Message-ID: <1628812167.75.0.612680183439.issue38656@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 8.0 -> 9.0 pull_requests: +26227 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27750 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 20:17:17 2021 From: report at bugs.python.org (Alejandro Reimondo) Date: Fri, 13 Aug 2021 00:17:17 +0000 Subject: [issue44906] Crash on deep call stack under Windows Message-ID: <1628813837.02.0.46640078544.issue44906@roundup.psfhosted.org> New submission from Alejandro Reimondo : The py8.py file starts a S8 system, a Smalltalk system running on Python runtime, I am actually developing (in Beta). The system is running w/o problems on OSX systems, but crash (fast exit w/o any information) when running on Windows. The crash occurs while compiling a simple expression (simple but produce a deep recursion on parsing stage). The expression is shown in "fileMeIn.st". The issue happens on Windows and python version Python 3.9.2 The stack depth is aprox 1800 frames. Steps to reproduce the crash: 1.- decompress the zip file in a folder 2.- on command prompt "python -i py8.py" 3.- "Image loaded" must be shown in console 4.- evaluate "t()" to run tests that fileIn the code in "fileMeIn.st" 5.- after aprox. one minute working, the fast exit occurs and the Python VM exits without reporting anything on output ---------- components: Windows files: crashWin3.9-2021-08-12.zip messages: 399487 nosy: aleReimondo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Crash on deep call stack under Windows type: crash versions: Python 3.9 Added file: https://bugs.python.org/file50214/crashWin3.9-2021-08-12.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 21:45:42 2021 From: report at bugs.python.org (Hugo Delgado) Date: Fri, 13 Aug 2021 01:45:42 +0000 Subject: [issue24955] webbrowser broken on Mac OS X when using the BROWSER variable In-Reply-To: <1440842500.82.0.168118984503.issue24955@psf.upfronthosting.co.za> Message-ID: <1628819142.28.0.0843533913171.issue24955@roundup.psfhosted.org> Change by Hugo Delgado : ---------- pull_requests: +26228 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/27751 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 21:52:12 2021 From: report at bugs.python.org (Hugo Delgado) Date: Fri, 13 Aug 2021 01:52:12 +0000 Subject: [issue24955] webbrowser broken on Mac OS X when using the BROWSER variable In-Reply-To: <1440842500.82.0.168118984503.issue24955@psf.upfronthosting.co.za> Message-ID: <1628819532.51.0.707131332159.issue24955@roundup.psfhosted.org> Hugo Delgado added the comment: Yes, I've created a PR for it. https://github.com/python/cpython/pull/27751 Happy to adapt it as needed. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 12 21:52:23 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 13 Aug 2021 01:52:23 +0000 Subject: [issue41234] Remove symbol.sym_name In-Reply-To: <1594162290.58.0.321462635772.issue41234@roundup.psfhosted.org> Message-ID: <1628819542.99.0.171645906872.issue41234@roundup.psfhosted.org> Andrei Kulakov added the comment: This can be closed; from the PR note: Resolved in PR #21624, can close. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 00:01:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 13 Aug 2021 04:01:58 +0000 Subject: [issue34938] Fix mimetype.init() to account for from import In-Reply-To: <1539036789.21.0.545547206417.issue34938@psf.upfronthosting.co.za> Message-ID: <1628827318.67.0.0834477859648.issue34938@roundup.psfhosted.org> Andrei Kulakov added the comment: How about returning the updated dicts from init() and showing an example in the docs of such usage? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 01:46:17 2021 From: report at bugs.python.org (meowmeowcat) Date: Fri, 13 Aug 2021 05:46:17 +0000 Subject: [issue44902] [Doc] Changing 'Mac OS X'/'OS X' to 'macOS' In-Reply-To: <1628775660.76.0.290058998171.issue44902@roundup.psfhosted.org> Message-ID: <1628833577.45.0.110976707078.issue44902@roundup.psfhosted.org> meowmeowcat added the comment: > Isn't it a duplicate of issue41203? Oh, sorry, I didn't notice that we have issue41203. I'll close this issue. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 01:50:28 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 13 Aug 2021 05:50:28 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628833828.36.0.813350976127.issue44895@roundup.psfhosted.org> Chris Jerdonek added the comment: Out of curiosity, is the failure deterministic in environments where it fails? If not, what is the source of the indeterminism -- some kind of race condition or something else? ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 02:32:57 2021 From: report at bugs.python.org (=?utf-8?b?5p2o6Z2S?=) Date: Fri, 13 Aug 2021 06:32:57 +0000 Subject: [issue44907] examples code output do not macth the current version 3.9 Message-ID: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> New submission from ?? : https://docs.python.org/3/tutorial/controlflow.html I got like this following: TypeError: function() got multiple values for argument 'a' not: TypeError: function() got multiple values for keyword argument 'a' >>> def function(a): ... pass ... >>> function(0, a=0) Traceback (most recent call last): File "", line 1, in TypeError: function() got multiple values for keyword argument 'a' ---------- assignee: docs at python components: Documentation messages: 399493 nosy: docs at python, yangqing priority: normal severity: normal status: open title: examples code output do not macth the current version 3.9 versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 02:41:10 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 13 Aug 2021 06:41:10 +0000 Subject: [issue44908] recommend httpx as well as requests in http.client/urllib.request docs Message-ID: <1628836870.78.0.245525781075.issue44908@roundup.psfhosted.org> New submission from Thomas Grainger : HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2. It's also broadly compatible and inspired by the requests API: https://github.com/encode/httpx/blob/master/docs/compatibility.md#requests-compatibility-guide Currently the project is looking to get a link from the docs to https://www.python-httpx.org/ here's the upstream issue https://github.com/encode/httpx/issues/1772 ---------- assignee: docs at python components: Documentation messages: 399494 nosy: docs at python, graingert priority: normal severity: normal status: open title: recommend httpx as well as requests in http.client/urllib.request docs versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 02:44:02 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Fri, 13 Aug 2021 06:44:02 +0000 Subject: [issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628837042.67.0.231494770401.issue44881@roundup.psfhosted.org> Neil Schemenauer added the comment: > The problem of PyObject_GC_UnTrack() is just the most visible effect of the > trashcan mecanism: tp_dealloc can be called twice, and this is *not* expected > by the tp_dealloc API. The fact that Py_TRASHCAN_BEGIN and Py_TRASHCAN_END can cause tp_dealloc to be called more than once is not a huge issue, IMHO. The statements executed more than once are the ones before or after the trashcan macros. If you use them properly, the multiple calls doesn't cause issues. The big trap is to use _PyObject_GC_UNTRACK before Py_TRASHCAN_BEGIN. It is not safe to call that macro multiple times. Anywhere you see Py_TRASHCAN_BEGIN and _PyObject_GC_UNTRACK before it, that's a bug. The point of this PR is to make the macros harder to use incorrectly. If there is no need to call untrack, Py_TRASHCAN_BEGIN and Py_TRASHCAN_END can normally be the first and last lines of the tp_dealloc function (declarations can be inside). Then, the fact that tp_dealloc is actually called more than once by the trashcan doesn't cause an issue. tp_dealloc can get called more than once for another reason. If the object is resurrected by tp_finalize or tp_del, then tp_dealloc can be called again. It's pretty mind bending to try to understand all of implications of that. Most of the ugliness is inside PyObject_CallFinalizerFromDealloc(). The type with the finalizer has to be careful not to put the object in an invalid state before it gets resurrected. > Putting trashcan mecanism outside tp_dealloc can allow to make sure that > tp_dealloc is called exactly once. _Py_Dealloc() sounds like a good > candidate, but I didn't check if it's the only way to call tp_dealloc. Are > there other places where tp_dealloc is called *directly*? tp_dealloc is called from a few more places, as you found. As for providing C-stack exhaustion protection via the trashcan, I think we are only interested in places were tp_dealloc is called as a result of a DECREF. And I think that only goes through _Py_Dealloc(). I suppose it would be possible to blow up the C stack via a call chain like: subtype_dealloc -> basedealloc -> subtype_dealloc -> basedealloc -> ... I think you would have to make a long chain of subclasses. Seems unlikely in real code so I'm not worried about trying to fix that. > Using military grade regex, I found the following functions calling tp_dealloc: > > grep 'dealloc[) ]*([a-zA-Z]\+)' */*.c > > * _Py_Dealloc() obviously > * _PyTrash_thread_destroy_chain() > * subtype_dealloc() > * Modules/_testcapimodule.c: check_pyobject_freed_is_freed() <= unit test, it can be ignored > > So if we move the trashcan usage inside functions, 3 functions must be modified: > > * _Py_Dealloc() > * _PyTrash_thread_destroy_chain() > * subtype_dealloc() Take a look at bpo-44897. It implements the _Py_Dealloc approach. You can see what needs to be modified. I removed the Py_TRASHCAN_BEGIN/Py_TRASHCAN_END macros as well, just because they are not needed anymore. _PyObject_GC_UNTRACK calls inside tp_dealloc methods need to be removed because _Py_Dealloc already does the untrack. For external extensions, they must be using PyObject_GC_UnTrack() and so that's safe (object is already untracked and so it does nothing). I think the big change is calling tp_dealloc methods with the object already untracked. If an extension did something like: mytype_dealloc(PyObject *self) { ... assert(PyObject_GC_IsTracked(self)); ... } That would break after PR 27738, at least as it's currently written. The other issue I'm not quite sure about is that PyObject_CallFinalizerFromDealloc insists that GC objects are tracked when that function is called. I think it is okay to just call _PyObject_GC_TRACK on the ones that are not tracked, to ensure that. Maybe Tim Peters will jump in and correct the errors of my thinking. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 03:09:43 2021 From: report at bugs.python.org (Ivan Marton) Date: Fri, 13 Aug 2021 07:09:43 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1628838583.53.0.703130832601.issue40469@roundup.psfhosted.org> Ivan Marton added the comment: Well, there is nothing in the documentation that would say the logrotation can be only performed by continously running scripts, thats why. :) There are scripts or even daemons written in Python that need to be restarted from time to time. If the logrotate period is greater than restart period the log files will never be rotated, however they could be. We were looking for something that works like the logrotate do, but without involving any external logic, but the one written in python. And TimedLogrotateHandler appears to be one of those, unless it checks the MTIME of the files instead of the CTIME. What is the logic behind checking the MTIME instead of CTIME when one is calculating the age of a file when tries to calculate whether it has to be rotated or not? If the only purpose of this initial rollover calculation would be to start a predefined long period (as you suggest), now() (time of execution) should used instead and no file attribute should be involved. From the code I have to assume that the original author also tried to prepare for the cases where the execution is interrupted and/or restarted and (s)he wanted the TimedLogrotateHandler to be resumed where it was during the previous execution. Dnn't you agree? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 03:28:40 2021 From: report at bugs.python.org (Jacob Nilsson) Date: Fri, 13 Aug 2021 07:28:40 +0000 Subject: [issue44905] Abstract instance and class attributes for abstract base classes In-Reply-To: <1628812109.02.0.042736265222.issue44905@roundup.psfhosted.org> Message-ID: <1628839720.2.0.668628181469.issue44905@roundup.psfhosted.org> Change by Jacob Nilsson : ---------- nosy: +ajoino _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 03:31:29 2021 From: report at bugs.python.org (Paul Menzel) Date: Fri, 13 Aug 2021 07:31:29 +0000 Subject: [issue44909] configure should pick /usr/bin/g++ automatically if present Message-ID: <1628839889.47.0.177188937689.issue44909@roundup.psfhosted.org> New submission from Paul Menzel : [copied from closed (out of date) issue https://bugs.python.org/issue25946] Reproduced with Python 3.9.6. ./configure` both prints `checking for g++... no` and WARNING: By default, distutils will build C++ extension modules with "g++". If this is not intended, then set CXX on the configure command line. if `/usr/bin/g++` is present and executable which doesn't seem to be constructive because it's quite common that one wants to use `/usr/bin/g++` as CXX compiler if available. In case incompatibilities exists with other C++ compilers there should a check and more detailed error message. Furthermore the error message doesn't explain if a part of distutils won't be build because the message sounds like the C++ extension is built, but does it work without a C++ compiler? Specifying `CXX` environment variable or `--with-cxx-main=/usr/bin/g++` `configure` option works fine. ---------- components: Build messages: 399497 nosy: iritkatriel, krichter, pmenzel priority: normal severity: normal status: open title: configure should pick /usr/bin/g++ automatically if present versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 03:31:53 2021 From: report at bugs.python.org (Paul Menzel) Date: Fri, 13 Aug 2021 07:31:53 +0000 Subject: [issue25946] configure should pick /usr/bin/g++ automatically if present In-Reply-To: <1451017608.26.0.200778632077.issue25946@psf.upfronthosting.co.za> Message-ID: <1628839913.74.0.480650970074.issue25946@roundup.psfhosted.org> Paul Menzel added the comment: I created https://bugs.python.org/issue44909. ---------- nosy: +pmenzel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:06:40 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 13 Aug 2021 08:06:40 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1628842000.08.0.134129067138.issue40469@roundup.psfhosted.org> Vinay Sajip added the comment: > Well, there is nothing in the documentation that would say the logrotation can be only performed by continously running scripts, thats why. :) Well, what's the need to rotate based on time when you just run scripts sporadically or they're very short-lived? Not trying to argue, just trying to understand. > There are scripts or even daemons written in Python that need to be restarted from time to time. If the logrotate period is greater than restart period the log files will never be rotated, however they could be. Yes, but generally daemons are long-lived relative to the rotation interval, aren't they? "From time to time" certainly implies that to me. > What is the logic behind checking the MTIME instead of CTIME when one is calculating the age of a file when tries to calculate whether it has to be rotated or not? I can't remember, that code is over 12 years old and that specific decision wasn't documented :-( > From the code I have to assume that the original author also tried to prepare for the cases where the execution is interrupted and/or restarted and (s)he wanted the TimedLogrotateHandler to be resumed where it was during the previous execution. Dnn't you agree? I take it you mean TimedRotatingFileHandler. Certainly it assumes that the script might be restarted, which is why it opens the file in append mode. If the computation using MTIME were changed to use CTIME, that would be a behaviour change, which could conceivably break someone's code that relied on current behaviour (unlikely, but you just never know). I've no other objection to using CTIME rather than MTIME - perhaps I'm just being hyper-cautious about breakage? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:11:38 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 13 Aug 2021 08:11:38 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1628842298.24.0.9045356768.issue40469@roundup.psfhosted.org> Vinay Sajip added the comment: I just checked - the relevant code (using MTIME) was added in 2010, as a fix for bpo-8117 - around the time that Python 2.6 was released. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:27:24 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 13 Aug 2021 08:27:24 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1628843244.67.0.0215445303252.issue44297@roundup.psfhosted.org> Mark Shannon added the comment: I believe this to be fixed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:29:24 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 13 Aug 2021 08:29:24 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1628843364.39.0.61819809162.issue44450@roundup.psfhosted.org> Mark Shannon added the comment: Ned, is this still an issue with the release candidate of 3.10? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:32:23 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 13 Aug 2021 08:32:23 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1628843543.91.0.667604786992.issue40222@roundup.psfhosted.org> Mark Shannon added the comment: I'd like to close this, as the exception handling is all done and working correctly. Is there a separate issue for how we are handling CodeType()? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:34:19 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 13 Aug 2021 08:34:19 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1628843659.38.0.351275289058.issue42837@roundup.psfhosted.org> Mark Shannon added the comment: I guess this will be resolved when the great PEP 563/649 debate is concluded. No need for another issue. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:35:10 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 13 Aug 2021 08:35:10 +0000 Subject: [issue41703] Most bytecode changes are absent from Python 3.9 What's new In-Reply-To: <1599139613.26.0.744077883478.issue41703@roundup.psfhosted.org> Message-ID: <1628843710.26.0.0424593079359.issue41703@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:37:01 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 13 Aug 2021 08:37:01 +0000 Subject: [issue44772] Regression in memory use of instances due to dictionary ordering In-Reply-To: <1627554489.64.0.275505717552.issue44772@roundup.psfhosted.org> Message-ID: <1628843821.04.0.0802097500894.issue44772@roundup.psfhosted.org> Mark Shannon added the comment: Duplicate of https://bugs.python.org/issue40116 ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:37:36 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 13 Aug 2021 08:37:36 +0000 Subject: [issue40116] Regression in memory use of shared key dictionaries for "compact dicts" In-Reply-To: <1585581236.94.0.571794171265.issue40116@roundup.psfhosted.org> Message-ID: <1628843856.52.0.620177530193.issue40116@roundup.psfhosted.org> Change by Mark Shannon : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:42:17 2021 From: report at bugs.python.org (Ivan Marton) Date: Fri, 13 Aug 2021 08:42:17 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1628844137.85.0.0830344941272.issue40469@roundup.psfhosted.org> Ivan Marton added the comment: > Well, what's the need to rotate based on time when you just run scripts sporadically or they're very short-lived? Not trying to argue, just trying to understand. > Yes, but generally daemons are long-lived relative to the rotation interval, aren't they? "From time to time" certainly implies that to me. In one of our use-cases, where I faced with this bug/behaviour of TimedRotatingFileHandler, we are using it in a daemon for daily logrotate. The aim is to have the logs separated day by day, just like the majority of our other components running on a linux. We've just realized that some days are missing from the series of logs and the investigation led to the service restart and the MTIME checking that we are talking about here. When a logger is configured to rotate daily one just simply assume that it will rotate daily regardless the daemon restart. (As en extreme(?) example, when a the system - and the daemon of course - is restarted each day - or just never running for a whole day - and btw it logs often, the log file won't be ever rotated and can inrease over every limits.) I've quickly googled around and found someone who execute some logic from cron and expects the loghandler to rotate his files, that wouldn't happened for the same reason: https://stackoverflow.com/questions/30569164/logging-handler-timedrotatingfilehandler-never-rotates-the-log > I just checked - the relevant code (using MTIME) was added in 2010, as a fix for bpo-8117 - around the time that Python 2.6 was released. As I understand bpo-8117, the goal was to do the rollover even after script restarts. (To be frank, only an extreme case was mentioned in the issue opener entry, when the rollover period had been reached when the script wasn't running.) I believe for this purpose MTIME wasn't the best choice, but using CTIME instead would make the script do what is expected to. > I take it you mean TimedRotatingFileHandler. Certainly it assumes that the script might be restarted, which is why it opens the file in append mode. > If the computation using MTIME were changed to use CTIME, that would be a behaviour change, which could conceivably break someone's code that relied on current behaviour (unlikely, but you just never know). I've no other objection to using CTIME rather than MTIME - perhaps I'm just being hyper-cautious about breakage? You are far better and more experienced in maintaining widely used opensource codebases so I wouldn't argue with you, but... :) - In case of scripts that create the log file for themselves the change would have no effect. - In case of scripts that are using already existing files for logging (by opening them for append) could change the behaviour, but just slighly. The first rollover would happen before adding the first new log line if the file age reached the configured time, and not when the age of last log line written to the file before having the script started reached the same value. No further rotation would be effected. I _believe_ no one expects the current initial behaviour in case of resumed log files, and for sure, the documentation doesn't cover this part so I don't know how to proceed. I _believe_ (again) that changing the behaviour wouldn't break the script outside, but rather would help them working the way how the developers originally assumed they did. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:48:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 13 Aug 2021 08:48:16 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628844496.25.0.0984178789571.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: It?s not deterministic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 04:52:25 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 13 Aug 2021 08:52:25 +0000 Subject: [issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation In-Reply-To: <1609926680.76.0.190133632062.issue42837@roundup.psfhosted.org> Message-ID: <1628844745.53.0.302701766739.issue42837@roundup.psfhosted.org> Batuhan Taskaya added the comment: AFAIK this is already resolved on the main (https://bugs.python.org/issue42725) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 05:18:14 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 13 Aug 2021 09:18:14 +0000 Subject: [issue44869] MacOS Monterrey malloc issue In-Reply-To: <1628479823.5.0.245309193527.issue44869@roundup.psfhosted.org> Message-ID: <1628846294.28.0.901248228059.issue44869@roundup.psfhosted.org> Ronald Oussoren added the comment: There is a 3th possibility: This could be a bug in the OS, Monterey is still in beta at this point and beta's tend to contain more bugs than release versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 05:41:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 09:41:39 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628847699.66.0.106610646125.issue44895@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7bf28cbb4bf37fa6bdfc2d3f8a3939066b3f8f22 by Irit Katriel in branch 'main': bpo-44895: Temporarily add an extra gc.collect() call (GH-27746) https://github.com/python/cpython/commit/7bf28cbb4bf37fa6bdfc2d3f8a3939066b3f8f22 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 05:41:53 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 09:41:53 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628847713.93.0.108020266528.issue44895@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26229 pull_request: https://github.com/python/cpython/pull/27753 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 05:44:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 09:44:37 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628847877.23.0.288880390814.issue33930@roundup.psfhosted.org> ?ukasz Langa added the comment: Since the refleak investigation moved to its own issue, I'm re-closing this one for clarity. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 05:45:17 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 09:45:17 +0000 Subject: [issue33930] Segfault with deep recursion into object().__dir__ In-Reply-To: <1529580477.24.0.56676864532.issue33930@psf.upfronthosting.co.za> Message-ID: <1628847917.01.0.294156055421.issue33930@roundup.psfhosted.org> miss-islington added the comment: New changeset ef36dfe4de1ee0df11cde94fd76465336aa8141d by Benjamin Peterson in branch '3.10': [3.10] bpo-33930: Fix typo in the test name. (GH-27736) https://github.com/python/cpython/commit/ef36dfe4de1ee0df11cde94fd76465336aa8141d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 05:56:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 13 Aug 2021 09:56:28 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628848588.09.0.775445165878.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: > what is the source of the indeterminism -- some kind of race condition or something else? My hunch is it could be timing of GC. But it's hard to say at this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:04:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 10:04:18 +0000 Subject: [issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str` In-Reply-To: <1628712079.84.0.245411182001.issue44891@roundup.psfhosted.org> Message-ID: <1628849058.5.0.705033437614.issue44891@roundup.psfhosted.org> ?ukasz Langa added the comment: Dennis, there's an existing issue on making the test suite more pypy-compatible: https://bugs.python.org/issue25130 In that issue Maciej says pypy adopted a policy to adjust tests when they have to so I'd say that unless we get a report on which additional tests should be marked as cpython_only, I wouldn't proactively do it myself. In fact, a RustPython core dev is specifically asking for more tests here so I don't see why we shouldn't accommodate that. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:15:21 2021 From: report at bugs.python.org (meowmeowcat) Date: Fri, 13 Aug 2021 10:15:21 +0000 Subject: [issue44907] examples code output do not macth the current version 3.9 In-Reply-To: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> Message-ID: <1628849721.68.0.723726426672.issue44907@roundup.psfhosted.org> meowmeowcat added the comment: Thanks! Confirmed with Python 3.9.2. I will open a PR for fixing this. ---------- nosy: +meowmeowmeowcat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:16:02 2021 From: report at bugs.python.org (meowmeowcat) Date: Fri, 13 Aug 2021 10:16:02 +0000 Subject: [issue44907] examples code output do not match the current version 3.9 In-Reply-To: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> Message-ID: <1628849762.53.0.995703123184.issue44907@roundup.psfhosted.org> Change by meowmeowcat : ---------- title: examples code output do not macth the current version 3.9 -> examples code output do not match the current version 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:18:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 10:18:30 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1628849910.1.0.110306866299.issue26228@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26230 pull_request: https://github.com/python/cpython/pull/27754 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:19:40 2021 From: report at bugs.python.org (meowmeowcat) Date: Fri, 13 Aug 2021 10:19:40 +0000 Subject: [issue44907] examples code output do not match the current version 3.9 In-Reply-To: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> Message-ID: <1628849980.08.0.179001437136.issue44907@roundup.psfhosted.org> Change by meowmeowcat : ---------- keywords: +patch pull_requests: +26231 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:21:29 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 10:21:29 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628850089.39.0.788442133085.issue44895@roundup.psfhosted.org> miss-islington added the comment: New changeset ebc59262349d6901b825ed9101d604e826757262 by Miss Islington (bot) in branch '3.10': bpo-44895: Temporarily add an extra gc.collect() call (GH-27746) https://github.com/python/cpython/commit/ebc59262349d6901b825ed9101d604e826757262 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:22:36 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 10:22:36 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628850156.96.0.266201132589.issue44895@roundup.psfhosted.org> ?ukasz Langa added the comment: I merged the workaround to get refleak buildbots unstuck for the weekend. I bumped the issue stage back to "needs patch" as the available one isn't a solution. ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:36:30 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 10:36:30 +0000 Subject: [issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str` In-Reply-To: <1628712079.84.0.245411182001.issue44891@roundup.psfhosted.org> Message-ID: <1628850990.66.0.223728246382.issue44891@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26232 pull_request: https://github.com/python/cpython/pull/27756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:36:36 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 10:36:36 +0000 Subject: [issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str` In-Reply-To: <1628712079.84.0.245411182001.issue44891@roundup.psfhosted.org> Message-ID: <1628850996.14.0.954069609494.issue44891@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a2ce538e16d5e3a6168704366bdd7a8c5af29881 by Nikita Sobolev in branch 'main': bpo-44891: Tests `id` preserving on `* 1` for `str` and `bytes` (GH-27745) https://github.com/python/cpython/commit/a2ce538e16d5e3a6168704366bdd7a8c5af29881 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:41:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 13 Aug 2021 10:41:08 +0000 Subject: [issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628851268.66.0.594719285808.issue44881@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks Neil for the thorough explanation! I think in any case we should benchmark this because this will affect *all* GC types if I understand correctly and the TS mechanism had shown slowdowns before ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:43:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 13 Aug 2021 10:43:48 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1628851428.13.0.781459019842.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Is there a separate issue for how we are handling CodeType()? No, that's why this is marked as release blocker, because this is the first issue where CodeType was changed. If you wish to close this one, please open a new issue explaining the situation and mark that one as release blocker. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:57:14 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 10:57:14 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1628852234.33.0.871138100838.issue26228@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26233 pull_request: https://github.com/python/cpython/pull/27758 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:57:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 10:57:16 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1628852236.81.0.299861320362.issue26228@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset dd8eb303b90d63e1f56684bedadca6674bb74a29 by ?ukasz Langa in branch 'main': bpo-26228: [doc] Adapt PTY documentation updates from GH-4167 (GH-27754) https://github.com/python/cpython/commit/dd8eb303b90d63e1f56684bedadca6674bb74a29 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:57:49 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 10:57:49 +0000 Subject: [issue44873] base64 RFC4648 test cases In-Reply-To: <1628527371.14.0.0350168122984.issue44873@roundup.psfhosted.org> Message-ID: <1628852269.06.0.18776055181.issue44873@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +26234 pull_request: https://github.com/python/cpython/pull/27757 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:59:02 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 10:59:02 +0000 Subject: [issue36700] base64 has old references that should be updated In-Reply-To: <1555957992.77.0.818777064587.issue36700@roundup.psfhosted.org> Message-ID: <1628852342.74.0.971687837833.issue36700@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26235 pull_request: https://github.com/python/cpython/pull/27759 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 06:58:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 10:58:59 +0000 Subject: [issue36700] base64 has old references that should be updated In-Reply-To: <1555957992.77.0.818777064587.issue36700@roundup.psfhosted.org> Message-ID: <1628852339.31.0.0948368268421.issue36700@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e43b9bbc31c22a0d97dc4fc420300e40c2d74166 by andrei kulakov in branch 'main': bpo-36700: [doc] Update base64 RFC references to RFC 4648 (GH-27700) https://github.com/python/cpython/commit/e43b9bbc31c22a0d97dc4fc420300e40c2d74166 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 07:04:12 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 11:04:12 +0000 Subject: [issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str` In-Reply-To: <1628712079.84.0.245411182001.issue44891@roundup.psfhosted.org> Message-ID: <1628852652.29.0.376708101138.issue44891@roundup.psfhosted.org> miss-islington added the comment: New changeset 45a97d91a42795fb0b220e67ee25a14b940c7e50 by Miss Islington (bot) in branch '3.10': bpo-44891: Tests `id` preserving on `* 1` for `str` and `bytes` (GH-27745) https://github.com/python/cpython/commit/45a97d91a42795fb0b220e67ee25a14b940c7e50 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 07:06:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 11:06:03 +0000 Subject: [issue44891] Tests for `id(a) == id(a * 1)` for `bytes` and `str` In-Reply-To: <1628712079.84.0.245411182001.issue44891@roundup.psfhosted.org> Message-ID: <1628852763.64.0.182398593391.issue44891@roundup.psfhosted.org> ?ukasz Langa added the comment: I opted for landing this and backporting to 3.10 to increase visibility. There will be a NEWS entry about this so if any alt implementations have issues with this test, they can reach us and we'll adapt. Thanks, Nikita! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 07:16:06 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 11:16:06 +0000 Subject: [issue44873] base64 RFC4648 test cases In-Reply-To: <1628527371.14.0.0350168122984.issue44873@roundup.psfhosted.org> Message-ID: <1628853366.1.0.93326103563.issue44873@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Andrei! ? ? ? ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 07:21:14 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 11:21:14 +0000 Subject: [issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1 In-Reply-To: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za> Message-ID: <1628853674.29.0.499579113691.issue26228@roundup.psfhosted.org> miss-islington added the comment: New changeset d4128485d6c2cbfebe756f3eeec2c60137b63bba by Miss Islington (bot) in branch '3.10': bpo-26228: [doc] Adapt PTY documentation updates from GH-4167 (GH-27754) https://github.com/python/cpython/commit/d4128485d6c2cbfebe756f3eeec2c60137b63bba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 07:21:56 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 11:21:56 +0000 Subject: [issue36700] base64 has old references that should be updated In-Reply-To: <1555957992.77.0.818777064587.issue36700@roundup.psfhosted.org> Message-ID: <1628853716.81.0.83775518302.issue36700@roundup.psfhosted.org> miss-islington added the comment: New changeset 16f73c8b5dbe02b4bf7f91ff9dbcd0886529bfe5 by Miss Islington (bot) in branch '3.10': bpo-36700: [doc] Update base64 RFC references to RFC 4648 (GH-27700) https://github.com/python/cpython/commit/16f73c8b5dbe02b4bf7f91ff9dbcd0886529bfe5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 07:22:47 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 11:22:47 +0000 Subject: [issue36700] base64 has old references that should be updated In-Reply-To: <1555957992.77.0.818777064587.issue36700@roundup.psfhosted.org> Message-ID: <1628853767.84.0.38298634118.issue36700@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for reporting, Paul, and Andrei for the patch! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 07:31:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 11:31:28 +0000 Subject: [issue30077] Support Apple AIFF-C pseudo compression in aifc.py In-Reply-To: <1492281879.16.0.0196863971193.issue30077@psf.upfronthosting.co.za> Message-ID: <1628854288.96.0.0964816482306.issue30077@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e4ed9d21534c2ed4397fdee0bb530a6e6a2c5af8 by dnknth in branch 'main': bpo-30077: Add support for Apple aifc/sowt pseudo-compression (GH-24449) https://github.com/python/cpython/commit/e4ed9d21534c2ed4397fdee0bb530a6e6a2c5af8 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 07:33:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 13 Aug 2021 11:33:51 +0000 Subject: [issue30077] Support Apple AIFF-C pseudo compression in aifc.py In-Reply-To: <1492281879.16.0.0196863971193.issue30077@psf.upfronthosting.co.za> Message-ID: <1628854431.24.0.719846483991.issue30077@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for reporting and the initial patch, Toby. And thanks for pushing this across the finish line, Yussuf! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 07:52:30 2021 From: report at bugs.python.org (Gautam Chaudhuri) Date: Fri, 13 Aug 2021 11:52:30 +0000 Subject: [issue16580] [doc] Add examples to int.to_bytes and int.from_bytes In-Reply-To: <1354217109.61.0.534443148437.issue16580@psf.upfronthosting.co.za> Message-ID: <1628855550.13.0.600188001518.issue16580@roundup.psfhosted.org> Change by Gautam Chaudhuri : ---------- pull_requests: +26236 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27760 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 08:00:55 2021 From: report at bugs.python.org (Gautam Chaudhuri) Date: Fri, 13 Aug 2021 12:00:55 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1628856055.99.0.139884952489.issue44903@roundup.psfhosted.org> Change by Gautam Chaudhuri : ---------- nosy: +quantum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 08:12:02 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 13 Aug 2021 12:12:02 +0000 Subject: [issue40469] TimedRotatingFileHandler rotating on use not time In-Reply-To: <1588345322.69.0.523914781015.issue40469@roundup.psfhosted.org> Message-ID: <1628856722.59.0.173292546616.issue40469@roundup.psfhosted.org> Vinay Sajip added the comment: > You are far better and more experienced in maintaining widely used opensource codebases so I wouldn't argue with you, but... :) Well, if a change introduces a problem, it will be my lookout, won't it? Just as the original patch for bpo-8117 is proving to be :-) OK, how about this? We update the PR to add a new use_ctime=False keyword argument to TimedRotatingHandler.__init__(). If nothing else changes, the behaviour is as it is currently. If use_ctime=True is passed in the instantiation, then the constructor will use CTIME rather than MTIME. Will that work for you? I'd be OK with that approach. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 08:36:31 2021 From: report at bugs.python.org (PySimpleGUI) Date: Fri, 13 Aug 2021 12:36:31 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628784363.9.0.221280761617.issue44903@roundup.psfhosted.org> Message-ID: <002001d7903f$d7033510$85099f30$@PySimpleGUI.com> PySimpleGUI added the comment: Thank you Terry! I'm glad I got it right. I've been trying to keep the wiki page updated that you mentioned as best I can: https://wiki.python.org/moin/GuiProgramming I agree with the overall conclusion that the wiki is the place these lists should live. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 08:59:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 13 Aug 2021 12:59:45 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628859585.7.0.0178091555109.issue44895@roundup.psfhosted.org> STINNER Victor added the comment: Chris: > Out of curiosity, is the failure deterministic in environments where it fails? If not, what is the source of the indeterminism -- some kind of race condition or something else? The GC uses counters and thresholds to decide which collection and when they should be collected. I tried to play with gc.set_threshold(), but I failed to reproduce the issue on Linux. Maybe it's a very precise threshold which triggers the issue. Between Linux and macOS, the site module executes different code paths which produce different GC counters. Sometimes, the GC must happen in a very precise line, one line later is too late. See bpo-44422 for a case of threading.enumerate() (different kind of bug, but it's related to the GC). See bpo-44184 for another example of GC bug which only occurred on Windows and only if you type an exact command line. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 09:05:49 2021 From: report at bugs.python.org (Alex Waygood) Date: Fri, 13 Aug 2021 13:05:49 +0000 Subject: [issue44905] Abstract instance and class attributes for abstract base classes In-Reply-To: <1628812109.02.0.042736265222.issue44905@roundup.psfhosted.org> Message-ID: <1628859949.78.0.0723215559962.issue44905@roundup.psfhosted.org> Alex Waygood added the comment: +1 to this suggestion. I had a use case for this the other day. It currently feels like something of a discrepancy between ABCs and `typing.Property`, which can be seen as analogous in some ways to "an ABC for the static type-checker". `typing.Property` allows you to specify that an object must have certain attributes, as well as certain methods, while for ABCs it is only the latter. ---------- nosy: +AlexWaygood _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 09:34:58 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 13 Aug 2021 13:34:58 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1628861698.49.0.571465206232.issue40222@roundup.psfhosted.org> Guido van Rossum added the comment: I propose we declare all APIs for code objects *unstable*, liable to change each (feature) release. I want to get rid of PyCode_NewWithPosArgs() and just have PyCode_New(). All callers to either one must be changed anyways. (And we?re not done changing this in 3.11 either.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 09:54:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 13 Aug 2021 13:54:58 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1628862898.12.0.649896170408.issue40222@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >> I want to get rid of PyCode_NewWithPosArgs() and just have PyCode_New(). That as added because of PEP 387 and unfortunately removing it is backwards incompatible. >> I propose we declare all APIs for code objects *unstable*, liable to change each (feature) release. I agree that we should do this, but this needs at least a discussion in python-dev because currently these APIs are protected by PEP 387 so changing them is backwards incompatible ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 09:59:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 13 Aug 2021 13:59:30 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628863170.86.0.848245035429.issue44895@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I have tried to reproduce this on my Linux and Mac machines and I have been unable to do it for the time being in either of them. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 10:24:33 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 13 Aug 2021 14:24:33 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1628864673.24.0.637318290574.issue40222@roundup.psfhosted.org> Guido van Rossum added the comment: > >> I want to get rid of PyCode_NewWithPosArgs() and just have PyCode_New(). > That as added because of PEP 387 and unfortunately removing it is backwards incompatible. Is changing the signature allowed? Because it *must* be changed (at the very least to accommodate the exceptiontable, but there are several others too -- your PEP 657 touched it last to add endlinetable and columntable). I think this was a mistake in PEP 387 and we just need to retract that. Perhaps it could be left as a dummy that always returns an error? > >> I propose we declare all APIs for code objects *unstable*, liable to change each (feature) release. > I agree that we should do this, but this needs at least a discussion in python-dev because currently these APIs are protected by PEP 387 so changing them is backwards incompatible Yeah that's the crux. :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 11:10:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 13 Aug 2021 15:10:26 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628867426.94.0.297553756945.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: The script below hangs on my mac (it's an extract from test_recursion_in_except_handler). ----------- import sys count = 0 def main(): def f(): global count count += 1 try: f() except RecursionError: f() sys.setrecursionlimit(30) try: f() except RecursionError: pass main() print(count) ----------- When I kill it the traceback shows it alternating between the two recursive calls, but not in a regular pattern: ... [snipped a lot] File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ [Previous line repeated 2 more times] RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ [Previous line repeated 1 more time] RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 22, in main() ^^^^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 18, in main f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ [Previous line repeated 10 more times] File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 7, in f def f(): KeyboardInterrupt ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 11:11:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 13 Aug 2021 15:11:28 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628867488.94.0.411444871708.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: Adding Mark since he worked on recursion recently. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 11:21:11 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 13 Aug 2021 15:21:11 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628868071.85.0.868114453593.issue44895@roundup.psfhosted.org> Dong-hee Na added the comment: >From my macOS, I was not able to reproduce the issue also as like as Victor and Pablo. repeat 10 ./python.exe -m test -R 3:3 test_exceptions -m test_no_hang_on_context_chain_cycle2 -m test_recursion_normalizing_infinite_exception -m test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory However hang was able to reproduce. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 11:21:45 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 13 Aug 2021 15:21:45 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628868105.64.0.122761374748.issue44895@roundup.psfhosted.org> Dong-hee Na added the comment: > However hang was able to reproduce. I meant msg399539 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 11:24:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 13 Aug 2021 15:24:48 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628868288.77.0.693981048755.issue44895@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +26237 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27761 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 11:30:56 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 13 Aug 2021 15:30:56 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628868656.83.0.0247231376185.issue44895@roundup.psfhosted.org> Dong-hee Na added the comment: Oops sorry. Without PR 27746, I was able to reproduce on my macOS environment. test_exceptions leaked [6, 6, 6] references, sum=18 test_exceptions leaked [6, 6, 6] memory blocks, sum=18 test_exceptions failed (reference leak) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 11:59:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 15:59:55 +0000 Subject: [issue41234] Remove symbol.sym_name In-Reply-To: <1594162290.58.0.321462635772.issue41234@roundup.psfhosted.org> Message-ID: <1628870395.26.0.782656928245.issue41234@roundup.psfhosted.org> Terry J. Reedy added the comment: Andrei, on bpo, # tags numbers as bpo numbers, and creates links to bpo issues, whereas in PRs, # tags numbers as PR numbers and creates links to PRs. So # must be removed and PR added when transferring references. So: PR 21624 or PR21624 or even, says the tracker doc, pull request 21624. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 12:00:49 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 16:00:49 +0000 Subject: [issue41234] Remove symbol.sym_name In-Reply-To: <1594162290.58.0.321462635772.issue41234@roundup.psfhosted.org> Message-ID: <1628870449.57.0.722037180904.issue41234@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Remove the old parser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 13:12:04 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 13 Aug 2021 17:12:04 +0000 Subject: [issue41234] Remove symbol.sym_name In-Reply-To: <1628870449.59.0.9090643639.issue41234@roundup.psfhosted.org> Message-ID: Andrei Kulakov added the comment: Terry: thanks! - that's good to know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 13:16:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 13 Aug 2021 17:16:59 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628875019.22.0.39783606875.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: Regarding the hang in msg399539, do we need some special handling of the case were a RecursionError is being raised and its context is another RecursionError? Like a FatalError? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 13:26:13 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 13 Aug 2021 17:26:13 +0000 Subject: [issue40222] "Zero cost" exception handling In-Reply-To: <1586338863.3.0.393749013734.issue40222@roundup.psfhosted.org> Message-ID: <1628875573.37.0.943864488002.issue40222@roundup.psfhosted.org> Guido van Rossum added the comment: I've started a thread on python-dev. https://mail.python.org/archives/list/python-dev at python.org/thread/ZWTBR5ESYR26BUIVMXOKPFRLGGYDJSFC/#ZWTBR5ESYR26BUIVMXOKPFRLGGYDJSFC ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 13:31:19 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Fri, 13 Aug 2021 17:31:19 +0000 Subject: [issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1628875879.97.0.51598895447.issue44881@roundup.psfhosted.org> Neil Schemenauer added the comment: > I think in any case we should benchmark this because this will affect *all* > GC types if I understand correctly and the TS mechanism had shown slowdowns > before We definitely need to benchmark. I would guess that adding trashcan protection to all GC types would not be a performance issue. We already had the macros for some performance critical ones (frame, tuple, list, dict). The performance hit will likely come as a result of adding a branch that uses _PyType_IS_GC() to the DECREF code path. It means any time an object hits zero refcount, we call _PyType_IS_GC() on it. Previously, we would just call tp_dealloc. Because of PEP 442, _PyType_IS_GC() checks not only a type flag but might also call tp_is_gc. So, benchmarks will need to be done. We might get a small win because the trashcan logic can be better optimized now that it's in a single complied unit. Small correction for my explaination above: if tp_dealloc gets called mutiple times because of the trashcan, it is the code before the BEGIN macro that gets called mutiple times. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 13:47:17 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 13 Aug 2021 17:47:17 +0000 Subject: [issue35105] Document that CPython accepts "invalid" identifiers In-Reply-To: <1540815891.13.0.788709270274.issue35105@psf.upfronthosting.co.za> Message-ID: <1628876837.63.0.764588378029.issue35105@roundup.psfhosted.org> Andrei Kulakov added the comment: It seems like the documentation is lacking and perhaps misleading in regard to attributes. - anything hashable can be used as a key in an obj.__dict__: an int, a tuple, etc. According to __dict__ docs, all of those are attributes. There's no warning that this isn't recommended. Various tooling may break, for example dir() will break if keys are not comparable. inspect.getmembers() will break because it relies on dir(). Probably other tooling will break in some way -- this is just the two first things I tried. Is the reason for allowing that, - only performance (obviously that's a strong enough reason in this case)? Or can this be useful in some other corner cases? - setattr() requires a string but a string can be '1 2', '(1,2)', etc. The docs for setattr strongly imply that it's the same as dotted notation, but it's not. The non-identifier string attrs don't break dir() or anything in inspect module AFAICT. Should the docs discourage this usage? Should they suggest some use cases where this is useful? In addition to just being confusing, I think this can create an impression for users that setattr() allows you to set 'private' or 'hidden' attrs, and setting attrs via __dict__ allows you to set even more 'private', 'top secret' attrs. Since attributes are such a core concept in Python, it might be good to have a section that lays out all of these corner cases and reasons for them, so that it can be linked from docs for setattr(), __dict__, dir(), inspect.getmembers(), etc. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 14:26:29 2021 From: report at bugs.python.org (A wilson) Date: Fri, 13 Aug 2021 18:26:29 +0000 Subject: [issue44910] Floating point issue Message-ID: <1628879189.27.0.388910502701.issue44910@roundup.psfhosted.org> New submission from A wilson : 0.01 + 273.15 should equal 273.16 but in python 3.9.5 or earlier report as 273.15999999999997. ---------- messages: 399550 nosy: afw2alan priority: normal severity: normal status: open title: Floating point issue type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 14:48:06 2021 From: report at bugs.python.org (Gautam Chaudhuri) Date: Fri, 13 Aug 2021 18:48:06 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1628880486.17.0.00600583137885.issue44903@roundup.psfhosted.org> Change by Gautam Chaudhuri : ---------- keywords: +patch pull_requests: +26238 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27762 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 14:51:26 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 13 Aug 2021 18:51:26 +0000 Subject: [issue42649] RecursionError when parsing unwieldy expression (regression from 2.7 -> 3.x) In-Reply-To: <1608054957.39.0.0382114401229.issue42649@roundup.psfhosted.org> Message-ID: <1628880686.7.0.0851957856154.issue42649@roundup.psfhosted.org> Jack DeVries added the comment: I spent some time experimenting with making the expression bigger and the recursion limit lower in python2. It seems like in python2, the depth that the compiler will recurse is unrelated to sys.recursionlimit. Then, I lowered resource limits on stack and heap by ~1000x and increased the size of the expression by 10,000x, which caused a segmentation fault. Not only that, but the interpreter won't even respond to KeyboardInterrupt while it is doing the compiling. I believe that the recursion depth of the 2.x compiler is simply unbound, which seems like a bug to me. As I tinkered with these things, I build out a reproduction script, which I've attached. I think that documenting this change is more pragmatic than thinking about "fixing" it (not sure it can truly be fixed, as that would mean re-incorporating a bug). I don't know where such a note would belong, though. This document is the closed I can find, but it's too high-level for a detail like this to belong:: https://docs.python.org/3/howto/pyporting.html ---------- nosy: +jack__d Added file: https://bugs.python.org/file50215/repro.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 14:53:06 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 13 Aug 2021 18:53:06 +0000 Subject: [issue42649] RecursionError when parsing unwieldy expression (regression from 2.7 -> 3.x) In-Reply-To: <1608054957.39.0.0382114401229.issue42649@roundup.psfhosted.org> Message-ID: <1628880786.58.0.56936708516.issue42649@roundup.psfhosted.org> Jack DeVries added the comment: edit; typo: **This document is the **closest** I can find ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 14:54:13 2021 From: report at bugs.python.org (Gautam Chaudhuri) Date: Fri, 13 Aug 2021 18:54:13 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628880486.21.0.246455432309.issue44903@roundup.psfhosted.org> Message-ID: <87czqh2n1t.fsf@gmail.com> Gautam Chaudhuri added the comment: I've submitted a PR making the changes suggested by Terry. Any feedback/suggestions on the PR would be highly appreciated. -- Gautam Chaudhuri ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 15:39:52 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 13 Aug 2021 19:39:52 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628883592.84.0.300303086236.issue44895@roundup.psfhosted.org> Chris Jerdonek added the comment: > Maybe it's a very precise threshold which triggers the issue. Between Linux and macOS, the site module executes different code paths which produce different GC counters. > Sometimes, the GC must happen in a very precise line, one line later is too late. How does this explain it not being non-deterministic on, say, macOS since the same lines of code will be executing each time? Is there a way to force things to happen in a deterministic fashion? (I interpreted the responses to mean that it's non-deterministic even when run on the same machine, so I'm not talking about, say, the differences from running macOS on different machines.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 15:43:42 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 13 Aug 2021 19:43:42 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628883822.77.0.410702657316.issue44895@roundup.psfhosted.org> Chris Jerdonek added the comment: "How does this explain it not being non-deterministic on" -> "How does this explain it not being deterministic on" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 15:53:58 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 13 Aug 2021 19:53:58 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628884438.95.0.526064381417.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: For instance, if memory addresses of objects are different, so objects sort differently in different runs on the same system. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 16:26:21 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 13 Aug 2021 20:26:21 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628886381.55.0.381981793472.issue44895@roundup.psfhosted.org> Chris Jerdonek added the comment: Last question: might trying different values of PYTHONHASHSEED help? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 16:44:39 2021 From: report at bugs.python.org (Toby Thurston) Date: Fri, 13 Aug 2021 20:44:39 +0000 Subject: [issue30077] Support Apple AIFF-C pseudo compression in aifc.py In-Reply-To: <1628854431.24.0.719846483991.issue30077@roundup.psfhosted.org> Message-ID: Toby Thurston added the comment: Hey! thanks for letting me know, glad it got there in the end. T. On Fri, 13 Aug 2021, at 12:33, ?ukasz Langa wrote: > > ?ukasz Langa added the comment: > > Thanks for reporting and the initial patch, Toby. And thanks for > pushing this across the finish line, Yussuf! ? ? ? > > ---------- > resolution: -> fixed > stage: patch review -> resolved > status: open -> closed > versions: +Python 3.11 -Python 3.8 > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 16:47:05 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 13 Aug 2021 20:47:05 +0000 Subject: [issue44079] [sqlite3] remove superfluous statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1628887625.26.0.53919253412.issue44079@roundup.psfhosted.org> Erlend E. Aasland added the comment: Berker: > My understanding is that their usages is a bit different: > one is for performance reasons (and it can configurable by users) and the other is to keep track of statements inside a connection. > > I'm not fully sure that the both use cases can be combined. Only unique statements are added to the weak ref list (and the LRU cache). Case 1: len(unique statements) <= 128 Both the LRU cache and the weak ref list will be equal sets of statements. Case 2: len(unique statements) > 128 <= 200 If more than 128 unique statements are created, they "fall off" of the LRU cache and are collected by the GC. The weak ref list will contain all the 128 cached statements, and up to 72 "lost" statements which have been reaped by the GC. The LRU cache and the _alive_ objects in weak ref list will be equal sets of statements. Case 3: len(unique statements) > 200 _pysqlite_drop_unused_statement_references() will remove the lost 72 refs and create a new weak ref list that will be equal to the 128 statements in the LRU cache. Fun fact: After the number of unique statements pass 200, the weak ref list is reset to the remaining 128 "active" statements, and sqlite3.Connection.created_statements is reset to 0. Thus, when we pass the "200 limit" again, the weak ref list will contain 329 elements, not 200 elements. Any statement that "falls off" of the LRU cache is reaped by the GC which implies that sqlite3_finalize() is called on it, and it's thus removed from the SQLite connection. This implies that the set of statements available through sqlite3_next_stmt() is equal to the set of statements in the LRU cache and the set of _alive_ statements in the weak ref list. This implies that if we want to finalise all connection statements in sqlite3.Connection.close(), all we need to do is to clear the LRU cache; the GC will invoke stmt_dealloc(), which will finalise the SQLite statement objects. If we want to reset all connection statements (pysqlite_do_all_statements()), we can iterate through them using sqlite3_next_stmt(). However, there is a corner case for when the sqlite3.Connection.statements list can contain statements that are not in the LRU cache: if we've got more than 128 active cursors, all of them with unique statements, we can end up with statements that are _only_ owned by a cursor. However, sqlite3_next_stmt() will still find them if we need to reset them in pysqlite_do_all_statements(). On connection close, all cursors are destroyed anyway, so we will end up finalising all statements, weak ref list or not. Can we merge PR-25998 now? Prove me wrong :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 16:48:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 13 Aug 2021 20:48:28 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628887708.21.0.397952272211.issue44895@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: If someone can reproduce more or less reliably, it would be great to know where are the leaked objects. For that, compile CPython with "-with-trace-refs", surround the suspicious test in a loop (test_no_hang_on_context_chain_cycle2 for example) of a 1000 or more iterations and run the test with the PYTHONDUMPREFS=1 environment variable. You will see the leaked objects at shutdown hopefully. Hopefully the leaked objects would be a gigantic set by then so we the number of references will be noticeable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 16:52:31 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 13 Aug 2021 20:52:31 +0000 Subject: [issue44910] Floating point issue In-Reply-To: <1628879189.27.0.388910502701.issue44910@roundup.psfhosted.org> Message-ID: <1628887951.08.0.260748437379.issue44910@roundup.psfhosted.org> Eric V. Smith added the comment: This a limitation of the floating point type that python uses. See https://docs.python.org/3/tutorial/floatingpoint.html ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 16:59:58 2021 From: report at bugs.python.org (Diego Ramirez) Date: Fri, 13 Aug 2021 20:59:58 +0000 Subject: [issue44892] configparser fails when the file contains a "%" inside a commentary In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1628888398.77.0.844694264312.issue44892@roundup.psfhosted.org> Diego Ramirez added the comment: Lukasz Langa, I would like to know your opinion, as you are recognized as the "configparser" developer. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 17:11:02 2021 From: report at bugs.python.org (Matej Cepl) Date: Fri, 13 Aug 2021 21:11:02 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1628889062.71.0.384802685685.issue38820@roundup.psfhosted.org> Change by Matej Cepl : ---------- nosy: +mcepl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 17:14:39 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 13 Aug 2021 21:14:39 +0000 Subject: [issue44906] Crash on deep call stack under Windows In-Reply-To: <1628813837.02.0.46640078544.issue44906@roundup.psfhosted.org> Message-ID: <1628889279.87.0.571276777074.issue44906@roundup.psfhosted.org> Steve Dower added the comment: I guess we've got a new path through the interpreter loop that takes more stack space than before and isn't part of our existing recursion tests. It's probably somewhere in the vector call changes. Capturing the stack at overflow point should show us - I'll see if I can get it easily from the repro. ---------- components: +Interpreter Core _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 17:18:38 2021 From: report at bugs.python.org (A wilson) Date: Fri, 13 Aug 2021 21:18:38 +0000 Subject: [issue44910] Floating point issue In-Reply-To: <1628887951.08.0.260748437379.issue44910@roundup.psfhosted.org> Message-ID: A wilson added the comment: Eric, I was unaware of this document and its implementation in python. where 0.01+0.15 = 0.16 but 0.01+273.15=273.15999999999997 the latter which should be 273.16 which is triple point temperature of water in Kelvin. This floating point variance explains some if the conditional test failures I have encountered. regards Alan Get Outlook for Android ________________________________ From: report=bugs.python.org at roundup.psfhosted.org on behalf of Eric V. Smith Sent: Friday, 13 August 2021, 21:52 To: afw2alan at outlook.com Subject: [issue44910] Floating point issue Eric V. Smith added the comment: This a limitation of the floating point type that python uses. See https://docs.python.org/3/tutorial/floatingpoint.html ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 17:38:51 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 13 Aug 2021 21:38:51 +0000 Subject: [issue44906] Crash on deep call stack under Windows In-Reply-To: <1628813837.02.0.46640078544.issue44906@roundup.psfhosted.org> Message-ID: <1628890731.51.0.635487940262.issue44906@roundup.psfhosted.org> Steve Dower added the comment: I get stack overflows all the way back to 3.7, so it's probably not anything new. But our stack overflow detection is clearly not going to catch this case. It's really only set up for a direct call within Python code, but this is going through many more steps. Best thing you can do as a user is run it with "python -X faulthandler ..." to see the error. Perhaps we can handle the stack overflow ourselves and print a message suggesting that option, but unfortunately this problem doesn't have a generic solution :( The assumption is that you have a known recursion limit for your application, and as a scripting engine, we don't. Decoupling from the C stack is the best hope. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 18:18:37 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 13 Aug 2021 22:18:37 +0000 Subject: [issue35105] Document that CPython accepts "invalid" identifiers In-Reply-To: <1540815891.13.0.788709270274.issue35105@psf.upfronthosting.co.za> Message-ID: <1628893117.77.0.778465864519.issue35105@roundup.psfhosted.org> Andrei Kulakov added the comment: In the last message I've said that according to __dict__ docs, anything in __dict__ is an attribute of respective obj. That's a bit too-strongly worded, the docs can be understood in the sense that anything that ends up in __dict__ via other mechanisms, such as dotted notation or setattr(), is an attribute. Since direct manipulation of __dict__ is not prohibited, and no limits are set, AFAIK, on keys that can be used for __dict__, the more natural reading of the docs is that anything that can be directly set in __dict__ is also an attribute. The only thing that would make a user doubt this reading is if he or she finds that getattr() cannot get non-string attrs, and going by its name, user would assume you can get any valid attrs using getattr(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 18:25:06 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 22:25:06 +0000 Subject: [issue44862] [docs] make "Deprecated since version {deprecated}, will be removed in version {removed}" translation available In-Reply-To: <1628361260.67.0.944506647918.issue44862@roundup.psfhosted.org> Message-ID: <1628893506.45.0.885157946479.issue44862@roundup.psfhosted.org> Terry J. Reedy added the comment: This tracker is for patching the english Python docs and CPython interpreter. Questions about using python should be asked elsewhere. The translated docs are the responsibility of a separate translation team and specific language teams. Either they chose not to translate that sentence, or it was added after their last translation update. see https://devguide.python.org/documenting/#translating ---------- nosy: +terry.reedy resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 18:25:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 22:25:55 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1628893555.62.0.115576846648.issue44863@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 18:34:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 22:34:14 +0000 Subject: [issue44864] [argparse] Do not translate user-provided strings in `ArgumentParser.add_subparsers()` In-Reply-To: <1628412158.14.0.0114857952802.issue44864@roundup.psfhosted.org> Message-ID: <1628894054.37.0.394347186077.issue44864@roundup.psfhosted.org> Terry J. Reedy added the comment: J?r?mie, what does the doc say about translation? This will likely determine whether the is a bug report or a future-version-only enhancement request. The PR changes the two lines as indicated above and the CLA is signed. A blurb will be needed if this is to me merged. (Not my decision.) ---------- nosy: +terry.reedy type: behavior -> versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 18:52:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 22:52:08 +0000 Subject: [issue44865] [argparse] Missing translations In-Reply-To: <1628431949.27.0.450799323412.issue44865@roundup.psfhosted.org> Message-ID: <1628895128.74.0.702164212991.issue44865@roundup.psfhosted.org> Terry J. Reedy added the comment: Same comment as for #44964, plus note that 3.8 and before only get security patches. Also, 3.9,3.10 only get bug fixes and I don't know if this qualifies. ---------- nosy: +terry.reedy versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 19:02:22 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 23:02:22 +0000 Subject: [issue44894] HTTP request handler: check sys.stderr != None before logging In-Reply-To: <1628726209.14.0.0889982500329.issue44894@roundup.psfhosted.org> Message-ID: <1628895742.1.0.502840213783.issue44894@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: HTTP request handler should check sys.stderr for None before use for logging -> HTTP request handler: check sys.stderr != None before logging _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 19:04:23 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 23:04:23 +0000 Subject: [issue44896] Issue with unparse in ast module In-Reply-To: <1628731580.95.0.847749574283.issue44896@roundup.psfhosted.org> Message-ID: <1628895863.91.0.0494230771031.issue44896@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +BTaskaya, Mark.Shannon, benjamin.peterson, brett.cannon, pablogsal, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 19:05:25 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 23:05:25 +0000 Subject: [issue44896] AttributeError in ast.unparse In-Reply-To: <1628731580.95.0.847749574283.issue44896@roundup.psfhosted.org> Message-ID: <1628895925.91.0.276468370125.issue44896@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: Issue with unparse in ast module -> AttributeError in ast.unparse _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 19:09:49 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 23:09:49 +0000 Subject: [issue44898] Path.read_bytes() failed when path contains chinese character In-Reply-To: <1628761535.09.0.889249928246.issue44898@roundup.psfhosted.org> Message-ID: <1628896189.47.0.321022175704.issue44898@roundup.psfhosted.org> Terry J. Reedy added the comment: If there is no file or directory by the name you give, then the exception is correct and there is no bug in CPython. A failing example should look like Steven's, with the filename in a string that is use to both create and access the file. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 19:39:22 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 23:39:22 +0000 Subject: [issue44907] examples code output do not match the current version 3.9 In-Reply-To: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> Message-ID: <1628897962.98.0.406714789347.issue44907@roundup.psfhosted.org> Terry J. Reedy added the comment: Example here is in https://docs.python.org/3/tutorial/controlflow.html#default-argument-values 2 more in PR in https://docs.python.org/3/tutorial/controlflow.html#function-examples I confirmed that message is same in 3.10 and 3.11. ---------- nosy: +terry.reedy type: -> behavior versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 19:41:24 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 23:41:24 +0000 Subject: [issue44907] examples code output do not match the current version 3.9 In-Reply-To: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> Message-ID: <1628898084.82.0.596255687753.issue44907@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26240 pull_request: https://github.com/python/cpython/pull/27764 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 19:41:20 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 13 Aug 2021 23:41:20 +0000 Subject: [issue44907] examples code output do not match the current version 3.9 In-Reply-To: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> Message-ID: <1628898080.92.0.40493454461.issue44907@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26239 pull_request: https://github.com/python/cpython/pull/27763 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 19:41:30 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 13 Aug 2021 23:41:30 +0000 Subject: [issue44907] examples code output do not match the current version 3.9 In-Reply-To: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> Message-ID: <1628898090.03.0.288186526763.issue44907@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset ed524b4569b1e4a166886c880018418d46284378 by meowmeowmeowcat in branch 'main': bpo-44907: Update error messages in tutorial examples (GH-27755) https://github.com/python/cpython/commit/ed524b4569b1e4a166886c880018418d46284378 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 20:25:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Aug 2021 00:25:29 +0000 Subject: [issue44907] examples code output do not match the current version 3.9 In-Reply-To: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> Message-ID: <1628900729.97.0.71370830139.issue44907@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 25122b2cf9b55f67572dd454b6809e1f62f78f39 by Miss Islington (bot) in branch '3.10': bpo-44907: Update error messages in tutorial examples (GH-27755) https://github.com/python/cpython/commit/25122b2cf9b55f67572dd454b6809e1f62f78f39 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 20:25:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Aug 2021 00:25:41 +0000 Subject: [issue44907] examples code output do not match the current version 3.9 In-Reply-To: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> Message-ID: <1628900741.88.0.52814697339.issue44907@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 43bab0537ceb6e2ca3597f8f3a3c79733b897434 by Miss Islington (bot) in branch '3.9': bpo-44907: Update error messages in tutorial examples (GH-27755) https://github.com/python/cpython/commit/43bab0537ceb6e2ca3597f8f3a3c79733b897434 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 20:27:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Aug 2021 00:27:19 +0000 Subject: [issue44907] examples code output do not match the current version 3.9 In-Reply-To: <1628836377.64.0.917738508338.issue44907@roundup.psfhosted.org> Message-ID: <1628900839.81.0.344470460242.issue44907@roundup.psfhosted.org> Terry J. Reedy added the comment: Thanks both of you for the fix and clean patch. I wonder if doctest should have picked up these, but this would be another issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 20:34:24 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Aug 2021 00:34:24 +0000 Subject: [issue44908] recommend httpx as well as requests in http.client/urllib.request docs In-Reply-To: <1628836870.78.0.245525781075.issue44908@roundup.psfhosted.org> Message-ID: <1628901264.55.0.707707999875.issue44908@roundup.psfhosted.org> Terry J. Reedy added the comment: The problem with linking anything is that it inspires requests like this. We don't hand out links like candy. I think the intent was to maybe link one package if in some sense the standard alternative. I don't know the protocol for adding more. Likely some usage stats are needed. You might ask on python-list or python-ideas. There is no current http-expert to handle this one. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 20:36:43 2021 From: report at bugs.python.org (Bar Harel) Date: Sat, 14 Aug 2021 00:36:43 +0000 Subject: [issue44911] Leaked tasks cause IsolatedAsyncioTestCase to throw an exception Message-ID: <1628901403.12.0.195708767229.issue44911@roundup.psfhosted.org> New submission from Bar Harel : Writing a test that leaks a running asyncio task will cause IsolatedAsyncioTestCase to crash while attempting to cancel. Seems like the loop argument wasn't removed from the usage of asyncio.gather() in IsolatedAsyncioTestCase._tearDownAsyncioLoop Pushing a fix as we speak ---------- components: Library (Lib) messages: 399577 nosy: bar.harel priority: normal severity: normal status: open title: Leaked tasks cause IsolatedAsyncioTestCase to throw an exception type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 20:51:47 2021 From: report at bugs.python.org (Bar Harel) Date: Sat, 14 Aug 2021 00:51:47 +0000 Subject: [issue44911] Leaked tasks cause IsolatedAsyncioTestCase to throw an exception In-Reply-To: <1628901403.12.0.195708767229.issue44911@roundup.psfhosted.org> Message-ID: <1628902307.51.0.316246585029.issue44911@roundup.psfhosted.org> Change by Bar Harel : ---------- keywords: +patch pull_requests: +26241 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27765 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 20:57:18 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Sat, 14 Aug 2021 00:57:18 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628902638.51.0.639213952319.issue44895@roundup.psfhosted.org> Chris Jerdonek added the comment: FYI, I tried myself, and setting PYTHONHASHSEED didn't make the failures deterministic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 20:58:11 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 14 Aug 2021 00:58:11 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1628902691.96.0.460865772723.issue44863@roundup.psfhosted.org> Guido van Rossum added the comment: See also https://github.com/python/mypy/issues/3863 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 22:08:38 2021 From: report at bugs.python.org (Diego Ramirez) Date: Sat, 14 Aug 2021 02:08:38 +0000 Subject: [issue44892] [configparser] Module configparser fails when the file contains a "%" inside a commentary In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1628906918.1.0.2721905446.issue44892@roundup.psfhosted.org> Diego Ramirez added the comment: I would like to give a better explanation of the issue (maybe the previous explanation was unclear). A user reported to Pip that, when he used a "setup.cfg" file, the configparser module crashed (as I said above). The file contained a percentage character (%) inside a commentary (which is expected to be ignored): [flake8] ignore = WPS323 # percentage sign '%' And, because pip uses configparser on those cases, any operation with pip fails. So, I would like to know if we can do something to fix this bug (I noticed the place where it fails at https://github.com/python/cpython/blob/main/Lib/configparser.py#L442). If I can fill a PR to help, just tell me, OK? ---------- title: configparser fails when the file contains a "%" inside a commentary -> [configparser] Module configparser fails when the file contains a "%" inside a commentary _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 13 23:00:26 2021 From: report at bugs.python.org (Jack DeVries) Date: Sat, 14 Aug 2021 03:00:26 +0000 Subject: [issue39039] zlib.error with tarfile.open In-Reply-To: <1576252848.69.0.760468308355.issue39039@roundup.psfhosted.org> Message-ID: <1628910026.79.0.524436345642.issue39039@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 3.0 -> 4.0 pull_requests: +26242 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27766 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 01:10:43 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 14 Aug 2021 05:10:43 +0000 Subject: [issue44800] Code readability: rename InterpreterFrame to `_Py_framedata` In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1628917843.53.0.616261648364.issue44800@roundup.psfhosted.org> Nick Coghlan added the comment: PR has been updated with a new API proposal prompted by Mark's review comments on the original proposal. * Rename "pycore_frame.h" to "pycore_framedata.h" * Rename the _interpreter_frame struct to _Py_execution_frame * Rename the type from InterpreterFrame to _Py_framedata * Rather than 6 fields with no prefix, and 6 fields with the "f_" prefix, _Py_framedata fields now consistently have no prefix (globals, builtins, locals, code, lasti, and stack are affected by this) * Use "fdata" rather than a mixture of "frame" and "f" for frame data variables * Generators and coroutines use ``gi_fdata`` (etc) rather than ``gi_xframe`` as their field name * Frame objects use ``f_fdata`` rather than ``f_frame`` as their field name * Thread states use ``fdata`` rather than ``frame`` as their field name * Consistently use _Py_frameobject as the access function prefix, rather than a confusing mixture of _PyFrame and _PyInterpreterFrame * Leave the name of _PyThreadState_PushFrame alone * Leave the name of _PyThreadState_PopFrame alone ---------- title: Code readability: rename interpreter frames to execution frames -> Code readability: rename InterpreterFrame to `_Py_framedata` _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 01:13:26 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 14 Aug 2021 05:13:26 +0000 Subject: [issue44800] Code readability: rename InterpreterFrame to `_Py_framedata` In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1628918006.64.0.554025728318.issue44800@roundup.psfhosted.org> Nick Coghlan added the comment: >From a naming convention perspective, the code comments and NEWS entry in the PR now refer to "full frame objects" (``PyFrameObject``) and "frame data storage structs" (``_Py_framedata``) to avoid giving the misleading impression that introspection and execution frames are different Python types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 01:59:40 2021 From: report at bugs.python.org (Ma Lin) Date: Sat, 14 Aug 2021 05:59:40 +0000 Subject: [issue44912] doc: macOS supports os.fsync(fd) Message-ID: <1628920780.23.0.904216312785.issue44912@roundup.psfhosted.org> New submission from Ma Lin : The doc of os.fsync() said: Availability: Unix, Windows. https://docs.python.org/3.11/library/os.html#os.fsync But it seems that macOS supports fsync. (I'm not a macOS user) ---------- assignee: docs at python components: Documentation, macOS messages: 399583 nosy: docs at python, malin, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: doc: macOS supports os.fsync(fd) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 02:01:34 2021 From: report at bugs.python.org (Ma Lin) Date: Sat, 14 Aug 2021 06:01:34 +0000 Subject: [issue44912] doc: macOS supports os.fsync(fd) In-Reply-To: <1628920780.23.0.904216312785.issue44912@roundup.psfhosted.org> Message-ID: <1628920894.96.0.277528236664.issue44912@roundup.psfhosted.org> Ma Lin added the comment: Unix includes macOS. Very sorry, close as invalid. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 02:09:37 2021 From: report at bugs.python.org (meowmeowcat) Date: Sat, 14 Aug 2021 06:09:37 +0000 Subject: [issue40899] Document exceptions raised by importlib.import In-Reply-To: <1591528094.81.0.814829435189.issue40899@roundup.psfhosted.org> Message-ID: <1628921377.85.0.776434574995.issue40899@roundup.psfhosted.org> Change by meowmeowcat : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 04:02:09 2021 From: report at bugs.python.org (russiavk) Date: Sat, 14 Aug 2021 08:02:09 +0000 Subject: [issue44898] Path.read_bytes() failed when path contains chinese character In-Reply-To: <1628761535.09.0.889249928246.issue44898@roundup.psfhosted.org> Message-ID: <1628928129.65.0.850529159224.issue44898@roundup.psfhosted.org> russiavk added the comment: Sorry.I found it only happen in pypy3 My os is win10 64,and pypy version is "PyPy 7.3.6-alpha0 with MSC v.1929 64 bit" File "C:\Program Files\pypy-c-jit-102746-9515a976b2ea-win64\lib-python\3\pathlib.py", line 1229, in read_bytes with self.open(mode='rb') as f: File "C:\Program Files\pypy-c-jit-102746-9515a976b2ea-win64\lib-python\3\pathlib.py", line 1223, in open opener=self._opener) File "C:\Program Files\pypy-c-jit-102746-9515a976b2ea-win64\lib-python\3\pathlib.py", line 1078, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: WindowsPath('D:/somepath contains chinese character') ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 04:43:00 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 14 Aug 2021 08:43:00 +0000 Subject: [issue44898] Path.read_bytes() failed when path contains chinese character In-Reply-To: <1628761535.09.0.889249928246.issue44898@roundup.psfhosted.org> Message-ID: <1628930580.74.0.475044376343.issue44898@roundup.psfhosted.org> Terry J. Reedy added the comment: pypy is a separate group of people and tracker. cpython 3.7 only gets security patches. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 05:47:39 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 14 Aug 2021 09:47:39 +0000 Subject: [issue44898] Path.read_bytes() failed when path contains chinese character In-Reply-To: <1628928129.65.0.850529159224.issue44898@roundup.psfhosted.org> Message-ID: <20210814094546.GD6219@ando.pearwood.info> Steven D'Aprano added the comment: You're still not giving a reproducible example. The PyPy people will be unable to resolve this unless you give them a reproducable example. 'D:/somepath contains chinese character' is not a path with Chinese characters in it. If you refuse to give enough information to debug the problem, all that anyone can do is close the issue. You are wasting your time, and our time, by giving false information in your bug reports, and if you do the same to PyPy, you will be wasting their time too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 06:59:54 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 14 Aug 2021 10:59:54 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628938794.96.0.467105378525.issue44895@roundup.psfhosted.org> Dong-hee Na added the comment: Here is the dump I extracted. 0:00:00 load avg: 2.89 Run tests sequentially 0:00:00 load avg: 2.89 [1/1] test_exceptions beginning 6 repetitions 123456 ...... test_exceptions leaked [6, 6, 6] references, sum=18 test_exceptions leaked [6, 6, 6] memory blocks, sum=18 test_exceptions failed (reference leak) == Tests result: FAILURE == 1 test failed: test_exceptions 1 re-run test: test_exceptions Total duration: 5.7 sec Tests result: FAILURE ---------- Added file: https://bugs.python.org/file50216/cpython-1628938551.dump.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 07:01:36 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 14 Aug 2021 11:01:36 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628938896.49.0.554671027005.issue44895@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +26243 pull_request: https://github.com/python/cpython/pull/27767 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 07:03:21 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 14 Aug 2021 11:03:21 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628939001.48.0.222859579747.issue44895@roundup.psfhosted.org> Dong-hee Na added the comment: GH-27767 is a tooling patch for extract dump easily. See cpython-1628938551.dump.gz for msg399588. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 08:49:46 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 14 Aug 2021 12:49:46 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <1628945386.08.0.381607468319.issue41102@roundup.psfhosted.org> Andrei Kulakov added the comment: Xiaolong: The file no longer exists on the google drive. How big was the file? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 10:28:01 2021 From: report at bugs.python.org (Madhu) Date: Sat, 14 Aug 2021 14:28:01 +0000 Subject: [issue44913] segfault in call to embedded PyModule_New Message-ID: <1628951281.11.0.836111617554.issue44913@roundup.psfhosted.org> New submission from Madhu : Attached zip file has a test case which illustrate the problem: A python process (`dload.py') loads up a shared library (`libfoo1.so') and makes a call to a foreign function `foo'. `foo' Initializes Python and creates makes a call to PyModule_New at which point dload.py crashes. If the calling process is not python(`dload.c'), there is no crash This sort of situation occurs with python-pam. I'm not sure if this is a programmer error and would welcome correction [I'm supplying a zip file because I can't attach multiple files Steps to repeat 1. compile libfoo1.so according to comment 2. Run ./dload.py 3. Optionally compile and run dload.c ---------- components: Extension Modules files: test-case-embedded-1.zip messages: 399591 nosy: enometh priority: normal severity: normal status: open title: segfault in call to embedded PyModule_New versions: Python 3.9 Added file: https://bugs.python.org/file50217/test-case-embedded-1.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 10:40:38 2021 From: report at bugs.python.org (meowmeowcat) Date: Sat, 14 Aug 2021 14:40:38 +0000 Subject: [issue40899] Document exceptions raised by importlib.import In-Reply-To: <1591528094.81.0.814829435189.issue40899@roundup.psfhosted.org> Message-ID: <1628952038.99.0.266553444196.issue40899@roundup.psfhosted.org> meowmeowcat added the comment: So.. maybe changing ``the module cannot be imported`` to ``the module is not found``? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 10:42:22 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 14 Aug 2021 14:42:22 +0000 Subject: [issue44896] AttributeError in ast.unparse In-Reply-To: <1628731580.95.0.847749574283.issue44896@roundup.psfhosted.org> Message-ID: <1628952142.63.0.343772088419.issue44896@roundup.psfhosted.org> Batuhan Taskaya added the comment: I don't think this is really an issue considering some other functionalities that consumes AST code (e.g `compile`) will expect it to be annotated with location metadata. This is why the `ast` module already comes bundled with a utility function called `fix_missing_locations` which in your example would work; > print(ast.unparse(bad)) > print(ast.unparse(ast.fix_missing_locations(bad))) Though I recall seeing this error once before, and since there also some counter examples (e.g ast.increment_lineno) that assume an AST node might lack of these attributes even though the nodes declare them makes it worth to fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 11:17:09 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 14 Aug 2021 15:17:09 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : Message-ID: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> New submission from Ken Jin : tp_version_tag is supposed to be unique for different class objects. Under normal circumstances, everything works properly: def good(): class C: def __init__(self): # Just to force `tp_version_tag` to update pass cls_id = hex(id(C)) tp_version_tag_before = C.v # v is tp_version_tag of C, exposed to Python x = C() # tp_new requires a _PyType_Lookup for `__init__`, updating `tp_version_tag` tp_version_tag_after = C.v print(f'C ID: {cls_id}, before: {tp_version_tag_before} after: {tp_version_tag_after}') for _ in range(100): good() Result: C ID: 0x2920c2d58d0, before: 0 after: 115 C ID: 0x2920c2d6170, before: 0 after: 116 C ID: 0x2920c2d65c0, before: 0 after: 117 C ID: 0x2920c8f2800, before: 0 after: 118 C ID: 0x2920c8f7150, before: 0 after: 119 C ID: 0x2920c8f6010, before: 0 after: 120 C ID: 0x2920c8f6460, before: 0 after: 121 C ID: 0x2920c8f3d90, before: 0 after: 122 C ID: 0x2920c8f0e20, before: 0 after: 123 C ID: 0x2920c8f41e0, before: 0 after: 124 C ID: 0x2920c8f4a80, before: 0 after: 125 C ID: 0x2920c8f1270, before: 0 after: 126 C ID: 0x2920c8f16c0, before: 0 after: 127 C ID: 0x2920c8f34f0, before: 0 after: 128 C ID: 0x2920c8f5770, before: 0 after: 129 C ID: 0x2920c8f30a0, before: 0 after: 130 ... However, wrapping in a unittest and run under -R : suddenly changes things: class BadTest(unittest.TestCase): def test_bad(self): class C: def __init__(self): pass cls_id = hex(id(C)) tp_version_tag_before = C.v x = C() tp_version_tag_after = C.v print(f'C ID: {cls_id}, before: {tp_version_tag_before} after: {tp_version_tag_after}') Result: "python_d.exe" -m test test_bad -R 10:10 C ID: 0x1c4c59354b0, before: 0 after: 78 .C ID: 0x1c4c59372e0, before: 0 after: 82 .C ID: 0x1c4c5934370, before: 0 after: 82 .C ID: 0x1c4c5934370, before: 0 after: 82 .C ID: 0x1c4c5933680, before: 0 after: 82 .C ID: 0x1c4c5938cc0, before: 0 after: 82 .C ID: 0x1c4c59354b0, before: 0 after: 82 .C ID: 0x1c4c5935900, before: 0 after: 82 .C ID: 0x1c4c5933680, before: 0 after: 82 .C ID: 0x1c4c59354b0, before: 0 after: 82 .C ID: 0x1c4c59354b0, before: 0 after: 82 .C ID: 0x1c4c59361a0, before: 0 after: 82 .C ID: 0x1c4c5933680, before: 0 after: 82 .C ID: 0x1c4c5931400, before: 0 after: 82 .C ID: 0x1c4c5938cc0, before: 0 after: 82 .C ID: 0x1c4c5938cc0, before: 0 after: 82 .C ID: 0x1c4c5933680, before: 0 after: 82 .C ID: 0x1c4c5936a40, before: 0 after: 82 .C ID: 0x1c4c5931400, before: 0 after: 82 .C ID: 0x1c4c5935900, before: 0 after: 82 Somehow the class is occasionally occupying the same address, and tp_version_tag didn't update properly. tp_version_tag being unique is an important invariant required for LOAD_ATTR and LOAD_METHOD specialization. I bumped into this problem after LOAD_METHOD specialization kept failing magically in test_descr. I think this is related to issue43636 and issue43452, but I ran out of time to bisect after spending a day chasing this down. I'll try to bisect soon. ---------- components: Interpreter Core messages: 399594 nosy: Mark.Shannon, kj, pablogsal, vstinner priority: normal severity: normal status: open title: tp_version_tag is not unique when test runs with -R : versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 11:48:00 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sat, 14 Aug 2021 15:48:00 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1628956080.11.0.0472703233135.issue37596@roundup.psfhosted.org> Change by Filipe La?ns : ---------- keywords: +patch pull_requests: +26244 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27769 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 13:54:18 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 14 Aug 2021 17:54:18 +0000 Subject: [issue44896] AttributeError in ast.unparse In-Reply-To: <1628731580.95.0.847749574283.issue44896@roundup.psfhosted.org> Message-ID: <1628963658.28.0.386864514095.issue44896@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +26245 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27770 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 14:28:18 2021 From: report at bugs.python.org (Doug Hoskisson) Date: Sat, 14 Aug 2021 18:28:18 +0000 Subject: [issue44915] Python keywords as string keys in TypedDict Message-ID: <1628965698.89.0.982806951929.issue44915@roundup.psfhosted.org> New submission from Doug Hoskisson : I'm running into an issue with the syntax of https://www.python.org/dev/peps/pep-0589/ ``` class C(TypedDict): to: int from: int SyntaxError: invalid syntax ``` I'm not sure any change needs to be made to the specification. But the interpreter needs to recognize that `from` is a string key to a `TypedDict`, not the keyword `from`. Or if you don't want to have to recognize `from` as a string instead of a keyword, we need a specification that allows us to put keywords as keys in `TypedDict`. I was thinking maybe something like: ``` class C(TypedDict): "to": int "from": int ``` as an optional way to write the same thing. ---------- messages: 399595 nosy: Doug Hoskisson priority: normal severity: normal status: open title: Python keywords as string keys in TypedDict type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 16:22:30 2021 From: report at bugs.python.org (George) Date: Sat, 14 Aug 2021 20:22:30 +0000 Subject: [issue44916] Undefined/random behaviour when importing two modules with the same name but different source files Message-ID: <1628972550.44.0.0656223373352.issue44916@roundup.psfhosted.org> New submission from George : Warning: There's a higher probability this is "expected" undefined behaviour or not even undefined and I'm just a moron. In addtion, I couldn't actually replicate it outside of the specific context it happened. But if it sounds plausible and it's something that shouldn't happen I can spend more time trying to replicate. 1. In two different python processes I'm "dynamically" creating a module named `M` using a file `m1.py` that contains a class `C`. Then I create an object of tpye `C` and pickle it. (let's call this object `c1`) 2. In a different thread I do the exact same thing, but the file is `m2.py` then I create an object of type `C` and pickle it. (call this one `c2`) 3. Then, in the same thread, I recreate the module named `M` from `m1.py` and unpickle `c1`, second I create a module named `M` from `m2.py` (this doesn't cause an error) and unpickle `c2`. 4. This (spurprisingly?) seems to basically work fine in most cases. Except for one (and I can't find why it's special) where for some reason `c2` starts calling the methods from a class that's not it's own. In other words `c1` usually maps ot `M.C --> m1.py` and `c2` to `M.C --> m2.py` | But randomly `c2` will start looking up methods in `M.C --> m1.py`, or at least that's what stack traces & debuggers seem to indicate. The way I create the module `M` in all cases: ``` with open(`m1.py`, 'wb') as fp: fp.write(code.encode('utf-8')) spec = importlib.util.spec_from_file_location('M', fp.name) temp_module = importlib.util.module_from_spec(spec) sys.modules['M] = temp_module spec.loader.exec_module(temp_module) # Note: Same for the other module but using `m2.py`, the code I use here contains a class `C` in both cases ``` This seems, unexpected. I wouldn't expect the recreation to cause a crash, but I'd expect it to either override the previous `M` for all existing objects instantiated from that module in all cases, or in no cases... currently it seems that both modules stay loaded and lookups are made randomly. ---------- components: Interpreter Core messages: 399596 nosy: George3d6 priority: normal severity: normal status: open title: Undefined/random behaviour when importing two modules with the same name but different source files versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 17:20:11 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 14 Aug 2021 21:20:11 +0000 Subject: [issue44862] [docs] make "Deprecated since version {deprecated}, will be removed in version {removed}" translation available In-Reply-To: <1628361260.67.0.944506647918.issue44862@roundup.psfhosted.org> Message-ID: <1628976011.12.0.0146211334724.issue44862@roundup.psfhosted.org> ?ric Araujo added the comment: I checked and the directive was indeed made translatable in #32087 So like Terry said, this should be brought to the attention of the PT translation team. The strings seem to be translated (https://github.com/python/python-docs-pt-br/blob/3.10/sphinx.po#L46), so there?s something else going on (even in the current 3.10 docs). ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 18:08:42 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 14 Aug 2021 22:08:42 +0000 Subject: [issue41082] Error handling and documentation of Path.home() In-Reply-To: <1592860421.93.0.490449762565.issue41082@roundup.psfhosted.org> Message-ID: <1628978922.97.0.235711954036.issue41082@roundup.psfhosted.org> Andrei Kulakov added the comment: In current dev version (3.11), _PosixFlavor doesn't have gethomedir(), and instead os.path.expanduser() is used via _NormalAccessor(). So at least for the current dev version, the docs are accurate. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 18:17:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 14 Aug 2021 22:17:05 +0000 Subject: [issue44917] interpreter hangs on recursion in both body and handler of a try block Message-ID: <1628979425.1.0.358414735966.issue44917@roundup.psfhosted.org> New submission from Irit Katriel : This was found while investigating issue44895. It may or may not be the cause of that issue. The script below hangs on a mac (it's an extract from test_exceptions.test_recursion_in_except_handler). ----------- import sys count = 0 def main(): def f(): global count count += 1 try: f() except RecursionError: f() sys.setrecursionlimit(30) try: f() except RecursionError: pass main() print(count) ----------- When I kill it the traceback shows it alternating between the two recursive calls, but not in a regular pattern: ... [snipped a lot] File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ [Previous line repeated 2 more times] RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ [Previous line repeated 1 more time] RecursionError: maximum recursion depth exceeded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython/tt.py", line 22, in main() ^^^^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 18, in main f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ [Previous line repeated 10 more times] File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 11, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 13, in f f() ^^^ File "/Users/iritkatriel/src/cpython/tt.py", line 7, in f def f(): KeyboardInterrupt ---------- components: Interpreter Core messages: 399599 nosy: iritkatriel priority: normal severity: normal status: open title: interpreter hangs on recursion in both body and handler of a try block type: crash versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 18:19:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 14 Aug 2021 22:19:04 +0000 Subject: [issue44917] interpreter hangs on recursion in both body and handler of a try block In-Reply-To: <1628979425.1.0.358414735966.issue44917@roundup.psfhosted.org> Message-ID: <1628979544.28.0.00417501758945.issue44917@roundup.psfhosted.org> Irit Katriel added the comment: Perhaps the interpreter should detect that it is about to raise a RecusionError whose context is another RecursionError, and raise a FatalError instead? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 18:20:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 14 Aug 2021 22:20:44 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1628979644.2.0.708076526987.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: I created issue44917 for the recursion hang because it seems like it's really another bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 19:29:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 14 Aug 2021 23:29:01 +0000 Subject: [issue19352] unittest loader barfs on symlinks In-Reply-To: <1382452375.52.0.637202424401.issue19352@psf.upfronthosting.co.za> Message-ID: <1628983741.25.0.36585469769.issue19352@roundup.psfhosted.org> Irit Katriel added the comment: > this affects python 2.7 only; ---------- nosy: +iritkatriel resolution: -> out of date status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 22:08:45 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 15 Aug 2021 02:08:45 +0000 Subject: [issue44916] Random behaviour when importing two modules with the same name but different source files In-Reply-To: <1628972550.44.0.0656223373352.issue44916@roundup.psfhosted.org> Message-ID: <1628993325.51.0.67720846108.issue44916@roundup.psfhosted.org> Steven D'Aprano added the comment: "Undefined behaviour" has a particular meaning to C programmers, which is relevant to Python because the interpreter is written in C. It's probably best not to use that term here. Let me see if I understand your issue. * You have two separate Python processes. * Each process has a thread which dynamically writes a file called "m1.py", containing a class C. * Each process has a second thread which dynamically writes a file called "m2.py", also containing a class C. * Each thread then imports its file using the common name "M", and tries to pickle and unpickle objects of type C. * And seemingly at random, each thread sometimes picks up its class M.C, but sometimes the class M.C from the other thread. * Not sure if you get any cross-process contamination as well (that is, process 1 picks up the modules from process 2), but it wouldn't surprise me in the least. My instinct here is to back away in horror *wink* You have a lot of non-deterministic code here. I'm kinda impressed that it ever works at all :-) 1. If you have two processes writing to the same file "m1.py", its a lottery which one will end up actually written to disk. It is at least theoretically possible that the data actually on the disk could be a hybrid of bits of process 1's m1.py and bits of process 2's m1.py. 2. Likewise for the file m2.py. 3. When you go to import the files, it is non-deterministic which file you will see, e.g. - process 1 writes its m1.py - process 2 writes its m1.py, overriding the previous m1.py - process 1 goes to import m1.py, but ends up reading the m1.py created by process 2 So that's how you could get cross-process contamination. ---------- nosy: +steven.daprano title: Undefined/random behaviour when importing two modules with the same name but different source files -> Random behaviour when importing two modules with the same name but different source files _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 22:20:58 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 15 Aug 2021 02:20:58 +0000 Subject: [issue44916] Random behaviour when importing two modules with the same name but different source files In-Reply-To: <1628972550.44.0.0656223373352.issue44916@roundup.psfhosted.org> Message-ID: <1628994058.29.0.562007528827.issue44916@roundup.psfhosted.org> Steven D'Aprano added the comment: The importing from multiple threads is possibly also non-deterministic, but I'm not an expert on the importlib module. It looks to me like a another plausible source of random/arbitrary behaviour could be: 1. Within a single process, you have two threads running in non-deterministic order. So you could have, let's say: - thread 1 imports M from file m1.py - thread 2 tries to import M, and the import system sees that M is cached in sys.modules and uses that instead. So even though the two threads are writing to different source files, they both call the module M, which means that you can have two threads stomping on each other's toes trying to import different classes C from different modules both called M. I don't think this is supported at all. I'm not really qualified to rule out a bug in the importlib functions but to me it surely looks like a case of "don't do that". Remember that sys.modules is cached globally per-process, so once you start pickling and unpickling your M.C instances, its a lottery which one you will get; furthermore, if you have instances: x = M.C() replace module M with a new module M y = M.C() only y is using the new definition of C from the new module M, instance x is still using the original class with its original methods. I'll leave it to Brett, Nick or Eric to confirm that there's nothing to fix in importlib, but my advice is to avoid using dynamically created modules **all with the same name** that touch the file system from multiple threads in multiple processes at the same time. There is far too many opportunities for non-deterministic behaviour to mess up your expectations. ---------- nosy: +brett.cannon, eric.snow, ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 14 22:24:53 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 15 Aug 2021 02:24:53 +0000 Subject: [issue41010] email.message.EmailMessage.get_body In-Reply-To: <1592410013.12.0.0160903099449.issue41010@roundup.psfhosted.org> Message-ID: <1628994293.26.0.346789408371.issue41010@roundup.psfhosted.org> Andrei Kulakov added the comment: This issue was fixed by https://github.com/python/cpython/pull/26903 (I confirmed that the error no longer happens with attached file). This can be closed as fixed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 03:49:05 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 15 Aug 2021 07:49:05 +0000 Subject: [issue44917] interpreter hangs on recursion in both body and handler of a try block In-Reply-To: <1628979425.1.0.358414735966.issue44917@roundup.psfhosted.org> Message-ID: <1629013745.98.0.0017328849325.issue44917@roundup.psfhosted.org> Mark Shannon added the comment: This looks like a duplicate of https://bugs.python.org/issue42951 ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 04:27:23 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 15 Aug 2021 08:27:23 +0000 Subject: [issue16580] [doc] Add examples to int.to_bytes and int.from_bytes In-Reply-To: <1354217109.61.0.534443148437.issue16580@psf.upfronthosting.co.za> Message-ID: <1629016043.2.0.344817062773.issue16580@roundup.psfhosted.org> Mark Dickinson added the comment: @Gautam > I think it's out of scope for this issue. Agreed. It was just a note in passing. I don't think it's worth opening a new issue, though, unless this is genuinely causing problems for someone. Just let it lie. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 04:44:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 15 Aug 2021 08:44:20 +0000 Subject: [issue44917] interpreter hangs on recursion in both body and handler of a try block In-Reply-To: <1628979425.1.0.358414735966.issue44917@roundup.psfhosted.org> Message-ID: <1629017060.47.0.805326888627.issue44917@roundup.psfhosted.org> Irit Katriel added the comment: Not sure. Here we do set the recursion limit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 05:29:35 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 15 Aug 2021 09:29:35 +0000 Subject: [issue44917] interpreter hangs on recursion in both body and handler of a try block In-Reply-To: <1628979425.1.0.358414735966.issue44917@roundup.psfhosted.org> Message-ID: <1629019775.39.0.599104459996.issue44917@roundup.psfhosted.org> Mark Shannon added the comment: A recursion limit of 30 is effectively infinite. With a debug build of 3.11, the time to execute grows very fast indeed, probably super-exponentially. mark at nero:~/repos/cpython$ time ./python ~/test/test.py 15 real 0m1.107s user 0m1.099s sys 0m0.008s mark at nero:~/repos/cpython$ time ./python ~/test/test.py 16 real 0m4.468s user 0m4.464s sys 0m0.004s mark at nero:~/repos/cpython$ time ./python ~/test/test.py 17 real 0m20.968s user 0m20.928s sys 0m0.040s mark at nero:~/repos/cpython$ time ./python ~/test/test.py 18 real 2m29.562s user 2m29.270s sys 0m0.140s I would expect ./python ~/test/test.py 30 to take millions of years. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 05:44:53 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 15 Aug 2021 09:44:53 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629020693.28.0.648304860454.issue44698@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +26246 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27772 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 06:00:59 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 15 Aug 2021 10:00:59 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629021659.13.0.69642079718.issue44698@roundup.psfhosted.org> Mark Dickinson added the comment: @Pablo: I'm adding you to the nosy list to get your opinion on whether (the backport of) GH-27772 can go into 3.10.0.rc2. Summary: GH-27278 (which I reviewed and approved) and its backports fixed some undefined behaviour in complex exponentiation, but also introduced a behaviour change that affected NumPy: some exponentiation expressions that returned a result in 3.10.0b4 raise an OverflowError in 3.10.0.rc1. GH-27772 reverts the behaviour change but keeps the fix for the undefined behaviour. Can the backport of GH-27772 to the 3.10 branch go in before 3.10.0 final? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 06:36:20 2021 From: report at bugs.python.org (Mark Deen) Date: Sun, 15 Aug 2021 10:36:20 +0000 Subject: [issue44918] Unhandled Exception (Not Implemented) in HTMLParser().feed Message-ID: <1629023780.24.0.906396765279.issue44918@roundup.psfhosted.org> New submission from Mark Deen : The hexadecimal sequence '3c215b02634717' when passed as an argument to HTMLParser()'s feed function results in the exception noted below. The code example below illustrates this exception. from html.parser import HTMLParser parser = HTMLParser() parser.feed(bytearray.fromhex('3c215b02634717').decode('ascii')) Traceback (most recent call last): File "poc.py", line 5, in parser.feed(bytearray.fromhex('3c215b02634717').decode('ascii')) File "/usr/lib/python3.9/html/parser.py", line 110, in feed self.goahead(0) File "/usr/lib/python3.9/html/parser.py", line 178, in goahead k = self.parse_html_declaration(i) File "/usr/lib/python3.9/html/parser.py", line 263, in parse_html_declaration return self.parse_marked_section(i) File "/usr/lib/python3.9/_markupbase.py", line 149, in parse_marked_section sectName, j = self._scan_name( i+3, i ) File "/usr/lib/python3.9/_markupbase.py", line 390, in _scan_name self.error("expected name token at %r" File "/usr/lib/python3.9/_markupbase.py", line 33, in error raise NotImplementedError( NotImplementedError: subclasses of ParserBase must override error() ---------- components: Parser messages: 399611 nosy: lys.nikolaou, md103, pablogsal priority: normal severity: normal status: open title: Unhandled Exception (Not Implemented) in HTMLParser().feed type: security versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 07:29:40 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 15 Aug 2021 11:29:40 +0000 Subject: [issue16580] [doc] Add examples to int.to_bytes and int.from_bytes In-Reply-To: <1354217109.61.0.534443148437.issue16580@psf.upfronthosting.co.za> Message-ID: <1629026980.57.0.544459364992.issue16580@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset ad0a8a9c629a7a0fa306fbdf019be63c701a8028 by Gautam Chaudhuri in branch 'main': bpo-16580: [doc] Add examples to int.to_bytes and int.from_bytes (GH-27760) https://github.com/python/cpython/commit/ad0a8a9c629a7a0fa306fbdf019be63c701a8028 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 07:30:03 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 15 Aug 2021 11:30:03 +0000 Subject: [issue16580] [doc] Add examples to int.to_bytes and int.from_bytes In-Reply-To: <1354217109.61.0.534443148437.issue16580@psf.upfronthosting.co.za> Message-ID: <1629027003.96.0.58998509788.issue16580@roundup.psfhosted.org> Mark Dickinson added the comment: Merged. Thank you for the contribution! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 07:30:16 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 15 Aug 2021 11:30:16 +0000 Subject: [issue16580] [doc] Add examples to int.to_bytes and int.from_bytes In-Reply-To: <1354217109.61.0.534443148437.issue16580@psf.upfronthosting.co.za> Message-ID: <1629027016.32.0.257520498531.issue16580@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 07:42:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 15 Aug 2021 11:42:46 +0000 Subject: [issue44917] interpreter hangs on recursion in both body and handler of a try block In-Reply-To: <1628979425.1.0.358414735966.issue44917@roundup.psfhosted.org> Message-ID: <1629027766.81.0.792274671656.issue44917@roundup.psfhosted.org> Irit Katriel added the comment: Right, this is a duplicate of issue42951. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Random and infinite loop in dealing with recursion error for "try-except " _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 08:23:36 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Sun, 15 Aug 2021 12:23:36 +0000 Subject: [issue44919] TypedDict subtypes ignore any other metaclasses in 3.9+ Message-ID: <1629030216.33.0.128972085225.issue44919@roundup.psfhosted.org> New submission from Nikita Sobolev : Some context. I have a `User` class defined as a `TypedDict`: ```python from typing import TypedDict class User(TypedDict): name: str registered: bool ``` Now, I want to check if some `dict` is an instance of `User` like so: `isinstance(my_dict, User)`. But, I can't. Because it raises `TypeError('TypedDict does not support instance and class checks')`. Ok. Let's change `__instancecheck__` method then. We can only do this in a metaclass: ```python from typing import _TypedDictMeta class UserDictMeta(_TypedDictMeta): def __instancecheck__(cls, arg: object) -> bool: return ( isinstance(arg, dict) and isinstance(arg.get('name'), str) and isinstance(arg.get('registered'), bool) ) class UserDict(User, metaclass=UserDictMeta): ... ``` It looks like it should work. It used to work like this in Python3.7 and Python3.8. But since Python3.9 it does not work. Let's try to debug what happens: ```python print(type(UserDict)) # print(UserDict.__instancecheck__(UserDict, {})) # TypeError: TypedDict does not support instance and class checks ``` It looks like my custom `UserDictMeta` is completely ignored. And I cannot change how `__instancecheck__` behaves. I suspect that the reason is in these 2 lines: https://github.com/python/cpython/blob/ad0a8a9c629a7a0fa306fbdf019be63c701a8028/Lib/typing.py#L2384-L2385 What's the most unclear in this behavior is that it does not match regular Python subclass patterns. Simplified example of the same behavior, using only primite types: ```python class FirstMeta(type): def __instancecheck__(cls, arg: object) -> bool: raise TypeError('You cannot use this type in isinstance() call') class First(object, metaclass=FirstMeta): ... # User space: class MyClass(First): # this looks like a user-define TypedDict subclass ... class MySubClassMeta(FirstMeta): def __instancecheck__(cls, arg: object) -> bool: return True # just an override example class MySubClass(MyClass, metaclass=MySubClassMeta): ... print(isinstance(1, MySubClass)) # True print(isinstance(1, MyClass)) # TypeError ``` As you can see our `MySubClassMeta` works perfectly fine this way. I suppose that this is a bug in `TypedDict`, not a desired behavior. Am I correct? ---------- components: Library (Lib) messages: 399615 nosy: sobolevn priority: normal severity: normal status: open title: TypedDict subtypes ignore any other metaclasses in 3.9+ type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 08:30:05 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 15 Aug 2021 12:30:05 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629030605.73.0.871348882277.issue44914@roundup.psfhosted.org> Mark Shannon added the comment: Thanks for putting in the effort to find this. I think the first step to fixing this is to formalize the semantics of `tp_version_tag`. Initially it was designed just for the method cache, but we have started using it as a unique identifier for the state of a class. The two different uses have different requirements when the global version counter overflows. Possibly in other scenarios as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 08:53:15 2021 From: report at bugs.python.org (Timothy Fleenor) Date: Sun, 15 Aug 2021 12:53:15 +0000 Subject: [issue35203] Windows Installer Ignores Launcher Installer Options Where The Python Launcher Is Already Present In-Reply-To: <1541791657.21.0.788709270274.issue35203@psf.upfronthosting.co.za> Message-ID: <1629031995.9.0.59071842008.issue35203@roundup.psfhosted.org> Timothy Fleenor added the comment: I am also having this same problem with python 3.9.5.. I am currently in windows 11 preview but it has also occurred for me in the windows 20h2 with no updates and caused a lot of issues running python for me including saying the pip command was not recognized. ---------- nosy: +digidoggie18 versions: +Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 09:21:54 2021 From: report at bugs.python.org (Bar Harel) Date: Sun, 15 Aug 2021 13:21:54 +0000 Subject: [issue44911] Leaked tasks cause IsolatedAsyncioTestCase to throw an exception In-Reply-To: <1628901403.12.0.195708767229.issue44911@roundup.psfhosted.org> Message-ID: <1629033714.04.0.922100971701.issue44911@roundup.psfhosted.org> Change by Bar Harel : ---------- nosy: +michael.foord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 10:18:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Aug 2021 14:18:32 +0000 Subject: [issue44918] Unhandled Exception (Not Implemented) in HTMLParser().feed In-Reply-To: <1629023780.24.0.906396765279.issue44918@roundup.psfhosted.org> Message-ID: <1629037112.96.0.684984260095.issue44918@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 10:26:05 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 15 Aug 2021 14:26:05 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629037565.6.0.198262037888.issue44914@roundup.psfhosted.org> Ken Jin added the comment: @Mark, agreed about properly defining the semantics. For the current bug: I've narrowed it down to a corner case in how the -R tests work: 1. On each run cleanup, libregrtest will clear the type cache https://github.com/python/cpython/blob/6f84656dc188191225c8d5cdfd2a00de663988d0/Lib/test/libregrtest/refleak.py#L170 2. This calls PyType_ClearCache, which sets the global next_version_tag counter to 0 https://github.com/python/cpython/blob/cee67fa66129b5d1db5c8aa3884338f82f0da3de/Objects/typeobject.c#L292. 3. On next run, since runs and type cache is deterministic, we end up with exact same tp_version_tag for the type. 4. This repeats every run until crash. One possible fix: we can tell sys._clear_type_cache to not reset next_version_tag to 0 (it can use another function, since PyType_ClearCache is part of public C API and shouldn't be modified). This seems like a bug in libregrtest, the type method cache and tp_version_tag aren't at fault for this specific scenario. I'm submitting a PR soon. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 10:31:40 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sun, 15 Aug 2021 14:31:40 +0000 Subject: [issue44918] Unhandled Exception (Not Implemented) in HTMLParser().feed In-Reply-To: <1629023780.24.0.906396765279.issue44918@roundup.psfhosted.org> Message-ID: <1629037900.53.0.383007796845.issue44918@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Seems similar to https://bugs.python.org/issue38573 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 10:37:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Aug 2021 14:37:00 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629038220.86.0.249641218169.issue44698@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > GH-27772 reverts the behaviour change but keeps the fix for the undefined behaviour. Can the backport of GH-27772 to the 3.10 branch go in before 3.10.0 final? Thanks for checking with me! Given that this is fixing a bug that we introduced in rc1, I think it makes sense to backport to fix it. I have reviewed the code in GH-27772 and is contained enough, so I think is a good idea to go ahead. Thanks Mark for all the work! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 10:38:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 15 Aug 2021 14:38:47 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629038327.92.0.47320472266.issue44698@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm keeping track to the 3.10 backports to the second rc so could you add me as a reviewer for the backport? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 11:13:33 2021 From: report at bugs.python.org (Alex Waygood) Date: Sun, 15 Aug 2021 15:13:33 +0000 Subject: [issue44904] Erroneous behaviour for abstract class properties In-Reply-To: <1628803001.12.0.882298478545.issue44904@roundup.psfhosted.org> Message-ID: <1629040413.99.0.951748156759.issue44904@roundup.psfhosted.org> Alex Waygood added the comment: This same bug (where classmethod properties are accidentally called by other parts of Python) is also present for non-abstract class properties, and has the side effect of causing doctest.py to crash with a fairly incomprehensible `AttributeError`: Script: class Untestable: """ >>> Untestable.my_classmethod_property 'Oh no!' """ @classmethod @property def my_classmethod_property(cls): return 'Oh no!' if __name__ == '__main__': import doctest doctest.testmod() Output: Traceback (most recent call last): File "C:/Users/Alex/classmethod_properties_bug.py", line 13, in doctest.testmod() File "C:\Users\Alex\.conda\envs\WebGame39\lib\doctest.py", line 1955, in testmod for test in finder.find(m, name, globs=globs, extraglobs=extraglobs): File "C:\Users\Alex\.conda\envs\WebGame39\lib\doctest.py", line 939, in find self._find(tests, obj, name, module, source_lines, globs, {}) File "C:\Users\Alex\.conda\envs\WebGame39\lib\doctest.py", line 1001, in _find self._find(tests, val, valname, module, source_lines, File "C:\Users\Alex\.conda\envs\WebGame39\lib\doctest.py", line 1028, in _find val = getattr(obj, valname).__func__ AttributeError: 'str' object has no attribute '__func__' ---------- nosy: +AlexWaygood Added file: https://bugs.python.org/file50218/classmethod_properties_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 12:01:08 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 15 Aug 2021 16:01:08 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629043268.22.0.700793343049.issue44914@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +26247 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27773 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 12:04:47 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 15 Aug 2021 16:04:47 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629043487.27.0.682252935117.issue44914@roundup.psfhosted.org> Mark Shannon added the comment: PyType_ClearCache() is documented as: Clear the internal lookup cache. Return the current version tag. Modifying it to do what it is documented to do fixes this bug :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 13:26:06 2021 From: report at bugs.python.org (Steve Simmons) Date: Sun, 15 Aug 2021 17:26:06 +0000 Subject: [issue44920] Support UUIDv6, UUIDv7, and UUIDv8 from the new version of RFC4122 Message-ID: <1629048365.97.0.101119142277.issue44920@roundup.psfhosted.org> New submission from Steve Simmons : Three new types of UUIDs have been proposed in the latest draft of the next version of RFC4122. Full text of that draft is in [1] (published 21 April 2021; draft period ends 21 Oct 2021). Support for these should be included in uuid.py for Python 3.11, with backport for 3.9 and 3.10. The timetable for Python 3.11 should fit with the end of the IETF draft period. Implementation should be similar to the existing UUID classes in uuid.py, the prototypes in [2], or even parts of my own uuid6 version [3]. [1] https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format [2] https://github.com/uuid6/prototypes/tree/main/python [3] https://github.com/stevesimmons/pyuuid6/blob/main/uuid6.py ---------- components: Library (Lib) messages: 399624 nosy: stevesimmons priority: normal severity: normal status: open title: Support UUIDv6, UUIDv7, and UUIDv8 from the new version of RFC4122 type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 16:10:26 2021 From: report at bugs.python.org (Marco Sulla) Date: Sun, 15 Aug 2021 20:10:26 +0000 Subject: [issue44921] dict subclassing is slow Message-ID: <1629058226.73.0.105626301201.issue44921@roundup.psfhosted.org> New submission from Marco Sulla : I asked on SO why subclassing dict makes the subclass much slower in some operations. This is the answer by Monica (https://stackoverflow.com/a/59914459/1763602): Indexing and in are slower in dict subclasses because of a bad interaction between a dict optimization and the logic subclasses use to inherit C slots. This should be fixable, though not from your end. The CPython implementation has two sets of hooks for operator overloads. There are Python-level methods like __contains__ and __getitem__, but there's also a separate set of slots for C function pointers in the memory layout of a type object. Usually, either the Python method will be a wrapper around the C implementation, or the C slot will contain a function that searches for and calls the Python method. It's more efficient for the C slot to implement the operation directly, as the C slot is what Python actually accesses. Mappings written in C implement the C slots sq_contains and mp_subscript to provide in and indexing. Ordinarily, the Python-level __contains__ and __getitem__ methods would be automatically generated as wrappers around the C functions, but the dict class has explicit implementations of __contains__ and __getitem__, because the explicit implementations (https://github.com/python/cpython/blob/v3.8.1/Objects/dictobject.c) are a bit faster than the generated wrappers: static PyMethodDef mapp_methods[] = { DICT___CONTAINS___METHODDEF {"__getitem__", (PyCFunction)(void(*)(void))dict_subscript, METH_O | METH_COEXIST, getitem__doc__}, ... (Actually, the explicit __getitem__ implementation is the same function as the mp_subscript implementation, just with a different kind of wrapper.) Ordinarily, a subclass would inherit its parent's implementations of C-level hooks like sq_contains and mp_subscript, and the subclass would be just as fast as the superclass. However, the logic in update_one_slot (https://github.com/python/cpython/blob/v3.8.1/Objects/typeobject.c#L7202) looks for the parent implementation by trying to find the generated wrapper methods through an MRO search. dict doesn't have generated wrappers for sq_contains and mp_subscript, because it provides explicit __contains__ and __getitem__ implementations. Instead of inheriting sq_contains and mp_subscript, update_one_slot ends up giving the subclass sq_contains and mp_subscript implementations that perform an MRO search for __contains__ and __getitem__ and call those. This is much less efficient than inheriting the C slots directly. Fixing this will require changes to the update_one_slot implementation. Aside from what I described above, dict_subscript also looks up __missing__ for dict subclasses, so fixing the slot inheritance issue won't make subclasses completely on par with dict itself for lookup speed, but it should get them a lot closer. As for pickling, on the dumps side, the pickle implementation has a dedicated fast path (https://github.com/python/cpython/blob/v3.8.1/Modules/_pickle.c#L4291) for dicts, while the dict subclass takes a more roundabout path through object.__reduce_ex__ and save_reduce. On the loads side, the time difference is mostly just from the extra opcodes and lookups to retrieve and instantiate the __main__.A class, while dicts have a dedicated pickle opcode for making a new dict. If we compare the disassembly for the pickles: In [26]: pickletools.dis(pickle.dumps({0: 0, 1: 1, 2: 2, 3: 3, 4: 4})) 0: \x80 PROTO 4 2: \x95 FRAME 25 11: } EMPTY_DICT 12: \x94 MEMOIZE (as 0) 13: ( MARK 14: K BININT1 0 16: K BININT1 0 18: K BININT1 1 20: K BININT1 1 22: K BININT1 2 24: K BININT1 2 26: K BININT1 3 28: K BININT1 3 30: K BININT1 4 32: K BININT1 4 34: u SETITEMS (MARK at 13) 35: . STOP highest protocol among opcodes = 4 In [27]: pickletools.dis(pickle.dumps(A({0: 0, 1: 1, 2: 2, 3: 3, 4: 4}))) 0: \x80 PROTO 4 2: \x95 FRAME 43 11: \x8c SHORT_BINUNICODE '__main__' 21: \x94 MEMOIZE (as 0) 22: \x8c SHORT_BINUNICODE 'A' 25: \x94 MEMOIZE (as 1) 26: \x93 STACK_GLOBAL 27: \x94 MEMOIZE (as 2) 28: ) EMPTY_TUPLE 29: \x81 NEWOBJ 30: \x94 MEMOIZE (as 3) 31: ( MARK 32: K BININT1 0 34: K BININT1 0 36: K BININT1 1 38: K BININT1 1 40: K BININT1 2 42: K BININT1 2 44: K BININT1 3 46: K BININT1 3 48: K BININT1 4 50: K BININT1 4 52: u SETITEMS (MARK at 31) 53: . STOP highest protocol among opcodes = 4 we see that the difference between the two is that the second pickle needs a whole bunch of opcodes to look up __main__.A and instantiate it, while the first pickle just does EMPTY_DICT to get an empty dict. After that, both pickles push the same keys and values onto the pickle operand stack and run SETITEMS ---------- components: C API messages: 399625 nosy: Marco Sulla priority: normal severity: normal status: open title: dict subclassing is slow type: performance versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 17:02:23 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Sun, 15 Aug 2021 21:02:23 +0000 Subject: [issue44897] Integrate trashcan mechanism into _Py_Dealloc In-Reply-To: <1628748753.21.0.569730676893.issue44897@roundup.psfhosted.org> Message-ID: <1629061343.65.0.828343713571.issue44897@roundup.psfhosted.org> Neil Schemenauer added the comment: As I suspected, the performance impact is significant (although pretty small). Based on Linux perf, it looks like the extra test+branch in _Py_Dealloc adds about 1% overhead. pyperformance shows something similar, see attached reports (pypref-trashcan.txt and perf-annotate-trash.txt). An idea I've been trying is to add another type slot, e.g. tp_call_dealloc. It could be set by PyType_Ready(). It would be called by the Py_DECREF macro on refcnt going to zero. If the object is non-GC and Py_TRACE_REFS is off, can make tp_call_dealloc actually be the tp_dealloc pointer. If the type has the GC flag, point tp_call_dealloc to a _Py_Dealloc version that checks tp_is_gc and does the trashcan stuff. Unfortunately, all types don't have PyType_Ready() called on them. So, we cannot rely on tp_call_dealloc being set correctly. ---------- Added file: https://bugs.python.org/file50219/pyperf-trashcan.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 17:02:32 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Sun, 15 Aug 2021 21:02:32 +0000 Subject: [issue44897] Integrate trashcan mechanism into _Py_Dealloc In-Reply-To: <1628748753.21.0.569730676893.issue44897@roundup.psfhosted.org> Message-ID: <1629061352.61.0.182033540798.issue44897@roundup.psfhosted.org> Change by Neil Schemenauer : Added file: https://bugs.python.org/file50220/perf-annotate-trash.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 17:03:06 2021 From: report at bugs.python.org (Mark Roseman) Date: Sun, 15 Aug 2021 21:03:06 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629061386.93.0.198446761621.issue42560@roundup.psfhosted.org> Mark Roseman added the comment: Here's a very rough work-in-progress snapshot: https://github.com/roseman/cpython/blob/tkinter-docs-snapshot-20210815/Doc/library/tkinter.rst This includes: 1. Changes I'd mentioned to the intro, external resources, modules, architecture 2. Rewrite of the 'life preserver' mini-tutorial section using a very different approach. 3. A start on the reference section (replacing the random bits that were there with a categorized, but detail-free list of classes and common methods). Anyone have any big picture thoughts at this point? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 18:19:35 2021 From: report at bugs.python.org (Oleg Baskakov) Date: Sun, 15 Aug 2021 22:19:35 +0000 Subject: [issue44922] isinstance breaks on imported dataclasses Message-ID: <1629065975.65.0.328459121322.issue44922@roundup.psfhosted.org> New submission from Oleg Baskakov : Hey I was trying to import dataclasses from another file and somehow isinstance doesn't work anymore: main.py: ``` import codegen from dataclasses import dataclass @dataclass class AtomX: my_symbol: str quantity: str = "" codegen.inheritance_map(AtomX("qwerty")) ``` codegen.py: ``` from main import AtomX def inheritance_map(candidate): assert isinstance(candidate, AtomX) ``` PS the same code with `assert candidate.__class__.__name__ == "AtomX"` works fine ---- Python 3.9.6 (v3.9.6:db3ff76da1, Jun 28 2021, 11:49:53) [Clang 6.0 (clang-600.0.57)] on darwin I'm running inside of PyCharm ---------- messages: 399628 nosy: baskakov priority: normal severity: normal status: open title: isinstance breaks on imported dataclasses type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 18:46:41 2021 From: report at bugs.python.org (Danya Sucharik) Date: Sun, 15 Aug 2021 22:46:41 +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: <1629067601.11.0.726447013249.issue31256@roundup.psfhosted.org> Danya Sucharik added the comment: May I aks, how it to add a doctype now? ---------- nosy: +sucharik versions: +Python 3.8 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 19:20:32 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 15 Aug 2021 23:20:32 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629069632.99.0.628802706751.issue42560@roundup.psfhosted.org> Terry J. Reedy added the comment: > Anyone have any big picture thoughts at this point? Yes. For years, I have wanted major changes in out tkinter docs, but making them myself has never become a top priority for me over working directly on IDLE. The latter has been hampered by the inadequate tkinter docs. Fortunately, I have learned to interpret the online tk docs. But I would be happy work with you, Mark, to make something better. My perspective is that of an competent but occasionally user who cannot keep all of tkinter in my head and needs a good reference that does not currently exist. (I am currently working on two other writing projects, but one should be done in a few days. So I should look at your proposals within a week. I already reviewed and critiqued Mason's PR.) I would like a complete, in some some sense, internal reference, which would would be able to correct ad further improve. Complete means everything in the Shipman 8.5 references, but somewhat rearranged and more compact. Current references both external and internal, are variously obsolete, incomplete, and buggy. The latter two apply to our internal ttk doc. All external references suffer from being out of pydev control. I don't see the tcl/tk versions as an issue. First, the 3.x *tkinter* docs should document the features available in the 3.x version of the tkinter module. It could mention that it should best be used with the most recent tcl/tk 8.6 possible. Second, the Centos is about the only *nix distribution not having 8.6 available. On another thread where the question of using something new in 8.6 came up, someone posted a link to a site with distribution versus tcl/tk information. Unfortunately, I cannot find it. The 8.6.z releases mostly add bugfixes. The new-in-8.6 features listed on https://www.tcl.tk/software/tcltk/8.6.html should be in all or most all of 8.6.z releases. My 'biggest' idea is that we should document tk and ttk widgets together. I don't think we should continue to treat ttk as just an optional, and by implication, 'advanced' add-on. Each entry should be labelled tk, tk&ttk, or ttk. Or perhaps there should be 3 subsections so labelled. The ttk doc only has widget entries for ttk (only). Perhaps the authors felt that full entries for 'tk&ttk' widgets would be mostly redundant with docs for the tk versions. I agree, and propose entries that cover both. We should expand on what the ttk doc does in separately documenting options common to more than one widget. I would like to add 1) a table (matrix) of common option versus widget, with marks indicating which option can be used with which widget, and 2) links from each widget doc to the blocks of common widgets it uses. The initial chapters of Shipman are mostly about possible values for some of the options. These belong together in the 'Options' subsection. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 20:55:26 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 16 Aug 2021 00:55:26 +0000 Subject: [issue44922] isinstance breaks on imported dataclasses In-Reply-To: <1629065975.65.0.328459121322.issue44922@roundup.psfhosted.org> Message-ID: <1629075326.48.0.37980744066.issue44922@roundup.psfhosted.org> Eric V. Smith added the comment: I get a circular import error: Traceback (most recent call last): File "main.py", line 1, in import codegen File "/cygdrive/c/home/eric/codegen.py", line 1, in from main import AtomX File "/cygdrive/c/home/eric/main.py", line 9, in codegen.inheritance_map(AtomX("qwerty")) AttributeError: partially initialized module 'codegen' has no attribute 'inheritance_map' (most likely due to a circular import) So I can't reproduce this problem. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 21:36:09 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 16 Aug 2021 01:36:09 +0000 Subject: [issue44921] dict subclassing is slow In-Reply-To: <1629058226.73.0.105626301201.issue44921@roundup.psfhosted.org> Message-ID: <1629077769.74.0.467759675239.issue44921@roundup.psfhosted.org> Jack DeVries added the comment: There was a thorough discussion about the concerns associated with supporting dict subclasses in general here: bpo-32615 If I understand correctly, allowing dict subclasses to inherit __contains__ and __getitem__ will be a step towards supporting dict subclasses in a more broad context, like being able to use them as namespaces passed to exec. Ultimately, dictionaries are at the very heart of Cpython's implementation. I think it is reasonable to say that it is not possible or reasonable to support users in creating custom dict implantation with their own behavior. There is no good real world use case for it (please tell me if anyone has one), and it opens the door to enormous unnecessary complexity. Also related to dict subclassing: bpo-15099 bpo-27561 Marco, I hope that the discussions I've linked will at least make it clear why cpython behaves this way, and what the concerns are especially around supporting user subclasses of dict. I noticed you tagged this bpo as performance, but there are significant negative performance implications around dict subclasses that you'll see in past discussions. With this additional context in mind, what changes do you propose? ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 15 23:58:50 2021 From: report at bugs.python.org (Roundup Robot) Date: Mon, 16 Aug 2021 03:58:50 +0000 Subject: [issue44888] ssl.OP_LEGACY_SERVER_CONNECT missing In-Reply-To: <1628681740.09.0.0670758507991.issue44888@roundup.psfhosted.org> Message-ID: <1629086330.82.0.00578270831393.issue44888@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +26248 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27776 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 01:20:26 2021 From: report at bugs.python.org (Oleg Baskakov) Date: Mon, 16 Aug 2021 05:20:26 +0000 Subject: [issue44922] isinstance breaks on imported dataclasses In-Reply-To: <1629065975.65.0.328459121322.issue44922@roundup.psfhosted.org> Message-ID: <1629091226.92.0.494235352598.issue44922@roundup.psfhosted.org> Oleg Baskakov added the comment: Sorry, I forgot to add if __name__ line: ``` import codegen from dataclasses import dataclass @dataclass class AtomX: my_symbol: str quantity: str = "" if __name__ == "__main__": codegen.inheritance_map(AtomX("qwerty")) ``` So the output: ``` Traceback (most recent call last): File "/Users/baskakov/PycharmProjects/main.py", line 11, in codegen.inheritance_map(AtomX("qwerty")) File "/Users/baskakov/PycharmProjects/codegen.py", line 5, in inheritance_map assert isinstance(candidate, AtomX) AssertionError ``` ---------- Added file: https://bugs.python.org/file50221/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 02:05:16 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 16 Aug 2021 06:05:16 +0000 Subject: [issue44922] isinstance breaks on imported dataclasses In-Reply-To: <1629065975.65.0.328459121322.issue44922@roundup.psfhosted.org> Message-ID: <1629093916.94.0.547898291519.issue44922@roundup.psfhosted.org> Eric V. Smith added the comment: You're importing main.py twice. The first is when you run "python main.py", where it has the module name '__main__'. The second time is in codegen.py, where it has the name 'main'. You create the AtomX instance as __main__.AtomX, but the isinstance check is against main.AtomX. Because the objects have different modules, they're not equal. You can see this if you change the isinstance check to: ============= from main import AtomX import sys def inheritance_map(candidate): assert isinstance(candidate, sys.modules['__main__'].AtomX) ============== Another way to see this if you add a print statement to the original codegen.py: ============== from main import AtomX def inheritance_map(candidate): print(f'{candidate=} {type(candidate)=} {AtomX=}') assert isinstance(candidate, AtomX) ============== Which will print: candidate=AtomX(my_symbol='qwerty', quantity='') type(candidate)= AtomX= Notice the types refer to different modules, so they are distinct and unequal. The easiest way around this is to not do any work in main.py, but instead create another module, import it from main.py, and do the work there. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 04:04:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 08:04:15 +0000 Subject: [issue44896] AttributeError in ast.unparse In-Reply-To: <1628731580.95.0.847749574283.issue44896@roundup.psfhosted.org> Message-ID: <1629101055.15.0.274908907053.issue44896@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 04:21:41 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Aug 2021 08:21:41 +0000 Subject: [issue44911] Leaked tasks cause IsolatedAsyncioTestCase to throw an exception In-Reply-To: <1628901403.12.0.195708767229.issue44911@roundup.psfhosted.org> Message-ID: <1629102101.87.0.208581821946.issue44911@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26249 pull_request: https://github.com/python/cpython/pull/27777 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 04:21:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 08:21:39 +0000 Subject: [issue44911] Leaked tasks cause IsolatedAsyncioTestCase to throw an exception In-Reply-To: <1628901403.12.0.195708767229.issue44911@roundup.psfhosted.org> Message-ID: <1629102099.4.0.72030816848.issue44911@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2cb1a6806c0cefab0c3a40fdd428a89a4392570e by Bar Harel in branch 'main': bpo-44911: Fixed IsolatedAsyncioTestCase from throwing an exception on leaked tasks (GH-27765) https://github.com/python/cpython/commit/2cb1a6806c0cefab0c3a40fdd428a89a4392570e ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 04:36:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 08:36:57 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629103017.05.0.516367256673.issue44895@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 62bc716fde20fcb7b47416c7959be9e66df93212 by Irit Katriel in branch 'main': bpo-44895: skip test_no_hang_on_context_chain_cycle2 until the refleak is fixed (GH-27761) https://github.com/python/cpython/commit/62bc716fde20fcb7b47416c7959be9e66df93212 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 04:36:56 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Aug 2021 08:36:56 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629103016.81.0.614897634931.issue44895@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26250 pull_request: https://github.com/python/cpython/pull/27778 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 04:47:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 08:47:10 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629103630.95.0.933918837889.issue44830@roundup.psfhosted.org> ?ukasz Langa added the comment: I merged the 3.10 backport but leaving the bug open since only removing the 404 link isn't really fixing the problem. Linking to the Wayback Machine feels off to me. I would rather support making a similar document in our own docs, using the removed document as inspiration. If Jack wants to pick this up, I'd merge it. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 04:48:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 08:48:18 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629103698.91.0.665304208255.issue44830@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b6a6d99a0ba3796a9d7d4fe8612b640f90e6d7f9 by Senthil Kumaran in branch '3.10': [3.10] bpo-44830 - Remove the broken Broken Mozilla devguide link. (GH-27664) (GH-27666) https://github.com/python/cpython/commit/b6a6d99a0ba3796a9d7d4fe8612b640f90e6d7f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 05:01:18 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Aug 2021 09:01:18 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629104478.06.0.641103670325.issue44895@roundup.psfhosted.org> miss-islington added the comment: New changeset 1960409a6dcbd1e3527f02b523bd27df9086dd77 by Miss Islington (bot) in branch '3.10': bpo-44895: skip test_no_hang_on_context_chain_cycle2 until the refleak is fixed (GH-27761) https://github.com/python/cpython/commit/1960409a6dcbd1e3527f02b523bd27df9086dd77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 05:52:33 2021 From: report at bugs.python.org (Troulet-lambert Odile) Date: Mon, 16 Aug 2021 09:52:33 +0000 Subject: [issue44923] Unittest incorrect result with argparse.ArgumentError in self asserRaises context Message-ID: <1629107553.76.0.661365207866.issue44923@roundup.psfhosted.org> New submission from Troulet-lambert Odile : When passed an Argparse.ArgumentError in the self.assertRaises context uniittest does not recognize the exception and raises an exception. As a consequence the test fails whereas it should pass ---------- components: Tests files: bug_unittest_exception.py messages: 399640 nosy: piscvau priority: normal severity: normal status: open title: Unittest incorrect result with argparse.ArgumentError in self asserRaises context type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50222/bug_unittest_exception.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 05:55:16 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Aug 2021 09:55:16 +0000 Subject: [issue44911] Leaked tasks cause IsolatedAsyncioTestCase to throw an exception In-Reply-To: <1628901403.12.0.195708767229.issue44911@roundup.psfhosted.org> Message-ID: <1629107716.88.0.0508687147038.issue44911@roundup.psfhosted.org> miss-islington added the comment: New changeset 8516ca500eb45ecf997a471f003df02a9eb767ce by Miss Islington (bot) in branch '3.10': bpo-44911: Fixed IsolatedAsyncioTestCase from throwing an exception on leaked tasks (GH-27765) https://github.com/python/cpython/commit/8516ca500eb45ecf997a471f003df02a9eb767ce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 06:11:14 2021 From: report at bugs.python.org (Mikael Koli) Date: Mon, 16 Aug 2021 10:11:14 +0000 Subject: [issue44924] logging.handlers.QueueHandler does not maintain the exc_text Message-ID: <1629108674.13.0.869133594401.issue44924@roundup.psfhosted.org> New submission from Mikael Koli : The reason why logging.handlers.QueueHandler does not maintain exc_text is obvious: def prepare(self, record): ... record = copy.copy(record) record.message = msg record.msg = msg record.args = None record.exc_info = None record.exc_text = None return record The record.exc_text is set to None. The reason for this is to prevent the exception text showing up multiple times to the message. See https://bugs.python.org/issue34334. However, there are a couple of situations this may cause a problem. First, it's not currently possible to format the exception of the record in a handler on the other side of the queue. Second, it's not possible to let the handler on the other side of the queue utilize exc_text. The default handlers do not behave in such a way but one could prefer to create their own handler that does so, such as log the records to a database with a column for the exception text. Possible solution: Don't override the record.msg and don't set the record.exc_text to None. I think it could be done simply: def prepare(self, record): ... record = copy.copy(record) record.message = msg # record.msg = msg record.args = None record.exc_info = None # record.exc_text = None return record This way one can format the record later again without multiple exception text showing up in the message. Doing so will fail the test 'test_logging.QueueHandlerTest.test_formatting' as this tests the record.msg is the same as record.message. This may cause issues if someone relies on record.msg. On the other hand, now other formatters and handlers down the line could use the exc_text attribute. I'm not sure if this is too breaking change or not. The failing test: def test_formatting(self): msg = self.next_message() levelname = logging.getLevelName(logging.WARNING) log_format_str = '{name} -> {levelname}: {message}' formatted_msg = log_format_str.format(name=self.name, levelname=levelname, message=msg) formatter = logging.Formatter(self.log_format) self.que_hdlr.setFormatter(formatter) self.que_logger.warning(msg) log_record = self.queue.get_nowait() self.assertEqual(formatted_msg, log_record.msg) # self.assertEqual(formatted_msg, log_record.message) I tested this issue with the following test (which is a pass with the current build): class QueueHandlerTest(BaseTest): def test_formatting_exc_text(self): formatter = logging.Formatter(self.log_format) self.que_hdlr.setFormatter(formatter) try: raise RuntimeError('deliberate mistake') except: self.que_logger.exception('failed', stack_info=True) log_record = self.queue.get_nowait() self.assertTrue(log_record.exc_text.startswith('Traceback (most recent ' 'call last):\n')) ---------- components: Library (Lib) messages: 399642 nosy: Miksus priority: normal severity: normal status: open title: logging.handlers.QueueHandler does not maintain the exc_text type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 06:19:15 2021 From: report at bugs.python.org (Mikael Koli) Date: Mon, 16 Aug 2021 10:19:15 +0000 Subject: [issue44924] logging.handlers.QueueHandler does not maintain the exc_text In-Reply-To: <1629108674.13.0.869133594401.issue44924@roundup.psfhosted.org> Message-ID: <1629109155.43.0.24322130868.issue44924@roundup.psfhosted.org> Mikael Koli added the comment: And the reason why overriding attribute 'record.msg' with the formatted message is problematic is that the method 'record.getMessage' (which is used by Formatter) fetches the log message from the variable 'record.msg'. Therefore the exc_text needs to be set to None as Formatter checks the existence of this attribute to decide whether or not to format the exception. Otherwise the exception text may be formatted multiple of time. I think it may be more correct solution to not override the record.msg and let the other formatters down the queue reformat the message if required. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 06:32:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 16 Aug 2021 10:32:44 +0000 Subject: [issue44923] Unittest incorrect result with argparse.ArgumentError in self asserRaises context In-Reply-To: <1629107553.76.0.661365207866.issue44923@roundup.psfhosted.org> Message-ID: <1629109964.57.0.0560488111146.issue44923@roundup.psfhosted.org> Irit Katriel added the comment: What is the output of the failed test? ---------- nosy: +iritkatriel versions: +Python 3.6 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 06:40:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 10:40:05 +0000 Subject: [issue44911] Leaked tasks cause IsolatedAsyncioTestCase to throw an exception In-Reply-To: <1628901403.12.0.195708767229.issue44911@roundup.psfhosted.org> Message-ID: <1629110405.02.0.194736390288.issue44911@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Bar! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 06:40:03 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 16 Aug 2021 10:40:03 +0000 Subject: [issue44923] Unittest incorrect result with argparse.ArgumentError in self asserRaises context In-Reply-To: <1629107553.76.0.661365207866.issue44923@roundup.psfhosted.org> Message-ID: <1629110403.65.0.969609346933.issue44923@roundup.psfhosted.org> Serhiy Storchaka added the comment: You raise ArgumentTypeError, but expect ArgumentError. ArgumentTypeError is not a subclass of ArgumentError. ---------- nosy: +serhiy.storchaka versions: +Python 3.8 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 06:47:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 16 Aug 2021 10:47:28 +0000 Subject: [issue44920] Support UUIDv6, UUIDv7, and UUIDv8 from the new version of RFC4122 In-Reply-To: <1629048365.97.0.101119142277.issue44920@roundup.psfhosted.org> Message-ID: <1629110848.53.0.957589583597.issue44920@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a new feature, and we usually do not backport new features to old Python versions, so it can only be included in Python 3.11 (backports can be provided by third-party libraries). Do you want to create a PR? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 06:53:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 16 Aug 2021 10:53:24 +0000 Subject: [issue44915] Python keywords as string keys in TypedDict In-Reply-To: <1628965698.89.0.982806951929.issue44915@roundup.psfhosted.org> Message-ID: <1629111204.9.0.835855714317.issue44915@roundup.psfhosted.org> Serhiy Storchaka added the comment: You can use the functional form of TypedDict: C = TypedDict("C", {"to": int, "from": int}) ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 07:02:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 16 Aug 2021 11:02:20 +0000 Subject: [issue44240] Incorrect behavior of LOAD_ATTR due to overflow in tp_version In-Reply-To: <1622044998.68.0.9376140973.issue44240@roundup.psfhosted.org> Message-ID: <1629111740.68.0.487986447117.issue44240@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> tp_version_tag is not unique when test runs with -R : _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 07:07:55 2021 From: report at bugs.python.org (Alex Waygood) Date: Mon, 16 Aug 2021 11:07:55 +0000 Subject: [issue44905] Abstract instance and class attributes for abstract base classes In-Reply-To: <1628812109.02.0.042736265222.issue44905@roundup.psfhosted.org> Message-ID: <1629112075.09.0.70555906923.issue44905@roundup.psfhosted.org> Alex Waygood added the comment: Tomasz -- as discussed in the original BPO issue for `abstractmethod` implementations (https://bugs.python.org/issue1706989), this works as a workaround: ``` >>> from abc import ABCMeta >>> class AbstractAttribute: ... __isabstractmethod__ = True ... >>> class Foo(metaclass=ABCMeta): ... abstract_attribute_to_be_overriden = AbstractAttribute() ... >>> class Bar(Foo): pass ... >>> b = Bar() Traceback (most recent call last): File "", line 1, in TypeError: Can't instantiate abstract class Bar with abstract method abstract_attribute_to_be_overriden ``` It would be nice to have something like this in the `abc` module, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 07:10:34 2021 From: report at bugs.python.org (Alex Waygood) Date: Mon, 16 Aug 2021 11:10:34 +0000 Subject: [issue44905] Abstract instance and class attributes for abstract base classes In-Reply-To: <1628812109.02.0.042736265222.issue44905@roundup.psfhosted.org> Message-ID: <1629112234.64.0.494450844915.issue44905@roundup.psfhosted.org> Alex Waygood added the comment: ^And, that only works for class attributes, not instance attributes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 07:21:54 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 16 Aug 2021 11:21:54 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629112914.31.0.609765946195.issue44914@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 1a511dc92dd10ee8fc2e5da9f52f795924bdc89a by Mark Shannon in branch 'main': bpo-44914: Maintain invariants of type version tags. (GH-27773) https://github.com/python/cpython/commit/1a511dc92dd10ee8fc2e5da9f52f795924bdc89a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 07:23:16 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 16 Aug 2021 11:23:16 +0000 Subject: [issue44900] Implement superinstructions In-Reply-To: <1628768681.09.0.627092423081.issue44900@roundup.psfhosted.org> Message-ID: <1629112996.96.0.493113975196.issue44900@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 4f51fa9e2d3ea9316e674fb9a9f3e3112e83661c by Mark Shannon in branch 'main': bpo-44900: Add five superinstructions. (GH-27741) https://github.com/python/cpython/commit/4f51fa9e2d3ea9316e674fb9a9f3e3112e83661c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 07:24:00 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 16 Aug 2021 11:24:00 +0000 Subject: [issue44900] Implement superinstructions In-Reply-To: <1628768681.09.0.627092423081.issue44900@roundup.psfhosted.org> Message-ID: <1629113040.6.0.479927051845.issue44900@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 07:39:37 2021 From: report at bugs.python.org (Jacob Nilsson) Date: Mon, 16 Aug 2021 11:39:37 +0000 Subject: [issue44905] Abstract instance and class attributes for abstract base classes In-Reply-To: <1628812109.02.0.042736265222.issue44905@roundup.psfhosted.org> Message-ID: <1629113977.47.0.220459749091.issue44905@roundup.psfhosted.org> Jacob Nilsson added the comment: Could one possible downside of this suggestion be, if implemented like in https://newbedev.com/python-abstract-class-shall-force-derived-classes-to-initialize-variable-in-init, a slowdown in code creating a lot of instances of a class with metaclass ABCMeta? I have personally never experienced that the current behavior is an issue, I've only occasionally got confused by the error messages until I read the traceback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 07:51:11 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Blondon?=) Date: Mon, 16 Aug 2021 11:51:11 +0000 Subject: [issue15373] copy.copy() does not properly copy os.environment In-Reply-To: <1342454937.95.0.386630033182.issue15373@psf.upfronthosting.co.za> Message-ID: <1629114671.02.0.402850918261.issue15373@roundup.psfhosted.org> St?phane Blondon added the comment: I think an asdict() method is not necessary. Instanciating a dict from os.environ is enough: >>> import os >>> os.environ environ({'SHELL': '/bin/bash', ...}) >>> dict(os.environ) {'SHELL': '/bin/bash', ...}) With 'dict()', it's obvious there is no side effect. I think os._Environ should not be pickable too because there is an ambiguity too when it will be unpicked: should we set the unpickled data to a basic dict (or another _Environ instance) or to the environment variables? It seems there are more maintainers in favour of the removal. Removing the copy is a breaking change so it should be done on several releases. Are you interested by a PR which adds DeprecationWarning when copy.copy(os.environ) or os.environ.copy() are called? It seems to be the first step to implement. ---------- nosy: +sblondon versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 08:33:17 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 16 Aug 2021 12:33:17 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629117197.17.0.870313212356.issue44914@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +26251 pull_request: https://github.com/python/cpython/pull/27774 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 09:22:03 2021 From: report at bugs.python.org (Jesse Rittner) Date: Mon, 16 Aug 2021 13:22:03 +0000 Subject: [issue44925] Confusing deprecation notice for typing.IO Message-ID: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> New submission from Jesse Rittner : The docs for typing.IO, typing.TextIO, and typing.BinaryIO include a confusing deprecation notice. https://docs.python.org/3/library/typing.html#typing.IO > Deprecated since version 3.8, will be removed in version 3.12: These types are also in the typing.io namespace, which was never supported by type checkers and will be removed. As per the discussion on https://github.com/python/typing/issues/834, this deprecation notice only refers to the typing.io package, which is confusing. It would be helpful to rephrase it for clarity. ---------- components: Library (Lib) messages: 399655 nosy: rittneje priority: normal severity: normal status: open title: Confusing deprecation notice for typing.IO type: enhancement versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 10:38:06 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 16 Aug 2021 14:38:06 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1629103630.95.0.933918837889.issue44830@roundup.psfhosted.org> Message-ID: Jack DeVries added the comment: I agree that linking to the wayback machine is clunky. I just sent a message out to the python-ideas mailing list to solicit more suggestions. The discourse thread didn't get much response. I guess that at some point, if there is no consensus, it wouldn't be a bad idea to ask the python-dev mailing list. I would think that core devs would be the most opinionated when it comes to how people should write bug reports! I don't want to ping that mailing list unnecessarily, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 10:43:53 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 16 Aug 2021 14:43:53 +0000 Subject: [issue35203] Windows Installer Ignores Launcher Installer Options Where The Python Launcher Is Already Present In-Reply-To: <1541791657.21.0.788709270274.issue35203@psf.upfronthosting.co.za> Message-ID: <1629125033.35.0.402743483883.issue35203@roundup.psfhosted.org> Steve Dower added the comment: Timothy - are you able to share your install logs? Look for all log files starting with "Python" in your %TEMP% directory. We definitely do not (and without an installer rewrite, cannot) support simultaneous per-user and per-machine installs of the same version. If you're just looking for the latest version for your own use, you may prefer to get it from the Windows Store instead. That one is per-user, won't interfere with other installs, and will give you global "python/python3/pip/pip3/etc." commands. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 11:26:32 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 16 Aug 2021 15:26:32 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1629127592.86.0.351366459377.issue44925@roundup.psfhosted.org> Change by Ken Jin : ---------- assignee: -> docs at python components: +Documentation -Library (Lib) keywords: +easy, newcomer friendly nosy: +docs at python, gvanrossum, kj, srittau title: Confusing deprecation notice for typing.IO -> [docs] Confusing deprecation notice for typing.IO versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 11:34:11 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 16 Aug 2021 15:34:11 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1629128051.71.0.498199812295.issue44925@roundup.psfhosted.org> Ken Jin added the comment: @rittneje, would you like to submit a PR for this? We can help if you'd like to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 11:59:26 2021 From: report at bugs.python.org (Antony Lee) Date: Mon, 16 Aug 2021 15:59:26 +0000 Subject: [issue44850] Could operator.methodcaller be optimized using LOAD_METHOD? In-Reply-To: <1628246534.03.0.387871214532.issue44850@roundup.psfhosted.org> Message-ID: <1629129566.01.0.944782873779.issue44850@roundup.psfhosted.org> Change by Antony Lee : ---------- keywords: +patch pull_requests: +26252 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27782 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 12:35:41 2021 From: report at bugs.python.org (Brett Cannon) Date: Mon, 16 Aug 2021 16:35:41 +0000 Subject: [issue44916] Random behaviour when importing two modules with the same name but different source files In-Reply-To: <1628972550.44.0.0656223373352.issue44916@roundup.psfhosted.org> Message-ID: <1629131741.18.0.710306407231.issue44916@roundup.psfhosted.org> Brett Cannon added the comment: So first, don't import from threads. It's non-deterministic as you have seen. You should do all imports **before** you start running multi-threaded code if multiple threads are going to access the Second, tossing in pickle is just asking for more trouble. ? The key thing to know is the master copy of a module is kept in `sys.modules`. But classes keep a reference to the module they were loaded from, not what `sys.modules` happens to have at that moment. So due to threading indeterminism it's quite possible to end up unpickling in such a way that the module that eventually ends up in `sys.modules` is not what your unpickled class is referencing. As such, I'm closing as "wont fix". ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 13:06:33 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 16 Aug 2021 17:06:33 +0000 Subject: [issue44924] logging.handlers.QueueHandler does not maintain the exc_text In-Reply-To: <1629108674.13.0.869133594401.issue44924@roundup.psfhosted.org> Message-ID: <1629133593.26.0.770654179532.issue44924@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +vinay.sajip, zach.ware versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 13:14:25 2021 From: report at bugs.python.org (Carol Willing) Date: Mon, 16 Aug 2021 17:14:25 +0000 Subject: [issue44921] dict subclassing is slow In-Reply-To: <1629058226.73.0.105626301201.issue44921@roundup.psfhosted.org> Message-ID: <1629134065.54.0.651300058059.issue44921@roundup.psfhosted.org> Change by Carol Willing : ---------- nosy: +willingc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 13:15:16 2021 From: report at bugs.python.org (Maximilian Hils) Date: Mon, 16 Aug 2021 17:15:16 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references Message-ID: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> New submission from Maximilian Hils : Someone reported this rather interesting issue where typing.get_type_hints crashes on type aliases with forward references. The original report is at https://github.com/mitmproxy/pdoc/issues/290. Here's an extended minimal example: foo.py: ``` import typing FooList1: typing.TypeAlias = list["Foo"] FooList2: typing.TypeAlias = typing.List["Foo"] class Foo: pass ``` bar.py: ``` import typing import foo def func1(x: foo.FooList1): pass def func2(x: foo.FooList2): pass print(typing.get_type_hints(func1)) # {'x': list['Foo']} print(typing.get_type_hints(func2)) # NameError: name 'Foo' is not defined. ``` Observations: 1. func1 doesn't crash, but also doesn't resolve the forward reference. I am not sure if this expected behavior. If it isn't, this should eventually run in the same problem as func2. 2. func2 crashes because "Foo" is evaluated in the context of bar.py (where class Foo is unknown) and not in the context of foo.py. ForwardRef._evaluate would somehow need to know in which context it was defined. #41249 (TypedDict inheritance doesn't work with get_type_hints) introduced ForwardRef.__forward_module__, which would be a logical place for that information. I'm not sure if it is a good idea to use __forward_module__ more widely. 3. This may end up as quite a bit of complexity for an edge case, I'm fine if it is considered wontfix. The reason I'm bringing it up is that PEP 613 (Explicit Type Aliases) decidedly allows forward references in type aliases. For the record, PEP 563 (postponed evaluations) does not change the outcome here. However, postponed evaluations often make it possible to avoid the forward references by declaring the aliases last. ---------- components: Library (Lib) messages: 399660 nosy: mhils priority: normal severity: normal status: open title: typing.get_type_hints() raises for type aliases with forward references type: crash versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 13:28:42 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 16 Aug 2021 17:28:42 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629134922.58.0.760734403547.issue44830@roundup.psfhosted.org> Jack DeVries added the comment: > If Jack wants to pick this up, I'd merge it. I might be interested but I'm not sure if I will have the time. I'm not "calling dibs" if anyone else wants to go ahead with this solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 13:45:54 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 16 Aug 2021 17:45:54 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629135954.97.0.748767519097.issue44926@roundup.psfhosted.org> Ken Jin added the comment: > 1. func1 doesn't crash, but also doesn't resolve the forward reference. I am not sure if this expected behavior. Good observation! That's indeed the current behavior. The reason is a little subtle - list[...] is using a special builtin type (https://docs.python.org/3/library/stdtypes.html#types-genericalias), while typing.List is the one from typing. The typing version wraps all strings in ForwardRef(), while the builtin version shouldn't import from typing, so it doesn't have that luxury. get_type_hints could probably support the builtin version, though I'd imagine we'd need some rework. Re: 2. You're right there too. Storing the defined module in __forward_module__ is an interesting proposal. For your specific use case (where the user is using Python 3.6), you could pass in globalns and localns to get_type_hints as a temporary workaround. Off the top of my head: get_type_hints(func2, globalns=foo.__dict__) might work. Would that work for your library? ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 14:01:00 2021 From: report at bugs.python.org (AR) Date: Mon, 16 Aug 2021 18:01:00 +0000 Subject: [issue44927] [sqlite3] insert Message-ID: <1629136860.31.0.191643980598.issue44927@roundup.psfhosted.org> New submission from AR : I propose to add an insert method to a SQLite cursor object, believe this could greatly improve readability of python code when you have to do a lot of insert operations to a different tables. Currently we have to create a dictionary with SQL's for each table: insert_sql = {'form_a': """INSERT INTO table_a (field_a1, field_a2) VALUES(:f1, :f2)""", 'form_b': """INSERT INTO table_b (field_b1, field_b2, field_b3) VALUES(:f1, :f2, :f3), ....other SQL statements }""" or we may use version with unnamed parameters: insert_sql = {'form_a': """INSERT INTO table_a (field_a1, field_a2) VALUES(?, ?)""", 'form_b': """INSERT INTO table_b (field_b1, field_b2, field_b3) VALUES(?, ?, ?), ....other SQL statements }""" The first one is conveniently compatible with cx_Oracle bind variable syntax, rows that are inserted are essentially dictionary. As dictionary is a mutable type, some extra freedom during construction of the row is allowed. The second syntax(qmark style) is specific to SQLite, rows that are inserted should have tuple type (namedtuple for us to be able to extract field names at later stage). entries_dict = [{'field_a1': 100, 'field_a2': 'sample1'}, {'field_a1': 500, 'field_a2': 'sample2'}] DataRow = namedtuple('DataRow', ['field_a1', 'field_a2']) entries_namedtuple = [DataRow(101, 'sample3'), DataRow(505, 'sample4')] In order to do an insert, you have to use either execute, or executemany: cursor.executemany(insert_sql['form_a'], entries_dict) or cursor.execute(insert_sql['form_a'], entries_dict[0]) Now let's move towards future insert method of cursor. As a first step, lets create SQL statement on the fly: table_name = 'table_a' #in case of a list of dictionaries: sql = """INSERT INTO {} ({}) VALUES({})""".format(table_name, ', '.join([str(key) for key in entries_dict[0]]), ', '.join([':' + str(key) for key in entries_dict[0]])) #currently, to do an insert operation, we have to: cursor.executemany(sql, entries_dict) #in case of a list of namedtuples: sql = """INSERT INTO {} ({}) VALUES({})""".format(table_name, ', '.join([str(field) for field in entries_namedtuple[0]._fields]), ', '.join(['?' for field in entries_namedtuple[0]._fields])) #currently, to do an insert operation, we have to: cursor.executemany(sql, entries_namedtuple) Now back to the proposal of insert method with unified syntax (one/many and dict/namedtuple). Let's do a second step and add an Insert method to a Cursor. The idea is to provide this method with table name, extract column names from supplied dict/namedtuple and use SQL generators from above. Than we could replace old cursor.executemany syntax with: cursor.insert(table_name, entries_dict) or cursor.insert(table_name, entries_dict[0]) or cursor.insert(table_name, entries_tuple) Since we may insert all, or any row of two types, this looks even more pythonic than pymongo(MongoDB) approach: collection.insert_many(entries_dict) Actually, the fact that pymongo insert code is so much cleaner and concise drew my attention. Other aspects of that lib are totally different story. I do not propose to generalize, or to move towards ORM or pymongo way of doing things. The scope is limited - lets do a convenient insert. Simplified implementation could be like this: def insert(self, table_name, entries): if(type(entries) == list): # several records(rows) need to be inserted do_insert = self.executemany if(hasattr(entries[0], '_fields')): #NamedTuple sql = "INSERT INTO {} ({}) VALUES({})".format(table_name, ', '.join([str(field) for field in entries[0]._fields]), ', '.join(['?' for field in entries[0]._fields])) elif(type(entries[0] == dict)): #dict sql = "INSERT INTO {} ({}) VALUES({})".format(table_name, ', '.join([str(key) for key in entries[0]]), ', '.join([':' + str(key) for key in entries[0]])) else: #just one record(row) do_insert = self.execute if(hasattr(entries, '_fields')): #NamedTuple sql = "INSERT INTO {} ({}) VALUES({})".format(table_name, ', '.join([str(field) for field in entries._fields]), ', '.join(['?' for field in entries._fields])) elif(type(entries == dict)): sql = "INSERT INTO {} ({}) VALUES({})".format(table_name, ', '.join([str(key) for key in entries]), ', '.join([':' + str(key) for key in entries])) do_insert(sql, entries) If proposal is not feasible/doesn?t fit to a broad concept, I suggest to mention in documentation - list comprehension one-line SQL-generators (see above) - remind users who create list of dictionaries for bulk insert that a copy of the dict should be used. Otherwise all dicts inside a list would be the same entries_dict.append(entry_dict.copy()). Definitely, as namedtuple is immutable, no need for extra steps for a list of namedtuples. ---------- components: Extension Modules messages: 399663 nosy: AR priority: normal severity: normal status: open title: [sqlite3] insert type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 14:06:27 2021 From: report at bugs.python.org (Maximilian Hils) Date: Mon, 16 Aug 2021 18:06:27 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629137187.01.0.70272924859.issue44926@roundup.psfhosted.org> Maximilian Hils added the comment: > For your specific use case (where the user is using Python 3.6), you could pass in globalns and localns to get_type_hints as a temporary workaround. Off the top of my head: get_type_hints(func2, globalns=foo.__dict__) might work. Would that work for your library? I guess the hard part is knowing that the type annotation comes from `foo`. In the example here we can of course hardcode it, but that doesn't work in the general case or for pdoc, the documentation generator I'm working on (https://pdoc.dev). I have experimented quite a bit with walking the AST to figure out where type aliases are imported from to then re-executing ForwardRefs with that globalns. Long story short, trying to reverse-engineer __forward_module__ quickly becomes a tangled hot mess where you need to adjust for import aliases, reimports, and so on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 14:13:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 18:13:54 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629137634.8.0.505585820296.issue44852@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a0a6d39295a30434b088f4b66439bf5ea21a3e4e by ?ukasz Langa in branch 'main': bpo-44852: Support ignoring specific DeprecationWarnings wholesale in regrtest (GH-27634) https://github.com/python/cpython/commit/a0a6d39295a30434b088f4b66439bf5ea21a3e4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 14:15:32 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 16 Aug 2021 18:15:32 +0000 Subject: [issue44927] [sqlite3] insert In-Reply-To: <1629136860.31.0.191643980598.issue44927@roundup.psfhosted.org> Message-ID: <1629137732.43.0.172326304431.issue44927@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 14:17:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 18:17:28 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629137848.17.0.455862665616.issue44852@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26253 pull_request: https://github.com/python/cpython/pull/27784 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 14:24:09 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 16 Aug 2021 18:24:09 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629138249.84.0.730382254148.issue44698@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks, Pablo! > could you add me as a reviewer for the backport Will do! I'll waiting on review for the PR against the main branch, but hope to get the backport PR up by this coming weekend at the latest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 14:27:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 18:27:15 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629138435.44.0.0517061073729.issue44852@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26254 pull_request: https://github.com/python/cpython/pull/27785 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 14:43:11 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 16 Aug 2021 18:43:11 +0000 Subject: [issue16379] SQLite error code not exposed to python In-Reply-To: <1351764878.68.0.13361347428.issue16379@psf.upfronthosting.co.za> Message-ID: <1629139391.68.0.277081958158.issue16379@roundup.psfhosted.org> Erlend E. Aasland added the comment: >> What would it take to get this merged? > > I've rebased Aviv's PR (GH-1108) onto main and resolved the conflicts. > If I get his blessing, I'll open a PR try to land this. I asked Aviv on GH eight days ago, and I haven't heard anything yet, so I'm going forward with this. For the record, here's a link to my question on the PR: https://github.com/python/cpython/pull/1108#issuecomment-894506420 I would also like to see this feature; it makes sqlite3 development slightly more convenient :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 14:44:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 16 Aug 2021 18:44:02 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629139442.54.0.418533966108.issue44830@roundup.psfhosted.org> Terry J. Reedy added the comment: Problems with linking to archive.org Wayback machine. 1. They have limited bandwidth. 2. Production linking, as opposed to research like Jack did to find the 'missing' page, stretches the meaning of 'fair use'. Potential problems with external docs. 1. Don't directly fit our needs. 2. Cannot be edited by us. 3. Can disappear. The Mozilla doc is obviously framed in terms of problems with Firefox, which is quite a different beast from Python. In my opinion, it is too long, somehow seems repetitious, and is a bit hard to read. I find it hard to imagine that many Python beginners will read the whole thing. Some of the advice, such as "Version: select the earliest Version with what the problem can be reproduced:" is wrong for our workflow. I would like our doc to recommend that real beginners, with less than a couple of months of experience, and anyone else with doubts, post first on python-list, asking "Is this a bug, and if not, please explain. Version: select the earliest Version with what the problem can be reproduced: A doc that we might link to, perhaps as a supplement to anything we write, is https://stackoverflow.com/help/minimal-reproducible-example. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 14:48:57 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 16 Aug 2021 18:48:57 +0000 Subject: [issue16379] SQLite error code not exposed to python In-Reply-To: <1351764878.68.0.13361347428.issue16379@psf.upfronthosting.co.za> Message-ID: <1629139737.43.0.73018450231.issue16379@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26255 pull_request: https://github.com/python/cpython/pull/27786 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 15:03:48 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 16 Aug 2021 19:03:48 +0000 Subject: [issue44897] Integrate trashcan mechanism into _Py_Dealloc In-Reply-To: <1628748753.21.0.569730676893.issue44897@roundup.psfhosted.org> Message-ID: <1629140628.15.0.283035330269.issue44897@roundup.psfhosted.org> Neil Schemenauer added the comment: Based on some testing, I think an extra type slot is not worth the extra complication. I made some small improvements to _Py_Dealloc and now the performance seems a bit better. Basically, I expanded _PyObject_IS_GC() to put the most common branches first. See pypref-trashcan2.txt for benchmark. Overall I think might be a bit slower (less than 1%?) but we have gained trashcan protection for the dealloc of all GC objects. If we are okay with the performance, here are other questions to answer: A) is it safe to untrack GC objects before calling tp_dealloc? B) is it safe to have PyObject_CallFinalizerFromDealloc() track objects that are resurrected? We might have to look at 3rd party extensions to decide on those. I.e. maybe in theory it is not safe but in practice there is no extension code that would actually break. ---------- Added file: https://bugs.python.org/file50223/pyperf-trashcan2.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 15:04:54 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 16 Aug 2021 19:04:54 +0000 Subject: [issue44927] [sqlite3] insert In-Reply-To: <1629136860.31.0.191643980598.issue44927@roundup.psfhosted.org> Message-ID: <1629140694.86.0.743868679614.issue44927@roundup.psfhosted.org> Erlend E. Aasland added the comment: The INSERT statement comes in many varieties. What about INSERT OR [ABORT,FAIL,IGNORE,REPLACE,ROLLBACK], INSERT WITH RECURSIVE, INSERT INTO table SELECT, etc.? Why only add such an API for insert; why not replace() as well? I'm not convinced this is a good idea. It sounds to me like a project specific need that would need a project specific implementation. And as you showed, the implementation is pretty straight-forward. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 15:06:19 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 16 Aug 2021 19:06:19 +0000 Subject: [issue44897] Integrate trashcan mechanism into _Py_Dealloc In-Reply-To: <1628748753.21.0.569730676893.issue44897@roundup.psfhosted.org> Message-ID: <1629140779.22.0.477750032954.issue44897@roundup.psfhosted.org> Change by Neil Schemenauer : ---------- nosy: +pablogsal, tim.peters, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 15:19:05 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 16 Aug 2021 19:19:05 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629141545.28.0.633084035225.issue44914@roundup.psfhosted.org> Mark Shannon added the comment: New changeset d84d2c4985457733602d46dc4ee77290da4e9539 by Ken Jin in branch 'main': bpo-44914: Add tests for some invariants of tp_version_tag (GH-27774) https://github.com/python/cpython/commit/d84d2c4985457733602d46dc4ee77290da4e9539 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 15:21:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 16 Aug 2021 19:21:45 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629141705.44.0.908793679157.issue44926@roundup.psfhosted.org> Guido van Rossum added the comment: Is GH-27017 at all relevant here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 15:30:34 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 16 Aug 2021 19:30:34 +0000 Subject: [issue44927] [sqlite3] proposal: add sqlite3.Cursor.insert() method In-Reply-To: <1629136860.31.0.191643980598.issue44927@roundup.psfhosted.org> Message-ID: <1629142234.48.0.958896855099.issue44927@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: [sqlite3] insert -> [sqlite3] proposal: add sqlite3.Cursor.insert() method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 15:36:23 2021 From: report at bugs.python.org (AR) Date: Mon, 16 Aug 2021 19:36:23 +0000 Subject: [issue44927] [sqlite3] proposal: add sqlite3.Cursor.insert() method In-Reply-To: <1629136860.31.0.191643980598.issue44927@roundup.psfhosted.org> Message-ID: <1629142583.77.0.847825257197.issue44927@roundup.psfhosted.org> AR added the comment: There is no good solution to this. Either a move to all-in-one solution and ORM at the end, or limited scope hack that allow for a convenient "just insert". I do not insist due to this controversy I just didn't realize the difference until I've noticed that one line of my pymongo code corresponds to many lines of sqlite code. I'm perfectly fine using direct SQL statements, but would happily use a shortcut. It's up to you to decide as you see a broader picture. Thank you in any case! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 15:39:47 2021 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 16 Aug 2021 19:39:47 +0000 Subject: [issue44924] logging.handlers.QueueHandler does not maintain the exc_text In-Reply-To: <1629108674.13.0.869133594401.issue44924@roundup.psfhosted.org> Message-ID: <1629142787.22.0.983624715112.issue44924@roundup.psfhosted.org> Vinay Sajip added the comment: Why can you not subclass QueueHandler and override the prepare method to do what you want/need? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 16:12:48 2021 From: report at bugs.python.org (Maximilian Hils) Date: Mon, 16 Aug 2021 20:12:48 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629144768.74.0.189265553521.issue44926@roundup.psfhosted.org> Maximilian Hils added the comment: @Guido van Rossum: Yes, GH-27017 is the same as #41249 in the initial post. There are also some cases where we don't even have a ForwardRef though: foo.py: ``` import typing FooType: typing.TypeAlias = "Foo" class Foo: pass ``` bar.py: ``` import typing import foo def func3(x: foo.FooType): pass print(typing.get_type_hints(func3)) # NameError: name 'Foo' is not defined. ``` In this example, `FooType` is just a regular str (with unknown origin). That's a case where get_type_hints just needs to give up? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 16:13:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 16 Aug 2021 20:13:38 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629144818.75.0.162701922709.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: I've attached an even shorter script (refleak.py) that reproduces the leak. ---------- Added file: https://bugs.python.org/file50224/refleak.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 16:22:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 16 Aug 2021 20:22:21 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629145341.68.0.3146569871.issue44926@roundup.psfhosted.org> Guido van Rossum added the comment: I think it's fine for get_type_hints() to give up in some cases. It's not fine if it were to look in the wrong namespace (e.g. if the caller of get_type_hints() were to happen to have an unrelated class named "Foo" in its namespace, that should *not* be found if the type alias was defined in a different file). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 16:25:55 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 16 Aug 2021 20:25:55 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629145555.57.0.34835591134.issue42560@roundup.psfhosted.org> E. Paine added the comment: > I don't see the tcl/tk versions as an issue My main concern was when Tcl/Tk has a major new release with new kwargs. If MacOS was shipped with one version and Windows another, I suspect we would have to hold back an update to the docs. I am slightly less concerned now, because so far there are no new kwargs in the 8.7 highlights: https://www.tcl.tk/software/tcltk/8.7.html > I would like a complete, in some sense, internal reference, which we would be able to correct and further improve Despite being more relaxed about the version issue above, my other major concern is the size of such a project. I started working on some reference documentation I named ?tkinter-docs? (https://github.com/E-Paine/tkinter-docs / https://tkinter-docs.readthedocs.io/en/latest/widgets/canvas.html) but as you can see I haven?t worked on it since mid-May (I simply lost steam given the number of hours I?d have to invest to finish it). My thinking is that an open-source documentation would be much easier to maintain going forward (rather being up to a single person to keep up-to-date) without filling Serhiy?s inbox with *a lot* of inevitable docs fixes. IMO, such documentation (regardless of a community to help) would still require a large amount of dedication from a single person to be checking and merging patches. Another thing I think we would need to work out is how we respect the Tk licence?s requirement for attribution while allowing the PSF to relicense the docs as they please (I ?m assuming that any work we produce would be based heavily enough on the Tk man pages to require the attribution). With tkinter-docs, this was easy enough as I could just include the full Tk license on a somewhat out-of-the-way page. Since the PSF would (probably) want to relicense the entire docs rather than just whatever modifications we?ve made, we may need legal advice or written exemption from the TCT (is there anyone more knowledgeable on the subject that we can nosy?). > My 'biggest' idea is that we should document tk and ttk widgets together. That does sound like a very good idea, so long as we make it obvious which module to find the specific widget in. > someone posted a link to a site with distribution versus tcl/tk information https://pkgs.org/download/tk ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 16:34:10 2021 From: report at bugs.python.org (Mikael Koli) Date: Mon, 16 Aug 2021 20:34:10 +0000 Subject: [issue44924] logging.handlers.QueueHandler does not maintain the exc_text In-Reply-To: <1629108674.13.0.869133594401.issue44924@roundup.psfhosted.org> Message-ID: <1629146050.62.0.718764105656.issue44924@roundup.psfhosted.org> Mikael Koli added the comment: I did subclass the QueueHandler and it did circumvent the issue for me. But after spending some time to find out why I could not access the exc_text I thought maybe there is something that could be done to make it more intuitive and save others' time. I find the current behaviour somewhat confusing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 16:47:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 20:47:29 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629146849.41.0.736880362744.issue44852@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c7c4cbc58e18ef5a6f4f377b1ece0a84a54335a7 by ?ukasz Langa in branch '3.9': [3.9] bpo-44852: Support ignoring specific DeprecationWarnings wholesale in regrtest (GH-27634) (GH-27785) https://github.com/python/cpython/commit/c7c4cbc58e18ef5a6f4f377b1ece0a84a54335a7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 17:05:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 16 Aug 2021 21:05:37 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629147937.37.0.181140032886.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: The leak seems to be due to the nested definitions of the Exception types A and B. It goes away if I move them out of the function so that it's like: class A(Exception): pass class B(Exception): pass def test_no_hang_on_context_chain_cycle2(): try: try: raise A() except A as _a: a = _a try: raise B() except B as _b: b = _b raise b except B: pass ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 17:11:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 16 Aug 2021 21:11:56 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629148316.54.0.249638727088.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: (Pdb) test_no_hang_on_context_chain_cycle2.__code__.co_consts[1] (Pdb) sys.getrefcount(test_no_hang_on_context_chain_cycle2.__code__.co_consts[1]) 2 (Pdb) gc.get_referrers(test_no_hang_on_context_chain_cycle2.__code__.co_consts[1]) [] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 17:26:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 21:26:46 +0000 Subject: [issue40608] PY3.8 GC segfault (Py_TRASHCAN_SAFE_BEGIN/END are not backwards compatible) In-Reply-To: <1589306849.27.0.146369076662.issue40608@roundup.psfhosted.org> Message-ID: <1629149206.29.0.875348273613.issue40608@roundup.psfhosted.org> ?ukasz Langa added the comment: Agreed with Irit. GH-12607 is conflicting with `main` and in an unclear review state. Irit's got both GH-20104 which fixes the segfault and GH-27693 which deprecates the old macros. It's sad we missed the train for either GH-20104 or the original GH-12607 to get merged to 3.10 but it's a C API change so there's no discussion. There's no hurry then in deciding for 3.11 if we leave the old macros as is and just deprecate them OR we both fix them using GH-20104 and deprecate them anyway. What are your thoughts, Pablo? ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 17:29:12 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 16 Aug 2021 21:29:12 +0000 Subject: [issue44928] async generator missing unawaited coroutine warning Message-ID: <1629149352.38.0.0667554084574.issue44928@roundup.psfhosted.org> New submission from Thomas Grainger : demo program: ``` def test_async_fn(): async def async_fn(): pass async_fn() def test_async_gen_fn(): async def agen_fn(): yield agen_fn().aclose() agen_fn().asend(None) test_async_fn() test_async_gen_fn() ``` output: ``` /home/graingert/projects/anyio/foo.py:5: RuntimeWarning: coroutine 'test_async_fn..async_fn' was never awaited async_fn() RuntimeWarning: Enable tracemalloc to get the object allocation traceback ``` expected: ``` /home/graingert/projects/anyio/foo.py:5: RuntimeWarning: coroutine 'test_async_fn..async_fn' was never awaited async_fn() RuntimeWarning: Enable tracemalloc to get the object allocation traceback /home/graingert/projects/anyio/foo.py:12: RuntimeWarning: coroutine '' was never awaited agen_fn().aclose() RuntimeWarning: Enable tracemalloc to get the object allocation traceback /home/graingert/projects/anyio/foo.py:13: RuntimeWarning: coroutine '' was never awaited agen_fn().asend(None) RuntimeWarning: Enable tracemalloc to get the object allocation traceback ``` ---------- components: Interpreter Core messages: 399684 nosy: graingert priority: normal severity: normal status: open title: async generator missing unawaited coroutine warning versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 17:32:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 16 Aug 2021 21:32:51 +0000 Subject: [issue40608] PY3.8 GC segfault (Py_TRASHCAN_SAFE_BEGIN/END are not backwards compatible) In-Reply-To: <1589306849.27.0.146369076662.issue40608@roundup.psfhosted.org> Message-ID: <1629149571.47.0.10233365874.issue40608@roundup.psfhosted.org> Irit Katriel added the comment: Re GH-20104 - What I did there was to simply revert the change that git bisect showed caused my segfault. It's been a year since then, and I don't understand this stuff well enough to say that reverting this brings us to a good state, with respect to everything else that has changed. So let's be careful about that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 17:40:17 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 16 Aug 2021 21:40:17 +0000 Subject: [issue44881] Consider integration of PyObject_GC_UnTrack() with the trashcan C API In-Reply-To: <1628629679.48.0.759166908477.issue44881@roundup.psfhosted.org> Message-ID: <1629150017.75.0.914587184895.issue44881@roundup.psfhosted.org> Neil Schemenauer added the comment: Another small correction, _PyType_IS_GC() checks only the type flag (Py_TPFLAGS_HAVE_GC). _PyObject_IS_GC() checks both the type flag and calls tp_is_gc(), if it exists. tp_is_gc() is wart, IMHO, and it would be nice if we can kill it off so only the type flag is needed. That's a topic for a different issue though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 17:42:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 21:42:33 +0000 Subject: [issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default In-Reply-To: <1575327804.72.0.272027136625.issue38956@roundup.psfhosted.org> Message-ID: <1629150153.61.0.934777403873.issue38956@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1512bc21d60f098a9e9f37b44a2f6a9b49a3fd4f by Maximilian Hils in branch 'main': bpo-38956: don't print BooleanOptionalAction's default twice (GH-27672) https://github.com/python/cpython/commit/1512bc21d60f098a9e9f37b44a2f6a9b49a3fd4f ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 17:42:43 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 16 Aug 2021 21:42:43 +0000 Subject: [issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default In-Reply-To: <1575327804.72.0.272027136625.issue38956@roundup.psfhosted.org> Message-ID: <1629150163.58.0.150582456768.issue38956@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26256 pull_request: https://github.com/python/cpython/pull/27787 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 17:50:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 16 Aug 2021 21:50:17 +0000 Subject: [issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default In-Reply-To: <1575327804.72.0.272027136625.issue38956@roundup.psfhosted.org> Message-ID: <1629150617.55.0.826011144659.issue38956@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26257 pull_request: https://github.com/python/cpython/pull/27788 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:03:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 22:03:59 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr Message-ID: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : When printing some instance of RegexFlag **in the REPL** it fails to print: >>> import gc # This prints a ton of objects, including the bad enum RegexFlag one >>> gc.get_referrers(None) Traceback (most recent call last): File "", line 1, in File "/home/pablogsal/github/cpython/Lib/enum.py", line 1399, in global_flag_repr return "%x" % (module, cls_name, self._value_) ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TypeError: %x format: an integer is required, not str ---------- messages: 399688 nosy: ethan.furman, pablogsal priority: normal severity: normal status: open title: Some RegexFlag cannot be printed in the repr versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:05:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 22:05:48 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr In-Reply-To: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> Message-ID: <1629151548.44.0.202618236524.issue44929@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Same happens when printing a enum.Flag with some values: >>> enum.Flag(1) Traceback (most recent call last): File "", line 1, in File "/home/pablogsal/github/cpython/Lib/enum.py", line 597, in __call__ return cls.__new__(cls, value) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pablogsal/github/cpython/Lib/enum.py", line 944, in __new__ raise exc ^^^^^^^^^ File "/home/pablogsal/github/cpython/Lib/enum.py", line 921, in __new__ result = cls._missing_(value) ^^^^^^^^^^^^^^^^^^^^ File "/home/pablogsal/github/cpython/Lib/enum.py", line 1185, in _missing_ raise ValueError( ^^^^^^^^^^^^^^^^^ ValueError: Flag: invalid value: 1 given 0b0 1 allowed 0b0 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:06:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 22:06:15 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr In-Reply-To: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> Message-ID: <1629151575.47.0.413691816325.issue44929@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg399689 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:06:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 22:06:35 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr In-Reply-To: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> Message-ID: <1629151595.72.0.47717563658.issue44929@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: (Deleted last message because it was incorrect) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:09:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 22:09:21 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr In-Reply-To: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> Message-ID: <1629151761.08.0.902595288803.issue44929@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Simpler reproducer: >>> import re >>> re.RegexFlag(0) Traceback (most recent call last): File "", line 1, in File "/home/pablogsal/github/cpython/Lib/enum.py", line 1399, in global_flag_repr return "%x" % (module, cls_name, self._value_) ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TypeError: %x format: an integer is required, not str ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:14:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 22:14:07 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr In-Reply-To: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> Message-ID: <1629152047.03.0.489082434897.issue44929@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This looks incorrect: https://github.com/python/cpython/blob/1512bc21d60f098a9e9f37b44a2f6a9b49a3fd4f/Lib/enum.py#L1399 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:17:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 22:17:00 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr In-Reply-To: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> Message-ID: <1629152220.18.0.723935480935.issue44929@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +26258 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27789 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:17:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 16 Aug 2021 22:17:30 +0000 Subject: [issue1596321] KeyError at exit after 'import threading' in other thread Message-ID: <1629152250.07.0.980403514342.issue1596321@roundup.psfhosted.org> Irit Katriel added the comment: The output is different now. I update the script for python 3: --------------------------------------------- import _thread as thread import time def start(): print("Secondary thread ID:", thread.get_ident()) import threading print("Main thread ID:", thread.get_ident()) thread.start_new_thread(start, ()) time.sleep(1) --------------------------------------------- and the output is: --------------------------------------------- Main thread ID: 4432801280 Secondary thread ID: 123145384259584 Exception ignored in: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-perf/Lib/threading.py", line 1512, in _shutdown assert tlock.locked() ^^^^^^^^^^^^^^^^^^^^^ AssertionError: --------------------------------------------- ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:21:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 16 Aug 2021 22:21:55 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629152515.93.0.626198310374.issue42560@roundup.psfhosted.org> Terry J. Reedy added the comment: It seems premature to worry about 8.7.0, as it might still be years away. 8.7.0a1 was 4 years ago. 8.6.0 spent 5 years in beta. https://sourceforge.net/projects/tcl/files/Tcl/. I'd like to see improved tkinter docs within a year. I don't think that license should be an issue. Tkinter, as well as our distribution of tcl/tk binaries and the Perl and Ruby tk wrappings, must be allowed by the tcl/tk license. At least by implication, we must be allowed to document the licensed wrapper and its usage from Python. The tkinter-docs listing of widget options is close to what I want to see*, except that I want to separately document shared options, as in the ttk doc. To the extent that I would prefer your versions, you have already done a big chunk of the work for that. Did you exactly copy the tk manual wordings or rewrite in your own words? Do you intend to contribute what you wrote? * In particular, you added OS-specific info. It seems to be mostly absent from *tkinter* doc and not knowing those facts has caused grief. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:32:31 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 16 Aug 2021 22:32:31 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629153151.06.0.490853190831.issue44830@roundup.psfhosted.org> Thomas Grainger added the comment: It looks like it got archived here https://github.com/mdn/archived-content/blob/main/files/en-us/mozilla/qa/bug_writing_guidelines/index.html ---------- nosy: +graingert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:37:09 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 16 Aug 2021 22:37:09 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629153429.35.0.0283725846865.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: I've reproduced the leak in 3.10 (with the reflinks.py script). In 3.9 the double-recursion segfaults: Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow. Python runtime state: initialized ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:42:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 16 Aug 2021 22:42:27 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629153747.84.0.664843219886.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: I meant refleaks.py, not reflinks.py. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:43:16 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 16 Aug 2021 22:43:16 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629153796.16.0.44572835246.issue44830@roundup.psfhosted.org> Terry J. Reedy added the comment: https://support.mozilla.org/en-US/kb/contributors-guide-writing-good-bug still has a link to https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines but the fact that they moved the latter to https://github.com/mdn/archived-content/blob/main/files/en-us/mozilla/qa/bug_writing_guidelines/index.html does not think highly of it now. The github archived document says last modified in 2013. The Wayback copy has an additional box saying last modified a year ago by 'MDM contributors'. I don't know what that means, even after clicking the link. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 18:55:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 16 Aug 2021 22:55:50 +0000 Subject: [issue34882] f(a=1, *args) should be a SyntaxError In-Reply-To: <1538553672.9.0.545547206417.issue34882@psf.upfronthosting.co.za> Message-ID: <1629154550.93.0.912731697028.issue34882@roundup.psfhosted.org> Irit Katriel added the comment: Reproduced in 3.11: >>> f(a=1, 2, 3) File "", line 1 f(a=1, 2, 3) ^ SyntaxError: positional argument follows keyword argument >>> f(a=1, *(2, 3)) Traceback (most recent call last): File "", line 1, in TypeError: f() got multiple values for argument 'a' >>> ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 19:03:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 16 Aug 2021 23:03:04 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629154984.92.0.271057692765.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: It's midnight, so just one last weirdness before I turn into a pumpkin: If I add this assignment to x the issue seems to go away (or become less frequent so I don't see it?) But if I assign x to a small constant it still leaks. def test_no_hang_on_context_chain_cycle2(): x = list(range(100)) class A(Exception): pass class B(Exception): pass ---------- keywords: -patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 19:05:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 23:05:52 +0000 Subject: [issue34882] f(a=1, *args) should be a SyntaxError In-Reply-To: <1538553672.9.0.545547206417.issue34882@psf.upfronthosting.co.za> Message-ID: <1629155152.39.0.00127563363706.issue34882@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is not a bug, check the thread that Serhiy attached. The grammar is, in principle, correct. For instance, you can do: def f(a,b,c): pass def wrapper(*args, **kw): return f(c=1, *args, **kw) wrapper(2,b=2) And you don't want that to be a syntax error. ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 19:05:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 23:05:57 +0000 Subject: [issue34882] f(a=1, *args) should be a SyntaxError In-Reply-To: <1538553672.9.0.545547206417.issue34882@psf.upfronthosting.co.za> Message-ID: <1629155157.79.0.740871776221.issue34882@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 19:07:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 23:07:27 +0000 Subject: [issue34882] f(a=1, *args) should be a SyntaxError In-Reply-To: <1538553672.9.0.545547206417.issue34882@psf.upfronthosting.co.za> Message-ID: <1629155247.97.0.688023762158.issue34882@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, just to make it clear: changing this would be backwards incompatible, so if someone is interested, a bigger discussion is needed (starting with python-ideas/python-dev). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 19:09:12 2021 From: report at bugs.python.org (Maximilian Hils) Date: Mon, 16 Aug 2021 23:09:12 +0000 Subject: [issue44587] argparse BooleanOptionalAction displays default=SUPPRESS unlike other action types In-Reply-To: <1625807257.47.0.987336531003.issue44587@roundup.psfhosted.org> Message-ID: <1629155352.84.0.517269543536.issue44587@roundup.psfhosted.org> Change by Maximilian Hils : ---------- keywords: +patch nosy: +mhils nosy_count: 2.0 -> 3.0 pull_requests: +26259 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27672 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 19:09:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 16 Aug 2021 23:09:02 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629155342.45.0.507919281682.issue44895@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >> x = list(range(100)) Is creating a lot of objects, and the gc has a chance to run on every object creation so maybe what's happening there is that you are inadvertently triggering the gc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 19:22:57 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 16 Aug 2021 23:22:57 +0000 Subject: [issue32937] Multiprocessing worker functions not terminating with a large number of processes and a manager In-Reply-To: <1519481823.24.0.467229070634.issue32937@psf.upfronthosting.co.za> Message-ID: <1629156177.15.0.518869606033.issue32937@roundup.psfhosted.org> Change by Ned Deily : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 19:30:26 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 16 Aug 2021 23:30:26 +0000 Subject: [issue33896] Document what components make up the filecmp.cmp os.stat signature. In-Reply-To: <1529345931.78.0.56676864532.issue33896@psf.upfronthosting.co.za> Message-ID: <1629156626.66.0.978975903762.issue33896@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 20:36:53 2021 From: report at bugs.python.org (Logan Jones) Date: Tue, 17 Aug 2021 00:36:53 +0000 Subject: [issue44920] Support UUIDv6, UUIDv7, and UUIDv8 from the new version of RFC4122 In-Reply-To: <1629048365.97.0.101119142277.issue44920@roundup.psfhosted.org> Message-ID: <1629160613.57.0.550284427114.issue44920@roundup.psfhosted.org> Change by Logan Jones : ---------- nosy: +loganasherjones _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 21:00:50 2021 From: report at bugs.python.org (Mark Roseman) Date: Tue, 17 Aug 2021 01:00:50 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629162050.18.0.0515571534313.issue42560@roundup.psfhosted.org> Mark Roseman added the comment: I would most definitely echo the concern about the massive size of such a project as well as future maintainability. I don't know anyone who would be able to do such a thing on a volunteer basis, and I think it would be highly unlikely that anyone would step up to pay someone to do it. I imagine we all agree that we would love to have such a complete reference, but I have a hard time seeing how it's even remotely feasible. As the effort supporting Tcl/Tk core development is fairly small, and most of the people involved are far more interested in the Tcl side of things rather than Tk, the odds of huge changes on the Tk front are small, beyond keeping it working, fixing bugs, and the odd little isolated burst of new stuff once in a while. Based on previous history with that community, I think you can safely assume any licensing issues won't be an impediment to whatever needs to be done on this end, though I'm sure there are details to sort out. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 21:16:08 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 17 Aug 2021 01:16:08 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1629153796.16.0.44572835246.issue44830@roundup.psfhosted.org> Message-ID: Jack DeVries added the comment: I am pretty sure that Mozilla moved to a new content management system and they've been refreshing a lot of content on their site. I would assume that any lingering presence of this article is just growing pains and it'll all be removed in due time. I might be wrong, though. I suppose we could submit a bug report to Mozilla to find out.... if we can ever figure out how to write a bug report again, that is! On Mon, Aug 16, 2021 at 10:43:16PM +0000, Terry J. Reedy wrote: > > Terry J. Reedy added the comment: > > https://support.mozilla.org/en-US/kb/contributors-guide-writing-good-bug > still has a link to > https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines > but the fact that they moved the latter to > https://github.com/mdn/archived-content/blob/main/files/en-us/mozilla/qa/bug_writing_guidelines/index.html > does not think highly of it now. The github archived document says last modified in 2013. The Wayback copy has an additional box saying last modified a year ago by 'MDM contributors'. I don't know what that means, even after clicking the link. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 21:48:47 2021 From: report at bugs.python.org (Xiaolong Liu) Date: Tue, 17 Aug 2021 01:48:47 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <202108170948419186022@126.com> Xiaolong Liu added the comment: Dear Andrei, It's about 63MB. I reshared it on Google Drive. Please check the following link. https://drive.google.com/file/d/1534MdIcGbXtMwYfuo2zeFxm6BVgHa4XX/view?usp=sharing Bruce / Xiaolong Liu / ??? From: Andrei Kulakov Date: 2021-08-14 20:49 To: liuxiaolong125 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file Andrei Kulakov added the comment: Xiaolong: The file no longer exists on the google drive. How big was the file? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 23:03:23 2021 From: report at bugs.python.org (Owen T. Heisler) Date: Tue, 17 Aug 2021 03:03:23 +0000 Subject: [issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb' In-Reply-To: <1330513271.31.0.437438851478.issue14156@psf.upfronthosting.co.za> Message-ID: <1629169403.6.0.714041085178.issue14156@roundup.psfhosted.org> Change by Owen T. Heisler : ---------- nosy: +owenh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 16 23:11:23 2021 From: report at bugs.python.org (wang xuancong) Date: Tue, 17 Aug 2021 03:11:23 +0000 Subject: [issue44930] super-Matlab-style ranged list literal initialization Message-ID: <1629169883.67.0.683689066007.issue44930@roundup.psfhosted.org> New submission from wang xuancong : Different from Python 2, Python 3 has removed the capability to create a list from a range. In Python 2, we can use range(1,100,2) to create a list [1, 3, 5, ..., 99], but in Python 3, we can only use list(range(1,100,2)) or [*range(1,100,2)] where the latter is even slower. I would like to propose to use something like [1:100:2] to initialize a list, moreover, you can use [1:100:2, 1000:1200:5, 5000:6000, :10] to create a list of multiple segments of ranges, i.e., [1,3,5,...,99,1000,1005,1010,...,1195,5000,5001,5002,...,5999,0,1,2,...,9]. Ranged list creation is quite useful and is often used in multi-thread/multi-processing scheduling or tracked sorting. This is especially useful in deep learning where you want to shuffle the training data but keep track of their corresponding labels. In deep RNN, where every training instance has a different length, after shuffling/sorting, you also need to keep track of their corresponding lengths information and etc. Thanks! ---------- components: Interpreter Core messages: 399707 nosy: xuancong84 priority: normal severity: normal status: open title: super-Matlab-style ranged list literal initialization type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 00:15:49 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 17 Aug 2021 04:15:49 +0000 Subject: [issue44930] super-Matlab-style ranged list literal initialization In-Reply-To: <1629169883.67.0.683689066007.issue44930@roundup.psfhosted.org> Message-ID: <1629173749.25.0.934387001422.issue44930@roundup.psfhosted.org> Steven D'Aprano added the comment: > Python 3 has removed the capability to create a list from a range. That's incorrect. You can do `list(range(1,100,2))`. But generally, why create a list? range objects support many of the list APIs: - iteration - fast containment tests `x in range(1, 100, 2)` - indexing (subscripts) and slicing - reversal using a slice - count and index methods Range objects support the full sequence API, so why do you need to convert to a list? >>> from collections.abc import Sequence >>> isinstance(range(1, 100, 2), Sequence) True For the unusual or rare cares where you do need a list, why do you need special syntax? Just call the list constructor. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 00:17:37 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 17 Aug 2021 04:17:37 +0000 Subject: [issue44930] super-Matlab-style ranged list literal initialization In-Reply-To: <1629169883.67.0.683689066007.issue44930@roundup.psfhosted.org> Message-ID: <1629173857.72.0.621146948976.issue44930@roundup.psfhosted.org> Steven D'Aprano added the comment: As a new feature, the absolute earliest we could add this would be Python 3.11. As new syntax, it would need a PEP. https://www.python.org/dev/peps/ ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 02:53:46 2021 From: report at bugs.python.org (Jurjen N.E. Bos) Date: Tue, 17 Aug 2021 06:53:46 +0000 Subject: [issue44931] Add "bidimap" to collections library Message-ID: <1629183226.79.0.0263345990362.issue44931@roundup.psfhosted.org> New submission from Jurjen N.E. Bos : The Java class "BiDiMap" is very useful and doesn't seem to have an equivalent in the Python libraries. I wrote a proposed class that does just that. Here's a simple implementation, that could be used as a starting point. ---------- files: bidimap.py hgrepos: 408 messages: 399710 nosy: jneb priority: normal severity: normal status: open title: Add "bidimap" to collections library Added file: https://bugs.python.org/file50225/bidimap.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 02:54:57 2021 From: report at bugs.python.org (Jurjen N.E. Bos) Date: Tue, 17 Aug 2021 06:54:57 +0000 Subject: [issue44931] Add "bidimap" to collections library In-Reply-To: <1629183226.79.0.0263345990362.issue44931@roundup.psfhosted.org> Message-ID: <1629183297.36.0.548987231346.issue44931@roundup.psfhosted.org> Change by Jurjen N.E. Bos : ---------- type: -> performance versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 02:56:59 2021 From: report at bugs.python.org (Jurjen N.E. Bos) Date: Tue, 17 Aug 2021 06:56:59 +0000 Subject: [issue44931] Add "bidimap" to collections library In-Reply-To: <1629183226.79.0.0263345990362.issue44931@roundup.psfhosted.org> Message-ID: <1629183419.75.0.253557804793.issue44931@roundup.psfhosted.org> Jurjen N.E. Bos added the comment: Give me a shout if you like this: I am happy to write a test suite, make a patch, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 02:57:29 2021 From: report at bugs.python.org (Jurjen N.E. Bos) Date: Tue, 17 Aug 2021 06:57:29 +0000 Subject: [issue44931] Add "bidimap" to collections library: a simple bidirectional map In-Reply-To: <1629183226.79.0.0263345990362.issue44931@roundup.psfhosted.org> Message-ID: <1629183449.35.0.143424263341.issue44931@roundup.psfhosted.org> Change by Jurjen N.E. Bos : ---------- title: Add "bidimap" to collections library -> Add "bidimap" to collections library: a simple bidirectional map _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 03:02:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Aug 2021 07:02:14 +0000 Subject: [issue44931] Add "bidimap" to collections library: a simple bidirectional map In-Reply-To: <1629183226.79.0.0263345990362.issue44931@roundup.psfhosted.org> Message-ID: <1629183734.7.0.865862478441.issue44931@roundup.psfhosted.org> Serhiy Storchaka added the comment: Is BiDiMap included in the Java SDK? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 03:10:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Aug 2021 07:10:45 +0000 Subject: [issue44930] super-Matlab-style ranged list literal initialization In-Reply-To: <1629169883.67.0.683689066007.issue44930@roundup.psfhosted.org> Message-ID: <1629184245.93.0.773366549358.issue44930@roundup.psfhosted.org> Serhiy Storchaka added the comment: I concur with Steven. Before range() and enumerate() were introduced there were discussions about introducing dedicated syntax. But it was decided that builtin functions are more preferable. range() was improved in Python 3, so you do not need to waste memory and time for a temporary list if you do not need it. You can create a list only if you absolutely need a list, and you can do it with the list constructor. ---------- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 03:12:43 2021 From: report at bugs.python.org (Jurjen N.E. Bos) Date: Tue, 17 Aug 2021 07:12:43 +0000 Subject: [issue44931] Add "bidimap" to collections library: a simple bidirectional map In-Reply-To: <1629183226.79.0.0263345990362.issue44931@roundup.psfhosted.org> Message-ID: <1629184363.75.0.764564762317.issue44931@roundup.psfhosted.org> Jurjen N.E. Bos added the comment: It is part of the Apache Common collections ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 03:18:38 2021 From: report at bugs.python.org (wang xuancong) Date: Tue, 17 Aug 2021 07:18:38 +0000 Subject: [issue44930] super-Matlab-style ranged list literal initialization In-Reply-To: <1629169883.67.0.683689066007.issue44930@roundup.psfhosted.org> Message-ID: <1629184718.33.0.224131814553.issue44930@roundup.psfhosted.org> wang xuancong added the comment: Another lazy explanation not wanting to improve anything ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 03:23:53 2021 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 17 Aug 2021 07:23:53 +0000 Subject: [issue44924] logging.handlers.QueueHandler does not maintain the exc_text In-Reply-To: <1629108674.13.0.869133594401.issue44924@roundup.psfhosted.org> Message-ID: <1629185033.9.0.415228217142.issue44924@roundup.psfhosted.org> Vinay Sajip added the comment: It might be inadvisable to make your suggested change because of backward compatibility and breakage of existing code. However, I don't mind updating the logging cookbook to mention your suggested method of resolving the issue for this use case. I'll leave the issue open until I've done that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 03:26:02 2021 From: report at bugs.python.org (theeshallnotknowethme) Date: Tue, 17 Aug 2021 07:26:02 +0000 Subject: [issue44932] `issubclass` and `isinstance` doesn't check for all 2nd argument types Message-ID: <1629185162.39.0.804391329839.issue44932@roundup.psfhosted.org> New submission from theeshallnotknowethme : When I tried using `isinstance` with a type (e.g. `bool`) as the 1st argument and a parameterized generic in a tuple (e.g. '(`bool`, `list[bool]`)') as the 2nd argument, it raised a `TypeError`, 'isinstance() argument 2 cannot be a parameterized generic'. But when I did the same thing in `issubclass`, it returned a boolean and did not raise any `TypeError`s. Using `isinstance` with an object as the 1st argument and the same tuple 2nd argument also returned a boolean, and did not raise any `TypeError`s. Is this expected behaviour, or should this be fixed? This was tested in Python 3.10.0rc1 in a 64-bit system. ---------- components: Tests, Windows messages: 399717 nosy: February291948, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: `issubclass` and `isinstance` doesn't check for all 2nd argument types type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 04:45:06 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 17 Aug 2021 08:45:06 +0000 Subject: [issue44931] Add "bidimap" to collections library: a simple bidirectional map In-Reply-To: <1629183226.79.0.0263345990362.issue44931@roundup.psfhosted.org> Message-ID: <1629189906.66.0.937782968426.issue44931@roundup.psfhosted.org> Vedran ?a?i? added the comment: Your implementation has many problems. First, almost all your complexity claims are wrong, probably because you copied them from Java, which uses balanced trees instead of Python's hash tables. (Also, the method names seem to be copied from Java, using camelCase which is unusual for Python stdlib.) Second, shouldn't _inverse be a weakkey dictionary? Otherwise many operations (e.g. removeValue) will get two dicts out of sync quickly. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:01:06 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 09:01:06 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1629190866.96.0.709286447102.issue44903@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6a358bb9482f7595b858ea7b800cbe66f0de5fa1 by Gautam Chaudhuri in branch 'main': bpo-44903: Removed othergui.rst and list of GUI frameworks (GH-27762) https://github.com/python/cpython/commit/6a358bb9482f7595b858ea7b800cbe66f0de5fa1 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:01:15 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 09:01:15 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1629190875.02.0.446748877877.issue44903@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26260 pull_request: https://github.com/python/cpython/pull/27790 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:02:10 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 09:02:10 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1629190930.14.0.858595337005.issue44903@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26261 pull_request: https://github.com/python/cpython/pull/27791 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:17:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 09:17:10 +0000 Subject: [issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default In-Reply-To: <1575327804.72.0.272027136625.issue38956@roundup.psfhosted.org> Message-ID: <1629191830.56.0.617140229641.issue38956@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 27fd31311097ab7326f084b5e0e5f388f8dc6b13 by ?ukasz Langa in branch '3.9': [3.9] bpo-38956: don't print BooleanOptionalAction's default twice (GH-27672) (GH-27788) https://github.com/python/cpython/commit/27fd31311097ab7326f084b5e0e5f388f8dc6b13 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:18:56 2021 From: report at bugs.python.org (tester) Date: Tue, 17 Aug 2021 09:18:56 +0000 Subject: [issue44933] python3.9-intel64 hardened runtime not enabled Message-ID: <1629191936.44.0.533137792291.issue44933@roundup.psfhosted.org> New submission from tester : When trying too build the python framework using the method below and you try to get it notarized you get the following error. "path": "munkitools-5.5.0.4362.pkg/munkitools_python.pkg Contents/Payload/usr/local/munki/Python.framework/Versions/3.9/bin/python3.9-intel64", "message": "The executable does not have the hardened runtime enabled.", https://github.com/munki/munki/blob/main/code/tools/build_python_framework.sh The package get built using this ttps://github.com/lifeunexpected/Scripts This issue happens on python 3.9.5 and 3.9.6 earlier versions did not include python3.9-intel64. ---------- components: macOS messages: 399721 nosy: bettyrab, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: python3.9-intel64 hardened runtime not enabled type: compile error versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:31:53 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 17 Aug 2021 09:31:53 +0000 Subject: [issue44932] `issubclass` and `isinstance` doesn't check for all 2nd argument types In-Reply-To: <1629185162.39.0.804391329839.issue44932@roundup.psfhosted.org> Message-ID: <1629192713.67.0.686334339731.issue44932@roundup.psfhosted.org> Ken Jin added the comment: @Paul, Steve, Tim and Zach, I've removed y'all from nosy as this isn't a Windows issue (but a typing/builtin types one). If you feel that I shouldn't have done that: my apologies and please do tell me. To summarize what OP said: >>> isinstance(bool, (bool, list[bool])) TypeError: isinstance() argument 2 cannot be a parameterized generic >>> issubclass(bool, (bool, list[bool])) True @OP, this seems like a bug. issubclass should raise according to PEP 585. In this case it's short-circuiting so it doesn't check the 2nd arg. Swapping the arguments around gives the expected TypeError. >>> issubclass(bool, (list[bool], bool)) TypeError: issubclass() argument 2 cannot be a parameterized generic At the same time, I'm hesitant to run a check through everything in the types tuple first. That would hurt issubclass performance (I'm not sure by how much). What do you think, Guido and Serhiy? ---------- components: +Library (Lib) -Tests, Windows nosy: +gvanrossum, kj, serhiy.storchaka -paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:37:10 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 17 Aug 2021 09:37:10 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629193030.05.0.103515911914.issue44914@roundup.psfhosted.org> Ken Jin added the comment: Thanks Mark and Victor for the patch and reviews! This issue also affects 3.10, but IMO we don't need to backport this as we don't have other code relying on this invariant in that version, so it won't affect anything there. If you feel otherwise, please let me know. The fix and tests have landed, I'm closing this issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:40:49 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 09:40:49 +0000 Subject: [issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default In-Reply-To: <1575327804.72.0.272027136625.issue38956@roundup.psfhosted.org> Message-ID: <1629193249.39.0.914711088397.issue38956@roundup.psfhosted.org> miss-islington added the comment: New changeset 6f6648e436d02bce0e49ba82f4377c0d2f586f0f by Miss Islington (bot) in branch '3.10': bpo-38956: don't print BooleanOptionalAction's default twice (GH-27672) https://github.com/python/cpython/commit/6f6648e436d02bce0e49ba82f4377c0d2f586f0f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:41:49 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 17 Aug 2021 09:41:49 +0000 Subject: [issue44933] python3.9-intel64 hardened runtime not enabled In-Reply-To: <1629191936.44.0.533137792291.issue44933@roundup.psfhosted.org> Message-ID: <1629193309.13.0.327302734863.issue44933@roundup.psfhosted.org> Ronald Oussoren added the comment: I'm not sure what your question is. But to enable the hardened runtime you need to sign the binaries using ``--options runtime`` as one of the options. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:42:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Aug 2021 09:42:30 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629193350.53.0.38183732529.issue44914@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The opcode cache for load attribute in 3.10 uses the tp_version_tag so unless I am missing something we can fall into the same problem, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 05:48:57 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 17 Aug 2021 09:48:57 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629193737.88.0.513288678085.issue44914@roundup.psfhosted.org> Ken Jin added the comment: @Pablo yup the 3.10 opcache used tp_version_tag. But it also does identity (pointer) comparison of type/class object https://github.com/python/cpython/blob/3.10/Python/ceval.c#L3432. Which is why it doesn't fail. I created this issue because we don't do type pointer comparisons anymore in 3.11's new specialization infrastructure, and rely only on tp_version_tag and dict keys version. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:01:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 10:01:37 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629194497.97.0.965023623323.issue44852@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:01:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 10:01:16 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629194476.84.0.682036510762.issue44852@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset bc98f981326d7cb30f939dedd04b91f378255d88 by ?ukasz Langa in branch '3.10': [3.10] bpo-44852: Support ignoring specific DeprecationWarnings wholesale in regrtest (GH-27634) (GH-27784) https://github.com/python/cpython/commit/bc98f981326d7cb30f939dedd04b91f378255d88 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:03:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 10:03:35 +0000 Subject: [issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default In-Reply-To: <1575327804.72.0.272027136625.issue38956@roundup.psfhosted.org> Message-ID: <1629194615.33.0.444791869967.issue38956@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Max for pushing this across the finish line! ? ? ? Closing this one. Further improvement of BooleanOptionalAction will be discussed in BPO-44587. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:04:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 10:04:48 +0000 Subject: [issue44587] argparse BooleanOptionalAction displays default=SUPPRESS unlike other action types In-Reply-To: <1625807257.47.0.987336531003.issue44587@roundup.psfhosted.org> Message-ID: <1629194688.24.0.235524284088.issue44587@roundup.psfhosted.org> ?ukasz Langa added the comment: Toshio, as I commented on GH-27672, that PR was merged because it's a rather trivial improvement over the status quo. I intend to also release this fix in 3.9.7 on August 30th. Your idea in this issue to further improve the situation while retaining displaying the default value (option 2 described above) is interesting. If you prepare a PR we can work with, I'll look into merging that as well. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:07:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 10:07:37 +0000 Subject: [issue44587] argparse BooleanOptionalAction displays default=SUPPRESS unlike other action types In-Reply-To: <1625807257.47.0.987336531003.issue44587@roundup.psfhosted.org> Message-ID: <1629194857.0.0.0876978383882.issue44587@roundup.psfhosted.org> ?ukasz Langa added the comment: Oh, I forgot to say this explicitly: an important reason why the trivial fix was desirable is that it was a clear-cut bugfix, making it easy to backport all the way to the 3.9 branch where BooleanOptionalAction was introduced. Having this in place, your potential PR here might be a cleaner refactor without having to worry about backporting. Of course, if we manage to keep it small and isolated, we can bring it to 3.9 and 3.10 as well. ---------- versions: +Python 3.11 -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:08:56 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 10:08:56 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1629194936.49.0.573610503473.issue44903@roundup.psfhosted.org> miss-islington added the comment: New changeset f6bd1ca166a9c8c9769fb23bc6d8f9c6dcc907ab by Miss Islington (bot) in branch '3.10': bpo-44903: Removed othergui.rst and list of GUI frameworks (GH-27762) https://github.com/python/cpython/commit/f6bd1ca166a9c8c9769fb23bc6d8f9c6dcc907ab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:09:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 10:09:13 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1629194953.15.0.365489742595.issue44903@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e21b66b0446d119862d352b1eecc830fed4192ff by Miss Islington (bot) in branch '3.9': bpo-44903: Removed othergui.rst and list of GUI frameworks (GH-27762) (GH-27790) https://github.com/python/cpython/commit/e21b66b0446d119862d352b1eecc830fed4192ff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:10:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 10:10:11 +0000 Subject: [issue44903] [Doc] How does one to about getting onto the "Other Graphical User Interface Packages" page? In-Reply-To: <1628781758.89.0.888842647561.issue44903@roundup.psfhosted.org> Message-ID: <1629195011.86.0.157580768659.issue44903@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks all! ? ? ? CPython docs are now out of the business of curating lists of GUI frameworks. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:15:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Aug 2021 10:15:00 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629195300.31.0.40002805816.issue44914@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > But it also does identity (pointer) comparison of type/class object Good point! Even if I wrote that code I forgot about all the guards that were needed for correctness. I now remember all the weird cases we discovered there :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:34:36 2021 From: report at bugs.python.org (tester) Date: Tue, 17 Aug 2021 10:34:36 +0000 Subject: [issue44933] python3.9-intel64 hardened runtime not enabled In-Reply-To: <1629191936.44.0.533137792291.issue44933@roundup.psfhosted.org> Message-ID: <1629196476.23.0.782333202088.issue44933@roundup.psfhosted.org> tester added the comment: This part of the script is used to notarize the python framework and it worked with python 3.9.4 and earlier but with 3.9.5 and 3.9.6 it stopped working because of "/python3.9-intel64", "message": "The executable does not have the hardened runtime enabled. #get current python version used in Munki build so that it doesn't have to be hardcoded PYTHON_FRAMEWORK_VERSION=$(ls Python.framework/Versions | grep -v "Current") find $MUNKIROOT/Python.framework/Versions/$PYTHON_FRAMEWORK_VERSION/lib/ -type f -perm -u=x -exec codesign --force --deep --verbose -s "$DevApp" {} \; find $MUNKIROOT/Python.framework/Versions/$PYTHON_FRAMEWORK_VERSION/bin/ -type f -perm -u=x -exec codesign --force --deep --verbose -s "$DevApp" {} \; find $MUNKIROOT/Python.framework/Versions/$PYTHON_FRAMEWORK_VERSION/lib/ -type f -name "*dylib" -exec codesign --force --deep --verbose -s "$DevApp" {} \; find $MUNKIROOT/Python.framework/Versions/$PYTHON_FRAMEWORK_VERSION/lib/ -type f -name "*so" -exec codesign --force --deep --verbose -s "$DevApp" {} \; /usr/libexec/PlistBuddy -c "Add :com.apple.security.cs.allow-unsigned-executable-memory bool true" $MUNKIROOT/entitlements.plist codesign --force --options runtime --entitlements $MUNKIROOT/entitlements.plist --deep --verbose -s "$DevApp" $MUNKIROOT/Python.framework/Versions/$PYTHON_FRAMEWORK_VERSION/Resources/Python.app/ codesign --force --options runtime --entitlements $MUNKIROOT/entitlements.plist --deep --verbose -s "$DevApp" $MUNKIROOT/Python.framework/Versions/$PYTHON_FRAMEWORK_VERSION/bin/"python$PYTHON_FRAMEWORK_VERSION" codesign --force --deep --verbose -s "$DevApp" $MUNKIROOT/Python.framework ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:35:52 2021 From: report at bugs.python.org (Bastian Neuburger) Date: Tue, 17 Aug 2021 10:35:52 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it Message-ID: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> New submission from Bastian Neuburger : Hi there, in our organization Python 3.9 is installed on Windows with the PrependPath option; as expected the Install and Scripts directories are prepended to path. However if there are Python scripts with the same name as a system command (e.g. a script named ping.py vs. the included ping.exe), the Python script gets preferred if I run ping in cmd.exe or Powershell, which makes sense, since the Python script path is considered before e.g. C:\Windows\System32\. Is it possible to either change the option to append the Install and scripts directories to the systems PATH instead of prepending it or add an AppendPath option? I searched for a discussion why prepending was chosen instead of appending but I didn't find anything. ---------- components: Windows messages: 399737 nosy: bn_append, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows installer: Append Python to PATH instead of prepending it type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:43:39 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 17 Aug 2021 10:43:39 +0000 Subject: [issue44933] python3.9-intel64 hardened runtime not enabled In-Reply-To: <1629191936.44.0.533137792291.issue44933@roundup.psfhosted.org> Message-ID: <1629197019.32.0.540895969676.issue44933@roundup.psfhosted.org> Ronald Oussoren added the comment: I don't know what creates "python3.9-intel64", but this is not created by the regular Python build process. It might be created by one of the build scripts you use. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:50:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 10:50:19 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629197419.49.0.0746883260371.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: However, if I replace the assignment with a gc.collect() call, it still leaks: def test_no_hang_on_context_chain_cycle2(): while gc.collect(): pass class A(Exception): pass class B(Exception): pass ... I also changed gc_collect in Lib/test/support/__init__.py (which is called by the refleak check) to loop until gc.collect() returns 0 (currently it calls gc.collect() 3 times). Still leaks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 06:58:33 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 10:58:33 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629197913.52.0.746485251425.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: But if I also add a gc loop at the beginning of test_recursion_in_except_handler, the leak goes away. def test_recursion_in_except_handler(): while gc.collect(): pass def set_relative_recursion_limit(n): ... So maybe test_recursion_in_except_handler is resurrecting something that test_no_hang_on_context_chain_cycle2 has let go of? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 07:17:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 17 Aug 2021 11:17:31 +0000 Subject: [issue44932] `issubclass` and `isinstance` doesn't check for all 2nd argument types In-Reply-To: <1629185162.39.0.804391329839.issue44932@roundup.psfhosted.org> Message-ID: <1629199051.7.0.349857160492.issue44932@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is not specific to typing. >>> isinstance(1, (int, 1)) True >>> isinstance(1, (1, int)) Traceback (most recent call last): File "", line 1, in TypeError: isinstance() arg 2 must be a type or tuple of types >>> issubclass(int, (int, 1)) True >>> issubclass(int, (1, int)) Traceback (most recent call last): File "", line 1, in TypeError: issubclass() arg 2 must be a class or tuple of classes isinstance() and issubclass() with tuples always stopped on first positive match. I don't think there is need to change this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 07:22:44 2021 From: report at bugs.python.org (tester) Date: Tue, 17 Aug 2021 11:22:44 +0000 Subject: [issue44933] python3.9-intel64 hardened runtime not enabled In-Reply-To: <1629191936.44.0.533137792291.issue44933@roundup.psfhosted.org> Message-ID: <1629199364.24.0.308939043717.issue44933@roundup.psfhosted.org> tester added the comment: oh i didn't now that so thank you so much i will look into that maybe thats where my problem is :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 07:22:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 11:22:51 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629199371.71.0.836274790805.issue44852@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26262 pull_request: https://github.com/python/cpython/pull/27793 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 07:43:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 11:43:52 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629200632.75.0.454987158239.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: Mark, it's great to see you work on the documentation again. I would like you invite you to produce a number of smaller PRs, just like you did with GH-27717. Those tend to be much easier to include even as we are discussing larger-scale evolution of the documentation. In particular, your cpython forks contains a number of commits, some tiny, some large. Taken in its entirety it will be hard to review because diffs aren't well suited for free-flowing text when semantic newlines aren't used [^1]. Reworking the tutorial seems like it could go in a separate PR. Same for updating literature to current versions, and so on. [^1]: https://sembr.org/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 07:49:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 11:49:56 +0000 Subject: [issue33479] Document tkinter and threads In-Reply-To: <1526184152.45.0.682650639539.issue33479@psf.upfronthosting.co.za> Message-ID: <1629200996.27.0.935231959995.issue33479@roundup.psfhosted.org> ?ukasz Langa added the comment: This is done. Thanks, Mark! For remaining discussion on reworking Tkinter docs, please refer to BPO-42560. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 07:57:52 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 17 Aug 2021 11:57:52 +0000 Subject: [issue44932] `issubclass` and `isinstance` doesn't check for all 2nd argument types In-Reply-To: <1629185162.39.0.804391329839.issue44932@roundup.psfhosted.org> Message-ID: <1629201472.4.0.297485138236.issue44932@roundup.psfhosted.org> Ken Jin added the comment: Thank you for the examples Serhiy. I agree. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 08:24:12 2021 From: report at bugs.python.org (Maximilian Hils) Date: Tue, 17 Aug 2021 12:24:12 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629203052.1.0.154640784602.issue44926@roundup.psfhosted.org> Maximilian Hils added the comment: Thank you Ken and Guido for the super quick feedback! > It's not fine if it were to look in the wrong namespace That's a really good point. Here's another terrible example: foo.py: ``` import typing FooData: typing.TypeAlias = "Data" class Data: pass ``` bar.py: ``` import typing import foo BarData: typing.TypeAlias = "Data" def func1(x: foo.FooData, y: BarData): pass class Data: pass print(typing.get_type_hints(func1)) # incorrectly uses bar.Data twice. ``` I don't see how we could distinguish FooData from BarData without static analysis. Changing get_type_hints to not pick the unrelated class with the same name would essentially mean not using func.__globals__, which breaks almost all ForwardRef evaluation. This doesn't seem viable. Potential alternatives: 1. Accept the current state: get_type_hints does not work well with type aliases that use forward references. 2. Fix it at least for cases where a ForwardRef is constructed immediately (typing.List["Foo"], but not "Foo" or list["Foo"]), similar to how it's been done for #41249. I have made a very basic proof-of-concept at https://github.com/mhils/cpython/commit/4adbcf088d2857166b579f7dd2954ff9981fc7db, but it's a mess (see commit comments). 3. Deprecate/discourage use of forward references in type aliases and/or change the syntax for [forward references in] type aliases so that their origin can be tracked. In summary, it seems like there are no really good solutions here. I'm fine if this ends up as a pragmatic wontfix, maybe with a comment added somewhere in the docs or in PEP 613. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 08:24:48 2021 From: report at bugs.python.org (hai shi) Date: Tue, 17 Aug 2021 12:24:48 +0000 Subject: [issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9 In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1629203088.34.0.224459788113.issue44050@roundup.psfhosted.org> Change by hai shi : ---------- keywords: +patch pull_requests: +26263 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27794 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 09:02:57 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 17 Aug 2021 13:02:57 +0000 Subject: [issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9 In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1629205377.34.0.58501480702.issue44050@roundup.psfhosted.org> Petr Viktorin added the comment: > Maybe the old behavior was better: if an extension uses the old API, share its state between all interpreters. Yes, I think the old behavior was better: if an extension uses the old API, share its state between all interpreters. This is obviously bad, but I don't see how skipping part of initialization (as done in https://github.com/python/cpython/commit/82c83bd907409c287a5bd0d0f4598f2c0538f34d#diff-28cfc3e2868980a79d93d2ebdc8747dcb9231f3dd7f2caef96e74107d1ea3bf3L721-R719 ) is better. (Note that the "def->m_size == -1" means that the module does not support sub-interpreters, because it has global state, per https://docs.python.org/3/c-api/module.html#c.PyModuleDef.m_size) ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 09:04:19 2021 From: report at bugs.python.org (hai shi) Date: Tue, 17 Aug 2021 13:04:19 +0000 Subject: [issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9 In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1629205459.67.0.439692471314.issue44050@roundup.psfhosted.org> hai shi added the comment: > Maybe the old behavior was better: if an extension uses the old API, share its state between all interpreters. +1. I create PR-27794, which use `def->m_slots` to identify the extension module created from `PyModule_Create()` or not. cc @petr ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 09:39:44 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 17 Aug 2021 13:39:44 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1629207584.86.0.719466550084.issue42035@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 3e2c643ae0b21f9e596bfd9c8ec99ca546ea8d0f by Hai Shi in branch 'main': bpo-42035: Add PyType_GetQualName() to get a type's qualified name. (GH-27551) https://github.com/python/cpython/commit/3e2c643ae0b21f9e596bfd9c8ec99ca546ea8d0f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 09:51:47 2021 From: report at bugs.python.org (Jakub Kulik) Date: Tue, 17 Aug 2021 13:51:47 +0000 Subject: [issue44935] Solaris: enable posix_spawn in subprocess Message-ID: <1629208307.21.0.258573678386.issue44935@roundup.psfhosted.org> New submission from Jakub Kulik : Solaris also provides posix_spawn() syscall that can/should be used in the subprocess module to spawn new processes. ---------- components: Library (Lib) messages: 399750 nosy: kulikjak priority: normal severity: normal status: open title: Solaris: enable posix_spawn in subprocess versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 09:52:50 2021 From: report at bugs.python.org (Richard Sheridan) Date: Tue, 17 Aug 2021 13:52:50 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629208370.19.0.190447111606.issue42560@roundup.psfhosted.org> Change by Richard Sheridan : ---------- nosy: +Richard Sheridan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 09:54:21 2021 From: report at bugs.python.org (Jakub Kulik) Date: Tue, 17 Aug 2021 13:54:21 +0000 Subject: [issue44935] Solaris: enable posix_spawn in subprocess In-Reply-To: <1629208307.21.0.258573678386.issue44935@roundup.psfhosted.org> Message-ID: <1629208461.11.0.626065914673.issue44935@roundup.psfhosted.org> Change by Jakub Kulik : ---------- keywords: +patch pull_requests: +26264 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27795 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 09:58:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 17 Aug 2021 13:58:51 +0000 Subject: [issue44931] Add "bidimap" to collections library: a simple bidirectional map In-Reply-To: <1629183226.79.0.0263345990362.issue44931@roundup.psfhosted.org> Message-ID: <1629208731.6.0.977906561912.issue44931@roundup.psfhosted.org> Raymond Hettinger added the comment: This has come up several times in the past and never moved forward. Part of the reason is that the mapping API doesn't translate cleanly to bidirectional lookups and it leaves users trapped if two keys every end up needing to be mapped to the same value (i.e. libre->free and gratis->free). Mostly, folks are better-off with two separate dictionaries augmented by a single function to create the initial pairing. Also note that there are several bimaps published on PyPi but they have very low uptake. If you want to pursue this further, I suggest bringing this to python-ideas (but first scan the archives for previous discussions and scan github for cases where projects have used one of the existing implementations). ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 10:14:27 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 17 Aug 2021 14:14:27 +0000 Subject: [issue26871] Change weird behavior of PyModule_AddObject() In-Reply-To: <1461779571.56.0.960686965696.issue26871@psf.upfronthosting.co.za> Message-ID: <1629209667.19.0.0892724449179.issue26871@roundup.psfhosted.org> Petr Viktorin added the comment: Since https://github.com/python/cpython/pull/23122, there is PyModule_AddObjectRef doesn't steal a reference. PyModule_AddObject is discouraged in the docs, but not formally deprecated. (As Stefan notes, the leaks are single references in case of a module initialization failure -- the cost of using the API incorrectly is very small; requiring everyone to change their code because it was possible to misuse it is overkill.) See https://docs.python.org/3.10/c-api/module.html#c.PyModule_AddObjectRef I think this is enough to close the issue. ---------- nosy: +petr.viktorin resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 10:38:40 2021 From: report at bugs.python.org (hai shi) Date: Tue, 17 Aug 2021 14:38:40 +0000 Subject: [issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9 In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1629211120.14.0.843643119907.issue44050@roundup.psfhosted.org> hai shi added the comment: > (Note that the "def->m_size == -1" means that the module does not support sub-interpreters, because it has global state. Make Sense. It's more better and exact than my suggestion :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 10:47:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 14:47:06 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1629211626.67.0.289793547693.issue44874@roundup.psfhosted.org> Irit Katriel added the comment: Following discussion on python-dev I added a compile-time deprecation warning. With this, and after reverting PR27683 I get the warning below. The build succeeds and the tests pass. % make -s -j2 Objects/frameobject.c:622:5: warning: 'UsingDeprecatedTrashcanMacro' is deprecated [-Wdeprecated-declarations] Py_TRASHCAN_SAFE_BEGIN(f) ^ ./Include/cpython/object.h:545:9: note: expanded from macro 'Py_TRASHCAN_SAFE_BEGIN' UsingDeprecatedTrashcanMacro cond=1; \ ^ ./Include/cpython/object.h:542:1: note: 'UsingDeprecatedTrashcanMacro' has been explicitly marked deprecated here Py_DEPRECATED(3.11) typedef int UsingDeprecatedTrashcanMacro; ^ ./Include/pyport.h:509:54: note: expanded from macro 'Py_DEPRECATED' #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__)) ^ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 10:47:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 14:47:31 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1629211651.72.0.529937658581.issue44874@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 10:50:41 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 17 Aug 2021 14:50:41 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1629211841.56.0.244352254429.issue42035@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset fcd651d16fc5ac3d07dd3f57f1001a861a2e7d23 by Hai Shi in branch 'main': bpo-42035: Enhance test_get_type_name() of _testcapi (GH-27649) https://github.com/python/cpython/commit/fcd651d16fc5ac3d07dd3f57f1001a861a2e7d23 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 10:51:11 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 14:51:11 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1629211871.23.0.50035364226.issue44874@roundup.psfhosted.org> Irit Katriel added the comment: Link to python-dev thread: https://mail.python.org/archives/list/python-dev at python.org/message/LWP6MOLP5UW2TH3MROZQK4N64SX35N2B/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 10:52:23 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 17 Aug 2021 14:52:23 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1629211943.36.0.607170545725.issue42035@roundup.psfhosted.org> Petr Viktorin added the comment: Now, I wonder if we should also introduce PyType_GetModuleName for __module__, or stop and close this as fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 10:56:05 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 17 Aug 2021 14:56:05 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629212165.58.0.275861950507.issue44934@roundup.psfhosted.org> Steve Dower added the comment: Prepending is used because it makes the most recently installed version of Python the "active" one. It also ensures that a deliberate install is going to override any applications that may have put their own copy on PATH (deliberately or otherwise). There's no real mechanism for managing multiple Python entries on PATH, so it just works out better to prepend and let the latest install win. However, we also disable this option by default because it can lead to confusion like what you've experienced. The best option here is to leave it disabled and update PATH yourself (or use "py.exe" which is always on PATH), since you've got the best awareness of your environment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 10:56:03 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 17 Aug 2021 14:56:03 +0000 Subject: [issue44889] Specialize LOAD_METHOD with PEP 659 adaptive interpreter In-Reply-To: <1628685800.71.0.329647990646.issue44889@roundup.psfhosted.org> Message-ID: <1629212163.75.0.748328175717.issue44889@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 96346cb6d0593ef9ec122614347ccb053cd63433 by Ken Jin in branch 'main': bpo-44889: Specialize LOAD_METHOD with PEP 659 adaptive interpreter (GH-27722) https://github.com/python/cpython/commit/96346cb6d0593ef9ec122614347ccb053cd63433 ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 10:59:23 2021 From: report at bugs.python.org (hai shi) Date: Tue, 17 Aug 2021 14:59:23 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1629212363.54.0.156863322323.issue42035@roundup.psfhosted.org> hai shi added the comment: > Now, I wonder if we should also introduce PyType_GetModuleName for __module__, or stop and close this as fixed. IMO, I suggest to close this bpo. We can get the `tp_name` by the C API now. If there have user want get `__module__`, we can open a new bpo to discuss :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 11:26:06 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 17 Aug 2021 15:26:06 +0000 Subject: [issue44889] Specialize LOAD_METHOD with PEP 659 adaptive interpreter In-Reply-To: <1628685800.71.0.329647990646.issue44889@roundup.psfhosted.org> Message-ID: <1629213966.43.0.132681810165.issue44889@roundup.psfhosted.org> Ken Jin added the comment: Some improvements can be made (see https://github.com/python/cpython/pull/27722#issuecomment-900369714), but for the most part we're done. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 11:33:17 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 17 Aug 2021 15:33:17 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1629214397.7.0.784014448679.issue42035@roundup.psfhosted.org> Change by Petr Viktorin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 11:53:03 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 17 Aug 2021 15:53:03 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629215583.64.0.461480307943.issue44895@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset c2c857b40f226575d64e0d56a759cbd799f51e62 by Dong-hee Na in branch 'main': bpo-44895: Introduce PYTHONDUMPREFSFILE variable for refcount dumping (GH-27767) https://github.com/python/cpython/commit/c2c857b40f226575d64e0d56a759cbd799f51e62 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:07:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 16:07:56 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629216476.23.0.792886962031.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: I'm pretty sure the frame locals is involved. This leaks (note that a is being re-raised, not b): --------------------- def test_no_hang_on_context_chain_cycle2(): class A(Exception): pass class B(Exception): pass try: try: raise A() except A as _a: a = _a try: raise B() except B as _b: b = _b raise a except A: pass --------------------- But this doesn't leak: --------------------- def test_no_hang_on_context_chain_cycle2(): class A(Exception): pass class B(Exception): pass try: try: raise A() except A as _a: a = _a try: raise B() except B as _b: pass # b = _b <== not saving b in a local raise a except A: pass --------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:08:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 16:08:12 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629216492.18.0.813008982237.issue44895@roundup.psfhosted.org> Change by Irit Katriel : ---------- Removed message: https://bugs.python.org/msg399763 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:05:33 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 16:05:33 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629216333.18.0.208445058465.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: I'm pretty sure the frame locals is involved. This leaks (not a is being re-raised, not b): --------------------- def test_no_hang_on_context_chain_cycle2(): class A(Exception): pass class B(Exception): pass try: try: raise A() except A as _a: a = _a try: raise B() except B as _b: b = _b raise a except A: pass --------------------- But this doesn't leak: --------------------- def test_no_hang_on_context_chain_cycle2(): class A(Exception): pass class B(Exception): pass try: try: raise A() except A as _a: a = _a try: raise B() except B as _b: pass # b = _b <== not saving b in a local raise a except A: pass --------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:48:47 2021 From: report at bugs.python.org (Mark Roseman) Date: Tue, 17 Aug 2021 16:48:47 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629218927.3.0.195942878869.issue42560@roundup.psfhosted.org> Mark Roseman added the comment: ?ukasz, I've got a bunch of individual branches for each of those sections. What I posted the link to was a merge of all of them just for overview purposes, but the PR's will be created from the individual branches. I can start creating those now or wait a bit, whatever is easiest workflow-wise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:46:29 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 17 Aug 2021 16:46:29 +0000 Subject: [issue24955] webbrowser broken on Mac OS X when using the BROWSER variable In-Reply-To: <1440842500.82.0.168118984503.issue24955@psf.upfronthosting.co.za> Message-ID: <1629218789.26.0.520109469687.issue24955@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:50:35 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 17 Aug 2021 16:50:35 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1629219035.62.0.846886459521.issue42255@roundup.psfhosted.org> Dong-hee Na added the comment: Let's deprecate it from 3.11 and remove it at 3.12 :) ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:50:15 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 17 Aug 2021 16:50:15 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1629219015.74.0.132309248697.issue42255@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:51:37 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 17 Aug 2021 16:51:37 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629219097.73.0.233002215576.issue44698@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 4b9a2dcf19e5d13c3bc2afea2de1f65cd994c699 by Mark Dickinson in branch 'main': bpo-44698: Restore complex pow behaviour for small integral exponents (GH-27772) https://github.com/python/cpython/commit/4b9a2dcf19e5d13c3bc2afea2de1f65cd994c699 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:51:43 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 16:51:43 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629219103.41.0.655238213719.issue44698@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26266 pull_request: https://github.com/python/cpython/pull/27797 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:51:39 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 16:51:39 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629219099.64.0.297963798792.issue44698@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26265 pull_request: https://github.com/python/cpython/pull/27796 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 12:55:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Aug 2021 16:55:02 +0000 Subject: [issue44936] test_concurrent_futures: test_cancel_futures_wait_false() and test_interpreter_shutdown() failed on GHA Windows x64 Message-ID: <1629219302.53.0.957750750211.issue44936@roundup.psfhosted.org> New submission from STINNER Victor : GitHub Action Windows x64: https://github.com/python/cpython/runs/3342514542 test_concurrent_futures failed when tests are run in parallel, but then passed then re-run in verbose mode. ====================================================================== FAIL: test_cancel_futures_wait_false (test.test_concurrent_futures.ThreadPoolShutdownTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_concurrent_futures.py", line 486, in test_cancel_futures_wait_false rc, out, err = assert_python_ok('-c', """if True: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 160, in assert_python_ok return _assert_python(True, *args, **env_vars) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 145, in _assert_python res.fail(cmd_line) ^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 72, in fail raise AssertionError("Process return code is %d\n" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Process return code is 3221225477 command line: ['D:\\a\\cpython\\cpython\\PCbuild\\amd64\\python.exe', '-X', 'faulthandler', '-I', '-c', 'if True:\n from concurrent.futures import ThreadPoolExecutor\n from test.test_concurrent_futures import sleep_and_print\n if __name__ == "__main__":\n t = ThreadPoolExecutor()\n t.submit(sleep_and_print, .1, "apple")\n t.shutdown(wait=False, cancel_futures=True)\n '] stdout: --- apple --- stderr: --- --- ====================================================================== FAIL: test_interpreter_shutdown (test.test_concurrent_futures.ThreadPoolShutdownTest) 0:01:59 load avg: 5.63 [100/428/1] test_lltrace passed -- running: test_regrtest (40.5 sec) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_concurrent_futures.py", line 307, in test_interpreter_shutdown rc, out, err = assert_python_ok('-c', """if 1: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 160, in assert_python_ok return _assert_python(True, *args, **env_vars) 0:01:59 load avg: 5.63 [101/428/1] test_ucn passed -- running: test_regrtest (40.5 sec) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fetching http://www.pythontest.net/unicode/13.0.0/NamedSequences.txt ... File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 145, in _assert_python res.fail(cmd_line) ^^^^^^^^^^^^^^^^^^ File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 72, in fail raise AssertionError("Process return code is %d\n" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Process return code is 3221225477 command line: ['D:\\a\\cpython\\cpython\\PCbuild\\amd64\\python.exe', '-X', 'faulthandler', '-I', '-c', 'if 1:\n from concurrent.futures import ThreadPoolExecutor\n from time import sleep\n from test.test_concurrent_futures import sleep_and_print\n if __name__ == "__main__":\n context = \'\'\n if context == "":\n t = ThreadPoolExecutor(5)\n else:\n from multiprocessing import get_context\n context = get_context(context)\n t = ThreadPoolExecutor(5, mp_context=context)\n t.submit(sleep_and_print, 1.0, "apple")\n '] stdout: --- apple --- stderr: --- --- ---------------------------------------------------------------------- Ran 226 tests in 109.440s FAILED (failures=2, skipped=111) test test_concurrent_futures failed (...) 0:21:19 load avg: 0.02 Re-running test_concurrent_futures in verbose mode (matching: test_cancel_futures_wait_false, test_interpreter_shutdown) test_interpreter_shutdown (test.test_concurrent_futures.ProcessPoolForkProcessPoolShutdownTest) ... skipped 'require unix system' test_interpreter_shutdown (test.test_concurrent_futures.ProcessPoolForkserverProcessPoolShutdownTest) ... skipped 'require unix system' test_interpreter_shutdown (test.test_concurrent_futures.ProcessPoolSpawnProcessPoolShutdownTest) ... 1.33s ok test_cancel_futures_wait_false (test.test_concurrent_futures.ThreadPoolShutdownTest) ... 0.27s ok test_interpreter_shutdown (test.test_concurrent_futures.ThreadPoolShutdownTest) ... 1.14s ok ---------------------------------------------------------------------- Ran 5 tests in 2.756s OK (skipped=2) ---------- components: Tests messages: 399768 nosy: lukasz.langa, pablogsal, vstinner priority: normal severity: normal status: open title: test_concurrent_futures: test_cancel_futures_wait_false() and test_interpreter_shutdown() failed on GHA Windows x64 versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:00:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Aug 2021 17:00:13 +0000 Subject: [issue44937] test_regrest: test_tools_script_run_tests() failed on GHA Windows x64 Message-ID: <1629219613.26.0.318881059728.issue44937@roundup.psfhosted.org> New submission from STINNER Victor : GitHub Action Windows x64 CI: https://github.com/python/cpython/runs/3342514542 First, test_regrtest was killed after 20 minutes, while it was running test_tools_script_run_tests(). Then, re-running test_regrtest in verbose mode failed with a PermissionError. 2021-08-16T17:33:22.5453810Z 0:21:19 load avg: 0.02 [428/428/3] test_regrtest crashed (Exit code 1) 2021-08-16T17:33:22.5454836Z Timeout (0:20:00)! 2021-08-16T17:33:22.5456120Z Thread 0x00000d2c (most recent call first): 2021-08-16T17:33:22.5457237Z File "D:\a\cpython\cpython\lib\subprocess.py", line 1493 in _readerthread 2021-08-16T17:33:22.5459078Z File "D:\a\cpython\cpython\lib\threading.py", line 946 in run 2021-08-16T17:33:22.5460342Z File "D:\a\cpython\cpython\lib\threading.py", line 1009 in _bootstrap_inner 2021-08-16T17:33:22.5461365Z File "D:\a\cpython\cpython\lib\threading.py", line 966 in _bootstrap 2021-08-16T17:33:22.5461983Z 2021-08-16T17:33:22.5462583Z Thread 0x000002e8 (most recent call first): 2021-08-16T17:33:22.5464628Z File "D:\a\cpython\cpython\lib\threading.py", line 1099 in _wait_for_tstate_lock 2021-08-16T17:33:22.5466364Z File "D:\a\cpython\cpython\lib\threading.py", line 1083 in join 2021-08-16T17:33:22.5468053Z File "D:\a\cpython\cpython\lib\subprocess.py", line 1522 in _communicate 2021-08-16T17:33:22.5469685Z File "D:\a\cpython\cpython\lib\subprocess.py", line 1148 in communicate 2021-08-16T17:33:22.5471344Z File "D:\a\cpython\cpython\lib\subprocess.py", line 503 in run 2021-08-16T17:33:22.5473016Z File "D:\a\cpython\cpython\lib\test\test_regrtest.py", line 521 in run_command 2021-08-16T17:33:22.5474852Z File "D:\a\cpython\cpython\lib\test\test_regrtest.py", line 546 in run_python 2021-08-16T17:33:22.5476717Z File "D:\a\cpython\cpython\lib\test\test_regrtest.py", line 600 in run_tests 2021-08-16T17:33:22.5478416Z File "D:\a\cpython\cpython\lib\test\test_regrtest.py", line 647 in test_tools_script_run_tests 2021-08-16T17:33:22.5480110Z File "D:\a\cpython\cpython\lib\unittest\case.py", line 549 in _callTestMethod 2021-08-16T17:33:22.5481748Z File "D:\a\cpython\cpython\lib\unittest\case.py", line 592 in run 2021-08-16T17:33:22.5483362Z File "D:\a\cpython\cpython\lib\unittest\case.py", line 652 in __call__ 2021-08-16T17:33:22.5484975Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 122 in run 2021-08-16T17:33:22.5486506Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 84 in __call__ 2021-08-16T17:33:22.5488012Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 122 in run 2021-08-16T17:33:22.5489316Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 84 in __call__ 2021-08-16T17:33:22.5490786Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 122 in run 2021-08-16T17:33:22.5492556Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 84 in __call__ 2021-08-16T17:33:22.5494071Z File "D:\a\cpython\cpython\lib\unittest\runner.py", line 176 in run 2021-08-16T17:33:22.5495666Z File "D:\a\cpython\cpython\lib\test\support\__init__.py", line 997 in _run_suite 2021-08-16T17:33:22.5496563Z test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_epoll 2021-08-16T17:33:22.5497530Z File "D:\a\cpython\cpython\lib\test\support\__init__.py", line 1122 in run_unittest 2021-08-16T17:33:22.5498484Z test_fcntl test_fork1 test_gdb test_grp test_ioctl test_kqueue 2021-08-16T17:33:22.5499441Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 261 in _test_module 2021-08-16T17:33:22.5500545Z test_multiprocessing_fork test_multiprocessing_forkserver test_nis 2021-08-16T17:33:22.5501639Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 297 in _runtest_inner2 2021-08-16T17:33:22.5502797Z test_openpty test_ossaudiodev test_pipes test_poll test_posix 2021-08-16T17:33:22.5503867Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 335 in _runtest_inner 2021-08-16T17:33:22.5504886Z test_pty test_pwd test_readline test_resource test_spwd 2021-08-16T17:33:22.5505946Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 202 in _runtest 2021-08-16T17:33:22.5506925Z test_syslog test_threadsignals test_wait3 test_wait4 2021-08-16T17:33:22.5507892Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 245 in runtest 2021-08-16T17:33:22.5508801Z test_xxtestfuzz test_zipfile64 2021-08-16T17:33:22.5509740Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest_mp.py", line 83 in run_tests_worker 2021-08-16T17:33:22.5511140Z File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 675 in _main 2021-08-16T17:33:22.5512662Z File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 655 in main 2021-08-16T17:33:22.5513586Z test_asyncio test_concurrent_futures test_regrtest 2021-08-16T17:33:22.5514516Z File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 733 in main 2021-08-16T17:33:22.5515982Z File "D:\a\cpython\cpython\lib\test\regrtest.py", line 43 in _main 2021-08-16T17:33:22.5517908Z File "D:\a\cpython\cpython\lib\test\regrtest.py", line 47 in 2021-08-16T17:33:22.5520342Z File "D:\a\cpython\cpython\lib\runpy.py", line 86 in _run_code 2021-08-16T17:33:22.5521322Z File "D:\a\cpython\cpython\lib\runpy.py", line 196 in _run_module_as_main (...) 2021-08-16T17:33:25.6698180Z 0:21:22 load avg: 0.01 Re-running test_regrtest in verbose mode 2021-08-16T17:33:25.7418249Z Traceback (most recent call last): 2021-08-16T17:33:25.7419935Z File "D:\a\cpython\cpython\lib\test\support\os_helper.py", line 396, in temp_dir 2021-08-16T17:33:25.7420863Z yield path 2021-08-16T17:33:25.7421674Z ^^^^^^^^^^ 2021-08-16T17:33:25.7422399Z File "D:\a\cpython\cpython\lib\test\support\os_helper.py", line 449, in temp_cwd 2021-08-16T17:33:25.7433248Z yield cwd_dir 2021-08-16T17:33:25.7434246Z ^^^^^^^^^^^^^ 2021-08-16T17:33:25.7435032Z File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 655, in main 2021-08-16T17:33:25.7435868Z self._main(tests, kwargs) 2021-08-16T17:33:25.7436399Z ^^^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7437160Z File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 728, in _main 2021-08-16T17:33:25.7438083Z sys.exit(0) 2021-08-16T17:33:25.7438591Z ^^^^^^^^^^^ 2021-08-16T17:33:25.7439133Z SystemExit: 0 2021-08-16T17:33:25.7439483Z 2021-08-16T17:33:25.7440281Z During handling of the above exception, another exception occurred: 2021-08-16T17:33:25.7440906Z 2021-08-16T17:33:25.7441466Z Traceback (most recent call last): 2021-08-16T17:33:25.7442312Z File "D:\a\cpython\cpython\lib\test\support\__init__.py", line 191, in _force_run 2021-08-16T17:33:25.7443113Z return func(*args) 2021-08-16T17:33:25.7443672Z ^^^^^^^^^^^ 2021-08-16T17:33:25.7446594Z PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\a\\cpython\\cpython\\build\\test_python_1976?\\test_python_worker_3504?' 2021-08-16T17:33:25.7447646Z 2021-08-16T17:33:25.7448449Z During handling of the above exception, another exception occurred: 2021-08-16T17:33:25.7449020Z 2021-08-16T17:33:25.7449617Z Traceback (most recent call last): 2021-08-16T17:33:25.7450443Z File "D:\a\cpython\cpython\lib\runpy.py", line 196, in _run_module_as_main 2021-08-16T17:33:25.7451253Z return _run_code(code, main_globals, None, 2021-08-16T17:33:25.7451964Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7452625Z File "D:\a\cpython\cpython\lib\runpy.py", line 86, in _run_code 2021-08-16T17:33:25.7453378Z exec(code, run_globals) 2021-08-16T17:33:25.7455186Z ^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7455860Z File "D:\a\cpython\cpython\lib\test\__main__.py", line 2, in 2021-08-16T17:33:25.7457168Z main() 2021-08-16T17:33:25.7457604Z ^^^^^^ 2021-08-16T17:33:25.7458336Z File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 733, in main 2021-08-16T17:33:25.7459194Z Regrtest().main(tests=tests, **kwargs) 2021-08-16T17:33:25.7459769Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7460528Z File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 649, in main 2021-08-16T17:33:25.7461374Z with os_helper.temp_cwd(test_cwd, quiet=True): 2021-08-16T17:33:25.7462043Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7462787Z File "D:\a\cpython\cpython\lib\contextlib.py", line 153, in __exit__ 2021-08-16T17:33:25.7463678Z self.gen.throw(typ, value, traceback) 2021-08-16T17:33:25.7464729Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7465461Z File "D:\a\cpython\cpython\lib\test\support\os_helper.py", line 447, in temp_cwd 2021-08-16T17:33:25.7466377Z with temp_dir(path=name, quiet=quiet) as temp_path: 2021-08-16T17:33:25.7467243Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7467944Z File "D:\a\cpython\cpython\lib\contextlib.py", line 153, in __exit__ 2021-08-16T17:33:25.7468797Z self.gen.throw(typ, value, traceback) 2021-08-16T17:33:25.7469408Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7470182Z File "D:\a\cpython\cpython\lib\test\support\os_helper.py", line 401, in temp_dir 2021-08-16T17:33:25.7471114Z rmtree(path) 2021-08-16T17:33:25.7471591Z ^^^^^^^^^^^^ 2021-08-16T17:33:25.7472342Z File "D:\a\cpython\cpython\lib\test\support\os_helper.py", line 358, in rmtree 2021-08-16T17:33:25.7473077Z _rmtree(path) 2021-08-16T17:33:25.7473676Z ^^^^^^^^^^^^^ 2021-08-16T17:33:25.7474441Z File "D:\a\cpython\cpython\lib\test\support\os_helper.py", line 301, in _rmtree 2021-08-16T17:33:25.7475690Z _waitfor(_rmtree_inner, path, waitall=True) 2021-08-16T17:33:25.7476344Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7477086Z File "D:\a\cpython\cpython\lib\test\support\os_helper.py", line 246, in _waitfor 2021-08-16T17:33:25.7477875Z func(pathname) 2021-08-16T17:33:25.7478398Z ^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7479130Z File "D:\a\cpython\cpython\lib\test\support\os_helper.py", line 298, in _rmtree_inner 2021-08-16T17:33:25.7480240Z _force_run(fullname, os.rmdir, fullname) 2021-08-16T17:33:25.7480851Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:33:25.7481603Z File "D:\a\cpython\cpython\lib\test\support\__init__.py", line 197, in _force_run 2021-08-16T17:33:25.7482298Z 2021-08-16T17:33:25.7482896Z return func(*args) 2021-08-16T17:33:25.7483533Z ---------------------------------------------------------------------- 2021-08-16T17:33:25.7484530Z ^^^^^^^^^^^ 2021-08-16T17:33:25.7484753Z 2021-08-16T17:33:25.7486229Z PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\a\\cpython\\cpython\\build\\test_python_1976?\\test_python_worker_3504?' 2021-08-16T17:33:25.7487341Z Ran 0 tests in 0.000s ---------- components: Tests messages: 399769 nosy: vstinner priority: normal severity: normal status: open title: test_regrest: test_tools_script_run_tests() failed on GHA Windows x64 versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:01:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Aug 2021 17:01:50 +0000 Subject: [issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure In-Reply-To: <1598923449.65.0.107960415995.issue41682@roundup.psfhosted.org> Message-ID: <1629219710.63.0.772707678241.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: Recent failure on GHA Windows x64: https://github.com/python/cpython/runs/3342514542 2021-08-16T17:19:58.4338049Z ====================================================================== 2021-08-16T17:19:58.4339129Z FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests) 2021-08-16T17:19:58.4340315Z ---------------------------------------------------------------------- 2021-08-16T17:19:58.4340937Z Traceback (most recent call last): 2021-08-16T17:19:58.4341846Z File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving 2021-08-16T17:19:58.4342849Z with self.assertRaises(ConnectionError): 2021-08-16T17:19:58.4343398Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2021-08-16T17:19:58.4343982Z AssertionError: ConnectionError not raised ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:02:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Aug 2021 17:02:30 +0000 Subject: [issue44937] test_regrest: test_tools_script_run_tests() failed on GHA Windows x64 In-Reply-To: <1629219613.26.0.318881059728.issue44937@roundup.psfhosted.org> Message-ID: <1629219750.64.0.31728942717.issue44937@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +erlendaasland, lukasz.langa, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:02:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Aug 2021 17:02:39 +0000 Subject: [issue44936] test_concurrent_futures: test_cancel_futures_wait_false() and test_interpreter_shutdown() failed on GHA Windows x64 In-Reply-To: <1629219302.53.0.957750750211.issue44936@roundup.psfhosted.org> Message-ID: <1629219759.45.0.240107233888.issue44936@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:05:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Aug 2021 17:05:07 +0000 Subject: [issue44936] test_concurrent_futures: test_cancel_futures_wait_false() and test_interpreter_shutdown() failed on GHA Windows x64 In-Reply-To: <1629219302.53.0.957750750211.issue44936@roundup.psfhosted.org> Message-ID: <1629219907.71.0.642175771412.issue44936@roundup.psfhosted.org> STINNER Victor added the comment: > AssertionError: Process return code is 3221225477 > (...) > AssertionError: Process return code is 3221225477 This is STATUS_ACCESS_VIOLATION: the process crashed, not good :-( Moreover, even if the process was run with -X faulthandler, stderr is empty :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:11:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Aug 2021 17:11:54 +0000 Subject: [issue44937] test_regrest: test_tools_script_run_tests() failed on GHA Windows x64 In-Reply-To: <1629219613.26.0.318881059728.issue44937@roundup.psfhosted.org> Message-ID: <1629220314.1.0.737694329199.issue44937@roundup.psfhosted.org> STINNER Victor added the comment: In another commit of the same PR 27774, I don't even see test_regrtest in the list of the "10 slowest tests", so test_regrtest took less than "test_socket: 46.4 sec". If test_regrtest is killed after 20 minutes, it's likely that it was stuck somewhere. test_tools_script_run_tests() runs Tools/scripts/run_tests.py with command line arguments. In the past, I see many issues with PermissionError: something prevents to delete a directory on Windows. I never understood what. regrtest creates a temporary directory, run a process in this directory, and then removes the directory. Here, something is stuck. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:16:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 17 Aug 2021 17:16:36 +0000 Subject: [issue44936] test_concurrent_futures: test_cancel_futures_wait_false() and test_interpreter_shutdown() failed on GHA Windows x64 In-Reply-To: <1629219302.53.0.957750750211.issue44936@roundup.psfhosted.org> Message-ID: <1629220596.6.0.778201316409.issue44936@roundup.psfhosted.org> STINNER Victor added the comment: The machine was busy when test_concurrent_futures: system load of 5.59. 2021-08-16T17:14:01.3805500Z 0:01:58 load avg: 5.59 [ 93/428/1] test_concurrent_futures failed (2 failures) (1 min 49 sec) -- running: test_regrtest (39.2 sec) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:32:19 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 17 Aug 2021 17:32:19 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629221539.57.0.760360663432.issue44926@roundup.psfhosted.org> Guido van Rossum added the comment: Maximilian, I think your last analysis is spot on. The problem is specific to type aliases and how at runtime they do not carry information about scope with them. The current type alias syntax (both the original form and the form using "x: TypeAlias = ...") was designed for static analysis only. I suppose we could fix cases like A = List["Foo"] but we can't fix for example A: TypeAlias = "Foo" since at runtime this just ends up creating a variable A whose value is the string "Foo", and if you import and use that in another module, all you have is the value "Foo". I think we have to accept this as a limitation of type aliases when combined with runtime access to types (it's not just get_type_hints(), but any mechanism that introspects types at runtime). I'm reluctant to fix the List["Foo"] case, if only because that case is being phased out in favor of list["Foo"] anyway, and because it depends on typing.List being special -- we can't do the same kind of fixup for user-defined classes (e.g. C["Foo"]). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:38:12 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 17 Aug 2021 17:38:12 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629221892.68.0.714772939515.issue44698@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 3f81e9628f6f104c103d0e38adb84c51e5261626 by Miss Islington (bot) in branch '3.10': bpo-44698: Restore complex pow behaviour for small integral exponents (GH-27772) (GH-27796) https://github.com/python/cpython/commit/3f81e9628f6f104c103d0e38adb84c51e5261626 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:38:49 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 17 Aug 2021 17:38:49 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629221929.6.0.891057720751.issue44698@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset beb3a835dae3cd940b93e7caa32450890c4cd539 by Miss Islington (bot) in branch '3.9': bpo-44698: Restore complex pow behaviour for small integral exponents (GH-27772) (GH-27797) https://github.com/python/cpython/commit/beb3a835dae3cd940b93e7caa32450890c4cd539 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:44:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Aug 2021 17:44:23 +0000 Subject: [issue44938] Expose PyErr_ChainExceptions in the stable API Message-ID: <1629222263.76.0.471437987741.issue44938@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Currently, exception chaining in the C-API must be done by hand. This is a painstaking process that involves several steps and is very easy to do incorrectly. We currently have a private function: _PyErr_ChainExceptions that does this job. Given that exception chaining is a very fundamental operation, this functionality must be exposed in the stable C-API ---------- messages: 399777 nosy: pablogsal priority: normal severity: normal status: open title: Expose PyErr_ChainExceptions in the stable API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 13:45:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Aug 2021 17:45:42 +0000 Subject: [issue44938] Expose PyErr_ChainExceptions in the stable API In-Reply-To: <1629222263.76.0.471437987741.issue44938@roundup.psfhosted.org> Message-ID: <1629222342.32.0.719764599718.issue44938@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +26267 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27799 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 14:10:03 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 17 Aug 2021 18:10:03 +0000 Subject: [issue44935] Solaris: enable posix_spawn in subprocess In-Reply-To: <1629208307.21.0.258573678386.issue44935@roundup.psfhosted.org> Message-ID: <1629223803.52.0.90085094536.issue44935@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset b1930bf75f276cd7ca08c4455298128d89adf7d1 by Jakub Kul?k in branch 'main': bpo-44935: enable posix_spawn() on Solaris (GH-27795) https://github.com/python/cpython/commit/b1930bf75f276cd7ca08c4455298128d89adf7d1 ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 14:10:36 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 18:10:36 +0000 Subject: [issue44935] Solaris: enable posix_spawn in subprocess In-Reply-To: <1629208307.21.0.258573678386.issue44935@roundup.psfhosted.org> Message-ID: <1629223836.94.0.893816586038.issue44935@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26268 pull_request: https://github.com/python/cpython/pull/27800 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 14:22:58 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 17 Aug 2021 18:22:58 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1629224578.56.0.382895316468.issue44698@roundup.psfhosted.org> Mark Dickinson added the comment: Re-closing; we should be good now. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 14:33:42 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 18:33:42 +0000 Subject: [issue44935] Solaris: enable posix_spawn in subprocess In-Reply-To: <1629208307.21.0.258573678386.issue44935@roundup.psfhosted.org> Message-ID: <1629225222.53.0.148793461509.issue44935@roundup.psfhosted.org> miss-islington added the comment: New changeset 826e059bb9b42e17bef2186938a2bd3f33610e69 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44935: enable posix_spawn() on Solaris (GH-27795) (GH-27800) https://github.com/python/cpython/commit/826e059bb9b42e17bef2186938a2bd3f33610e69 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 14:55:09 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 17 Aug 2021 18:55:09 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629226509.47.0.613195499609.issue44895@roundup.psfhosted.org> Guido van Rossum added the comment: So there's code generated for an except clause with a variable that clears the variable at the end, so that this works: try: ... except Exception as err: ... print(err) # Should fail, since err was cleared when the except clause exited. Maybe there's a bug here, either in the runtime or in the way that the code is generated? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 15:04:22 2021 From: report at bugs.python.org (E. Paine) Date: Tue, 17 Aug 2021 19:04:22 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629227062.9.0.919313481527.issue42560@roundup.psfhosted.org> E. Paine added the comment: > In particular, you added OS-specific info I also deemed this very useful information. The issue is that it is not documented in the man pages and so those values are pulled straight from the source code. We would need to decide whether we keep such information in our docs, which is subject to change without warning. > Did you exactly copy the tk manual wordings or rewrite in your own words? All of the text was originally copied from the man pages. I have done a reasonable amount of rewording, reformatting and elaborating. > Do you intend to contribute what you wrote? If we conclude a complete doc is the way to go, I would finish documenting the canvas widget, make relevant reformatting changes (such as moving common widget options) and then open a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 15:09:23 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 17 Aug 2021 19:09:23 +0000 Subject: [issue44932] `issubclass` and `isinstance` doesn't check for all 2nd argument types In-Reply-To: <1629185162.39.0.804391329839.issue44932@roundup.psfhosted.org> Message-ID: <1629227363.98.0.703575620519.issue44932@roundup.psfhosted.org> Guido van Rossum added the comment: Agreed. Thanks, Serhiy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 15:16:12 2021 From: report at bugs.python.org (Antony Lee) Date: Tue, 17 Aug 2021 19:16:12 +0000 Subject: [issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default In-Reply-To: <1575327804.72.0.272027136625.issue38956@roundup.psfhosted.org> Message-ID: <1629227772.72.0.953192654885.issue38956@roundup.psfhosted.org> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 15:19:36 2021 From: report at bugs.python.org (Achraf Merzouki) Date: Tue, 17 Aug 2021 19:19:36 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629227976.02.0.99530503861.issue36384@roundup.psfhosted.org> Achraf Merzouki added the comment: Can we backport the security fix from this issue https://bugs.python.org/issue36384#msg392684 to version 3.8 The comment explicitly says that it was decided to not include in 3.8, I am not sure this is best, since it prevents using 3.8 because of this open vulnerability, and it does not seem to be a breaking change or too hard to port. ---------- components: -Documentation nosy: +achraf.merzouki versions: +Python 3.8 -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 16:02:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 20:02:35 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629230555.34.0.745225508915.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: It's probably not that because this leaks too, and it skips the cleanup: try: raise B() except B: b = sys.exc_info()[1] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 16:04:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 20:04:47 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629230687.68.0.854495000181.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: But this makes it not leak again, so now we know it's the traceback: try: raise B() except B: b = sys.exc_info()[1] b.__traceback__ = None ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 16:11:12 2021 From: report at bugs.python.org (Leon Mintz) Date: Tue, 17 Aug 2021 20:11:12 +0000 Subject: [issue44939] proposal: add support for regex in Literal type hint Message-ID: <1629231072.16.0.414725051443.issue44939@roundup.psfhosted.org> New submission from Leon Mintz : Could typing.Literal (or analogous) accept a regex pattern to match against? For example, if I want a duration string, duration: str # allowed syntax: 3s, 3m, 3h etc. vs duration: LiteralPattern['[0-9]+[smh]'] ---------- messages: 399787 nosy: leon.mintz priority: normal severity: normal status: open title: proposal: add support for regex in Literal type hint _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 16:13:46 2021 From: report at bugs.python.org (Roundup Robot) Date: Tue, 17 Aug 2021 20:13:46 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629231226.41.0.856299346397.issue36384@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 17.0 -> 18.0 pull_requests: +26269 pull_request: https://github.com/python/cpython/pull/27801 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 16:20:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Aug 2021 20:20:20 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629231620.01.0.840787888027.issue44895@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am still amazed that I cannot reproduce the leaks on my machine. Maybe I am missing some steps. Could you outline how are you reproducing the leaks? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 16:21:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Aug 2021 20:21:45 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629231705.19.0.187743927615.issue44895@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > But this makes it not leak again, so now we know it's the traceback: The traceback is a very heavy gc object because it contains the frames, and in the locals of the frame is the traceback itself via the exception. This is a well known heavy cycle, but the gc should take care of it if the cycle becomes isolated ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 16:51:15 2021 From: report at bugs.python.org (Marco Sulla) Date: Tue, 17 Aug 2021 20:51:15 +0000 Subject: [issue44921] dict subclassing is slow In-Reply-To: <1629058226.73.0.105626301201.issue44921@roundup.psfhosted.org> Message-ID: <1629233475.77.0.013769275566.issue44921@roundup.psfhosted.org> Marco Sulla added the comment: Since my knowledge of this is very poor, I informed Monica about the issue. I'm quite sure that if there's a way to turn lemons into lemonade :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 16:53:16 2021 From: report at bugs.python.org (Marco Sulla) Date: Tue, 17 Aug 2021 20:53:16 +0000 Subject: [issue44921] dict subclassing is slow In-Reply-To: <1629058226.73.0.105626301201.issue44921@roundup.psfhosted.org> Message-ID: <1629233596.51.0.234585293949.issue44921@roundup.psfhosted.org> Marco Sulla added the comment: .... I not finished my phrase. I'm sure that if there's a way to turn lemons into lemonade, she is **MUCH** more skilled than me to find one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 16:59:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 20:59:10 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629233950.61.0.424401306301.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: This doesn't leak: try: raise B() except B: tb = sys.exc_info()[1].__traceback__ So this isn't about the traceback being part of the cycle. The B() needs to be there too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 16:59:29 2021 From: report at bugs.python.org (Rondevous) Date: Tue, 17 Aug 2021 20:59:29 +0000 Subject: [issue42448] re.findall have different match result against re.search or re.sub In-Reply-To: <1606159857.65.0.962689074974.issue42448@roundup.psfhosted.org> Message-ID: <1629233969.0.0.61155218116.issue42448@roundup.psfhosted.org> Rondevous added the comment: I was frustrated for hours when I couldn't figure out why this won't match: >>> re.findall(r'(foo)?bar|cool', 'cool') Now I know, I have to make this change: (?:foo) But this isn't obvious. Should it be mentioned in the docs of re.findall() to use (?:...) for non-capturing groups? ---------- nosy: +rondevous _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 17:07:14 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 17 Aug 2021 21:07:14 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629234434.82.0.155486253412.issue44895@roundup.psfhosted.org> Mark Shannon added the comment: refleak.py seems to run forever for me. Got bored after 6000 iterations. Which O/S and configure options are needed for refleak.py to fail? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 17:11:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 21:11:21 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629234681.16.0.643266487847.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: I'm using a mac. It typically fails within at most 10-20 iterations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 17:16:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 17 Aug 2021 21:16:31 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629234991.79.0.810472738411.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: > Could you outline how are you reproducing the leaks? Sorry I missed this. Just run the script: iritkatriel at Irits-MBP cpython-1 % ./python.exe refleak.py -- 1 -- beginning 6 repetitions 123456 ...... -- 2 -- beginning 6 repetitions 123456 ...... -- 3 -- beginning 6 repetitions 123456 ...... test leaked [2, 4, 2] references, sum=8 test leaked [2, 4, 2] memory blocks, sum=8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 17:21:42 2021 From: report at bugs.python.org (Kevin Shweh) Date: Tue, 17 Aug 2021 21:21:42 +0000 Subject: [issue44921] dict subclassing is slow In-Reply-To: <1629058226.73.0.105626301201.issue44921@roundup.psfhosted.org> Message-ID: <1629235302.23.0.150006438685.issue44921@roundup.psfhosted.org> Kevin Shweh added the comment: Of course it's reasonable to support dict subclasses. We already have a bunch of dict subclasses in the standard library, like collections.defaultdict and collections.Counter, and collections.Counter is significantly slower than it could be because of this issue. (collections.defaultdict seems to be unaffected due to differences between classes implemented in C and Python.) dict.__getitem__ even has dedicated support for a __missing__ hook, which is only useful for subclasses. ---------- nosy: +Kevin Shweh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 18:22:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 22:22:15 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629238935.66.0.498457040547.issue36384@roundup.psfhosted.org> ?ukasz Langa added the comment: > it prevents using 3.8 because of this open vulnerability What do you mean by this? Our understanding is that this is a low-severity CVE because in order for this to be a vulnerability, you'd have to have both: 1. user access to IP address input; and 2. control over two addresses sharing numerical representation with leading zeroes: the first resolving when leading zeroes are treated as octal numbers; the second resolving when leading zeroes are treated as decimal numbers. Access to both then allows you at best to circumvent IP address-based access control or denial of service. However, access to just 1. allows you to input any IP address to achieve the same goals. Hence low-severity. > it does not seem to be a breaking change It is a bona fide breaking change. Any IP address configuration saved in files or databases which might have used leading zeroes would be rejected by 3.8.12. The same was true for 3.9.5 but since this release series has much higher exposure (still receiving binary installers and regular-cadence bugfixes), it was less controversial to include it. If you still feel this ought to be fixed in 3.8, please elaborate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 18:24:06 2021 From: report at bugs.python.org (Rondevous) Date: Tue, 17 Aug 2021 22:24:06 +0000 Subject: [issue44940] Hint the use of non-capturing group in re.findall() documentation Message-ID: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> New submission from Rondevous : Can it please be hinted in the docs of re.findall to use (?:...) for non-capturing groups? >>> re.findall('(foo)?bar|cool', 'cool') [''] >>> ### I expected the result: ['cool'] After hours of frustration, I learnt that I should use a non-capturing group (?:foo) in the pattern. This was not obvious. P.S. Making the groups non-capturing in such a pattern is not needed in javascript (as tested on regexr.com); could this be an issue with the | operator in re.findall? ---------- assignee: docs at python components: Documentation messages: 399799 nosy: docs at python, rondevous priority: normal severity: normal status: open title: Hint the use of non-capturing group in re.findall() documentation type: enhancement versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 18:34:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 17 Aug 2021 22:34:16 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629239656.87.0.684320542025.issue44895@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: There is some timing-related race condition at hand because I tried in a Linux machine and a MacBook Pro (intel) laptop and I wasn't able to reproduce after 20 min of the script running :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 18:51:52 2021 From: report at bugs.python.org (Achraf Merzouki) Date: Tue, 17 Aug 2021 22:51:52 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629240712.24.0.864349377206.issue36384@roundup.psfhosted.org> Achraf Merzouki added the comment: >> it prevents using 3.8 because of this open vulnerability >What do you mean by this? >Our understanding is that this is a low-severity CVE because in order for this to be a vulnerability, you'd have to have both: >1. user access to IP address input; and >2. control over two addresses sharing numerical representation with leading zeroes: the first resolving when leading zeroes are treated as octal numbers; the second resolving when leading zeroes are treated as decimal numbers. >Access to both then allows you at best to circumvent IP address-based access control or denial of service. However, access to just 1. allows you to input any IP address to achieve the same goals. >Hence low-severity. Even though I agree with you assessment on the root cause of the issue itself, it is listed as critical in https://nvd.nist.gov/vuln/detail/CVE-2021-29921, which means most commercial scan tools will also flag python 3.8 as critical, and this could prevent users from going with python 3.8 on production. (our case too) >> it does not seem to be a breaking change >It is a bona fide breaking change. Any IP address configuration saved in files or databases which might have used leading zeroes would be rejected by 3.8.12. The same was true for 3.9.5 but since this release series has much higher exposure (still receiving binary installers and regular-cadence bugfixes), it was less controversial to include it. >If you still feel this ought to be fixed in 3.8, please elaborate. IMHO I still think this should be solved in 3.8, otherwise there is really no other alternative but to upgrade to python 3.9 which is a hassle, since all 3.8.x are "critically vulnerable", had the CVE in https://nvd.nist.gov/vuln/detail/CVE-2021-29921 not been marked as critical, then we could have used python 3.8 knowing the two conditions you mentioned earlier. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 18:55:15 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 22:55:15 +0000 Subject: [issue44508] asyncio: document failure mode for loop.call_soon_threadsafe In-Reply-To: <1624622415.86.0.725571040455.issue44508@roundup.psfhosted.org> Message-ID: <1629240915.77.0.751563100194.issue44508@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26271 pull_request: https://github.com/python/cpython/pull/27805 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 18:55:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 22:55:08 +0000 Subject: [issue44508] asyncio: document failure mode for loop.call_soon_threadsafe In-Reply-To: <1624622415.86.0.725571040455.issue44508@roundup.psfhosted.org> Message-ID: <1629240908.47.0.91219282166.issue44508@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 3240bc62f4e0afa09964f3afc845697f0a0806b9 by meowmeowmeowcat in branch 'main': bpo-44508: [Doc] Document failure mode for loop.call_soon_threadsafe (GH-27688) https://github.com/python/cpython/commit/3240bc62f4e0afa09964f3afc845697f0a0806b9 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 18:55:11 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 22:55:11 +0000 Subject: [issue44508] asyncio: document failure mode for loop.call_soon_threadsafe In-Reply-To: <1624622415.86.0.725571040455.issue44508@roundup.psfhosted.org> Message-ID: <1629240911.88.0.566439052623.issue44508@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26270 pull_request: https://github.com/python/cpython/pull/27804 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 18:59:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 22:59:24 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629241164.64.0.192954970916.issue36384@roundup.psfhosted.org> ?ukasz Langa added the comment: I was unaware of the "CRITICAL" base score assigned by NIST to this. Alright, let's port this back then. There are a few things the PR will need. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 19:08:43 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 17 Aug 2021 23:08:43 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629241723.03.0.2881292857.issue36384@roundup.psfhosted.org> Christian Heimes added the comment: "CRITICAL" is a ridiculous high assessment for this bug. Somebody ticked all the scary boxes in the CVSS form like "total loss of control". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 19:13:39 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 17 Aug 2021 23:13:39 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629242019.89.0.168405110886.issue36384@roundup.psfhosted.org> Christian Heimes added the comment: The CVE was rated https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H&version=3.1, which is equivalent to a RCE with authentication bypass. I would rate the issue https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N&version=3.1, maybe A:L. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 19:17:32 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 17 Aug 2021 23:17:32 +0000 Subject: [issue44508] asyncio: document failure mode for loop.call_soon_threadsafe In-Reply-To: <1624622415.86.0.725571040455.issue44508@roundup.psfhosted.org> Message-ID: <1629242252.58.0.42242134335.issue44508@roundup.psfhosted.org> miss-islington added the comment: New changeset bbb10761b64095425f7f8dcb3bc1f0d8bdee528a by Miss Islington (bot) in branch '3.10': bpo-44508: [Doc] Document failure mode for loop.call_soon_threadsafe (GH-27688) https://github.com/python/cpython/commit/bbb10761b64095425f7f8dcb3bc1f0d8bdee528a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 19:18:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 23:18:26 +0000 Subject: [issue44508] asyncio: document failure mode for loop.call_soon_threadsafe In-Reply-To: <1624622415.86.0.725571040455.issue44508@roundup.psfhosted.org> Message-ID: <1629242306.38.0.118475701903.issue44508@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e2320c6a34d44a0efa7ecc693c3a6215014b7b6e by Miss Islington (bot) in branch '3.9': bpo-44508: [Doc] Document failure mode for loop.call_soon_threadsafe (GH-27688) (GH-27805) https://github.com/python/cpython/commit/e2320c6a34d44a0efa7ecc693c3a6215014b7b6e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 19:19:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 23:19:05 +0000 Subject: [issue44508] asyncio: document failure mode for loop.call_soon_threadsafe In-Reply-To: <1624622415.86.0.725571040455.issue44508@roundup.psfhosted.org> Message-ID: <1629242345.53.0.864519638861.issue44508@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for reporting, Mark, and for the patch, meowmeowcat! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 19:40:07 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 17 Aug 2021 23:40:07 +0000 Subject: [issue44935] Solaris: enable posix_spawn in subprocess In-Reply-To: <1629208307.21.0.258573678386.issue44935@roundup.psfhosted.org> Message-ID: <1629243607.13.0.416190315923.issue44935@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 19:46:43 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 17 Aug 2021 23:46:43 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629244003.5.0.74953173648.issue36384@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 03dd89d62413c4a92831ed1b36e2ae8983bcb2d4 by achraf-mer in branch '3.8': [3.8] bpo-36384: Leading zeros in IPv4 addresses are no longer tolerated (GH-25099) (GH-27801) https://github.com/python/cpython/commit/03dd89d62413c4a92831ed1b36e2ae8983bcb2d4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 20:13:16 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 18 Aug 2021 00:13:16 +0000 Subject: [issue44899] tarfile: add support for creating an archive of potentially changing files In-Reply-To: <1628768592.88.0.0306570478346.issue44899@roundup.psfhosted.org> Message-ID: <1629245596.65.0.824190891821.issue44899@roundup.psfhosted.org> Change by Ethan Furman : ---------- nosy: +ethan.furman versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 20:37:40 2021 From: report at bugs.python.org (Ryan Mast) Date: Wed, 18 Aug 2021 00:37:40 +0000 Subject: [issue30924] RPM build doc_files needs files separated into separate lines In-Reply-To: <1499968200.32.0.508510692032.issue30924@psf.upfronthosting.co.za> Message-ID: <1629247060.96.0.664575359702.issue30924@roundup.psfhosted.org> Ryan Mast added the comment: Should this be closed? It looks like the PR is only changing a file in distutils, and according to https://bugs.python.org/issue30925#msg386350 distutils is deprecated and only release blocking issues will be considered. ---------- nosy: +rmast _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 20:42:06 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 18 Aug 2021 00:42:06 +0000 Subject: [issue39039] zlib.error with tarfile.open In-Reply-To: <1576252848.69.0.760468308355.issue39039@roundup.psfhosted.org> Message-ID: <1629247326.03.0.00286747610253.issue39039@roundup.psfhosted.org> Jack DeVries added the comment: @jvoisin I am able to reproduce the problem when I download your script, but I am having a hard time reproducing it by passing corrupt archives to `tarfile.open`. How exactly was this file corrupted? I am trying to figure out if there are any similar implementation leaks / poor error messages in similar scenarios so I can do my best to patch them all. You can see the reproduction scripts I am using here to get a better idea of what I have been trying. Be forewarned, they are pretty gnarly! https://gist.github.com/jdevries3133/acbb5ba2a19093d3bcc214733ef85e5a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 20:43:20 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Wed, 18 Aug 2021 00:43:20 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1629247400.68.0.614198608055.issue33140@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: If this function were to be implemented on Windows would the preferred approach be the one described in the initial message for this issue of creating a Windows `os.set_owner` function that uses the appropriate Windows API calls to change owner/group settings, and then using that for Windows in the `shutil.chown` function? ---------- nosy: +rmast _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 20:51:09 2021 From: report at bugs.python.org (jakirkham) Date: Wed, 18 Aug 2021 00:51:09 +0000 Subject: [issue28646] Using a read-only buffer. In-Reply-To: <1478664292.05.0.145705220958.issue28646@psf.upfronthosting.co.za> Message-ID: <1629247869.57.0.983122712082.issue28646@roundup.psfhosted.org> Change by jakirkham : ---------- nosy: +jakirkham _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 21:01:04 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Wed, 18 Aug 2021 01:01:04 +0000 Subject: [issue24905] Allow incremental I/O to blobs in sqlite3 In-Reply-To: <1440144321.97.0.0781853247945.issue24905@psf.upfronthosting.co.za> Message-ID: <1629248464.13.0.925609266915.issue24905@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: It looks like this has a PR that just needs rebasing, then it will be ready for another review. ---------- nosy: +rmast _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 22:06:42 2021 From: report at bugs.python.org (Finn Mason) Date: Wed, 18 Aug 2021 02:06:42 +0000 Subject: [issue44941] Add check_methods function to standard library Message-ID: <1629252402.72.0.293302326241.issue44941@roundup.psfhosted.org> New submission from Finn Mason : In _collections_abc.py is a private function titled `_check_methods`. It takes a class and a number of method names (as strings), checks if the class has all of the methods, and returns NotImplemented if any are missing. The code is below: ``` def _check_methods(C, *methods): mro = C.__mro__ for method in methods: for B in mro: if method in B.__dict__: if B.__dict__[method] is None: return NotImplemented break else: return NotImplemented return True ``` This is an incredibly convenient function (referred to as check_methods here on out) for creating abstract base classes, and is much simpler than using `hasattr` for each method you want to check. For example: ``` >>> from abc import ABCMeta >>> # Without check_methods >>> class A(metaclass=ABCMeta): ... @classmethod ... def __subclasshook__(cls, subclass): ... return (hasattr(subclass, 'foo') and ... callable(subclass.foo) and ... hasattr(subclass, 'bar') and ... callable(subclass.bar) or ... NotImplemented) ... >>> # With check_methods >>> class B(metaclass=ABCMeta): ... @classmethod ... def __subclasshook(cls, subclass): ... return check_methods(subclass, 'foo', 'bar') ... >>> ``` This would be a great function to add to the standard lib, perhaps in the `abc` module. One problem with `check_methods` as defined in _collections_abc.py is that it doesn't check if the name is callable. Also, type hints and more readable variables may be desirable. The final code, if implemented, may look something like this: ``` # In imports section: from typing import Literal def check_methods(Class: type, *methods: str) -> Literal[True, NotImplemented]: """Check if class `Class` has methods `methods`.""" mro = Class.__mro__ for method in methods: for Base in mro: if (attr := getattr(Base, method, None)) is not None: if not callable(attr): return NotImplemented break else: return NotImplemented return True ``` Again, this would be a great function to add to the `abc` module or a similar one. ---------- components: Library (Lib) messages: 399814 nosy: finnjavier08 priority: normal severity: normal status: open title: Add check_methods function to standard library type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 22:34:57 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 18 Aug 2021 02:34:57 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1629254097.25.0.630857253524.issue33140@roundup.psfhosted.org> Eryk Sun added the comment: > creating a Windows `os.set_owner` function that uses the > appropriate Windows API calls to change owner/group settings, > and then using that for Windows in the `shutil.chown` function? I'd gladly help with implementing os.set_owner(), as a separate issue. But I've changed my mind about supporting more POSIX functions in Windows. I'd prefer to see more Windows-only functionality added, as well as simplified cross-platform support that's not based on and biased by POSIX. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 23:08:11 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Wed, 18 Aug 2021 03:08:11 +0000 Subject: [issue44942] Add number pad enter bind to TK's simpleDialog Message-ID: <1629256091.95.0.739265447957.issue44942@roundup.psfhosted.org> New submission from Ryan Mast (nightlark) : Tk the number pad enter and main enter keys separately. The number pad enter button should be bound to `self.ok` in simpleDialog's `Dialog` class so that both enter buttons have the same behavior. A PR for this change has been submitted on GitHub by Electro707. ---------- components: Tkinter messages: 399816 nosy: rmast priority: normal pull_requests: 26272 severity: normal status: open title: Add number pad enter bind to TK's simpleDialog type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 23:12:53 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Wed, 18 Aug 2021 03:12:53 +0000 Subject: [issue44942] Add number pad enter bind to TK's simpleDialog In-Reply-To: <1629256091.95.0.739265447957.issue44942@roundup.psfhosted.org> Message-ID: <1629256373.72.0.317225186339.issue44942@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: I'm new to this system, if I'm understanding https://devguide.python.org/triaging/#nosy-list then it looks like the people listed for `tkinter` should be added to the Nosy List? ---------- nosy: +gpolo, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 23:55:17 2021 From: report at bugs.python.org (Jesse Rittner) Date: Wed, 18 Aug 2021 03:55:17 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1629258917.32.0.974108156334.issue44925@roundup.psfhosted.org> Jesse Rittner added the comment: @kj I'm not sure if I'll have the time, but for reference, is this what the PR would be raised against? https://raw.githubusercontent.com/python/cpython/main/Doc/library/typing.rst ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 17 23:58:11 2021 From: report at bugs.python.org (Elsie Hupp) Date: Wed, 18 Aug 2021 03:58:11 +0000 Subject: [issue44943] Integrate PyHyphen into the textwrap module? Message-ID: <1629259091.17.0.693384406062.issue44943@roundup.psfhosted.org> New submission from Elsie Hupp : PyHyphen is a mature library that wraps the existing CPython `textwrap` module and provides the ability to break and hyphenate words in wrapped text. PyHyphen is on PyPI here: https://pypi.org/project/PyHyphen/ And on GitHub here: https://github.com/dr-leo/PyHyphen While the PyPI page and the README file say that PyHyphen uses an Apache 2.0 License, the GitHub repository says that it uses a GPL 2.0/LGPL 2.1/MPL 1.1 tri-license: https://github.com/dr-leo/PyHyphen/blob/master/LICENSE.txt To what extent would it be feasible to integrate PyHyphen's enhancements into the core `textwrap` module? It is my understanding that the `textwrap` itself began life as a third-party module, which would suggest that such integrations are somewhat precedented. I'm not experienced enough to know how to do a pull request myself, and I don't understand the legal details well enough to know if PyHyphen is license-compatible with CPython. ---------- messages: 399819 nosy: elsiehupp priority: normal severity: normal status: open title: Integrate PyHyphen into the textwrap module? type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 00:09:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Aug 2021 04:09:59 +0000 Subject: [issue44938] Expose PyErr_ChainExceptions in the stable API In-Reply-To: <1629222263.76.0.471437987741.issue44938@roundup.psfhosted.org> Message-ID: <1629259799.39.0.447835066598.issue44938@roundup.psfhosted.org> Serhiy Storchaka added the comment: As the original author of _PyErr_ChainExceptions() (issue21715) I am not sure that its name and signature are optimal. It did not matter while it was internal function because we could change them at any moment, but for public API the design should be more thoughtful. Is passing three arguments convenient enough? Would not be better to pass them as a single argument like in _PyErr_ChainStackItem()? Is the function name good? Should we provide several similar functions for setting __context__, __cause__ and both? There are other, more specialized, helpers: _PyErr_FormatFromCause() and _PyErr_TrySetFromCause(). There are also some flaws in setting __context__ and __cause__ (see issue39725). Perhaps we will design better concept of chaining exceptions in future. ---------- components: +C API nosy: +serhiy.storchaka type: -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 00:12:48 2021 From: report at bugs.python.org (Yatharth Mathur) Date: Wed, 18 Aug 2021 04:12:48 +0000 Subject: [issue44944] Addition of _heappush_max method to complete the max heap implementation in Python's heapq module Message-ID: <1629259968.75.0.146566969003.issue44944@roundup.psfhosted.org> Change by Yatharth Mathur : ---------- nosy: yatharthmathur priority: normal pull_requests: 26273 severity: normal status: open title: Addition of _heappush_max method to complete the max heap implementation in Python's heapq module type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 00:17:36 2021 From: report at bugs.python.org (Yatharth Mathur) Date: Wed, 18 Aug 2021 04:17:36 +0000 Subject: [issue44944] Addition of _heappush_max method to complete the max heap implementation in Python's heapq module Message-ID: <1629260256.06.0.237301649932.issue44944@roundup.psfhosted.org> Change by Yatharth Mathur : ---------- keywords: +patch pull_requests: +26274 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27807 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 00:32:33 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 18 Aug 2021 04:32:33 +0000 Subject: [issue44933] python3.9-intel64 hardened runtime not enabled In-Reply-To: <1629191936.44.0.533137792291.issue44933@roundup.psfhosted.org> Message-ID: <1629261153.24.0.0371712443527.issue44933@roundup.psfhosted.org> Ned Deily added the comment: The "python3.x-intel64" executable was added for macOS "universal2" builds by Issue44009 in the 3.9.5 and 3.8.10 releases. As described in the issue and the changelog entries, the rationale is: "Provide ?python3.x-intel64? executable to allow reliably forcing macOS universal2 framework builds to run under Rosetta 2 Intel-64 emulation on Apple Silicon Macs. This can be useful for testing or when universal2 wheels are not yet available." We provided an analogous "python3.x-32" executable for macOS "intel" (x64_64 and i386 archs) builds for a similar reason. Although it is mentioned in the changelog (and the python.org macOS installer ReadMe), I didn't anticipate that there would be anyone attempting to build and submit a universal binary for Apple notarization and who would be affected by this change: sorry about that! You can just either add the new executable to your codesigning script or you could delete the file before codesigning if you don't have a need to provide it to your users: it isn't needed unless you want to reliably force running under Rosetta 2 Intel emulation on an Apple Silcon Mac. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 01:20:47 2021 From: report at bugs.python.org (Toshio Kuratomi) Date: Wed, 18 Aug 2021 05:20:47 +0000 Subject: [issue44587] argparse BooleanOptionalAction displays default=SUPPRESS unlike other action types In-Reply-To: <1625807257.47.0.987336531003.issue44587@roundup.psfhosted.org> Message-ID: <1629264047.49.0.447965127073.issue44587@roundup.psfhosted.org> Change by Toshio Kuratomi : ---------- pull_requests: +26275 pull_request: https://github.com/python/cpython/pull/27808 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 01:20:52 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 18 Aug 2021 05:20:52 +0000 Subject: [issue27498] Regression in repr() of class object In-Reply-To: <1468338842.06.0.843714859349.issue27498@psf.upfronthosting.co.za> Message-ID: <1629264052.36.0.619787425061.issue27498@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: -26016 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 01:26:33 2021 From: report at bugs.python.org (Toshio Kuratomi) Date: Wed, 18 Aug 2021 05:26:33 +0000 Subject: [issue44587] argparse BooleanOptionalAction displays default=SUPPRESS unlike other action types In-Reply-To: <1625807257.47.0.987336531003.issue44587@roundup.psfhosted.org> Message-ID: <1629264393.86.0.535758647263.issue44587@roundup.psfhosted.org> Toshio Kuratomi added the comment: PR Opened. A fix for this should be backported as well. However, if you decide you don't want the refactor backported, you can merely continue to change the condition inside of BooleanOptionalAction to repeat all of the same checks as are contained in the older versions' ArgumentDefaultsHelpFormatter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 01:45:01 2021 From: report at bugs.python.org (Tobias Burger) Date: Wed, 18 Aug 2021 05:45:01 +0000 Subject: [issue44863] Allow TypedDict to inherit from Generics In-Reply-To: <1628363087.29.0.710236107674.issue44863@roundup.psfhosted.org> Message-ID: <1629265501.49.0.510049064034.issue44863@roundup.psfhosted.org> Change by Tobias Burger : ---------- nosy: +toburger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 02:14:42 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Wed, 18 Aug 2021 06:14:42 +0000 Subject: [issue15373] copy.copy() does not properly copy os.environment In-Reply-To: <1342454937.95.0.386630033182.issue15373@psf.upfronthosting.co.za> Message-ID: <1629267282.9.0.555830760378.issue15373@roundup.psfhosted.org> Change by Ryan Mast (nightlark) : ---------- nosy: +rmast _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 02:30:22 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Wed, 18 Aug 2021 06:30:22 +0000 Subject: [issue26545] [doc] os.walk is limited by python's recursion limit In-Reply-To: <1457744340.04.0.931517157669.issue26545@psf.upfronthosting.co.za> Message-ID: <1629268222.61.0.412560060983.issue26545@roundup.psfhosted.org> Change by Ryan Mast (nightlark) : ---------- nosy: +rmast _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 02:37:50 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Wed, 18 Aug 2021 06:37:50 +0000 Subject: [issue20041] TypeError when f_trace is None and tracing. In-Reply-To: <1387634487.03.0.628100767515.issue20041@psf.upfronthosting.co.za> Message-ID: <1629268670.62.0.712327024613.issue20041@roundup.psfhosted.org> Change by Ryan Mast (nightlark) : ---------- nosy: +rmast _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 04:41:12 2021 From: report at bugs.python.org (neonene) Date: Wed, 18 Aug 2021 08:41:12 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. In-Reply-To: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> Message-ID: <1629276072.52.0.54035421686.issue44878@roundup.psfhosted.org> neonene added the comment: FYI, PR27727 ("Remove loop...") seems to be a bit slower than the previous commit (f08e6d1bb3c5655f184af88c6793e90908bb6338) on my Windows build (msvc14.29.16.10). pyperformance shows that Windows x64 PGO: 34 slower, 11 faster, 13 not significant, Geometric mean: 1.02x slower Windows x86 PGO: 28 slower, 17 faster, 13 not significant, Geometric mean: 1.02x slower Undoing PR27727 on current cpython-main branch also get speed-ups by 1-2% on average. ---------- nosy: +neonene _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 04:42:47 2021 From: report at bugs.python.org (Christian Buhtz) Date: Wed, 18 Aug 2021 08:42:47 +0000 Subject: [issue44701] Create a @deprecated decorator (annotation) In-Reply-To: <1626894458.82.0.833124063655.issue44701@roundup.psfhosted.org> Message-ID: <1629276167.29.0.951295043558.issue44701@roundup.psfhosted.org> Christian Buhtz added the comment: This discussion on python-ideas https://mail.python.org/archives/list/python-ideas at python.org/thread/62CTVNQ2GIS4B6WUBX23K4CCCK5MCGYL/ ---------- nosy: +buhtz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 05:27:28 2021 From: report at bugs.python.org (Hugo van Kemenade) Date: Wed, 18 Aug 2021 09:27:28 +0000 Subject: [issue41165] [Python 3.10] Remove APIs deprecated long enough In-Reply-To: <1593492796.52.0.194597415316.issue41165@roundup.psfhosted.org> Message-ID: <1629278848.26.0.534758749013.issue41165@roundup.psfhosted.org> Hugo van Kemenade added the comment: ## unittest What's needed to move forward with removing the deprecated aliases? A deprecation warning is shown for `python3 -m unittest test_bar` and `python3 test_bar.py` (tested Python 3.6-3.10). No deprecation warning is shown for `python setup.py test`, however, both setuptools and pytest have deprecated/discouraged `python setup.py test`: https://github.com/pypa/setuptools/pull/1878 https://github.com/pytest-dev/pytest/pull/5546 https://github.com/pytest-dev/pytest/issues/5534 Docs already mention they are deprecated: https://docs.python.org/3/library/unittest.html#deprecated-aliases > At a bare minimum you should list removed features in the 3.9 changelog and porting guide as "will be removed in 3.10". I would even argue to add deprecation warnings to the code in 3.9 (with permission from the RM). If the RM is against deprecation warnings, then it might be good idea to postpone removal to 3.11. So at this stage (3.10 in RC), do we need to list them in the 3.11 changelog and porting guide as "will be removed in 3.12"? ---------- nosy: +hugovk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 05:37:17 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 18 Aug 2021 09:37:17 +0000 Subject: [issue44878] Clumsy dispatching on interpreter entry. In-Reply-To: <1628602958.73.0.911240136542.issue44878@roundup.psfhosted.org> Message-ID: <1629279437.13.0.0165602822018.issue44878@roundup.psfhosted.org> Mark Shannon added the comment: I'm somewhat surprised by that. After all, the only change in control flow was the change from a break to a goto in exception handling. I would have expected PR27726 to have made much more difference. There are a few possibilities, including: 1. It's just a random fluctuation from tiny changes in alignment. 2. MSVC aligns loops, but not switches, or vice-versa, and that makes a systematic difference. I suspect that it is (1), but this is a bit worrying nonetheless. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 05:38:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 09:38:20 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr In-Reply-To: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> Message-ID: <1629279500.93.0.0496991658564.issue44929@roundup.psfhosted.org> ?ukasz Langa added the comment: Ethan, could you take a look at the PR? I added a few failing test methods since `repr` handling for global enum flags wasn't covered and looks unfinished. If you tell us what the expected return values should be, I'll finish the fix. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 05:45:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2021 09:45:24 +0000 Subject: [issue44449] Segfault in _PyTrash_begin when faulthandler tries to dump thread stacks In-Reply-To: <1624012030.73.0.910498447609.issue44449@roundup.psfhosted.org> Message-ID: <1629279924.46.0.988721943804.issue44449@roundup.psfhosted.org> STINNER Victor added the comment: _Py_DumpTracebackThreads() should not use Py_DECREF(). It's a bug. It must only *read* memory, not *modify* memory since it's called from a signal handler. It's a regression in dump_traceback(). Python 3.9 and 3.10 use: frame = PyThreadState_GetFrame(tstate); ... Py_DECREF(frame); The main branch (future 3.11) uses: frame = tstate->frame; Without Py_DECREF(): it's a borrowed reference. It was changed by commit ae0a2b756255629140efcbe57fc2e714f0267aa3. Python 3.9 and 3.10 should be fixed to use a borrowed reference. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 05:49:33 2021 From: report at bugs.python.org (Maximilian Hils) Date: Wed, 18 Aug 2021 09:49:33 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629280173.39.0.785077740753.issue44926@roundup.psfhosted.org> Maximilian Hils added the comment: Thanks Guido! I agree on not pursuing the List["Foo"] case for the reasons you mentioned. Let me know if you think it'd be useful to mention this limitation briefly in one of the relevant PEPs or somewhere else. I'm not sure if it meets the bar for notability, you probably have a better gut feeling for this. Other than that I'd propose we close this here as wontfix. Thank you again for the very useful feedback! :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 06:11:48 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 18 Aug 2021 10:11:48 +0000 Subject: [issue44945] Specialize BINARY_ADD using PEP 659 machinery. Message-ID: <1629281508.42.0.164315730868.issue44945@roundup.psfhosted.org> New submission from Mark Shannon : Specializing BINARY_ADD is worthwhile for two reasons: Specializing for ints, floats and strings may give us some small speedup. It removes the complex checks for the special case of extending a string, `s = s + ...` from the normal instruction to a specialized form. ---------- messages: 399830 nosy: Mark.Shannon priority: normal severity: normal status: open title: Specialize BINARY_ADD using PEP 659 machinery. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 06:17:14 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 18 Aug 2021 10:17:14 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1629281834.53.0.0466608279827.issue44925@roundup.psfhosted.org> Ken Jin added the comment: Yep! You can choose to add a new section under "Other concrete types", maybe "typing.io and typing.re submodules" then talk about how we could import from them in the past, but they're now deprecated and going to be removed. Alternatively, you can remove the existing notice, and just place a big note (..note::) underneath with the content above. > I'm not sure if I'll have the time No worries. We're not in a hurry. If you haven't checked it out already (and to save you some time) the devguide is here: https://devguide.python.org/pullrequest/#quick-guide You can probably skip some parts (like running tests) for a docs-only change. The main things are: 1. Please sign the CLA https://devguide.python.org/pullrequest/#licensing. 2. Make the change on main branch and send a PR over. We can review your changes once the PR is open. Thanks for your interest in contributing! (once again, no pressure, if you feel at any time you're too busy to take this up, it's perfectly okay). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 06:19:15 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 18 Aug 2021 10:19:15 +0000 Subject: [issue44941] Add check_methods function to collections.abc in standard library In-Reply-To: <1629252402.72.0.293302326241.issue44941@roundup.psfhosted.org> Message-ID: <1629281955.5.0.402268562439.issue44941@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +rhettinger, stutzbach title: Add check_methods function to standard library -> Add check_methods function to collections.abc in standard library versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 06:25:32 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 18 Aug 2021 10:25:32 +0000 Subject: [issue44946] Integer operations are inefficient for "medium" integers. Message-ID: <1629282332.14.0.448234766884.issue44946@roundup.psfhosted.org> New submission from Mark Shannon : "Medium" integers are those with a single internal digit or zero. Medium integers are integers in the range -2**30 to +2**30 on 64 bit machines. "Small" integers, -5 to 256 are cached, but are represented as medium integers internally. To a good approximation, all integers are "medium". However, we make little effort to exploit that fact in the code for binary operations, which are very common operations on integers. ---------- components: Interpreter Core messages: 399832 nosy: Mark.Shannon priority: normal severity: normal status: open title: Integer operations are inefficient for "medium" integers. type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 06:41:40 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 18 Aug 2021 10:41:40 +0000 Subject: [issue44946] Integer operations are inefficient for "medium" integers. In-Reply-To: <1629282332.14.0.448234766884.issue44946@roundup.psfhosted.org> Message-ID: <1629283300.21.0.600294494848.issue44946@roundup.psfhosted.org> Mark Dickinson added the comment: We already special-case medium integers in the Objects/longobject.c code, in various places. For example for addition, here: https://github.com/python/cpython/blob/3240bc62f4e0afa09964f3afc845697f0a0806b9/Objects/longobject.c#L3070-L3072 Are you proposing further changes in longobject.c, or some other mechanism? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 06:43:21 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 18 Aug 2021 10:43:21 +0000 Subject: [issue44946] Integer operations are inefficient for "medium" integers. In-Reply-To: <1629282332.14.0.448234766884.issue44946@roundup.psfhosted.org> Message-ID: <1629283401.98.0.0765675485135.issue44946@roundup.psfhosted.org> Mark Dickinson added the comment: See also #21955, #10044, and https://github.com/python/cpython/blob/3240bc62f4e0afa09964f3afc845697f0a0806b9/Python/ceval.c#L1986-L1991 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 06:44:15 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 18 Aug 2021 10:44:15 +0000 Subject: [issue44946] Integer operations are inefficient for "medium" integers. In-Reply-To: <1629282332.14.0.448234766884.issue44946@roundup.psfhosted.org> Message-ID: <1629283455.72.0.28362405779.issue44946@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 07:09:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Aug 2021 11:09:53 +0000 Subject: [issue44938] Expose PyErr_ChainExceptions in the stable API In-Reply-To: <1629222263.76.0.471437987741.issue44938@roundup.psfhosted.org> Message-ID: <1629284993.99.0.362206526906.issue44938@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Serhiy, what do you suggest we should do then? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 07:19:36 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 11:19:36 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629285576.71.0.603152112919.issue44852@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8cf07d3db3eed02b43350a5f9dbf68f1c839ea82 by ?ukasz Langa in branch 'main': bpo-44852: Support filtering over warnings without a set message (GH-27793) https://github.com/python/cpython/commit/8cf07d3db3eed02b43350a5f9dbf68f1c839ea82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 07:19:38 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Aug 2021 11:19:38 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629285578.8.0.0965561206479.issue44852@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26276 pull_request: https://github.com/python/cpython/pull/27809 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 07:19:42 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Aug 2021 11:19:42 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629285582.64.0.926433313801.issue44852@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26277 pull_request: https://github.com/python/cpython/pull/27810 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 07:48:58 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 18 Aug 2021 11:48:58 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading Message-ID: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> New submission from Andre Roberge : Consider the following four slightly different examples: Python 3.10.0rc1 ... >>> from math import sin and cos File "", line 1 from math import sin and cos ^^^ SyntaxError: invalid syntax >>> from math import sin, cos, and tan File "", line 1 from math import sin, cos, and tan ^^^ SyntaxError: trailing comma not allowed without surrounding parentheses >>> from math import (sin, cos,) and tan File "", line 1 from math import (sin, cos,) and tan ^^^ SyntaxError: invalid syntax >>> from math import sin, cos and tan File "", line 1 from math import sin, cos and tan ^^^ SyntaxError: invalid syntax ==== In all four cases, the keyword 'and' is correctly identified as causing the error. In the second case, the message given may suggest that adding parentheses is all that is needed to correct the problem; however, that is "obviously" not the case as shown in the third case. **Perhaps** when a _keyword_ like 'and' is identified as a problem, a generally better message would be something like SyntaxError: the keyword 'and' is not allowed here leaving out all guesses like 'surrounding by parentheses', "meaning == instead of =", 'perhaps forgot a comma', etc., which are sometimes added by Python 3.10+ ? I am fully and painfully aware that attempting to provide helpful and accurate error message is challenging... ---------- components: Parser messages: 399837 nosy: aroberge, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: SyntaxError: trailing comma not allowed ... misleading versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 07:59:10 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 18 Aug 2021 11:59:10 +0000 Subject: [issue44946] Integer operations are inefficient for "medium" integers. In-Reply-To: <1629282332.14.0.448234766884.issue44946@roundup.psfhosted.org> Message-ID: <1629287950.89.0.564994538704.issue44946@roundup.psfhosted.org> Mark Shannon added the comment: Just changes to longobject.c. There are still various minor inefficiencies in testing to see whether an int is a medium value, and then throwing away size information before creating result objects. I'm not expecting this to make much difference, but every little helps. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 08:03:02 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 18 Aug 2021 12:03:02 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629288182.67.0.0167493416398.issue44947@roundup.psfhosted.org> Andre Roberge added the comment: This message is not new to Python 3.10 as it is also shown with Python 3.9.5. >>> from math import sin, cos, and tan File "", line 1 from math import sin, cos, and tan ^ SyntaxError: trailing comma not allowed without surrounding parentheses ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 08:10:31 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Aug 2021 12:10:31 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629288631.76.0.85470774471.issue44852@roundup.psfhosted.org> miss-islington added the comment: New changeset d1c0e4413dd544270df1f5b8a145fd4370cb759b by Miss Islington (bot) in branch '3.10': bpo-44852: Support filtering over warnings without a set message (GH-27793) https://github.com/python/cpython/commit/d1c0e4413dd544270df1f5b8a145fd4370cb759b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 08:10:43 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 12:10:43 +0000 Subject: [issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite In-Reply-To: <1628267642.59.0.0108096773806.issue44852@roundup.psfhosted.org> Message-ID: <1629288643.26.0.430055268392.issue44852@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ebe7e6d86cf8f54d449d49866698d7f4c700cc7c by Miss Islington (bot) in branch '3.9': bpo-44852: Support filtering over warnings without a set message (GH-27793) (GH-27810) https://github.com/python/cpython/commit/ebe7e6d86cf8f54d449d49866698d7f4c700cc7c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 08:28:32 2021 From: report at bugs.python.org (Yatharth Mathur) Date: Wed, 18 Aug 2021 12:28:32 +0000 Subject: [issue44944] Addition of _heappush_max method to complete the max heap implementation in Python's heapq module Message-ID: <1629289712.46.0.298438483389.issue44944@roundup.psfhosted.org> Change by Yatharth Mathur : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 09:06:53 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 18 Aug 2021 13:06:53 +0000 Subject: [issue44943] Integrate PyHyphen into the textwrap module? In-Reply-To: <1629259091.17.0.693384406062.issue44943@roundup.psfhosted.org> Message-ID: <1629292013.35.0.862569276119.issue44943@roundup.psfhosted.org> Eric V. Smith added the comment: Thank you for the suggestion. Hyphenation seems like a niche requirement to me, probably too niche and with too many design decisions to include it in the stdlib. It's also not clear to my why PyHyphen would be the best option for this, as opposed to the other hyphenation libraries on PyPI. You'll need to address both of these issues as part of any proposal. I suggest you bring this up on the python-ideas mailing list in order to get a broader discussion. ---------- components: +Library (Lib) nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 09:52:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Aug 2021 13:52:23 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629294743.28.0.501101461542.issue44947@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Hummm, interesting. I wonder if this only happens with keywords or if this can be reproduced with other constructs ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 09:53:28 2021 From: report at bugs.python.org (Electro707) Date: Wed, 18 Aug 2021 13:53:28 +0000 Subject: [issue44942] Add number pad enter bind to TK's simpleDialog In-Reply-To: <1629256091.95.0.739265447957.issue44942@roundup.psfhosted.org> Message-ID: <1629294808.3.0.215774926071.issue44942@roundup.psfhosted.org> Change by Electro707 : ---------- nosy: +Electro707 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 09:55:11 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 18 Aug 2021 13:55:11 +0000 Subject: [issue44942] Add number pad enter bind to TK's simpleDialog In-Reply-To: <1629256091.95.0.739265447957.issue44942@roundup.psfhosted.org> Message-ID: <1629294911.34.0.139091334399.issue44942@roundup.psfhosted.org> Guido van Rossum added the comment: It?s fine. We now need the PR author to sign the CLA. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 10:02:24 2021 From: report at bugs.python.org (Jon Clucas) Date: Wed, 18 Aug 2021 14:02:24 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1629295344.09.0.897753495699.issue22393@roundup.psfhosted.org> Change by Jon Clucas : ---------- nosy: +shnizzedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 10:02:51 2021 From: report at bugs.python.org (Jon Clucas) Date: Wed, 18 Aug 2021 14:02:51 +0000 Subject: [issue43805] multiprocessing.Queue hangs when process on other side dies In-Reply-To: <1618141970.93.0.19986621438.issue43805@roundup.psfhosted.org> Message-ID: <1629295371.12.0.463418544727.issue43805@roundup.psfhosted.org> Change by Jon Clucas : ---------- nosy: +shnizzedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 10:09:10 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 18 Aug 2021 14:09:10 +0000 Subject: [issue44937] test_regrest: test_tools_script_run_tests() failed on GHA Windows x64 In-Reply-To: <1629219613.26.0.318881059728.issue44937@roundup.psfhosted.org> Message-ID: <1629295750.09.0.628744674778.issue44937@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 10:15:54 2021 From: report at bugs.python.org (Thomas Trummer) Date: Wed, 18 Aug 2021 14:15:54 +0000 Subject: [issue44743] asyncio DatagramProtocol stops calling callbacks after OSError In-Reply-To: <1627311058.63.0.328526216812.issue44743@roundup.psfhosted.org> Message-ID: <1629296154.41.0.0996794565123.issue44743@roundup.psfhosted.org> Change by Thomas Trummer : ---------- nosy: +Thomas Trummer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 10:16:49 2021 From: report at bugs.python.org (Thomas Trummer) Date: Wed, 18 Aug 2021 14:16:49 +0000 Subject: [issue44948] DeprecationWarning: Using ioctl() method Message-ID: <1629296209.14.0.265691405038.issue44948@roundup.psfhosted.org> New submission from Thomas Trummer : DeprecationWarning: Using ioctl() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org. Use case: def connection_made(self, transport: asyncio.BaseTransport) -> None: sock = transport.get_extra_info('socket') # type: socket.socket sock.ioctl(SIO_UDP_CONNRESET, False) Releated: https://bugs.python.org/issue44743 ---------- components: Windows, asyncio messages: 399845 nosy: Thomas Trummer, asvetlov, paul.moore, steve.dower, tim.golden, yselivanov, zach.ware priority: normal severity: normal status: open title: DeprecationWarning: Using ioctl() method versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 10:21:18 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 18 Aug 2021 14:21:18 +0000 Subject: [issue44944] Addition of _heappush_max method to complete the max heap implementation in Python's heapq module Message-ID: <1629296478.45.0.736118078819.issue44944@roundup.psfhosted.org> New submission from Eric V. Smith : This has been discussed and rejected in at least issue 27295 and issue 42240, and probably others. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 10:36:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2021 14:36:00 +0000 Subject: [issue40512] [subinterpreters] Meta issue: per-interpreter GIL In-Reply-To: <1588683075.13.0.0239787407564.issue40512@roundup.psfhosted.org> Message-ID: <1629297360.89.0.416806122134.issue40512@roundup.psfhosted.org> STINNER Victor added the comment: PyStructSequence_InitType2() is not compatible with subinterpreters: it uses static types. Moreover, it allocates tp_members memory which is not released when the type is destroyed. But I'm not sure that the type is ever destroyed, since this API is designed for static types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 11:09:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2021 15:09:16 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x Message-ID: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> New submission from STINNER Victor : test_readline fails randomly on aarc64 RHEL8 buildbots (3.9, 3.10 and 3.x). In some builds, test_readline fails but then pass when re-run in verbose mode. Example: https://buildbot.python.org/all/#/builders/41/builds/148 --- 0:02:56 load avg: 2.79 Re-running test_readline in verbose mode (matching: test_auto_history_disabled) test_auto_history_disabled (test.test_readline.TestReadline) ... ok --- aarch64 RHEL8 Refleaks 3.9: https://buildbot.python.org/all/#/builders/247/builds/107 test.pythoninfo: readline._READLINE_LIBRARY_VERSION: 7.0 readline._READLINE_RUNTIME_VERSION: 0x700 readline._READLINE_VERSION: 0x700 Tests: 0:33:57 load avg: 0.93 Re-running test_readline in verbose mode (matching: test_auto_history_disabled) beginning 6 repetitions 123456 readline version: 0x700 readline runtime version: 0x700 readline library version: '7.0' use libedit emulation? False test test_readline failed test_auto_history_disabled (test.test_readline.TestReadline) ... FAIL ====================================================================== FAIL: test_auto_history_disabled (test.test_readline.TestReadline) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.9.cstratak-RHEL8-aarch64.refleak/build/Lib/test/test_readline.py", line 154, in test_auto_history_disabled self.assertIn(b"History length: 0\r\n", output) AssertionError: b'History length: 0\r\n' not found in bytearray(b'dummy input\r\ndummy input\r\nHistory length: 0') ---------------------------------------------------------------------- ---------- components: Tests messages: 399848 nosy: erlendaasland, lukasz.langa, pablogsal, vstinner priority: normal severity: normal status: open title: test_readline: test_auto_history_disabled() fails on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 11:10:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2021 15:10:29 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1629299429.92.0.181541607609.issue44949@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_readline: test_auto_history_disabled() fails on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x -> test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 11:14:35 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 18 Aug 2021 15:14:35 +0000 Subject: [issue44942] Add number pad enter bind to TK's simpleDialog In-Reply-To: <1629256091.95.0.739265447957.issue44942@roundup.psfhosted.org> Message-ID: <1629299675.43.0.965123589564.issue44942@roundup.psfhosted.org> Guido van Rossum added the comment: Sorry, CLA is signed, but I'd like Terry Reedy to have a peek. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 11:22:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 18 Aug 2021 15:22:21 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629300141.21.0.0164877565641.issue44926@roundup.psfhosted.org> Guido van Rossum added the comment: We could mention this in the docs for one or more of the following: - type aliases (old or new syntax) - forward references - get_type_hints() Ken Jin, can you guide Maximilian towards a successful doc update PR? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 11:48:56 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Wed, 18 Aug 2021 15:48:56 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1629301736.87.0.470919374503.issue44925@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 11:46:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2021 15:46:29 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1629301589.7.0.349574619129.issue44949@roundup.psfhosted.org> STINNER Victor added the comment: I failed to reproduce the issue on Fedora 34 (readline-8.1-2.fc34.i686). $ ./python -m test test_readline -m test_auto_history_disabled -j40 -F (...) 0:19:35 load avg: 42.40 [10785] test_readline passed 0:19:35 load avg: 42.40 [10786] test_readline passed 0:19:35 load avg: 42.40 [10787] test_readline passed ^C Test suite interrupted by signal SIGINT. 10787 tests OK. Total duration: 19 min 36 sec $ ./python -m test test_readline -j40 -F (...) 0:03:30 load avg: 41.07 [1330] test_readline passed 0:03:31 load avg: 41.07 [1331] test_readline passed ^C 1331 tests OK. Total duration: 3 min 31 sec Tests result: INTERRUPTED ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 11:52:44 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 18 Aug 2021 15:52:44 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629301964.82.0.40321477437.issue44926@roundup.psfhosted.org> Ken Jin added the comment: > Ken Jin, can you guide Maximilian towards a successful doc update PR? It seems that Maximilian has already made some contributions to CPython, so I'm sure he's somewhat familiar with our workflow :). Nonetheless, @Maximilian if you need any help, please do ping me, I'll be happy to. We could add a ..note: here https://docs.python.org/3/library/typing.html#typing.get_type_hints. The document is at https://github.com/python/cpython/blob/main/Doc/library/typing.rst. The Python docs style guide is at https://devguide.python.org/documenting/#style-guide. Thanks Max for your interest in improving CPython! PS: I've changed the affected versions to the ones we still bugfix (3.9 and up). ---------- versions: +Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 12:31:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2021 16:31:40 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1629304300.71.0.492210178708.issue44949@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +26278 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27813 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 12:33:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2021 16:33:03 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1629304383.44.0.611649068241.issue44949@roundup.psfhosted.org> STINNER Victor added the comment: I ran the test manually on the buildbot worker. Sometimes, the test process gets the EIO error even before getting the 2 newline bytes (b"\r\n"). I wrote PR 27813 to simply not expect the newline character. Adding flush=True to the print("History length:", readline.get_current_history_length()) call in the Python script doesn't fix the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 12:42:10 2021 From: report at bugs.python.org (Elsie Hupp) Date: Wed, 18 Aug 2021 16:42:10 +0000 Subject: [issue44943] Integrate PyHyphen into the textwrap module? In-Reply-To: <1629259091.17.0.693384406062.issue44943@roundup.psfhosted.org> Message-ID: <1629304930.65.0.526399096884.issue44943@roundup.psfhosted.org> Elsie Hupp added the comment: I mainly suggested PyHyphen because (at a fairly superficial glance) it has been around for over a decade, and it extends an existing module rather than adding a new one. To be fair, `textwrap` itself is relatively niche, and it's my understanding that it's also a relatively recent addition to the standard library. I can repost this this to the mailing list, though I'll probably do some more digging first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 12:43:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2021 16:43:00 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629304980.16.0.692044171295.issue44895@roundup.psfhosted.org> STINNER Victor added the comment: Irit: do you still reproduce the issue using gc.disable()? Or you can try different values to call gc.set_threshold(). You may also try different values in ns.huntrleaks, like: ns.huntrleaks = (3, 20, 'tt_out.py'). With 20 iterations, do you still reproduce the leak? To make the issue more likely, you can change check_rc_deltas() in Lib/test/libregrtest/refleak.py. Try: def check_rc_deltas(deltas): return any(delta >= 1 for delta in deltas) With this change, the script stops immediately: test leaked [-4, 4, -4] references, sum=-4 test leaked [-4, 4, -4] memory blocks, sum=-4 Using 20 iterations, I get: test leaked [-4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4] references, sum=0 test leaked [-4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4] memory blocks, sum=0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 12:48:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2021 16:48:12 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629305292.74.0.128001756084.issue44895@roundup.psfhosted.org> STINNER Victor added the comment: > test leaked [-4, 4, -4] references, sum=-4 If I disable the GC, the script no longer detects "leaks". Same using a GC threshold of 800. Using a GC threshold between 100 and 700, I reproduce the [-4, 4, -4] references leak. Funny bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 12:49:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 18 Aug 2021 16:49:48 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1629305388.16.0.209099796575.issue44895@roundup.psfhosted.org> STINNER Victor added the comment: You can also play with the clear() method of frame objects and traceback.clear_frames() (which expects a traceback object). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 13:30:30 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 18 Aug 2021 17:30:30 +0000 Subject: [issue44173] Stored (uncompressed) ZipExtFile in zipfile can be seekable at lower cost In-Reply-To: <1621391319.87.0.895694633998.issue44173@roundup.psfhosted.org> Message-ID: <1629307830.11.0.604031013788.issue44173@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 13:39:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 17:39:03 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1629308343.47.0.594480042805.issue44949@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6fb62b42f4db56ed5efe0ca4c1059049276c1083 by Victor Stinner in branch 'main': bpo-44949: Fix test_readline auto history tests (#27813) https://github.com/python/cpython/commit/6fb62b42f4db56ed5efe0ca4c1059049276c1083 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 13:40:06 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 18 Aug 2021 17:40:06 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629308406.53.0.592287578707.issue44947@roundup.psfhosted.org> Andre Roberge added the comment: Based on what I just read on https://github.com/davidhalter/parso/blob/master/parso/python/issue_list.txt I gather that this exception is only raised in the context of an import statement with a trailing comma (usually followed by nothing). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 14:06:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Aug 2021 18:06:49 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629310009.49.0.693520312264.issue44947@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The problem is not the keyword, is that we are parsing correctly until the "and" and we find the comma there. It happens with anything that invalidates more items: >>> from math import sin, cos, $ tan File "", line 1 from math import sin, cos, $ tan ^ SyntaxError: trailing comma not allowed without surrounding parentheses ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 14:09:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Aug 2021 18:09:54 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629310194.22.0.986721501422.issue44947@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +26279 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27814 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 14:27:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 18 Aug 2021 18:27:45 +0000 Subject: [issue44943] Integrate PyHyphen into the textwrap module? In-Reply-To: <1629259091.17.0.693384406062.issue44943@roundup.psfhosted.org> Message-ID: <1629311265.2.0.759251436245.issue44943@roundup.psfhosted.org> Serhiy Storchaka added the comment: Many years ago I write highly optimized hyphenation module (as a part of OrnamentBook project https://sourceforge.net/projects/pybookreader/files/OrnamentBook/). I could contribute the code to the stdlib. But the problem is that the algorithm depends on language specific data files. I am not sure that we are ready to include these files in the stdlib. And how are we going to handle requests for support of new languages and how to validate contributed data files for unknown new languages? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 14:48:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 18:48:10 +0000 Subject: [issue44815] asyncio.gather no DeprecationWarning if task are passed In-Reply-To: <1627928997.24.0.837145443801.issue44815@roundup.psfhosted.org> Message-ID: <1629312490.71.0.565796350304.issue44815@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b2779b2aa16acb3fd1297ccfe2fe5aaa007f74ae by Sam Bull in branch '3.9': [3.9] bpo-44815: Always show deprecation in asyncio.gather/sleep() (GH-27569) https://github.com/python/cpython/commit/b2779b2aa16acb3fd1297ccfe2fe5aaa007f74ae ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 14:56:33 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 18 Aug 2021 18:56:33 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr In-Reply-To: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> Message-ID: <1629312993.59.0.730324864989.issue44929@roundup.psfhosted.org> Ethan Furman added the comment: `_name_` is only None if the entire enum value is outside any named member and `_boundary_` is `KEEP` -- so class Example(Flag, boundary=KEEP): first = auto() second = auto() third = auto() >>> Example(0) module.Example(0) >>> Example(8) module.Example(8) No need to backport. ---------- versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 14:58:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 18:58:54 +0000 Subject: [issue44815] asyncio.gather no DeprecationWarning if task are passed In-Reply-To: <1627928997.24.0.837145443801.issue44815@roundup.psfhosted.org> Message-ID: <1629313134.19.0.466257436938.issue44815@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Sam! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 15:08:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 19:08:41 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629313721.89.0.378772908774.issue44524@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a3a4d20d6798aa2975428d51f3a4f890248810cb by Yurii Karabas in branch 'main': bpo-44524: Fix cryptic TypeError message when trying to subclass special forms in `typing` (GH-27710) https://github.com/python/cpython/commit/a3a4d20d6798aa2975428d51f3a4f890248810cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 15:08:41 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Aug 2021 19:08:41 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629313721.52.0.362648822758.issue44524@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26280 pull_request: https://github.com/python/cpython/pull/27815 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 15:50:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 19:50:27 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1629316227.05.0.788980438864.issue44874@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 31ee985db86c1339d00bd0d3cc1712019460670a by Irit Katriel in branch 'main': bpo-44874: deprecate Py_TRASHCAN_SAFE_BEGIN and Py_TRASHCAN_SAFE_END (GH-27693) https://github.com/python/cpython/commit/31ee985db86c1339d00bd0d3cc1712019460670a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 16:09:29 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Aug 2021 20:09:29 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629317369.27.0.267792237636.issue44947@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26281 pull_request: https://github.com/python/cpython/pull/27816 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 16:09:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 20:09:37 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629317377.76.0.753860387565.issue44947@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b2f68b190035540872072ac1d2349e7745e85596 by Pablo Galindo Salgado in branch 'main': bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814) https://github.com/python/cpython/commit/b2f68b190035540872072ac1d2349e7745e85596 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 16:32:09 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 18 Aug 2021 20:32:09 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629318729.79.0.637491886376.issue44947@roundup.psfhosted.org> miss-islington added the comment: New changeset 846a10fc45ef83b41d1b1b568a9ee8012f37c8c2 by Miss Islington (bot) in branch '3.10': bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814) https://github.com/python/cpython/commit/846a10fc45ef83b41d1b1b568a9ee8012f37c8c2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 16:39:47 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 18 Aug 2021 20:39:47 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629319187.56.0.699608904773.issue44830@roundup.psfhosted.org> Jack DeVries added the comment: All right, consider the needle in the haystack officially found. This page has the same content as the missing page: https://bugzilla.mozilla.org/page.cgi?id=bug-writing.html Thank you @buhtz for opening an issue with Mozilla; they are eventually going to deploy a redirect to the link above from the old link: https://github.com/mdn/content/issues/8036 So, we could go ahead and insert the link above which contains the same content as before. Or, we can keep the call open for a new document. What does everyone think? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 16:40:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 20:40:28 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629319228.69.0.856262436152.issue44947@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26282 pull_request: https://github.com/python/cpython/pull/27817 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 16:42:18 2021 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 18 Aug 2021 20:42:18 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1629319187.56.0.699608904773.issue44830@roundup.psfhosted.org> Message-ID: Thomas Grainger added the comment: Depends on the redirect type they create. If it's temporary we should keep the same URL, if it's permanent or otherwise has bookmark updating semantics we should update the URL to follow the redirect On Wed, 18 Aug 2021, 21:40 Jack DeVries, wrote: > > Jack DeVries added the comment: > > All right, consider the needle in the haystack officially found. This page > has the same content as the missing page: > > https://bugzilla.mozilla.org/page.cgi?id=bug-writing.html > > Thank you @buhtz for opening an issue with Mozilla; they are eventually > going to deploy a redirect to the link above from the old link: > https://github.com/mdn/content/issues/8036 > > So, we could go ahead and insert the link above which contains the same > content as before. Or, we can keep the call open for a new document. What > does everyone think? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 17:04:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 21:04:56 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629320696.16.0.683185442547.issue44947@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 17:04:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 18 Aug 2021 21:04:07 +0000 Subject: [issue44947] SyntaxError: trailing comma not allowed ... misleading In-Reply-To: <1629287338.23.0.729068225715.issue44947@roundup.psfhosted.org> Message-ID: <1629320647.2.0.543411564709.issue44947@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4e4d35d3325fb1e05dad43bd1ec73f14c3c5dc0a by ?ukasz Langa in branch '3.9': [3.9] bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814) (GH-27817) https://github.com/python/cpython/commit/4e4d35d3325fb1e05dad43bd1ec73f14c3c5dc0a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 17:22:16 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 18 Aug 2021 21:22:16 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629321736.32.0.101236618899.issue44830@roundup.psfhosted.org> Terry J. Reedy added the comment: Fixing the link now, given that it is possible, and someone someday writing a new doc to replace it are different issues. This issue is about the link. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 19:32:44 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 18 Aug 2021 23:32:44 +0000 Subject: [issue42491] Tkinter wait_visibility hanging when used in thread In-Reply-To: <1606559266.34.0.795590814191.issue42491@roundup.psfhosted.org> Message-ID: <1629329564.17.0.548955080392.issue42491@roundup.psfhosted.org> Terry J. Reedy added the comment: tcl/tk can be compiled without or with thread support. For 8.5, the default was without. For 8.6, the default is with. The Windows and macOS installers include 8.6 compiled with the default. I have not previously heard of problems with thread when it is so compiled. Both of you, what tcl versions? how compiled? ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 19:36:56 2021 From: report at bugs.python.org (Hamish) Date: Wed, 18 Aug 2021 23:36:56 +0000 Subject: [issue44950] Math Message-ID: <1629329816.72.0.712259708349.issue44950@roundup.psfhosted.org> New submission from Hamish : Error shown in image ---------- components: Interpreter Core files: unknowasdasdasdn.png messages: 399874 nosy: hamish555 priority: normal severity: normal status: open title: Math type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50226/unknowasdasdasdn.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 19:38:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Aug 2021 23:38:02 +0000 Subject: [issue44079] [sqlite3] remove superfluous statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1629329882.42.0.641883286143.issue44079@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 Wed Aug 18 19:38:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 18 Aug 2021 23:38:02 +0000 Subject: [issue44079] [sqlite3] remove superfluous statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1629329882.59.0.402347625359.issue44079@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 243b6c3b8fd3144450c477d99f01e31e7c3ebc0f by Erlend Egeberg Aasland in branch 'main': bpo-44079: Strip superfluous statement cache from sqlite3.Connection (GH-25998) https://github.com/python/cpython/commit/243b6c3b8fd3144450c477d99f01e31e7c3ebc0f ---------- nosy: +pablogsal resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 19:46:41 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 18 Aug 2021 23:46:41 +0000 Subject: [issue44950] Math In-Reply-To: <1629329816.72.0.712259708349.issue44950@roundup.psfhosted.org> Message-ID: <1629330401.02.0.209367687669.issue44950@roundup.psfhosted.org> Dennis Sweeney added the comment: This is not a bug, see the tutorial page here: https://docs.python.org/3.9/tutorial/floatingpoint.html Also, in the future, it's best to report bugs by thoroughly describing the actual/expected behavior in text and copy/pasting code, rather than just posting an image, otherwise it looks like spam from the outside. It also helps screen readers for people with difficulty seeing. ---------- nosy: +Dennis Sweeney resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 19:54:01 2021 From: report at bugs.python.org (Finn Mason) Date: Wed, 18 Aug 2021 23:54:01 +0000 Subject: [issue44941] Add check_methods function to standard library In-Reply-To: <1629252402.72.0.293302326241.issue44941@roundup.psfhosted.org> Message-ID: <1629330841.84.0.343060982258.issue44941@roundup.psfhosted.org> Finn Mason added the comment: I strongly feel that `check_methods` shouldn't be in collections.abc, even though that's where it's originally found, because it's not related specifically to collections but to ABCs and classes in general. I would prefer for it to be implemented in `abc` or similar. I'm reverting to the original title until a module is decided on. I'd be happy to do the implementation and pull request once approval is given and a module is decided on. ---------- title: Add check_methods function to collections.abc in standard library -> Add check_methods function to standard library _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 20:09:26 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 19 Aug 2021 00:09:26 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629331766.71.0.764172968461.issue44830@roundup.psfhosted.org> Change by Jack DeVries : ---------- pull_requests: +26283 pull_request: https://github.com/python/cpython/pull/27818 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 20:10:12 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 19 Aug 2021 00:10:12 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629331812.9.0.551263730952.issue44830@roundup.psfhosted.org> Jack DeVries added the comment: @terry.reedy ok, a PR to restore the docs with the new link is open. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 20:14:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 19 Aug 2021 00:14:18 +0000 Subject: [issue44942] Add number pad enter bind to TK's simpleDialog In-Reply-To: <1629256091.95.0.739265447957.issue44942@roundup.psfhosted.org> Message-ID: <1629332058.09.0.852569761777.issue44942@roundup.psfhosted.org> Terry J. Reedy added the comment: This proposal is not a bug fix. In my testing on Windows today, Ryan is correct in saying (on the PR) that kp return key normally acts is same as normal return key. True regardless of Numlock. This is *also true*, at least on Windows, of instances of SimpleDialog, Dialog, and _QueryDialog. I tested _QueryDialog via IDLE's use of askinteger. I believe the patch has no effect on Windows. I have the impression that the Windows behavior in not standard on *nix, where tcl/tk was first implemented. I would not change behavior on *nix with Serhiy's okay, and I would not expect it. IDLE adds KP_Enter bindings in a couple of its own dialogs with defaults. I don't remember if I inherited these, but I believe that there was a pre-existing policy of trying to make IDLE acts the same across systems, which I have adopted also. But a *nix-only tkinter app should not have Windows behavior imposed on it. I cannot test on my no-numberpad Macbook Air. ---------- nosy: -gpolo type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 22:49:09 2021 From: report at bugs.python.org (David Gilman) Date: Thu, 19 Aug 2021 02:49:09 +0000 Subject: [issue44951] selector.EpollSelector: EPOLLEXCLUSIVE, round 2 Message-ID: <1629341349.12.0.0455922443851.issue44951@roundup.psfhosted.org> New submission from David Gilman : Note that this is a different approach from the one taken in https://bugs.python.org/issue35517 although the issue is still the same. I've written a patch that allows users of selector.EpollSelector to enable EPOLLEXCLUSIVE on their file descriptors. This PR adds a setter and read only property to only the EpollSelector class instead of trying to expand the entire selector API like the other patch. The other discussion mentioned that there are some useful flags that could be passed down like this one. If other useful behavioral flags emerged in the future I think they should get their own API similar to how I've done it here. However, the other flags available so far for epoll are not useful for the selector module: EPOLLONESHOT and EPOLLET are incompatible with the design of the selector API and EPOLLWAKEUP is only marginally useful, not even getting exported into the select module after nearly a decade (Linux 3.5 was released in 2012). My API uses a getter/method instead of a read/write property because my understanding is that property access shouldn't raise exceptions, but if that doesn't matter here, it could be a read/write property. Justification: First, this is a useful flag that improves performance of epoll under even moderate load. I was going to turn it on by default in this patch but unfortunately Linux prevents you from doing epoll_mod() on anything that has EPOLLEXCLUSIVE set on it, breaking the python-level API. With this patch if you try to modify() after EPOLLEXCLUSIVE is set you'll get an EINVAL but I think the trade-off here is worth it. You don't enable EPOLLEXCLUSIVE on accident and you're reading the manpage for EPOLLEXCLUSIVE where this exact behavior is mentioned before turning anything on, right? And of course the Python docs also warn you about modify(). Second, the thundering herd problem solved by EPOLLEXCLUSIVE is somewhat of a sore spot for Python's PR. In the past year two widely disseminated articles have brought up this issue. This PR isn't going to be a silver bullet however it can make a huge impact in gunicorn, the 3rd party library mentioned in both articles. Gunicorn is a popular WSGI web server and its gthread worker (not the default but the one most often used in production) directly uses the selector module from the standard library. Honestly, it's pretty cool that they were able to make such efficient use of a standard library module like this - how far we've come from the days of asynchat! There is nothing in gunicorn's threaded worker that calls modify() so there would be no API breakage there. Gunicorn thundering herd articles: https://blog.clubhouse.com/reining-in-the-thundering-herd-with-django-and-gunicorn/ https://rachelbythebay.com/w/2020/03/07/costly/ ---------- components: Library (Lib) messages: 399880 nosy: David.Gilman priority: normal severity: normal status: open title: selector.EpollSelector: EPOLLEXCLUSIVE, round 2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 23:01:44 2021 From: report at bugs.python.org (David Gilman) Date: Thu, 19 Aug 2021 03:01:44 +0000 Subject: [issue44951] selector.EpollSelector: EPOLLEXCLUSIVE, round 2 In-Reply-To: <1629341349.12.0.0455922443851.issue44951@roundup.psfhosted.org> Message-ID: <1629342104.56.0.827250854027.issue44951@roundup.psfhosted.org> Change by David Gilman : ---------- keywords: +patch pull_requests: +26284 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27819 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 23:09:45 2021 From: report at bugs.python.org (David Gilman) Date: Thu, 19 Aug 2021 03:09:45 +0000 Subject: [issue44951] selector.EpollSelector: EPOLLEXCLUSIVE, round 2 In-Reply-To: <1629341349.12.0.0455922443851.issue44951@roundup.psfhosted.org> Message-ID: <1629342585.89.0.78747575414.issue44951@roundup.psfhosted.org> David Gilman added the comment: I also played with making another whole subclass that has it on by default, see this package https://github.com/dgilman/selector-epoll-exclusive That class could have EPOLLEXCLUSIVE on by default but could raise NotImplemented if you try and modify() it. Putting it in as a second class means you can also drop it into existing code unmodified, something that will play very nicely with all existing users of selector. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 23:37:18 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 19 Aug 2021 03:37:18 +0000 Subject: [issue44944] Addition of _heappush_max method to complete the max heap implementation in Python's heapq module In-Reply-To: <1629296478.45.0.736118078819.issue44944@roundup.psfhosted.org> Message-ID: <1629344238.27.0.270839196209.issue44944@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 18 23:56:29 2021 From: report at bugs.python.org (py_ok) Date: Thu, 19 Aug 2021 03:56:29 +0000 Subject: [issue44952] list need to filter again because the continue empty str value? Message-ID: <1629345389.69.0.268716831338.issue44952@roundup.psfhosted.org> New submission from py_ok <1979239641 at qq.com>: I`m poor in english.please run my code,Thanks. def rv(list): for i in list: #print(type(i)) #print(i.__len__()) if (i.isspace() or i=='' or len(i)==0): list.remove(i) return list list=['k', '', '', '', 'v', '', 'e', '', '', '', '73', '', 'p', '76', ''] print(rv(list))#['k', 'v', 'e', '73', '', 'p', '76', ''] The result still have empty str,I need to filter again.The reason is more empty val is linked.is a bug?or some reason? ---------- components: Build messages: 399882 nosy: py_ok priority: normal severity: normal status: open title: list need to filter again because the continue empty str value? type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 00:26:31 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 19 Aug 2021 04:26:31 +0000 Subject: [issue44921] dict subclassing is slow In-Reply-To: <1629058226.73.0.105626301201.issue44921@roundup.psfhosted.org> Message-ID: <1629347191.78.0.578355214515.issue44921@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 00:36:06 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 19 Aug 2021 04:36:06 +0000 Subject: [issue44952] list need to filter again because the continue empty str value? In-Reply-To: <1629345389.69.0.268716831338.issue44952@roundup.psfhosted.org> Message-ID: <1629347766.57.0.1248507433.issue44952@roundup.psfhosted.org> Steven D'Aprano added the comment: Not a bug. Use this instead: def rv(items): for item in items[:]: # iterate over a copy if not (item.isspace() or item == ''): items.remove(item) return items Or the same as above, as a list comprehension, no need to make a copy: items = [item for item in items if not (item.isspace() or item == '')] ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 00:47:26 2021 From: report at bugs.python.org (py_ok) Date: Thu, 19 Aug 2021 04:47:26 +0000 Subject: [issue44952] list need to filter again because the continue empty str value? In-Reply-To: <1629345389.69.0.268716831338.issue44952@roundup.psfhosted.org> Message-ID: <1629348446.9.0.821108630119.issue44952@roundup.psfhosted.org> py_ok <1979239641 at qq.com> added the comment: Thanks,Very timely resolve my problem ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 00:53:29 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 19 Aug 2021 04:53:29 +0000 Subject: [issue44952] list need to filter again because the continue empty str value? In-Reply-To: <1629345389.69.0.268716831338.issue44952@roundup.psfhosted.org> Message-ID: <1629348809.81.0.600587264024.issue44952@roundup.psfhosted.org> Steven D'Aprano added the comment: To understand why your code doesn't work, run this: items = ['a', '', 'b', '', 'c', '', 'd', '', 'e', ''] print(len(items)) for index, item in enumerate(items): print(index, repr(item), items) if item == '': items.remove('') When you remove an item, all the remaining items slide over one position, into the slot that has already been inspected. That means that they get skipped. ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 00:57:47 2021 From: report at bugs.python.org (py_ok) Date: Thu, 19 Aug 2021 04:57:47 +0000 Subject: [issue44952] list need to filter again because the continue empty str value? In-Reply-To: <1629348809.81.0.600587264024.issue44952@roundup.psfhosted.org> Message-ID: py_ok <1979239641 at qq.com> added the comment: Yes,I remember that my error in Java,like you say it`s skiped ------------------ ???? ------------------ ???: "Python tracker"https://bugs.python.org/issue44952>; _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 03:03:39 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 19 Aug 2021 07:03:39 +0000 Subject: [issue44079] [sqlite3] remove superfluous statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1629356619.69.0.921265501204.issue44079@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks Pablo for merging, and Berker for pushing me to investigate further. Highly appreciated! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:11:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 08:11:15 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629360675.75.0.194685239892.issue44830@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 942d1a4284e9341df47c48d7c63e921136dc9719 by Jack DeVries in branch 'main': bpo-44830: [doc] Restore missing Mozilla devguide link (GH-27818) https://github.com/python/cpython/commit/942d1a4284e9341df47c48d7c63e921136dc9719 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:11:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Aug 2021 08:11:17 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629360677.24.0.304854140647.issue44830@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26285 pull_request: https://github.com/python/cpython/pull/27820 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:11:21 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Aug 2021 08:11:21 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629360681.51.0.857763405233.issue44830@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26286 pull_request: https://github.com/python/cpython/pull/27821 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:15:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 08:15:17 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629360917.56.0.0210752263969.issue36384@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:31:27 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Aug 2021 08:31:27 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1629361887.45.0.0207176466132.issue44949@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26287 pull_request: https://github.com/python/cpython/pull/27822 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:31:31 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Aug 2021 08:31:31 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1629361891.63.0.822021940503.issue44949@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26288 pull_request: https://github.com/python/cpython/pull/27823 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:33:46 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Aug 2021 08:33:46 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629362026.45.0.911781165973.issue44830@roundup.psfhosted.org> miss-islington added the comment: New changeset ad16f93942a398ca1ec9bba54bb9c53a4e121e75 by Miss Islington (bot) in branch '3.10': bpo-44830: [doc] Restore missing Mozilla devguide link (GH-27818) https://github.com/python/cpython/commit/ad16f93942a398ca1ec9bba54bb9c53a4e121e75 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:36:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 08:36:59 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629362219.41.0.978962706119.issue44830@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset fb6074f5d71a6f9802bad97a129378c9556ed8d3 by Miss Islington (bot) in branch '3.9': bpo-44830: [doc] Restore missing Mozilla devguide link (GH-27818) (GH-27821) https://github.com/python/cpython/commit/fb6074f5d71a6f9802bad97a129378c9556ed8d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:39:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 08:39:57 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629362397.8.0.726651008384.issue36384@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26289 pull_request: https://github.com/python/cpython/pull/27824 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:41:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 08:41:05 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629362465.21.0.943378695452.issue36384@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26290 pull_request: https://github.com/python/cpython/pull/27825 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:43:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 08:43:10 +0000 Subject: [issue44830] Broken Mozilla devguide link in "Dealing with Bugs" doc section In-Reply-To: <1628096367.53.0.828359601844.issue44830@roundup.psfhosted.org> Message-ID: <1629362590.44.0.968369145225.issue44830@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, everyone! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:50:47 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 08:50:47 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629363047.36.0.742897524415.issue36384@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6ebfe8da6331bfcf54057f6e22a6f353a5621d35 by ?ukasz Langa in branch '3.8': [3.8] bpo-36384: [doc] Correct typos in CVE-2021-29921 fix description (GH-27825) https://github.com/python/cpython/commit/6ebfe8da6331bfcf54057f6e22a6f353a5621d35 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:52:20 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Aug 2021 08:52:20 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1629363140.08.0.44229327673.issue44949@roundup.psfhosted.org> miss-islington added the comment: New changeset fc6ad0585e8133ee0fca05f0f8075b62fe71a95d by Miss Islington (bot) in branch '3.10': bpo-44949: Fix test_readline auto history tests (GH-27813) https://github.com/python/cpython/commit/fc6ad0585e8133ee0fca05f0f8075b62fe71a95d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:55:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 08:55:53 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629363353.3.0.117374079251.issue36384@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0fd66e46b2f472d0d206a185dc8892f4f0347cb6 by ?ukasz Langa in branch 'main': bpo-36384: [doc] Mention CVE-2021-29921 fix in 3.8.12 (GH-27824) https://github.com/python/cpython/commit/0fd66e46b2f472d0d206a185dc8892f4f0347cb6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:56:02 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Aug 2021 08:56:02 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629363362.05.0.329159258422.issue36384@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26292 pull_request: https://github.com/python/cpython/pull/27827 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 04:55:58 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Aug 2021 08:55:58 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629363358.02.0.905562673315.issue36384@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26291 pull_request: https://github.com/python/cpython/pull/27826 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 05:07:24 2021 From: report at bugs.python.org (Mike Hommey) Date: Thu, 19 Aug 2021 09:07:24 +0000 Subject: [issue27035] Cannot set exit code in atexit callback In-Reply-To: <1463385428.15.0.762354704325.issue27035@psf.upfronthosting.co.za> Message-ID: <1629364044.11.0.781787530922.issue27035@roundup.psfhosted.org> Mike Hommey added the comment: > I think we should change the documentation to expand the parenthetical " (unless SystemExit is raised)" to a complete explanation of that special case. That would not be enough, since the case for other exceptions would still be ambiguous, as the described behavior ("After all exit handlers have had a chance to run the last exception to be raised is re-raised.") would imply the exit code would be altered, like when exceptions are raised in normal context. In 2.7 the only exception that _did_ change the exit code was SystemExit. ---------- nosy: +Mike Hommey _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 05:10:43 2021 From: report at bugs.python.org (Mike Hommey) Date: Thu, 19 Aug 2021 09:10:43 +0000 Subject: [issue27035] Cannot set exit code in atexit callback In-Reply-To: <1463385428.15.0.762354704325.issue27035@psf.upfronthosting.co.za> Message-ID: <1629364243.71.0.461918926436.issue27035@roundup.psfhosted.org> Mike Hommey added the comment: > In 2.7 the only exception that _did_ change the exit code was SystemExit. (and only if it was the last thrown exception) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 05:16:18 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 19 Aug 2021 09:16:18 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629364578.83.0.933025318256.issue36384@roundup.psfhosted.org> miss-islington added the comment: New changeset 1204dfc89cb3ed5e21dce32aed0339b7569fe1f9 by Miss Islington (bot) in branch '3.10': bpo-36384: [doc] Mention CVE-2021-29921 fix in 3.8.12 (GH-27824) https://github.com/python/cpython/commit/1204dfc89cb3ed5e21dce32aed0339b7569fe1f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 05:20:50 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 09:20:50 +0000 Subject: [issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal In-Reply-To: <1553125209.55.0.0358803413865.issue36384@roundup.psfhosted.org> Message-ID: <1629364850.97.0.253993286638.issue36384@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 98820250a3c9c131d3c2d57c4fc5260aebd8aa1d by Miss Islington (bot) in branch '3.9': bpo-36384: [doc] Mention CVE-2021-29921 fix in 3.8.12 (GH-27824) (GH-27827) https://github.com/python/cpython/commit/98820250a3c9c131d3c2d57c4fc5260aebd8aa1d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 05:23:49 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 19 Aug 2021 09:23:49 +0000 Subject: [issue44953] Add vectorcall on operator.itemgetter and attrgetter objects Message-ID: <1629365029.54.0.100452744635.issue44953@roundup.psfhosted.org> New submission from Dennis Sweeney : ## Below are my benchmarks for this change. from operator import itemgetter, attrgetter from pyperf import Runner class MyClass: __slots__ = "a", "b" namespace = {'itemgetter': itemgetter, 'attrgetter': attrgetter, 'MyClass': MyClass, } runner = Runner() runner.timeit( name="itemgetter", setup="f = itemgetter(1); x = (1, 2, 3)", stmt="f(x)", globals=namespace ) runner.timeit( name="attrgetter", setup="f = attrgetter('b'); x = MyClass(); x.a = x.b = 1", stmt="f(x)", globals=namespace ) ##### Results ##### # itemgetter: Mean +- std dev: [operator_main] 45.3 ns +- 1.3 ns -> [operator_vec] 29.5 ns +- 0.7 ns: 1.54x faster # attrgetter: Mean +- std dev: [operator_main] 61.6 ns +- 1.7 ns -> [operator_vec] 43.8 ns +- 0.9 ns: 1.41x faster ---------- components: Library (Lib) messages: 399900 nosy: Dennis Sweeney priority: normal severity: normal status: open title: Add vectorcall on operator.itemgetter and attrgetter objects type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 05:24:31 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 19 Aug 2021 09:24:31 +0000 Subject: [issue44953] Add vectorcall on operator.itemgetter and attrgetter objects In-Reply-To: <1629365029.54.0.100452744635.issue44953@roundup.psfhosted.org> Message-ID: <1629365071.49.0.322122594116.issue44953@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +26293 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27828 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 05:41:12 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 09:41:12 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629366072.97.0.9523456194.issue41322@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 3db42fc5aca320b0cac1895bc3cb731235ede794 by andrei kulakov in branch 'main': bpo-41322: added deprecation warning for tests returning value!=None (GH-27748) https://github.com/python/cpython/commit/3db42fc5aca320b0cac1895bc3cb731235ede794 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 05:42:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 09:42:07 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629366127.72.0.971861393193.issue41322@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for reporting, Alexander, and Andrei for the patch! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 05:42:12 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 09:42:12 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629366132.31.0.157565202587.issue41322@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 06:07:47 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 19 Aug 2021 10:07:47 +0000 Subject: [issue44850] Could operator.methodcaller be optimized using LOAD_METHOD? In-Reply-To: <1628246534.03.0.387871214532.issue44850@roundup.psfhosted.org> Message-ID: <1629367667.02.0.172186730802.issue44850@roundup.psfhosted.org> Mark Shannon added the comment: If the problem is that methodcaller is not faster than a lambda, then why not use a lambda? Lambdas are just Python functions and calling them will get faster. We aren't going to spend time optimizing calls to methodcaller, so you might as well use a lambda. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 06:36:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 19 Aug 2021 10:36:01 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1629369361.11.0.255793335028.issue44949@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0215257c613d55bec27201683f3dcb00f1726536 by Miss Islington (bot) in branch '3.9': bpo-44949: Fix test_readline auto history tests (GH-27813) (GH-27822) https://github.com/python/cpython/commit/0215257c613d55bec27201683f3dcb00f1726536 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 06:40:50 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 19 Aug 2021 10:40:50 +0000 Subject: [issue44941] Add check_methods function to standard library In-Reply-To: <1629252402.72.0.293302326241.issue44941@roundup.psfhosted.org> Message-ID: <1629369650.18.0.767829065712.issue44941@roundup.psfhosted.org> Ken Jin added the comment: @finnjavier08 sorry, I'd misinterpreted your original message. Thanks for clarifying your intent! > I'd be happy to do the implementation and pull request once approval is given and a module is decided on. I can't comment because I'm not an expert on collections.abc/abc and friends, but you might want to post your idea on the python-ideas mailing list or https://discuss.python.org/c/ideas/6 to get other opinions first. I have the feeling more people read the former. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 06:51:17 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 19 Aug 2021 10:51:17 +0000 Subject: [issue44914] tp_version_tag is not unique when test runs with -R : In-Reply-To: <1628954229.73.0.911721360588.issue44914@roundup.psfhosted.org> Message-ID: <1629370277.05.0.775836992213.issue44914@roundup.psfhosted.org> Ken Jin added the comment: I just realised I'm slightly wrong about identity checks -- there is a very very small chance where if the type object occupies the same address and the attribute is in a dynamically allocated __dict__ (and not some static slot), we can trick the checks and a segfault may occur for LOAD_ATTR using the old opcache in 3.10. I've tried running tests for 30 repetitions, but I cannot get the segfault to appear. @Pablo I'll leave it up to you if you feel it's backport worthy. I don't think people use sys._clear_type_cache or PyType_ClearCache normally so the chances of this causing any crash is astronomically small. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 07:22:07 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 19 Aug 2021 11:22:07 +0000 Subject: [issue44940] Hint the use of non-capturing group in re.findall() documentation In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629372127.91.0.304259336487.issue44940@roundup.psfhosted.org> Vedran ?a?i? added the comment: It currently says: ...matches are returned in the order found. If one or more groups are present in the pattern, return a list of groups... I'm not quite sure how it could be clearer. Maybe "Alternatively" at the start of the second sentence? regexr does the same thing, as far as I can see. Match is 'cool', group 1 is empty. Matches are not the same as groups. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 07:28:18 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 19 Aug 2021 11:28:18 +0000 Subject: [issue44940] Hint the use of non-capturing group in re.findall() documentation In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629372498.13.0.801792612755.issue44940@roundup.psfhosted.org> Vedran ?a?i? added the comment: Ah, now I see. When some_match.group(0) is called, the whole match is returned. So match can be considered kinda group (quasigroup?:). I see how it can be confusing: python usually starts indexing at 0, and someone might think that a .group(0) would be included in "a list of groups" returned. I'm not sure how best to fix it. Maybe: Alternatively, if grouping parentheses are present in the pattern, return a list of groups captured by them... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 07:34:02 2021 From: report at bugs.python.org (Pedro Gimeno) Date: Thu, 19 Aug 2021 11:34:02 +0000 Subject: [issue44954] Bug in float.fromhex Message-ID: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> New submission from Pedro Gimeno : >>> float.fromhex('0x0.8p-1074') 0.0 >>> float.fromhex('0x.8p-1074') 5e-324 One of them is obviously wrong. It's the second one, because: - The smallest denormal is 0x1p-1074 - Therefore, 0x0.8p-1074 is a tie for rounding purposes. - The digit in the last place is even because the number is zero, and there is a tie, which implies rounding down. ---------- components: Library (Lib) messages: 399909 nosy: pgimeno priority: normal severity: normal status: open title: Bug in float.fromhex versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 07:41:53 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 19 Aug 2021 11:41:53 +0000 Subject: [issue41379] Configparser is not reading Indended Sections as Mentioned in Docs In-Reply-To: <1595570483.9.0.509189951267.issue41379@roundup.psfhosted.org> Message-ID: <1629373313.91.0.655513454936.issue41379@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +26294 pull_request: https://github.com/python/cpython/pull/27830 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 07:52:18 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 19 Aug 2021 11:52:18 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629373938.13.0.972941862763.issue44954@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks for the report! I can reproduce the issue, and agree with your analysis. ---------- assignee: -> mark.dickinson nosy: +mark.dickinson versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 07:58:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Aug 2021 11:58:46 +0000 Subject: [issue44955] Method stopTestRun() is not always called for skipped tests Message-ID: <1629374326.22.0.989975388504.issue44955@roundup.psfhosted.org> New submission from Serhiy Storchaka : Method startTestRun() is always called for the TestResult object implicitly created by TestCase.defaultTestResult() when no TestResult object is passed to TestCase.run(). But method stopTestRun() is not always called in pair with startTestRun() for skipped tests. It is only called if SkipTest was raised directly or indirectly (via skipTest()). It is not called if a skipping decorator (@skip, @skipIf, @skipUnless) was used for a method or a class. ---------- components: Library (Lib) messages: 399911 nosy: ezio.melotti, michael.foord, rbcollins, serhiy.storchaka priority: normal severity: normal status: open title: Method stopTestRun() is not always called for skipped tests type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 08:12:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Aug 2021 12:12:38 +0000 Subject: [issue44955] Method stopTestRun() is not always called for skipped tests In-Reply-To: <1629374326.22.0.989975388504.issue44955@roundup.psfhosted.org> Message-ID: <1629375158.68.0.00465132641454.issue44955@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26295 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27831 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 08:18:04 2021 From: report at bugs.python.org (David Gilman) Date: Thu, 19 Aug 2021 12:18:04 +0000 Subject: [issue44951] selector.EpollSelector: EPOLLEXCLUSIVE, round 2 In-Reply-To: <1629341349.12.0.0455922443851.issue44951@roundup.psfhosted.org> Message-ID: <1629375484.7.0.502055158953.issue44951@roundup.psfhosted.org> David Gilman added the comment: Reflecting on this a bit I wonder if the best of all worlds is to have an EpollExclusiveSelector whose modify() implementation just unregisters and registers the file descriptor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 08:22:06 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 19 Aug 2021 12:22:06 +0000 Subject: [issue44946] Integer operations are inefficient for "medium" integers. In-Reply-To: <1629282332.14.0.448234766884.issue44946@roundup.psfhosted.org> Message-ID: <1629375726.19.0.219648751241.issue44946@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +26296 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 08:29:06 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 19 Aug 2021 12:29:06 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629376146.62.0.213173826853.issue44954@roundup.psfhosted.org> Mark Dickinson added the comment: The bug is in this line: https://github.com/python/cpython/blob/3db42fc5aca320b0cac1895bc3cb731235ede794/Objects/floatobject.c#L1467 which reads: (half_eps == 8 && (HEX_DIGIT(key_digit+1) & 1) != 0)) In the buggy case, key_digit=0 and the HEX_DIGIT macro is trying to retrieve the value of the second-to-least significant hex digit in the coefficient, to decide whether it's odd or not. For the "0x0.8" case it retrieves the "0". For the "0x.8" case, it retrieves the "x" and tries to interpret it as a hex digit. Even worse, if we exclude the "0x" prefix, as in `float.fromhex(".8p-1074")`, `HEX_DIGIT(1)` is accessing memory that doesn't belong to the string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 08:59:09 2021 From: report at bugs.python.org (Steve Carll) Date: Thu, 19 Aug 2021 12:59:09 +0000 Subject: [issue42491] Tkinter wait_visibility hanging when used in thread In-Reply-To: <1606559266.34.0.795590814191.issue42491@roundup.psfhosted.org> Message-ID: <1629377949.66.0.987388794254.issue42491@roundup.psfhosted.org> Steve Carll added the comment: This is a Tkinter problem and not a TK problem. I ended up working around the problem by forcing garbage collection before opening and after closing any Tkinter windows that are created from other Tkinter windows. Since adding this code I have not had the problem. ---------- nosy: +spcmicro2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 09:04:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Aug 2021 13:04:30 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629378270.96.0.784394167192.issue41322@roundup.psfhosted.org> Serhiy Storchaka added the comment: Tests are needed. ---------- resolution: fixed -> stage: resolved -> test needed status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 09:22:53 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Aug 2021 13:22:53 +0000 Subject: [issue44942] Add number pad enter bind to TK's simpleDialog In-Reply-To: <1629256091.95.0.739265447957.issue44942@roundup.psfhosted.org> Message-ID: <1629379373.61.0.762841171778.issue44942@roundup.psfhosted.org> Serhiy Storchaka added the comment: Tk does not bind KP_Enter in standard TK dialogs. I do not think we should introduce additional discrepancy between dialogs implemented in Tk and Python. Please file a feature request for Tk. If they add a binding for KP_Enter we will follow them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 09:30:19 2021 From: report at bugs.python.org (Robert T McQuaid) Date: Thu, 19 Aug 2021 13:30:19 +0000 Subject: [issue44956] curses getch returns wrong value Message-ID: <1629379819.39.0.754773231829.issue44956@roundup.psfhosted.org> New submission from Robert T McQuaid : This applies to Python 3.8 under Debian-11 Bullseye. Under curses getch should return the value of curses.KEY_B2 (350 decimal) when pressing the keypad 5. Instead it returns 574. The simple program following the signature block illustrates the problem. Robert T McQuaid 558 McMartin Road Mattawa Ontario P0H 1V0 phone: 705-744-6274 email: rtmq at fixcas.com # Put the following lines in a file bug.py # Run from a terminal with: python3 bug.py import curses as cs def report(stdscr): print('press the keypad 5') global result result=stdscr.getch() cs.initscr() cs.wrapper(report) print('KEY_B2 (decimal): '+str(cs.KEY_B2)) print('input decimal value: '+str(result)) ---------- components: Library (Lib) messages: 399917 nosy: arbor priority: normal severity: normal status: open title: curses getch returns wrong value versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 09:33:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 19 Aug 2021 13:33:03 +0000 Subject: [issue44949] test_readline: test_auto_history_disabled() fails randomly on aarch64 RHEL8 Refleaks 3.9, 3.10 and 3.x In-Reply-To: <1629299356.46.0.606067543476.issue44949@roundup.psfhosted.org> Message-ID: <1629379983.06.0.539975633113.issue44949@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 09:48:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Aug 2021 13:48:13 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629380893.59.0.11457480296.issue44524@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are still cryptic TypeError messages for Annotated: >>> class X(Annotated[int | float, "const"]): pass ... Traceback (most recent call last): File "", line 1, in TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 09:50:37 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Thu, 19 Aug 2021 13:50:37 +0000 Subject: [issue44957] typing docs: Mention PEP 604 syntax more prominently Message-ID: <1629381037.95.0.0399293112923.issue44957@roundup.psfhosted.org> New submission from Sebastian Rittau : The new PEP 604 syntax for type unions should be mentioned more prominently in the typing docs, starting with Python 3.10. I'm preparing a PR for discussion. ---------- assignee: docs at python components: Documentation messages: 399919 nosy: docs at python, srittau priority: normal severity: normal status: open title: typing docs: Mention PEP 604 syntax more prominently versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 09:56:46 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Thu, 19 Aug 2021 13:56:46 +0000 Subject: [issue44957] typing docs: Mention PEP 604 syntax more prominently In-Reply-To: <1629381037.95.0.0399293112923.issue44957@roundup.psfhosted.org> Message-ID: <1629381406.52.0.0645391122321.issue44957@roundup.psfhosted.org> Change by Sebastian Rittau : ---------- keywords: +patch pull_requests: +26297 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27833 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 10:14:28 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 19 Aug 2021 14:14:28 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629382468.53.0.47382757483.issue44954@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +26298 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27834 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 10:22:25 2021 From: report at bugs.python.org (Douglas Raillard) Date: Thu, 19 Aug 2021 14:22:25 +0000 Subject: [issue22239] asyncio: nested event loop In-Reply-To: <1408557830.66.0.604610139339.issue22239@psf.upfronthosting.co.za> Message-ID: <1629382945.61.0.221154406309.issue22239@roundup.psfhosted.org> Douglas Raillard added the comment: Drive by comment: I landed on this thread for the exact same reason: > This situation is very frequent when e.g. a library is designed to be async-first, and also provides a blocking API which just wraps the async code by running it until complete. The library in question is "devlib", which abstracts over SSH/adb/local shell. We cannot make a "full" switch to async as it would be a big breaking change. To workaround that, I came up with a decorator that wraps a corountine, and "replaces" it such that: @asyncf async def f(...): ... # Blocking call under its "normal" name, for backward compat f() # Used in an async environment await f.asyn() This allows converting bit by bit the whole library, with full backward compatibility for both users and internal calls. On top of that, that library is heavily used in jupyter notebooks, so all in all, nest-asyncio is impossible to avoid. ---------- nosy: +douglas-raillard-arm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 10:30:09 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 19 Aug 2021 14:30:09 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629383409.91.0.0938413182363.issue42560@roundup.psfhosted.org> Change by Mark Roseman : ---------- pull_requests: +26299 pull_request: https://github.com/python/cpython/pull/27835 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 10:39:01 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 19 Aug 2021 14:39:01 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629383941.95.0.0545277688089.issue42560@roundup.psfhosted.org> Change by Mark Roseman : ---------- pull_requests: +26300 pull_request: https://github.com/python/cpython/pull/27836 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 10:51:26 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 19 Aug 2021 14:51:26 +0000 Subject: [issue42255] webbrowser.MacOSX is unused, untested and undocumented In-Reply-To: <1604430901.68.0.981211049507.issue42255@roundup.psfhosted.org> Message-ID: <1629384686.62.0.429356259254.issue42255@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +26301 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27837 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 10:56:47 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 19 Aug 2021 14:56:47 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629385007.05.0.4878221361.issue42560@roundup.psfhosted.org> Change by Mark Roseman : ---------- pull_requests: +26302 pull_request: https://github.com/python/cpython/pull/27838 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 11:06:26 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 19 Aug 2021 15:06:26 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629385586.12.0.0498977104493.issue42560@roundup.psfhosted.org> Change by Mark Roseman : ---------- pull_requests: +26303 pull_request: https://github.com/python/cpython/pull/27839 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 11:18:21 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 19 Aug 2021 15:18:21 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629386301.6.0.818378963881.issue42560@roundup.psfhosted.org> Change by Mark Roseman : ---------- pull_requests: +26304 pull_request: https://github.com/python/cpython/pull/27840 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 11:41:27 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 19 Aug 2021 15:41:27 +0000 Subject: [issue44957] typing docs: Mention PEP 604 syntax more prominently In-Reply-To: <1629381037.95.0.0399293112923.issue44957@roundup.psfhosted.org> Message-ID: <1629387687.56.0.199602477737.issue44957@roundup.psfhosted.org> Guido van Rossum added the comment: Ken, this sounds like a good idea. Can you help? ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 12:21:29 2021 From: report at bugs.python.org (Marco Sulla) Date: Thu, 19 Aug 2021 16:21:29 +0000 Subject: [issue44921] dict subclassing is slow In-Reply-To: <1629058226.73.0.105626301201.issue44921@roundup.psfhosted.org> Message-ID: <1629390089.88.0.65824233314.issue44921@roundup.psfhosted.org> Marco Sulla added the comment: Since probably Monica are taking her holidays, I try to decipher her answer. Probably, the more problematic function spotted by Monica is update_one_slot. I re-quote her sentence: update_one_slot looks for the parent implementation by trying to find the generated wrapper methods through an MRO search. dict doesn't have generated wrappers for sq_contains and mp_subscript, because it provides explicit __contains__ and __getitem__ implementations. Instead of inheriting sq_contains and mp_subscript, update_one_slot ends up giving the subclass sq_contains and mp_subscript implementations that perform an MRO search for __contains__ and __getitem__ and call those. This is much less efficient than inheriting the C slots directly. The solution for Monica is to change the behaviour of update_one_slot for these cases (no wrappers, C slots directly). I don't know the implications of this change... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 12:24:05 2021 From: report at bugs.python.org (santhosh) Date: Thu, 19 Aug 2021 16:24:05 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629390245.98.0.668607848819.issue41322@roundup.psfhosted.org> santhosh added the comment: def split_module_names(module): unnamed, named = set(), set() for name in dir(module): if not name.startswith('_'): attr = getattr(module, name) try: if hasattr(attr, '__name__'): named.add(name) else: unnamed.add(name) except TypeError: pass return named, unnamed ---------- nosy: +santhu_reddy12 -andrei.avk, defreng, ezio.melotti, lukasz.langa, michael.foord, rbcollins, serhiy.storchaka, terry.reedy, xtreak, zach.ware versions: +Python 3.8 -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 12:24:58 2021 From: report at bugs.python.org (santhosh) Date: Thu, 19 Aug 2021 16:24:58 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629390298.66.0.53519750041.issue41322@roundup.psfhosted.org> Change by santhosh : ---------- nosy: +fdrake, stefan, terry.reedy versions: +Python 3.7 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 12:36:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Aug 2021 16:36:15 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629390975.21.0.201680278713.issue44524@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are some side effects of setting _name. In 3.9: >>> class X(Annotated[int, (1, 10)]): pass ... >>> X.__mro__ (, , ) In 3.10: >>> class X(Annotated[int, (1, 10)]): pass ... >>> X.__mro__ (, , , ) Now a subclass of an Annotated alias is a generic type. Should it be? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 12:50:58 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 19 Aug 2021 16:50:58 +0000 Subject: [issue44942] Add number pad enter bind to TK's simpleDialog In-Reply-To: <1629256091.95.0.739265447957.issue44942@roundup.psfhosted.org> Message-ID: <1629391858.5.0.362233196308.issue44942@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 12:54:56 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 19 Aug 2021 16:54:56 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629392096.38.0.537343049302.issue41322@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +lukasz.langa, serhiy.storchaka -fdrake, stefan, terry.reedy versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 12:57:32 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 19 Aug 2021 16:57:32 +0000 Subject: [issue44957] typing docs: Mention PEP 604 syntax more prominently In-Reply-To: <1629381037.95.0.0399293112923.issue44957@roundup.psfhosted.org> Message-ID: <1629392252.66.0.432322217321.issue44957@roundup.psfhosted.org> Ken Jin added the comment: Sure. Sebastian has created a really thorough PR at GH-27833 and I like it (with only one point for discussion). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 13:02:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Aug 2021 17:02:34 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629392554.64.0.629610142963.issue41322@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +andrei.avk, defreng, ezio.melotti, michael.foord, rbcollins, terry.reedy, xtreak, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 13:24:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Aug 2021 17:24:09 +0000 Subject: [issue44923] Unittest incorrect result with argparse.ArgumentError in self asserRaises context In-Reply-To: <1629107553.76.0.661365207866.issue44923@roundup.psfhosted.org> Message-ID: <1629393849.76.0.771856571654.issue44923@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 13:33:38 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 19 Aug 2021 17:33:38 +0000 Subject: [issue44957] typing docs: Mention PEP 604 syntax more prominently In-Reply-To: <1629381037.95.0.0399293112923.issue44957@roundup.psfhosted.org> Message-ID: <1629394418.68.0.820102452786.issue44957@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks to both of you!! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 13:43:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 19 Aug 2021 17:43:12 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629394992.67.0.864466399265.issue41322@roundup.psfhosted.org> Andrei Kulakov added the comment: I will add the test in the next 1-2 days, I should have asked if it's needed in this case.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 13:49:42 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 19 Aug 2021 17:49:42 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629395382.57.0.874433009398.issue44524@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +26305 pull_request: https://github.com/python/cpython/pull/27841 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 13:50:08 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 19 Aug 2021 17:50:08 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629395408.24.0.325604349755.issue44524@roundup.psfhosted.org> Ken Jin added the comment: > Now a subclass of an Annotated alias is a generic type. Should it be? I'm unsure if Annotated should be subclassable in the first place, but if I understand PEP 593 correctly, class X(Annotated[int, (1, 10)]), should be equivalent to class X(int) right? If that's the case, it's subclassable and Generic shouldn't be in the MRO. FWIW, the other special forms don't allow subclassing, so we don't need to think about this problem for them. Annotated is a special cookie. I propose we just drop the _name hack temporarily in Annotated. A real fix requires fixing up __mro_entries__, but I am uncomfortable with us backporting to 3.10 anything that touches __mro_entries__ due to the numerous edge cases it has and how close we are to 3.10 final. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 14:07:35 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 19 Aug 2021 18:07:35 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629396455.36.0.0373576411335.issue44524@roundup.psfhosted.org> Jelle Zijlstra added the comment: I don't think we need to support Annotated as a base class. PEP 593 is titled "Flexible function and variable annotations", and base classes are neither of those things. None of the examples in the PEP or the implementation use Annotated as a base class either. On the other hand, subclassing Annotated[T, ...] does work at runtime in 3.9, so maybe we're bound by backward compatibility now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 14:51:46 2021 From: report at bugs.python.org (Mark Roseman) Date: Thu, 19 Aug 2021 18:51:46 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629399106.52.0.551869101464.issue42560@roundup.psfhosted.org> Change by Mark Roseman : ---------- pull_requests: +26306 pull_request: https://github.com/python/cpython/pull/27842 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 15:20:41 2021 From: report at bugs.python.org (tester) Date: Thu, 19 Aug 2021 19:20:41 +0000 Subject: [issue44933] python3.9-intel64 hardened runtime not enabled In-Reply-To: <1629191936.44.0.533137792291.issue44933@roundup.psfhosted.org> Message-ID: <1629400841.5.0.620649984884.issue44933@roundup.psfhosted.org> tester added the comment: I found the fix for it earlier today and of course the fix is always right in front of you, you just need to look in the right place lol jokes on me. I orginnaly had this and a few other things in my notarization script to get python notarized. codesign --force --options runtime --entitlements $MUNKIROOT/entitlements.plist --deep --verbose -s "$DevApp" $MUNKIROOT/Python.framework/Versions/$PYTHON_FRAMEWORK_VERSION/bin/"python$PYTHON_FRAMEWORK_VERSION" So i just had to add the stuff below to make python3.x-intel64 also get notarized properly codesign --force --options runtime --entitlements $MUNKIROOT/entitlements.plist --deep --verbose -s "$DevApp" $MUNKIROOT/Python.framework/Versions/$PYTHON_FRAMEWORK_VERSION/bin/"python$PYTHON_FRAMEWORK_VERSION-intel64" https://github.com/lifeunexpected/Scripts/blob/master/Munki.Notarize.zsh I mostly posted this in case anyone else randomly googles this type off issue so maybe it can help them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 16:05:09 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 19 Aug 2021 20:05:09 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed Message-ID: <1629403509.48.0.897657910933.issue44958@roundup.psfhosted.org> New submission from Erlend E. Aasland : Ref. Serhiy's msg387858 in bpo-43350: "Maybe the code could be rewritten in more explicit way and call pysqlite_statement_reset() only when it is necessary [...]" Currently, we try to reset statements in all "statement exit" routes. IMO, it would be cleaner to just reset statements when we really need to: 1. before the first sqlite3_step() 2. at cursor exit, if there's an active statement (3. in pysqlite_do_all_statements() ... see bpo-44092) This will make the code easier to follow, and it will minimise the number of resets. The current patch is pretty small: 7 insertions(+), 33 deletions(-) Pro: - less lines of code, less maintenance - cleaner exit paths - optimise SQLite API usage Con: - code churn If this is accepted, PR 25984 of bpo-44073 will be easier to land and review :) ---------- components: Extension Modules messages: 399931 nosy: berker.peksag, erlendaasland, pablogsal, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite3] only reset statements when needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 16:07:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 19 Aug 2021 20:07:00 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629403509.48.0.897657910933.issue44958@roundup.psfhosted.org> Message-ID: <1629403620.77.0.950501374258.issue44958@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +26307 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27844 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 16:10:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 19 Aug 2021 20:10:44 +0000 Subject: [issue44073] [sqlite3] drop statement in_use field in favour of sqlite3_stmt_busy() In-Reply-To: <1620460079.81.0.577574944672.issue44073@roundup.psfhosted.org> Message-ID: <1629403844.2.0.225679011635.issue44073@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-44958 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 16:14:31 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 19 Aug 2021 20:14:31 +0000 Subject: [issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute() In-Reply-To: <1614592369.49.0.483199992415.issue43350@roundup.psfhosted.org> Message-ID: <1629404071.64.0.712054236723.issue43350@roundup.psfhosted.org> Erlend E. Aasland added the comment: msg387858 (Serhiy): > Maybe the code could be rewritten in more explicit way and call > pysqlite_statement_reset() only when it is necessary [...] I've opened bpo-44958 for such an enhancement. Closing this issue. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> [sqlite3] only reset statements when needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 16:36:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 19 Aug 2021 20:36:49 +0000 Subject: [issue44956] curses getch returns wrong value In-Reply-To: <1629379819.39.0.754773231829.issue44956@roundup.psfhosted.org> Message-ID: <1629405409.24.0.910041693704.issue44956@roundup.psfhosted.org> Serhiy Storchaka added the comment: Your terminal emulator does not support this key. I tested it on Konsole and it returned 27. But on XTerm and on the Linux virtual console I get the expected result. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 17:04:23 2021 From: report at bugs.python.org (Sascha) Date: Thu, 19 Aug 2021 21:04:23 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629407063.13.0.831590080898.issue44934@roundup.psfhosted.org> Sascha added the comment: hi, if you know that it will lead to confusion why is this confusion not written here: https://docs.python.org/3/using/windows.html If you do software deployment in a company you will only have one version so having more than one version is not the point. And if you make append path optional available like prepend everybody can choose. Anyway. What i have seen now is if you uninstall Python it is not cleaning up the path variable. Is there any parameter i missed? ---------- nosy: +Saxomania _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 17:31:35 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 19 Aug 2021 21:31:35 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629408695.81.0.989567153008.issue44934@roundup.psfhosted.org> Steve Dower added the comment: > why is this confusion not written here >From https://docs.python.org/3/using/windows.html#configuring-python > While the installer provides an option to configure the PATH and PATHEXT variables for you, this is only reliable for a single, system-wide installation. If you regularly use multiple versions of Python, consider using the Python Launcher for Windows. Now, that isn't *exactly* the issue in the original post, but the warning is present. > If you do software deployment in a company you will only have one version so having more than one version is not the point. Unfortunately not true. It's been a while since I had actual data on this, but last time I did the *majority* had 2 versions installed, and 3-5 versions were all more likely than only a single one. So handling multiple versions matters. > What i have seen now is if you uninstall Python it is not cleaning up the path variable. We do the best we can by using the native Windows support for installing environment variables. It sometimes doesn't work if you (or another installer) has modified the variable since you installed Python, or if you've updated it yourself. That's out of our control - we can't do a better job than the OS. > if you make append path optional available like prepend everybody can choose Contributions are welcome. We aren't paid to implement features - we volunteer to manage contributions, so if you'd really like this to be in the installer, feel free to go for it. (Last time the installer was modified we had most trouble making the UI not break, but it's probably not too hard if this was a command-line only.) ---------- stage: -> needs patch type: behavior -> enhancement versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 17:46:10 2021 From: report at bugs.python.org (Eli Skeggs) Date: Thu, 19 Aug 2021 21:46:10 +0000 Subject: [issue43884] Cannot cleanly kill a subprocess using high-level asyncio APIs In-Reply-To: <1618800458.29.0.766698985684.issue43884@roundup.psfhosted.org> Message-ID: <1629409570.97.0.917273899792.issue43884@roundup.psfhosted.org> Eli Skeggs added the comment: I'm also experiencing this, with virtually identical code, on macOS 10.15.7. The given fix (process._transport.close()) also works for me, so I'm just using that workaround for the time being. ---------- nosy: +skeggse _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 19 21:12:59 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 20 Aug 2021 01:12:59 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629421979.84.0.27861514469.issue41322@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- pull_requests: +26308 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/27846 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 02:55:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Aug 2021 06:55:02 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629442502.32.0.439603724197.issue41322@roundup.psfhosted.org> Serhiy Storchaka added the comment: Every new feature should be documented and covered by tests (unless it is very trivial or it is very difficult to write a test for it). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 03:33:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 20 Aug 2021 07:33:44 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629403509.48.0.897657910933.issue44958@roundup.psfhosted.org> Message-ID: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Erlend E. Aasland added the comment: Ref. Serhiy's msg387858 in bpo-43350: "Maybe the code could be rewritten in more explicit way and call pysqlite_statement_reset() only when it is necessary [...]" Currently, we try to reset statements in all "statement exit" routes. IMO, it would be cleaner to just reset statements when we really need to: 1. before the first sqlite3_step() every time we (re)execute a query 2. at cursor exit, if there's an active statement (3. in pysqlite_do_all_statements() ... see bpo-44092) This will make the code easier to follow, and it will minimise the number of resets. The current patch is pretty small: 7 insertions(+), 33 deletions(-) Pro: - less lines of code, less maintenance - cleaner exit paths - optimise SQLite API usage Con: - code churn If this is accepted, PR 25984 of bpo-44073 will be easier to land and review :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 03:33:50 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 20 Aug 2021 07:33:50 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1629444830.36.0.696873118358.issue44958@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- Removed message: https://bugs.python.org/msg399931 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 04:22:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Aug 2021 08:22:46 +0000 Subject: [issue44940] Hint the use of non-capturing group in re.findall() documentation In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629447766.36.0.542598822497.issue44940@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch nosy: +serhiy.storchaka nosy_count: 3.0 -> 4.0 pull_requests: +26309 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27849 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:04:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 09:04:44 +0000 Subject: [issue20499] Rounding errors with statistics.variance In-Reply-To: <1391431579.33.0.244887922603.issue20499@psf.upfronthosting.co.za> Message-ID: <1629450284.63.0.329604715002.issue20499@roundup.psfhosted.org> Irit Katriel added the comment: Reproduced on 3.11: >>> statistics.pvariance([0,0,1]) 0.22222222222222224 >>> statistics.variance([0,0,2]) 1.3333333333333335 ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:07:44 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 09:07:44 +0000 Subject: [issue21111] Add a new PyLong_AsUnsignedLongAndOverflow function In-Reply-To: <1396272396.7.0.644063349125.issue21111@psf.upfronthosting.co.za> Message-ID: <1629450464.87.0.0360808888267.issue21111@roundup.psfhosted.org> Mark Dickinson added the comment: Let's close this one. The patch is stale, and I think we should be somewhat cautious about expanding the C-API without clear use-cases - I don't think it's worth adding the new function just for symmetry / consistency. I'm happy to re-open if those use-cases emerge. ---------- resolution: -> rejected stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:09:57 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 09:09:57 +0000 Subject: [issue44728] Testsuite fails on x86_64 In-Reply-To: <1627062901.76.0.984645302952.issue44728@roundup.psfhosted.org> Message-ID: <1629450597.19.0.191814001964.issue44728@roundup.psfhosted.org> Mark Dickinson added the comment: Update: test_turtle is fixed (44734); I think test_math and test_cmath should be resolved as either "third party" or "wont fix", since the issue is almost certainly the platform libm. That leaves test_posix, which we should probably open a fresh issue for. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:12:25 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 09:12:25 +0000 Subject: [issue44728] Testsuite fails on x86_64 In-Reply-To: <1627062901.76.0.984645302952.issue44728@roundup.psfhosted.org> Message-ID: <1629450745.81.0.694868492987.issue44728@roundup.psfhosted.org> Mark Dickinson added the comment: Here's the test_posix failure, extracted from the attachment: ====================================================================== ERROR: test_sched_rr_get_interval (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/build/python/src/Python-3.9.6/Lib/test/test_posix.py", line 1347, in test_sched_rr_get_interval interval = posix.sched_rr_get_interval(0) PermissionError: [Errno 1] Operation not permitted ---------------------------------------------------------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:20:20 2021 From: report at bugs.python.org (Bastian Neuburger) Date: Fri, 20 Aug 2021 09:20:20 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629451220.12.0.387726893424.issue44934@roundup.psfhosted.org> Bastian Neuburger added the comment: Hi Steve, Of course there are various reasons for having multiple Python versions on a developer workstation but I would assume that the majority of Windows installer users simple want to run Python projects, at least this holds true for the majority of Python on Windows users in my org. > if you'd really like this to be in the installer, feel free to go for it. could you point me to the relevant files and lines for the PrependPath CLI option and implementation logic on Github? Not sure if I got it right, but I assume the following file is in charge of modifying the env:path: https://github.com/python/cpython/blob/main/Tools/msi/path/path.wxs Since I have never worked within the MSI framework, I could not figure out how the "call flow" from enabling the definition of the PrependPath in https://github.com/python/cpython/blob/main/Tools/msi/bundle/bundle.wxs to actually modifying the path Regarging path.wxs: Would you prefer that I add a pathappend/pathappend.wxs or should I simply add a new Component ID like so: ALLUSERS=1 ... Or would I introduce a new condition ALLUSERS_APPEND or something? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:33:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Aug 2021 09:33:48 +0000 Subject: [issue44449] Segfault in _PyTrash_begin when faulthandler tries to dump thread stacks In-Reply-To: <1624012030.73.0.910498447609.issue44449@roundup.psfhosted.org> Message-ID: <1629452028.26.0.0201968295107.issue44449@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +26310 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27850 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:34:43 2021 From: report at bugs.python.org (=?utf-8?q?Florin_Sp=C4=83tar?=) Date: Fri, 20 Aug 2021 09:34:43 +0000 Subject: [issue44959] EXT_SUFFIX is missing '.sl' on HP-UX Message-ID: <1629452083.0.0.513630560234.issue44959@roundup.psfhosted.org> New submission from Florin Sp?tar : On HP-UX, python can no longer find extension modules with the '.sl' suffix. [fspatar at hpux1131:/cust/fspatar/buildtest/hp-ux/11.31/build]> ~/tmp/investigation3/old/bin/python3 Python 3.8.11 (default, Aug 3 2021, 06:15:31) [GCC 4.2.4] on hp-ux-pa Type "help", "copyright", "credits" or "license" for more information. >>> import M2Crypto Traceback (most recent call last): File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/m2crypto.py", line 16, in swig_import_helper fp, pathname, description = imp.find_module('_m2crypto', [dirname(__file__)]) File "/h/fspatar/tmp/investigation3/old/lib/python3.8/imp.py", line 296, in find_module raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named '_m2crypto' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/__init__.py", line 37, in from M2Crypto import (ASN1, AuthCookie, BIO, BN, DH, DSA, EVP, Engine, Err, File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/ASN1.py", line 15, in from M2Crypto import BIO, m2, py27plus, six, has_typing File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/BIO.py", line 9, in from M2Crypto import m2, py27plus, six, has_typing File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/m2.py", line 30, in from M2Crypto.m2crypto import * File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/m2crypto.py", line 26, in _m2crypto = swig_import_helper() File "/cust/fspatar/buildtest/hp-ux/11.31/build/M2Crypto/m2crypto.py", line 18, in swig_import_helper import _m2crypto ModuleNotFoundError: No module named '_m2crypto' This works fine in python 3.8.5 [fspatar at hpux1131:/cust/fspatar/buildtest/hp-ux/11.31/build]> /opt/OPSWbuildtools/2.0.5/python/3.8.5.04/bin/python3 Python 3.8.5 (default, Jul 28 2021, 08:38:55) [GCC 4.2.4] on hp-ux-pa Type "help", "copyright", "credits" or "license" for more information. >>> import M2Crypto It seems to be related to recent changes from https://bugs.python.org/issue42604 Given the file name is _m2crypto.sl, python 3.8.11 can no longer find it. Based on https://www.python.org/dev/peps/pep-3149/#pep-384, my understanding is that python should search for the following file names when extension module _m2crypto is imported (in this order): _m2crypto.cpython-38.sl _m2crypto.so Python can only load the extension module if the file name is _m2crypto.cpython-38.sl [fspatar at hpux1131:/cust/fspatar/buildtest/hp-ux/11.31/build]> ~/tmp/investigation3/old/bin/python3 Python 3.8.11 (default, Aug 3 2021, 06:15:31) [GCC 4.2.4] on hp-ux-pa Type "help", "copyright", "credits" or "license" for more information. >>> import _imp >>> _imp.extension_suffixes() ['.cpython-38.sl'] >>> [fspatar at hpux1131:/cust/fspatar/buildtest/hp-ux/11.31/build]> /opt/OPSWbuildtools/2.0.5/python/3.8.5.04/bin/python3 Python 3.8.5 (default, Jul 28 2021, 08:38:55) [GCC 4.2.4] on hp-ux-pa Type "help", "copyright", "credits" or "license" for more information. >>> import _imp >>> _imp.extension_suffixes() ['.sl'] >>> ---------- components: Extension Modules files: python-hpux-extension-suffixes.patch keywords: patch messages: 399945 nosy: florinspatar, mattip, miss-islington, pablogsal, vstinner priority: normal severity: normal status: open title: EXT_SUFFIX is missing '.sl' on HP-UX type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50227/python-hpux-extension-suffixes.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:36:10 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 09:36:10 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1629452170.97.0.39024989395.issue44603@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:37:26 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 09:37:26 +0000 Subject: [issue44625] Python C API version of `fractions` module In-Reply-To: <1626192943.31.0.963042102585.issue44625@roundup.psfhosted.org> Message-ID: <1629452246.86.0.689226898022.issue44625@roundup.psfhosted.org> Mark Dickinson added the comment: Closing here. I think we'd need a PEP and a wider discussion to take this forward. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:37:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 20 Aug 2021 09:37:39 +0000 Subject: [issue44959] EXT_SUFFIX is missing '.sl' on HP-UX In-Reply-To: <1629452083.0.0.513630560234.issue44959@roundup.psfhosted.org> Message-ID: <1629452259.38.0.686248301184.issue44959@roundup.psfhosted.org> STINNER Victor added the comment: Can you please try to convert your patch into a GitHub pull request? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:51:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 09:51:12 +0000 Subject: [issue28327] statistics.geometric_mean gives incorrect results for mixed int/float inputs In-Reply-To: <1475324315.92.0.282609876939.issue28327@psf.upfronthosting.co.za> Message-ID: <1629453072.72.0.110743669826.issue28327@roundup.psfhosted.org> Irit Katriel added the comment: I can't reproduce this now: >>> statistics.geometric_mean([2, 3, 5, 7]) 3.80675409583932 >>> statistics.geometric_mean([2, 3, 5, 7.0]) 3.80675409583932 >>> statistics.geometric_mean([2, 3, 5.0, 7.0]) 3.80675409583932 >>> statistics.geometric_mean([2, 3.0, 5.0, 7.0]) 3.80675409583932 >>> statistics.geometric_mean([2.0, 3.0, 5.0, 7.0]) 3.80675409583932 >>> The current geometric_mean was added in PR12638. Is this issue about a previous version? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:53:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 09:53:18 +0000 Subject: [issue28111] geometric_mean can raise OverflowError for large input length In-Reply-To: <1473733233.31.0.576673883283.issue28111@psf.upfronthosting.co.za> Message-ID: <1629453198.23.0.252001108195.issue28111@roundup.psfhosted.org> Irit Katriel added the comment: I can't reproduce this now (tried on mac and windows): >>> statistics.geometric_mean([0.7 for _ in range(5000)]) 0.7 The current geometric_mean was added in PR12638. Is this issue about a previous version? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 05:58:28 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 09:58:28 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1629453508.72.0.807615056564.issue44547@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +26311 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27851 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:01:31 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 10:01:31 +0000 Subject: [issue28111] geometric_mean can raise OverflowError for large input length In-Reply-To: <1473733233.31.0.576673883283.issue28111@psf.upfronthosting.co.za> Message-ID: <1629453691.78.0.795600134902.issue28111@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks, @Irit. Yes, this is about a different version of geometric_mean that didn't end up making it into any release. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:02:48 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 10:02:48 +0000 Subject: [issue28327] statistics.geometric_mean gives incorrect results for mixed int/float inputs In-Reply-To: <1475324315.92.0.282609876939.issue28327@psf.upfronthosting.co.za> Message-ID: <1629453768.55.0.729299085543.issue28327@roundup.psfhosted.org> Mark Dickinson added the comment: > Is this issue about a previous version? Yep. Sorry for failing to close this earlier. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:04:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 10:04:08 +0000 Subject: [issue20389] clarify meaning of xbar and mu in pvariance/variance of statistics module In-Reply-To: <1390653440.27.0.247965137131.issue20389@psf.upfronthosting.co.za> Message-ID: <1629453848.77.0.368519685579.issue20389@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:09:23 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 10:09:23 +0000 Subject: [issue44728] Testsuite fails on x86_64 In-Reply-To: <1627062901.76.0.984645302952.issue44728@roundup.psfhosted.org> Message-ID: <1629454163.73.0.538395515962.issue44728@roundup.psfhosted.org> Mark Dickinson added the comment: One more thought on the libm issues - from the logs, it looks as though the libm implementation is coming from a fairly recent version of glibc (glibc 2.33, which was released in February 2021). There were updates to the 'exp' implementation in glibc in 2018[1], but I'm not seeing anything more recent than that. Is it possible that glibc was miscompiled somehow on this platform - e.g., that it's using code designed to work with the x87 FPU with its extended precision, but was compiled with flags that force use of SSE2 instead? If not, and if there's a genuine accuracy problem in glibc itself, we should expect to see more Python test_math and test_cmath failures in the future. If anyone is able to run test_math or test_cmath on a machine using glibc 2.33 or glibc 2.34 and report results, that would be useful. [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=e70c17682518fab2fad164fecf73341443bc2ed3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:10:09 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 10:10:09 +0000 Subject: [issue16801] Preserve original representation for integers / floats in docstrings In-Reply-To: <1356699853.91.0.313275944642.issue16801@psf.upfronthosting.co.za> Message-ID: <1629454209.49.0.101915425733.issue16801@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:12:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 10:12:17 +0000 Subject: [issue20389] clarify meaning of xbar and mu in pvariance/variance of statistics module In-Reply-To: <1390653440.27.0.247965137131.issue20389@psf.upfronthosting.co.za> Message-ID: <1629454337.45.0.95453065197.issue20389@roundup.psfhosted.org> Irit Katriel added the comment: I've closed issue36099 as a duplicate of this. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:12:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 10:12:22 +0000 Subject: [issue36099] Clarify the difference between mu and xbar in the statistics documentation In-Reply-To: <1550979599.93.0.0625062939228.issue36099@roundup.psfhosted.org> Message-ID: <1629454342.23.0.721176554859.issue36099@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> clarify meaning of xbar and mu in pvariance/variance of statistics module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:16:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 10:16:57 +0000 Subject: [issue27353] Add nroot function to math In-Reply-To: <1466382160.58.0.562689353089.issue27353@psf.upfronthosting.co.za> Message-ID: <1629454617.24.0.938521566549.issue27353@roundup.psfhosted.org> Irit Katriel added the comment: Is this still needed? It was requested for issue27181, which has been resolved by now. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:20:40 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 10:20:40 +0000 Subject: [issue44344] Documentation for pow() should include the possibility of complex numbers as a return type In-Reply-To: <1623125616.73.0.892905550694.issue44344@roundup.psfhosted.org> Message-ID: <1629454840.94.0.480349152012.issue44344@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +26312 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27853 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:21:29 2021 From: report at bugs.python.org (mattip) Date: Fri, 20 Aug 2021 10:21:29 +0000 Subject: [issue44959] EXT_SUFFIX is missing '.sl' on HP-UX In-Reply-To: <1629452083.0.0.513630560234.issue44959@roundup.psfhosted.org> Message-ID: <1629454889.97.0.869290995693.issue44959@roundup.psfhosted.org> mattip added the comment: I assume you tried and succeeded with your patch. Could you post what `_imp.extension_suffixes()` reports after the patch? I am a bit confused because you said the following, should the last line be `_m2crypto.sl` and not `_m2crypto.sl` ? my understanding is that python should search for the following file names when extension module _m2crypto is imported (in this order): _m2crypto.cpython-38.sl _m2crypto.so ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:22:03 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 10:22:03 +0000 Subject: [issue44344] Documentation for pow() should include the possibility of complex numbers as a return type In-Reply-To: <1623125616.73.0.892905550694.issue44344@roundup.psfhosted.org> Message-ID: <1629454923.23.0.421535305317.issue44344@roundup.psfhosted.org> Change by Mark Dickinson : ---------- assignee: docs at python -> mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:23:50 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 20 Aug 2021 10:23:50 +0000 Subject: [issue44960] Add regression test for geometric test Message-ID: <1629455030.72.0.396293974466.issue44960@roundup.psfhosted.org> New submission from Steven D'Aprano : Hi Irit, thanks for looking at #28327. Sorry to be That Guy who can't do it himself, but I'm still stuck with old tech and ignorance about the git way of doing things, which limits my ability to do PRs :-( Would you be willing to add a regression test for that bug to the test_statistics.py file please? If you can add a test case for this in class TestGeometricMean and make a PR that would be great. If you're not willing or able, please just reassign back to me and I'll go old school and make a patch file. Should be fairly straight-forward, just add a method like def test_regression_28327(self): # Regression test for b.p.o. #28327 gmean = statistics.geometric_mean expected = 3.80675409583932 self.assertTrue(math.isclose(gmean([2, 3, 5, 7]), expected)) self.assertTrue(math.isclose(gmean([2.0, 3.0, 5.0, 7.0]), expected)) Thanks. ---------- assignee: iritkatriel messages: 399956 nosy: iritkatriel, steven.daprano priority: normal severity: normal status: open title: Add regression test for geometric test type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:31:43 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 10:31:43 +0000 Subject: [issue27353] Add nroot function to math In-Reply-To: <1466382160.58.0.562689353089.issue27353@psf.upfronthosting.co.za> Message-ID: <1629455503.91.0.00342687094399.issue27353@roundup.psfhosted.org> Mark Dickinson added the comment: [Irit] > Is this still needed? It's not needed for geometric_mean. It's still a reasonable feature request, but it would be non-trivial effort to put a good quality implementation together - C doesn't have this function, so we can't simply wrap it like we did for cbrt. But at least IEEE 754 does specify a "rootn" function, so we know what the behaviour should be in all the various special cases. cbrt probably covers a good proportion of use-cases for rootn (those that weren't already satisfied by sqrt). NumPy seems to have survived without needing a rootn function so far, which seems like an indication that it's not a really pressing need. Let's close, and re-open or open a new issue if someone discovers another good use-case. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:33:21 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 10:33:21 +0000 Subject: [issue44960] Add regression test for geometric test In-Reply-To: <1629455030.72.0.396293974466.issue44960@roundup.psfhosted.org> Message-ID: <1629455601.06.0.735264094279.issue44960@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:36:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Aug 2021 10:36:25 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1629455785.47.0.814652208295.issue44547@roundup.psfhosted.org> Serhiy Storchaka added the comment: Fraction.__int__ = Fraction.__trunc__ may not work because __trunc__() can return any object with __index__, while __int__ should return an exact int (not even an int subclass). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:38:42 2021 From: report at bugs.python.org (=?utf-8?q?Florin_Sp=C4=83tar?=) Date: Fri, 20 Aug 2021 10:38:42 +0000 Subject: [issue44959] EXT_SUFFIX is missing '.sl' on HP-UX In-Reply-To: <1629452083.0.0.513630560234.issue44959@roundup.psfhosted.org> Message-ID: <1629455922.49.0.830533985507.issue44959@roundup.psfhosted.org> Florin Sp?tar added the comment: @mattip Yes, the patch fixed the issue and the extension module import works. With the patch applied: [fspatar at hpux1131:/cust/fspatar/buildtest/hp-ux/11.31/build]> /opt/OPSWbuildtools/2.0.5/python/3.8.11.01/bin/python3 Python 3.8.11 (default, Aug 4 2021, 03:13:01) [GCC 4.2.4] on hp-ux-pa Type "help", "copyright", "credits" or "license" for more information. >>> import _imp >>> _imp.extension_suffixes() ['.cpython-38.sl', '.sl'] >>> Sorry for the confusion; I meant python should search for the following file names when extension module _m2crypto is imported (in this order): _m2crypto.cpython-38.sl _m2crypto.sl @vstinner I'm working on the pull request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:40:20 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 10:40:20 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629456020.34.0.912936797537.issue44954@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 60b93d9e4922eeae25052bc15909d1f4152babde by Mark Dickinson in branch 'main': bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834) https://github.com/python/cpython/commit/60b93d9e4922eeae25052bc15909d1f4152babde ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:40:37 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Aug 2021 10:40:37 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629456037.55.0.120769279922.issue44954@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26314 pull_request: https://github.com/python/cpython/pull/27855 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:40:32 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Aug 2021 10:40:32 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629456032.37.0.0893871340139.issue44954@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26313 pull_request: https://github.com/python/cpython/pull/27854 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:51:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 10:51:24 +0000 Subject: [issue44960] Add regression test for geometric test In-Reply-To: <1629455030.72.0.396293974466.issue44960@roundup.psfhosted.org> Message-ID: <1629456684.84.0.191390183645.issue44960@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26315 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27856 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 06:57:27 2021 From: report at bugs.python.org (Roundup Robot) Date: Fri, 20 Aug 2021 10:57:27 +0000 Subject: [issue44959] EXT_SUFFIX is missing '.sl' on HP-UX In-Reply-To: <1629452083.0.0.513630560234.issue44959@roundup.psfhosted.org> Message-ID: <1629457047.22.0.122033656147.issue44959@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +26316 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27857 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 07:30:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 11:30:20 +0000 Subject: [issue44960] Add regression test for geometric_mean In-Reply-To: <1629455030.72.0.396293974466.issue44960@roundup.psfhosted.org> Message-ID: <1629459020.39.0.311882220981.issue44960@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: Add regression test for geometric test -> Add regression test for geometric_mean _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 07:37:47 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 11:37:47 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629459467.85.0.434227294419.issue44954@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 7ef0673de48958bc3a75af5f152564bd2dffa8dd by Miss Islington (bot) in branch '3.9': bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834) (GH-27855) https://github.com/python/cpython/commit/7ef0673de48958bc3a75af5f152564bd2dffa8dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 07:40:13 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 11:40:13 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629459613.46.0.186644833486.issue44954@roundup.psfhosted.org> Mark Dickinson added the comment: Fixed in the main branch and in 3.9; 3.10 is very close to release, so the backport PR for 3.10 may have to wait for 3.10.1 (which wouldn't really be a problem, given that this bug has apparently lain unnoticed since Python 2.7). That's Pablo's call, of course. @Pedro Thanks again for the report! Just out of curiosity, how did you manage to find this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 07:48:00 2021 From: report at bugs.python.org (Cornelius Krupp) Date: Fri, 20 Aug 2021 11:48:00 +0000 Subject: [issue43093] Make modules picklable In-Reply-To: <1612207064.95.0.494686404563.issue43093@roundup.psfhosted.org> Message-ID: <1629460080.07.0.0895189709427.issue43093@roundup.psfhosted.org> Cornelius Krupp added the comment: I would also like to see this added, and I can also provided a usecase where I naturally came across this. I am helping on a parsing library which uses regular expressions internally. We allow the user to select the stdlib re module or the third party regex module and store the selected module as an attribute in multiple different objects, since those modules (by design) have pretty much compatible interfaces. This however makes it unpicklable, unless one adds a custom __reduce__ function for each of those classes. Most notably, this issue also extends to deepcopy and the multiprocessing module. ---------- nosy: +MegaIng _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 07:51:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 11:51:03 +0000 Subject: [issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array In-Reply-To: <1578202492.29.0.981939629191.issue39218@roundup.psfhosted.org> Message-ID: <1629460263.25.0.305655909856.issue39218@roundup.psfhosted.org> Irit Katriel added the comment: I've reproduced this on 3.9 and 3.10. This part of the code in main is still the same, so the issue is probably there even though we don't have numpy with which to test. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 08:07:01 2021 From: report at bugs.python.org (Thomas) Date: Fri, 20 Aug 2021 12:07:01 +0000 Subject: [issue44961] @classmethod doesn't set __wrapped__ the same way as functool's update_wrapper Message-ID: <1629461221.25.0.480325774253.issue44961@roundup.psfhosted.org> New submission from Thomas : @classmethod defines a __wrapped__ attribute that always points to the inner most function in a decorator chain while functool's update_wrapper has been fixed to set the wrapper.__wrapped__ attribute after updating the wrapper.__dict__ (see https://bugs.python.org/issue17482) so .__wrapped__ points to the next decorator in the chain. This results in inconsistency of the value of the.__wrapped__ attribute. Consider this code: from functools import update_wrapper class foo_deco: def __init__(self, func): self._func = func update_wrapper(self, func) def __call__(self, *args, **kwargs): return self._func(*args, **kwargs) class bar_deco: def __init__(self, func): self._func = func update_wrapper(self, func) def __call__(self, *args, **kwargs): return self._func(*args, **kwargs) class Foo: @classmethod @foo_deco def bar_cm(self): pass @bar_deco @foo_deco def bar_bar(self): pass print(Foo.bar_cm.__wrapped__) # print(Foo.bar_bar.__wrapped__) # <__main__.foo_deco object at 0x7fb025445fd0> # The foo_deco object is available on bar_cm this way though print(Foo.__dict__['bar_cm'].__func__) # <__main__.foo_deco object at 0x7fb025445fa0> It would be more consistent if the fix that was applied to update_wrapper was ported to classmethod's construction (or classmethod could invoke update_wrapper directly, maybe). It's also worth noting that @staticmethod behaves the same and @property doesn't define a .__wrapped__ attribute. For @property, I don't know if this is by design or if it was just never ported, but I believe it would be a great addition just to be able to go down a decorator chain without having to special-case the code. ---------- components: Extension Modules messages: 399965 nosy: Thomas701 priority: normal severity: normal status: open title: @classmethod doesn't set __wrapped__ the same way as functool's update_wrapper type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 08:16:28 2021 From: report at bugs.python.org (Maximilian Hils) Date: Fri, 20 Aug 2021 12:16:28 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629461788.5.0.186596012663.issue44926@roundup.psfhosted.org> Change by Maximilian Hils : ---------- keywords: +patch pull_requests: +26317 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27859 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 09:08:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 13:08:29 +0000 Subject: [issue44960] Add regression test for geometric_mean In-Reply-To: <1629455030.72.0.396293974466.issue44960@roundup.psfhosted.org> Message-ID: <1629464909.72.0.325674051649.issue44960@roundup.psfhosted.org> Irit Katriel added the comment: New changeset f5d7a8d29c49ad47254fa098abb7a510e5e7b45e by Irit Katriel in branch 'main': bpo-44960: add regression test for geometric_mean with mixed int/floa? (#27856) https://github.com/python/cpython/commit/f5d7a8d29c49ad47254fa098abb7a510e5e7b45e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 09:09:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 13:09:28 +0000 Subject: [issue44960] Add regression test for geometric_mean In-Reply-To: <1629455030.72.0.396293974466.issue44960@roundup.psfhosted.org> Message-ID: <1629464968.32.0.380798996252.issue44960@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 09:11:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 13:11:54 +0000 Subject: [issue21184] statistics.pvariance with known mean does not work as expected In-Reply-To: <1397013270.92.0.0743559681991.issue21184@psf.upfronthosting.co.za> Message-ID: <1629465114.96.0.159232485298.issue21184@roundup.psfhosted.org> Irit Katriel added the comment: I can't reproduce this on 3.11, was it fixed? >>> import statistics >>> data = [1, 2, 2, 2, 3, 4] >>> statistics.pvariance(data) 0.8888888888888888 >>> statistics.pvariance(data, 2.5) 0.9166666666666666 >>> ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 09:16:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 13:16:23 +0000 Subject: [issue33084] statistics module: NaN handling in median, median_high an median_low In-Reply-To: <1521179882.82.0.467229070634.issue33084@psf.upfronthosting.co.za> Message-ID: <1629465383.27.0.831366103852.issue33084@roundup.psfhosted.org> Irit Katriel added the comment: Reproduced in 3.11: >>> import numpy as np >>> import statistics as stats >>> data = [75, 90,85, 92, 95, 80, np.nan] >>> stats.median(data) 90 >>> stats.median_low(data) 90 >>> stats.median_high(data) 90 ---------- nosy: +iritkatriel title: Computing median, median_high an median_low in statistics library -> statistics module: NaN handling in median, median_high an median_low versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 10:07:52 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 20 Aug 2021 14:07:52 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition Message-ID: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> New submission from Thomas Grainger : with the following demo script I can get a IndexError: pop from empty list ``` import itertools import asyncio import concurrent.futures import sys import threading threads = 200 def test_all_tasks_threading() -> None: async def foo() -> None: await asyncio.sleep(0) async def create_tasks() -> None: for i in range(1000): asyncio.create_task(foo()) await asyncio.sleep(0) results = [] with concurrent.futures.ThreadPoolExecutor(threads) as tpe: for f in concurrent.futures.as_completed( tpe.submit(asyncio.run, create_tasks()) for i in range(threads) ): results.append(f.result()) assert results == [None] * threads def main(): for i in itertools.count(): test_all_tasks_threading() print(f"worked {i}") return 0 if __name__ == "__main__": sys.exit(main()) ``` ``` worked 0 worked 1 worked 2 worked 3 worked 4 worked 5 worked 6 worked 7 worked 8 worked 9 worked 10 worked 11 worked 12 worked 13 worked 14 worked 15 worked 16 worked 17 worked 18 Traceback (most recent call last): File "/home/graingert/projects/asyncio-demo/demo.py", line 36, in sys.exit(main()) File "/home/graingert/projects/asyncio-demo/demo.py", line 30, in main test_all_tasks_threading() File "/home/graingert/projects/asyncio-demo/demo.py", line 24, in test_all_tasks_threading results.append(f.result()) File "/usr/lib/python3.9/concurrent/futures/_base.py", line 438, in result return self.__get_result() File "/usr/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result raise self._exception File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/lib/python3.9/asyncio/runners.py", line 48, in run loop.run_until_complete(loop.shutdown_asyncgens()) File "/usr/lib/python3.9/asyncio/base_events.py", line 621, in run_until_complete future = tasks.ensure_future(future, loop=self) File "/usr/lib/python3.9/asyncio/tasks.py", line 667, in ensure_future task = loop.create_task(coro_or_future) File "/usr/lib/python3.9/asyncio/base_events.py", line 433, in create_task task = tasks.Task(coro, loop=self, name=name) File "/usr/lib/python3.9/_weakrefset.py", line 84, in add self._commit_removals() File "/usr/lib/python3.9/_weakrefset.py", line 57, in _commit_removals discard(l.pop()) IndexError: pop from empty list sys:1: RuntimeWarning: coroutine 'BaseEventLoop.shutdown_asyncgens' was never awaited Task was destroyed but it is pending! task: > ``` here's a live demo on github actions: https://github.com/graingert/asyncio-backport/runs/3380502247#step:5:90 ---------- components: asyncio messages: 399969 nosy: asvetlov, graingert, yselivanov priority: normal severity: normal status: open title: asyncio.create_task weakrefset race condition versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 10:09:21 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 20 Aug 2021 14:09:21 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1629468561.41.0.862778473586.issue44962@roundup.psfhosted.org> Change by Thomas Grainger : ---------- versions: +Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 10:09:44 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 20 Aug 2021 14:09:44 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1629468584.64.0.367067501353.issue44962@roundup.psfhosted.org> Change by Thomas Grainger : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 10:10:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 14:10:55 +0000 Subject: [issue30999] statistics module: add a general selection function In-Reply-To: <1500847822.23.0.66362631161.issue30999@psf.upfronthosting.co.za> Message-ID: <1629468655.58.0.841193722263.issue30999@roundup.psfhosted.org> Irit Katriel added the comment: Updating the subject according to the discussion. ---------- nosy: +iritkatriel title: statistics module: add "key" keyword argument to median, mode, ... -> statistics module: add a general selection function versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 10:11:27 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 20 Aug 2021 14:11:27 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1629468687.03.0.593319250733.issue44962@roundup.psfhosted.org> Thomas Grainger added the comment: still happens on 3.10 even though there's an `with _IterationGuard` ``` worked 0 Traceback (most recent call last): File "/home/graingert/projects/asyncio-demo/demo.py", line 36, in sys.exit(main()) File "/home/graingert/projects/asyncio-demo/demo.py", line 30, in main test_all_tasks_threading() File "/home/graingert/projects/asyncio-demo/demo.py", line 24, in test_all_tasks_threading results.append(f.result()) File "/usr/lib/python3.10/concurrent/futures/_base.py", line 438, in result return self.__get_result() File "/usr/lib/python3.10/concurrent/futures/_base.py", line 390, in __get_result raise self._exception File "/usr/lib/python3.10/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/lib/python3.10/asyncio/runners.py", line 47, in run _cancel_all_tasks(loop) File "/usr/lib/python3.10/asyncio/runners.py", line 56, in _cancel_all_tasks to_cancel = tasks.all_tasks(loop) File "/usr/lib/python3.10/asyncio/tasks.py", line 53, in all_tasks tasks = list(_all_tasks) File "/usr/lib/python3.10/_weakrefset.py", line 60, in __iter__ with _IterationGuard(self): File "/usr/lib/python3.10/_weakrefset.py", line 33, in __exit__ w._commit_removals() File "/usr/lib/python3.10/_weakrefset.py", line 57, in _commit_removals discard(l.pop()) IndexError: pop from empty list ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 10:12:57 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 20 Aug 2021 14:12:57 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1629468777.29.0.307437003213.issue44962@roundup.psfhosted.org> Thomas Grainger added the comment: interestingly 3.10 didn't show: sys:1: RuntimeWarning: coroutine 'BaseEventLoop.shutdown_asyncgens' was never awaited ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 10:26:48 2021 From: report at bugs.python.org (Ben) Date: Fri, 20 Aug 2021 14:26:48 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1629469608.0.0.438978243615.issue44962@roundup.psfhosted.org> Ben added the comment: I can reproduce on 3.9.6 A little digging and it seems asyncio imports Task from _asyncio and _asyncio's implementation (in asynciomodule.c) of Task has an __init__ which adds the task to the `all_tasks` weakref.WeakSet which appears to be implemented in Python (in Lib/_weakrefset.py) weakref.WeakSet is not thread-safe, which means concurrent create_task's in different threads (even on separate event loops) is not safe. ---------- nosy: +bjs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 10:37:01 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Aug 2021 14:37:01 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629470221.71.0.67950259677.issue44926@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26318 pull_request: https://github.com/python/cpython/pull/27860 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 10:36:59 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 20 Aug 2021 14:36:59 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629470219.5.0.423582374025.issue44926@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 16b9be4861e007ad483611ba0479feb2b90ea783 by Maximilian Hils in branch 'main': bpo-44926: `get_type_hints`: Add note about type aliases with forward refs (#27859) https://github.com/python/cpython/commit/16b9be4861e007ad483611ba0479feb2b90ea783 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 11:27:05 2021 From: report at bugs.python.org (Hasan) Date: Fri, 20 Aug 2021 15:27:05 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1629473225.32.0.832038745679.issue39355@roundup.psfhosted.org> Hasan added the comment: We have tested with cxx-modules that issue. module is just a specifier for export (only export is a compiler-based keyword in >= C++20) That's why we can use module as argument name and there's no need to rename or delete *module arguments from header files. What do you recommend to do? http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1103r3.pdf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 12:01:16 2021 From: report at bugs.python.org (Rondevous) Date: Fri, 20 Aug 2021 16:01:16 +0000 Subject: [issue44940] Hint the use of non-capturing group in re.findall() documentation In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629475276.89.0.480735876811.issue44940@roundup.psfhosted.org> Rondevous added the comment: To clarify in short: the pattern I mentioned doesn't give the result I expected in re.findall() unlike re.search() Given pattern: (foo)?bar|cool Maybe my approach in testing the regex first using re.search() and then using re.findall() to return all matches was wrong. Initially, after going through help(re) I had associated re.findall with the 'global' flag used in javascript regex which would return all the matches. Without the global flag (in javascript) only the first match is returned, like re.search() in python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 12:02:18 2021 From: report at bugs.python.org (Rondevous) Date: Fri, 20 Aug 2021 16:02:18 +0000 Subject: [issue44940] Suggest the use of non-capturing groups in re.findall() and re.finditer() docs In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629475338.81.0.577131597297.issue44940@roundup.psfhosted.org> Rondevous added the comment: >From my understanding, "|" should match either the RegEx on the left or the RegEx on the right of the pipe >>> help(re): "|" A|B, creates an RE that will match either A or B. With re.search(), the pattern below matches 'cool' as well as 'foo' >>> re.search('(foo)|cool?', 'foo bar cool foobar coolbar') >>> re.search('(foo)|cool?', 'cool') But, the same pattern and strings won't match 'cool' if used with re.findall() or re.finditer() because of how they work when capture-groups are present in the pattern. ---------- title: Hint the use of non-capturing group in re.findall() documentation -> Suggest the use of non-capturing groups in re.findall() and re.finditer() docs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 12:03:57 2021 From: report at bugs.python.org (Rondevous) Date: Fri, 20 Aug 2021 16:03:57 +0000 Subject: [issue44940] Suggest the use of non-capturing groups in re.findall() and re.finditer() docs In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629475437.67.0.934882868048.issue44940@roundup.psfhosted.org> Rondevous added the comment: Maybe the functionality of re.findall and re.finditer is limited because, e.g. I can't do something like this: https://stackoverflow.com/questions/3512471/what-is-a-non-capturing-group-in-regular-expressions#3513858 The workaround for doing that might need me to eventually write a parser O_O ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 12:02:49 2021 From: report at bugs.python.org (Rondevous) Date: Fri, 20 Aug 2021 16:02:49 +0000 Subject: [issue44940] Suggest the use of non-capturing groups in re.findall() and re.finditer() docs In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629475369.61.0.905551234275.issue44940@roundup.psfhosted.org> Rondevous added the comment: To produce the same results that you'd get by using the global flag in javascript regex, and make re.findall to not capture the groups exclusively, all the groups in the pattern need to be of the non-capturing (?:) type. If the distinction about capturing and non-capturing groups is mentioned in the docs of re.findall, it would help those who have learnt regex from another language (like javascript), where the global flag in regex is allowed. I want the docs of re.findall and re.finditer to somehow suggest the use (?:group) to return the original matches and not the captured groups. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 12:57:08 2021 From: report at bugs.python.org (Gautam Chaudhuri) Date: Fri, 20 Aug 2021 16:57:08 +0000 Subject: [issue4442] document immutable type subclassing via __new__ In-Reply-To: <1227719282.37.0.890069433685.issue4442@psf.upfronthosting.co.za> Message-ID: <1629478628.16.0.111215307521.issue4442@roundup.psfhosted.org> Change by Gautam Chaudhuri : ---------- nosy: +quantum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 12:59:21 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Fri, 20 Aug 2021 16:59:21 +0000 Subject: [issue44940] Suggest the use of non-capturing groups in re.findall() and re.finditer() docs In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629478761.53.0.157051801776.issue44940@roundup.psfhosted.org> Vedran ?a?i? added the comment: Have you seen the patch? In the patched docs, non-capturing grouping is explicitly mentioned. (Though I myself wouldn't include even that, as it's superfluous with what's said before, obviously it's needed.:) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 13:01:46 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Fri, 20 Aug 2021 17:01:46 +0000 Subject: [issue44940] Suggest the use of non-capturing groups in re.findall() and re.finditer() docs In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629478906.72.0.676731382151.issue44940@roundup.psfhosted.org> Vedran ?a?i? added the comment: Also, maybe you should read the following sentence (also in the docs): > If one wants more information about all matches of a pattern than the matched text, finditer() is useful as it provides match objects instead of strings. It seems that's what you wanted in the first place. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 13:19:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 20 Aug 2021 17:19:13 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629479953.3.0.160277637308.issue44524@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26319 pull_request: https://github.com/python/cpython/pull/27861 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 13:24:00 2021 From: report at bugs.python.org (Daniel Pope) Date: Fri, 20 Aug 2021 17:24:00 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator Message-ID: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> New submission from Daniel Pope : The anext_awaitable object returned by anext(..., default) does not support .send()/.throw(). It only supports __next__(). So we can pass messages from the suspending coroutine to the event loop but not from the event loop to the suspending coroutine. trio and curio rely on both directions working. (I don't know about asyncio.) For example, this trio code fails: import trio async def produce(): for v in range(3): await trio.sleep(1) yield v async def consume(): p = produce() while True: print(await anext(p, 'finished')) trio.run(consume) raising AttributeError: 'anext_awaitable' object has no attribute 'send'. I realise that any awaitable that wants to await another awaitable must return not an iterator from __await__() but something that implements the full PEP-342 generator protocol. Should PEP-492 section on __await__()[1] say something about that? [1] https://www.python.org/dev/peps/pep-0492/#await-expression ---------- components: Library (Lib) messages: 399982 nosy: lordmauve priority: normal severity: normal status: open title: anext_awaitable is not a collections.abc.Generator type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 13:49:04 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 20 Aug 2021 17:49:04 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629481744.01.0.632530886403.issue44954@roundup.psfhosted.org> miss-islington added the comment: New changeset 838b0e975fc2c106508eb27d19a9548533ac1e55 by Miss Islington (bot) in branch '3.10': bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834) https://github.com/python/cpython/commit/838b0e975fc2c106508eb27d19a9548533ac1e55 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 14:05:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 20 Aug 2021 18:05:33 +0000 Subject: [issue44958] [sqlite3] only reset statements when needed In-Reply-To: <1629444824.56.0.865259292634.issue44958@roundup.psfhosted.org> Message-ID: <1629482733.71.0.100234486152.issue44958@roundup.psfhosted.org> Erlend E. Aasland added the comment: I did a quick count of sqlite3_reset()s in the sqlite3 test suite: - main: 2976 calls - PR 27844: 1730 calls Since we never call sqlite3_reset() with a NULL pointer, all sqlite3_reset() calls we execute hold the SQLite db mutex; reducing the number of sqlite3_reset() calls reduces the number of times we need to hold the mutex. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 14:07:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 20 Aug 2021 18:07:40 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed Message-ID: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : I have noticed that the semantics of PyCode_Addr2Line() have changed from 3.9 to 3.10. Technically, the function was called with: PyCode_Addr2Line(frame->f_code, frame->f_last_i * 2) but now it needs to be called with PyCode_Addr2Line(frame->f_code, frame->f_last_i * 2) This is likely going to break all users of this function. This is also not advertised in the 3.10 "how to port to Python 3.10" section. We should discuss what's the best approach here because technically this is a backwards incompatible change, although in the other hand PyCode_Addr2Line() was not documented previously so we may have some room. We need to decide on this ASAP, because there is only one extra release candidate before the actual release of 3.10/ ---------- keywords: 3.10regression messages: 399985 nosy: Mark.Shannon, pablogsal priority: release blocker severity: normal status: open title: Semantics of PyCode_Addr2Line() changed versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 14:08:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 20 Aug 2021 18:08:09 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1629482889.41.0.591864523105.issue44964@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Sorry, bad copy paste. Correction: Technically, the function was called with: PyCode_Addr2Line(frame->f_code, frame->f_last_i) but now it needs to be called with PyCode_Addr2Line(frame->f_code, frame->f_last_i * 2) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 14:10:04 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 18:10:04 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629483004.74.0.69206092819.issue44954@roundup.psfhosted.org> Mark Dickinson added the comment: All fixed! Closing. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 14:10:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 20 Aug 2021 18:10:59 +0000 Subject: [issue11479] Add discussion of trailing backslash in raw string to tutorial In-Reply-To: <1299985803.24.0.199507309731.issue11479@psf.upfronthosting.co.za> Message-ID: <1629483059.05.0.547303152981.issue11479@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs to be converted into a github PR, and modified according to the feedback on this issue. ---------- keywords: +easy nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 14:11:20 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 20 Aug 2021 18:11:20 +0000 Subject: [issue30999] statistics module: add a general selection function In-Reply-To: <1500847822.23.0.66362631161.issue30999@psf.upfronthosting.co.za> Message-ID: <1629483080.59.0.425397631519.issue30999@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 14:44:22 2021 From: report at bugs.python.org (jvoisin) Date: Fri, 20 Aug 2021 18:44:22 +0000 Subject: [issue39039] zlib.error with tarfile.open In-Reply-To: <1576252848.69.0.760468308355.issue39039@roundup.psfhosted.org> Message-ID: <1629485062.8.0.546798490098.issue39039@roundup.psfhosted.org> jvoisin added the comment: The file was created with a fuzzer, like the one described in https://dustri.org/b/fuzzing-python-in-python-and-doing-it-fast.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 15:03:01 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 20 Aug 2021 19:03:01 +0000 Subject: [issue44941] Add check_methods function to standard library In-Reply-To: <1629252402.72.0.293302326241.issue44941@roundup.psfhosted.org> Message-ID: <1629486181.54.0.172710622645.issue44941@roundup.psfhosted.org> ?ric Araujo added the comment: FYI there was a ticket and a discussion before: https://mail.python.org/archives/list/python-ideas at python.org/thread/FCGDSVWHIJHBYKS2O4RHZVLXCGSGBLQH/#FCGDSVWHIJHBYKS2O4RHZVLXCGSGBLQH Should be reviewed to see the arguments made and determine if things have changed to reopen the question! ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 16:01:50 2021 From: report at bugs.python.org (Pedro Gimeno) Date: Fri, 20 Aug 2021 20:01:50 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629489710.78.0.495316853355.issue44954@roundup.psfhosted.org> Pedro Gimeno added the comment: > @Pedro Thanks again for the report! Just out of curiosity, how did you manage to find this? I'm writing a C strtod implementation and I was adding corner cases to the unit testing (now published here: https://codeberg.org/pgimeno/ACSL/src/branch/master/tests/test-strtod.c). Sometimes I get confused by whether to add one or subtract one to the exponent as digits are moved, and since I have an interactive Python shell always open as a calculator, I used it to make sure that the test I was writing had the correct exponent. But the result I got was not the one I expected, and upon verification, I soon became convinced that it was a bug, so I dug a bit more (at first I didn't notice it only happened if the leading zero was left out) and finally submitted the bug. Thanks for the quick fix, by the way. ---------- resolution: fixed -> status: closed -> open type: behavior -> versions: -Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 16:07:27 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 20 Aug 2021 20:07:27 +0000 Subject: [issue44965] [sqlite3] early exit for non-DML statements in executemany() Message-ID: <1629490047.04.0.534577541585.issue44965@roundup.psfhosted.org> New submission from Erlend E. Aasland : Currently, if a non-DML statement is executed with executemany(), we only bail as late as possible: just before the call to _pysqlite_fetch_one_row(). This means that we've already stepped through the statement once (!), and possibly bound values, built the row cast map, and created the description tuple, all before raising the "executemany() can only execute DML statements." So, the error message currently is not quite true, because we already executed the statement once. Checking for this earlier will prevent a (possibly time-consuming) sqlite3_step(), and it will leave the main loop in _pysqlite_query_execute() slightly easier to read, IMO. ---------- components: Extension Modules messages: 399992 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: low severity: normal status: open title: [sqlite3] early exit for non-DML statements in executemany() type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 16:09:07 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 20 Aug 2021 20:09:07 +0000 Subject: [issue44965] [sqlite3] early exit for non-DML statements in executemany() In-Reply-To: <1629490047.04.0.534577541585.issue44965@roundup.psfhosted.org> Message-ID: <1629490147.53.0.159042716646.issue44965@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +26320 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27865 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 16:17:56 2021 From: report at bugs.python.org (Joshua Bronson) Date: Fri, 20 Aug 2021 20:17:56 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1629490676.11.0.884327172379.issue44963@roundup.psfhosted.org> Change by Joshua Bronson : ---------- nosy: +jab _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 16:39:05 2021 From: report at bugs.python.org (Thomas Grainger) Date: Fri, 20 Aug 2021 20:39:05 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1629491945.59.0.335741131837.issue44963@roundup.psfhosted.org> Thomas Grainger added the comment: it also fails with asyncio.create_task ``` import asyncio async def agen(): yield async def main(): p = agen() await asyncio.create_task(anext(p, 'finished')) asyncio.run(main()) ``` ``` Traceback (most recent call last): File "/home/graingert/projects/datapraxis/analysis/foo.py", line 10, in asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete return future.result() File "/home/graingert/projects/asyncio-demo/foo.py", line 8, in main await asyncio.create_task(anext(p, 'finished')) File "/usr/lib/python3.10/asyncio/tasks.py", line 337, in create_task task = loop.create_task(coro) File "/usr/lib/python3.10/asyncio/base_events.py", line 433, in create_task task = tasks.Task(coro, loop=self, name=name) TypeError: a coroutine was expected, got ``` there's also a problem with cancelling and aclosing an async gen this way: ``` import asyncio import contextlib async def agen(): await asyncio.sleep(1) yield async def main(): async with contextlib.aclosing(agen()) as p: asyncio.current_task().cancel() try: await anext(p, 'finished') except asyncio.CancelledError: pass asyncio.run(main()) ``` ``` an error occurred during closing of asynchronous generator asyncgen: Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete return future.result() File "/home/graingert/projects/asyncio-demo/foo.py", line 9, in main async with contextlib.aclosing(agen()) as p: File "/usr/lib/python3.10/contextlib.py", line 366, in __aexit__ await self.thing.aclose() RuntimeError: aclose(): asynchronous generator is already running During handling of the above exception, another exception occurred: RuntimeError: aclose(): asynchronous generator is already running Traceback (most recent call last): File "/home/graingert/projects/datapraxis/analysis/foo.py", line 16, in asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete return future.result() File "/home/graingert/projects/asyncio-demo/foo.py", line 9, in main async with contextlib.aclosing(agen()) as p: File "/usr/lib/python3.10/contextlib.py", line 366, in __aexit__ await self.thing.aclose() RuntimeError: aclose(): asynchronous generator is already running ``` ---------- nosy: +graingert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 16:41:49 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 20 Aug 2021 20:41:49 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629492109.59.0.0897039442847.issue44934@roundup.psfhosted.org> Steve Dower added the comment: The logic is probably simplest if you clone the Tools/msi/path project entirely as pathappend. That will technically allow people to both prepend and append if they set both flags, but I think it's okay to say "don't do that", especially if AppendPath is only a command line option. Per-component or optional features are complicated and best avoided if we can. For a simple on-off like this, a whole MSI is actually the simplest way to manage it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 17:37:26 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 20 Aug 2021 21:37:26 +0000 Subject: [issue33084] statistics module: NaN handling in median, median_high an median_low In-Reply-To: <1521179882.82.0.467229070634.issue33084@psf.upfronthosting.co.za> Message-ID: <1629495446.36.0.117007738638.issue33084@roundup.psfhosted.org> Raymond Hettinger added the comment: [Steven] > Thoughts? 1) Document that results are undefined if a NaN is present in the data. 2) Add function to strip NaNs from the data: def remove_nans(iterable): "Remove float('NaN') and other objects not equal to themselves" return [x for x in iterable if x == x] ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 17:43:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Aug 2021 21:43:39 +0000 Subject: [issue44915] Python keywords as string keys in TypedDict In-Reply-To: <1628965698.89.0.982806951929.issue44915@roundup.psfhosted.org> Message-ID: <1629495819.09.0.754164757953.issue44915@roundup.psfhosted.org> Terry J. Reedy added the comment: The current behavior is not a bug, so this is an enhancement proposal. ---------- nosy: +gvanrossum, terry.reedy type: behavior -> enhancement versions: +Python 3.11 -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 17:46:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Aug 2021 21:46:41 +0000 Subject: [issue44918] Unhandled Exception (Not Implemented) in HTMLParser().feed In-Reply-To: <1629023780.24.0.906396765279.issue44918@roundup.psfhosted.org> Message-ID: <1629496001.8.0.901584689906.issue44918@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Not Implemented Error in stdLib HTMLParser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 17:48:20 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 20 Aug 2021 21:48:20 +0000 Subject: [issue30999] statistics module: add a general selection function In-Reply-To: <1500847822.23.0.66362631161.issue30999@psf.upfronthosting.co.za> Message-ID: <1629496100.69.0.295745979535.issue30999@roundup.psfhosted.org> Raymond Hettinger added the comment: No one has shown any interest in this in a long time. Marking is as closed for now. This issue can be reopened if there is an interest and a reasonable use case that can't be reasonably handled with sorted, min, or max. ---------- resolution: -> later stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 18:01:49 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 20 Aug 2021 22:01:49 +0000 Subject: [issue44915] Python keywords as string keys in TypedDict In-Reply-To: <1628965698.89.0.982806951929.issue44915@roundup.psfhosted.org> Message-ID: <1629496909.75.0.21992274995.issue44915@roundup.psfhosted.org> Guido van Rossum added the comment: Unfortunately you can?t use Python keywords in such positions and we have no plans to fix this. Serhiy?s workaround is the best you can do. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 18:11:58 2021 From: report at bugs.python.org (Bastian Neuburger) Date: Fri, 20 Aug 2021 22:11:58 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629497518.93.0.389069438953.issue44934@roundup.psfhosted.org> Bastian Neuburger added the comment: Thanks for the rundown, after digging a little bit into the abyss that is the WIX toolset if you've never dealt with it before I already started going down that route. I pushed it to my fork of cpython: https://github.com/bneuburg/cpython/commits/issue44934 Since I'm pretty sure that my commits are not correct yet (following the instructions in Tools/msi/README.txt regarding fetching dependencies building the MSI resulted in a failed build before I even touched a single line of code) I abstained from handing in a pull request. Feedback would be very much appreciated. Of course if you'd want to use that stuff and refine it I would be totally fine with it ;) In case I messed up any formal requirements (i.e. wording of commit messages etc.): I will get myself up to speed and fix that, but since I'll be offline for a week starting Monday I wanted to get my initial draft out there, so in case you have any feedback until Monday I can incorporate it before my brain pushes that stuff out... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 18:30:20 2021 From: report at bugs.python.org (Bastian Neuburger) Date: Fri, 20 Aug 2021 22:30:20 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629498620.94.0.128142901469.issue44934@roundup.psfhosted.org> Bastian Neuburger added the comment: Maybe this view better shows what I've actually done: https://github.com/python/cpython/compare/16b9be4861e007ad483611ba0479feb2b90ea783...bneuburg:issue44934?expand=1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 18:35:27 2021 From: report at bugs.python.org (Bastian Neuburger) Date: Fri, 20 Aug 2021 22:35:27 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629498927.24.0.936422508895.issue44934@roundup.psfhosted.org> Bastian Neuburger added the comment: Previous URL got "fixed" by roundup, hopefully this one works: https://github.com/python/cpython/compare/16b9be4861e007ad483611ba0479feb2b90ea783...bneuburg:issue44934 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 18:47:07 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Aug 2021 22:47:07 +0000 Subject: [issue44943] Integrate PyHyphen into the textwrap module? In-Reply-To: <1629259091.17.0.693384406062.issue44943@roundup.psfhosted.org> Message-ID: <1629499627.21.0.195097642848.issue44943@roundup.psfhosted.org> Terry J. Reedy added the comment: This strikes me as an example of the sort of thing that should not be in the stdlib. 'Correct' behavior is a matter of opinion and the language being hyphenated. I recommend rejecting. ---------- nosy: +terry.reedy versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 18:48:49 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 20 Aug 2021 22:48:49 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629498927.24.0.936422508895.issue44934@roundup.psfhosted.org> Message-ID: Steve Dower added the comment: That branch looks like you're on the right track. The build scripts in Tools/msi should Just Work, so I'd be interested to see the error you get. You can also submit it as a PR and the MSI will be built automatically. One thing I noticed is updating the name of the "Add Python to PATH" option, which I'd rather keep as "Add" since we won't have both options in the UI. The word "Prepend" is quite obscure jargon, and for the range of users we have it isn't fair to expect them to know it (or to break all of the guidance out there explaining that checkbox already). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 18:49:17 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 20 Aug 2021 22:49:17 +0000 Subject: [issue44954] Bug in float.fromhex In-Reply-To: <1629372842.45.0.638068158675.issue44954@roundup.psfhosted.org> Message-ID: <1629499757.08.0.873743865932.issue44954@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 20:23:11 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 21 Aug 2021 00:23:11 +0000 Subject: [issue4442] document immutable type subclassing via __new__ In-Reply-To: <1227719282.37.0.890069433685.issue4442@psf.upfronthosting.co.za> Message-ID: <1629505391.03.0.541766915126.issue4442@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch nosy: +rhettinger nosy_count: 8.0 -> 9.0 pull_requests: +26321 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27866 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 20:26:26 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 21 Aug 2021 00:26:26 +0000 Subject: [issue44943] Integrate PyHyphen into the textwrap module? In-Reply-To: <1629259091.17.0.693384406062.issue44943@roundup.psfhosted.org> Message-ID: <1629505586.5.0.939574549221.issue44943@roundup.psfhosted.org> Raymond Hettinger added the comment: I concur with Terry. The suggestion is nice but it belongs outside the standard library. ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 20:36:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 21 Aug 2021 00:36:02 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1629506162.17.0.297861797825.issue44963@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +asvetlov, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 20:40:04 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 21 Aug 2021 00:40:04 +0000 Subject: [issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar In-Reply-To: <1583161890.16.0.234726594776.issue39827@roundup.psfhosted.org> Message-ID: <1629506404.92.0.323025787333.issue39827@roundup.psfhosted.org> Andrei Kulakov added the comment: I wrote a longer explanation but BPO and Chrome ate it. The issue is that DoubleVar is not locale aware. I don't know what should be the actual fix but the following may be a useful workaround (It works on my system): import tkinter import locale import sys locale.setlocale(locale.LC_NUMERIC, 'de_DE') class Var(tkinter.DoubleVar): def get(self): return locale.atof(self._tk.globalgetvar(self._name)) class TestDoubleVar(): def __init__(self): root = tkinter.Tk() self.var = Var() self.var.set(0.8) number = tkinter.Spinbox( root, from_=0, to=1, increment=0.1, textvariable=self.var, command=self.update, width=4 ) number.pack(side=tkinter.LEFT) root.mainloop() def update(self, *args): print(self.var.get()) if __name__ == '__main__': TestDoubleVar() ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 20:41:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 21 Aug 2021 00:41:40 +0000 Subject: [issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array In-Reply-To: <1578202492.29.0.981939629191.issue39218@roundup.psfhosted.org> Message-ID: <1629506500.47.0.456272422971.issue39218@roundup.psfhosted.org> Raymond Hettinger added the comment: Removing the assertion and implementing Steven's idea seems like the best way to go: sum((y:=(x-c)) * y for x in data) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 21:14:41 2021 From: report at bugs.python.org (=?utf-8?b?5p2o6Z2S?=) Date: Sat, 21 Aug 2021 01:14:41 +0000 Subject: [issue44966] example code does not macth the very version(3.9) Message-ID: <1629508481.91.0.0767549415848.issue44966@roundup.psfhosted.org> New submission from ?? : ?url?https://docs.python.org/3/tutorial/errors.html ?chapter?8.2. Exceptions ?origina example code? >>> '2' + 2 Traceback (most recent call last): File "", line 1, in TypeError: Can't convert 'int' object to str implicitly ?what i got in practice? >>> '2' + 2 Traceback (most recent call last): File "", line 1, in TypeError: can only concatenate str (not "int") to str ---------- assignee: docs at python components: Documentation messages: 400007 nosy: docs at python, yangqing priority: normal severity: normal status: open title: example code does not macth the very version(3.9) type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 21:40:52 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 21 Aug 2021 01:40:52 +0000 Subject: [issue44966] example code does not macth the very version(3.9) In-Reply-To: <1629508481.91.0.0767549415848.issue44966@roundup.psfhosted.org> Message-ID: <1629510052.65.0.271121009472.issue44966@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch nosy: +rhettinger nosy_count: 2.0 -> 3.0 pull_requests: +26322 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27867 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 21:51:04 2021 From: report at bugs.python.org (Finn Mason) Date: Sat, 21 Aug 2021 01:51:04 +0000 Subject: [issue44941] Add check_methods function to standard library In-Reply-To: <1629252402.72.0.293302326241.issue44941@roundup.psfhosted.org> Message-ID: <1629510664.5.0.297099566785.issue44941@roundup.psfhosted.org> Finn Mason added the comment: Thank you for the suggestions. >From what I could tell, the cited python-ideas discussion was more about checking the signature of a method. However, an issue cited by the ex-BDFL (issue9731) was helpful. It's a similar idea that verifies that a class implements an ABC. However, I'm looking at a function that simplifies writing the ABC itself. I will post the idea to python-ideas and see what people think. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 21:52:03 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 21 Aug 2021 01:52:03 +0000 Subject: [issue21184] statistics.pvariance with known mean does not work as expected In-Reply-To: <1397013270.92.0.0743559681991.issue21184@psf.upfronthosting.co.za> Message-ID: <1629510723.53.0.966954356206.issue21184@roundup.psfhosted.org> Raymond Hettinger added the comment: See commit d71ab4f73887a6e2b380ddbbfe35b600d236fd4a for bpo-40855. ---------- nosy: +rhettinger resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 23:13:09 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 03:13:09 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629515589.15.0.686499684183.issue41322@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: It looks like since GH-27748 got merged, `test_subprocess_wait_no_same_group` in `test_asyncio` has been failing for the Ubuntu SSL tests. ---------- nosy: +rmast _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 23:16:58 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 21 Aug 2021 03:16:58 +0000 Subject: [issue44943] Integrate PyHyphen into the textwrap module? In-Reply-To: <1629259091.17.0.693384406062.issue44943@roundup.psfhosted.org> Message-ID: <1629515818.67.0.66258320999.issue44943@roundup.psfhosted.org> Eric V. Smith added the comment: I agree this doesn?t belong in the stdlib. For future reference, my principal objections are 1) the need to manage and distribute per-language dictionaries and 2) difficulty in determining the best algorithm for the stdlib. There are a lot of ways to tweak this. The community is well served with the multiple libraries on PyPI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 23:22:27 2021 From: report at bugs.python.org (Gregory Anders) Date: Sat, 21 Aug 2021 03:22:27 +0000 Subject: [issue44967] pydoc should return non-zero exit code when a query is not found Message-ID: <1629516147.02.0.928809585196.issue44967@roundup.psfhosted.org> New submission from Gregory Anders : Currently pydoc returns an exit code of zero no matter what, even with e.g. pydoc lsjdfkdfj However, the ability to know whether or not pydoc successfully found a result is useful in tools that embed pydoc in some way. Here's one use case: Vim and Neovim have a feature that allows a user to run an external command for the keyword under the cursor (keywordprg). In Python files, this defaults to pydoc. In Neovim, we would like to automatically close the PTY buffers that we create for these processes when they finish without any errors, but if it returns a non-zero exit code we want to keep the PTY buffer open so the user can see what went wrong. Because pydoc returns immediately when it fails to find a match and does not indicate that it failed via a return code, the PTY buffer is closed immediately with no indication to the user that anything went wrong. I have a patch prepared for this that I will link to the issue. ---------- components: Demos and Tools messages: 400012 nosy: gpanders priority: normal severity: normal status: open title: pydoc should return non-zero exit code when a query is not found type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 23:23:41 2021 From: report at bugs.python.org (Gregory Anders) Date: Sat, 21 Aug 2021 03:23:41 +0000 Subject: [issue44967] pydoc should return non-zero exit code when a query is not found In-Reply-To: <1629516147.02.0.928809585196.issue44967@roundup.psfhosted.org> Message-ID: <1629516221.86.0.14574629465.issue44967@roundup.psfhosted.org> Change by Gregory Anders : ---------- keywords: +patch pull_requests: +26323 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27868 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 23:45:27 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 21 Aug 2021 03:45:27 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629517527.57.0.271795288594.issue41322@roundup.psfhosted.org> Andrei Kulakov added the comment: That test does have a yield statement in it, and does cause the deprecation warning to fire off. I'm looking into it.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 23:49:36 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 03:49:36 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629517776.23.0.835810651216.issue41322@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: Would rewriting the test so that it doesn't yield be the right fix? ``` def test_subprocess_wait_no_same_group(self): # start the new process in a new session connect = self.loop.subprocess_shell( functools.partial(MySubprocessProtocol, self.loop), 'exit 7', stdin=None, stdout=None, stderr=None, start_new_session=True) _, proto = yield self.loop.run_until_complete(connect) self.assertIsInstance(proto, MySubprocessProtocol) self.loop.run_until_complete(proto.completed) self.assertEqual(7, proto.returncode) ``` to ``` def test_subprocess_wait_no_same_group(self): # start the new process in a new session connect = self.loop.subprocess_shell( functools.partial(MySubprocessProtocol, self.loop), 'exit 7', stdin=None, stdout=None, stderr=None, start_new_session=True) transp, proto = self.loop.run_until_complete(connect) self.assertIsInstance(proto, MySubprocessProtocol) self.loop.run_until_complete(proto.completed) self.assertEqual(7, proto.returncode) transp.close() ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 20 23:54:33 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 21 Aug 2021 03:54:33 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629518073.81.0.933839175899.issue41322@roundup.psfhosted.org> Andrei Kulakov added the comment: Yes, it seems like this deprecation detected a broken test that wasn't running. If I add a `raise` statement to it and rerun the test, it still passes on my local system: ./python.exe -m unittest -v test.test_asyncio.test_events.PollEventLoopTests.test_subprocess_wait_no_same_group warnings.warn(f'It is deprecated to return a value!=None from a ' Ran 1 test in 0.022s OK (with last line of test being just `raise`). It seems to me it should be fixed in some way although I don't know if Ryan's suggestion will do or not as I haven't looked at asyncio tests before.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 00:05:39 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 21 Aug 2021 04:05:39 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629518739.15.0.0838262789084.issue41322@roundup.psfhosted.org> Andrei Kulakov added the comment: The test was refactored in this commit: https://github.com/python/cpython/commit/658103f84ea860888f8dab9615281ea64fee31b9 the refactoring moved yield statement from inner func into the test. That was 8 years ago so it hasn't worked since then, and since asyncio changed a lot, I wonder if the test is still valid? Ryan, do you want to open a new issue for fixing / removing the test? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 00:09:29 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 04:09:29 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629518969.91.0.839071408677.issue41322@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: Sure, I'll open a new issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 00:27:33 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 04:27:33 +0000 Subject: [issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests Message-ID: <1629520052.97.0.572214305384.issue44968@roundup.psfhosted.org> New submission from Ryan Mast (nightlark) : A deprecation made in bpo-41322 uncovered issues with test_subprocess_wait_no_same_group in test_asyncio that seems to have been broken for some time. Reverting to a similar structure prior to the refactoring in https://github.com/python/cpython/commit/658103f84ea860888f8dab9615281ea64fee31b9 using async/await avoids the deprecation error, though it still might not be running correctly. With the change I tried in https://github.com/python/cpython/commit/658103f84ea860888f8dab9615281ea64fee31b9 there is a message about an `unknown child process`, which makes me think there could be some issues with the subprocess exiting prior to the refactoring ~8 years ago. ---------- components: Tests messages: 400018 nosy: asvetlov, ezio.melotti, michael.foord, rbcollins, rmast, yselivanov priority: normal severity: normal status: open title: Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 00:28:38 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 04:28:38 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629520118.56.0.588107172158.issue41322@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: The new issue for the failing test is bpo-44968 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 00:32:32 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 21 Aug 2021 04:32:32 +0000 Subject: [issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests In-Reply-To: <1629520052.97.0.572214305384.issue44968@roundup.psfhosted.org> Message-ID: <1629520352.24.0.633612898259.issue44968@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 02:18:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Aug 2021 06:18:54 +0000 Subject: [issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests In-Reply-To: <1629520052.97.0.572214305384.issue44968@roundup.psfhosted.org> Message-ID: <1629526734.69.0.193952490977.issue44968@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch nosy: +serhiy.storchaka nosy_count: 7.0 -> 8.0 pull_requests: +26324 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27870 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 02:21:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Aug 2021 06:21:18 +0000 Subject: [issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests In-Reply-To: <1629520052.97.0.572214305384.issue44968@roundup.psfhosted.org> Message-ID: <1629526878.1.0.306719885751.issue44968@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- components: +asyncio type: -> behavior versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 02:48:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Aug 2021 06:48:08 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629528488.36.0.292598183417.issue44524@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 4ceec495598e78f0776dd46d511dcc612a434dc3 by Serhiy Storchaka in branch 'main': bpo-44524: Do not set _name of _SpecialForm without need (GH-27861) https://github.com/python/cpython/commit/4ceec495598e78f0776dd46d511dcc612a434dc3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 02:48:19 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Aug 2021 06:48:19 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629528499.74.0.831421074547.issue44524@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26325 pull_request: https://github.com/python/cpython/pull/27871 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 03:41:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Aug 2021 07:41:02 +0000 Subject: [issue44969] Subclassing of annotated types does not always work Message-ID: <1629531662.05.0.587324912826.issue44969@roundup.psfhosted.org> New submission from Serhiy Storchaka : It works only with simple types >>> class X(Annotated[list, 'annotation']): pass ... But not with type aliases >>> class X(Annotated[List[int], 'annotation']): pass ... Traceback (most recent call last): File "", line 1, in TypeError: _GenericAlias.__init__() takes 3 positional arguments but 4 were given >>> class X(Annotated[list[int], 'annotation']): pass ... Traceback (most recent call last): File "", line 1, in TypeError: GenericAlias expected 2 arguments, got 3 And even if the original type is not subclassable, the error message is not always clear: >>> class X(Annotated[Union[int, str], 'annotation']): pass ... Traceback (most recent call last): File "", line 1, in TypeError: _GenericAlias.__init__() takes 3 positional arguments but 4 were given >>> class X(Annotated[int | str, 'annotation']): pass ... Traceback (most recent call last): File "", line 1, in TypeError: _GenericAlias.__init__() takes 3 positional arguments but 4 were given ---------- components: Library (Lib) messages: 400021 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Subclassing of annotated types does not always work type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 03:47:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Aug 2021 07:47:25 +0000 Subject: [issue44969] Subclassing of annotated types does not always work In-Reply-To: <1629531662.05.0.587324912826.issue44969@roundup.psfhosted.org> Message-ID: <1629532045.3.0.870224415864.issue44969@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think that __mro_entries__() for annotated types should return the result of __mro_entries__() for the original type if it has __mro_entries__. But details can be complicated, especially if user-defined generic types are involved. Alternatively, __build_class__ can call __mro_entries__() repeatedly for the result of __mro_entries__(). I do not know what is better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 04:08:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Aug 2021 08:08:14 +0000 Subject: [issue39827] setting a locale that uses comma as decimal separator breaks tkinter.DoubleVar In-Reply-To: <1583161890.16.0.234726594776.issue39827@roundup.psfhosted.org> Message-ID: <1629533294.01.0.225613533916.issue39827@roundup.psfhosted.org> Serhiy Storchaka added the comment: See also issue12558 which exposes the other side of the same issue. Las time I looked at it, it was inherently a Tcl issue. In some places it uses locale-dependent formatting of floating point numbers, but locale-unaware parsing, or vice versa. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 05:33:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Aug 2021 09:33:37 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629538417.78.0.451330160637.issue44524@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 5bd27c3be5734e158f67ff86087a977a25d89161 by Miss Islington (bot) in branch '3.10': bpo-44524: Do not set _name of _SpecialForm without need (GH-27861) (GH-27871) https://github.com/python/cpython/commit/5bd27c3be5734e158f67ff86087a977a25d89161 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 09:20:41 2021 From: report at bugs.python.org (Thomas Grainger) Date: Sat, 21 Aug 2021 13:20:41 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1629552041.41.0.44558301301.issue44963@roundup.psfhosted.org> Change by Thomas Grainger : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 09:26:43 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 21 Aug 2021 13:26:43 +0000 Subject: [issue44970] Re-examine complex pow special case handling Message-ID: <1629552403.37.0.715300348368.issue44970@roundup.psfhosted.org> New submission from Mark Dickinson : Complex power, both via `**` and the built-in `pow`, and via `cmath.pow`, is currently a bit of a mess when it comes to special-case handling - particularly handling of signed zeros, infinities, NaNs, and overflow. At some point it would be nice to rationalise and document the special-case handling, as far as possible, and to make the behaviour of `**` and `pow` consistent with that of `cmath.pow`. Note that while for all the other cmath functions we have good guidance from the C standards on how special cases should be handled, for pow we're on our own - the C standard refuses to specify anything at all about special case handling. Note also that there are a *lot* of special cases to consider. We have four real input parameters (the real and imaginary parts of each of the base and the exponent), each of which can be one of the 7 cases nan, -inf, -finite, -0.0, 0.0, finite, inf, for a total of 7**4 = 2401 combinations; moreover, for some cases we might need to distinguish integral from non-integral values, and even integers from odd integers. This is low priority - in many years of mathematical, scientific and numeric work, I've seen little evidence that anyone actually cares about or uses general complex power. Most users are interested in one or more subcases, like: - positive real base and complex exponent - complex base and integral exponent - complex nth root for positive integers n, especially for small n (square root, cube root, ...) So a possibly more manageable and more useful subtask would be to ensure that special cases are handled in a sensible manner for these subcases. ---------- messages: 400025 nosy: mark.dickinson priority: low severity: normal status: open title: Re-examine complex pow special case handling versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 09:31:00 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 21 Aug 2021 13:31:00 +0000 Subject: [issue44800] Code readability: rename InterpreterFrame to `_Py_framedata` In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1629552660.27.0.823425860602.issue44800@roundup.psfhosted.org> Change by Nick Coghlan : ---------- pull_requests: +26326 pull_request: https://github.com/python/cpython/pull/3640 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 09:31:47 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 21 Aug 2021 13:31:47 +0000 Subject: [issue44970] Re-examine complex pow special case handling In-Reply-To: <1629552403.37.0.715300348368.issue44970@roundup.psfhosted.org> Message-ID: <1629552707.86.0.779459705805.issue44970@roundup.psfhosted.org> Mark Dickinson added the comment: Here's just one example that doesn't make a whole lot of sense: in this case, z ** 1 should be returning z. >>> z = complex(3, float("inf")) >>> z ** 1 Traceback (most recent call last): File "", line 1, in OverflowError: complex exponentiation ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 09:33:48 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 21 Aug 2021 13:33:48 +0000 Subject: [issue44970] Re-examine complex pow special case handling In-Reply-To: <1629552403.37.0.715300348368.issue44970@roundup.psfhosted.org> Message-ID: <1629552828.28.0.416584085612.issue44970@roundup.psfhosted.org> Mark Dickinson added the comment: Aargh. Brain fail. There *is* no `cmath.pow`, of course; this issue applies only to `**` and the built-in `pow`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 10:08:31 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 21 Aug 2021 14:08:31 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629554911.26.0.303280615649.issue41322@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: There are few deprecation warnings in other tests : 0:00:05 load avg: 3.20 [ 52/428] test_code passed /home/karthikeyan/stuff/python/cpython/Lib/unittest/case.py:550: DeprecationWarning: It is deprecated to return a value!=None from a test case (>) warnings.warn(f'It is deprecated to return a value!=None from a ' 0:00:12 load avg: 3.74 [110/428] test_capi passed /home/karthikeyan/stuff/python/cpython/Lib/unittest/case.py:550: DeprecationWarning: It is deprecated to return a value!=None from a test case () warnings.warn(f'It is deprecated to return a value!=None from a ' 0:00:13 load avg: 3.74 [114/428] test_distutils passed /home/karthikeyan/stuff/python/cpython/Lib/distutils/tests/test_unixccompiler.py:7: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead from distutils import sysconfig /home/karthikeyan/stuff/python/cpython/Lib/unittest/case.py:550: DeprecationWarning: It is deprecated to return a value!=None from a test case (>) warnings.warn(f'It is deprecated to return a value!=None from a ' /home/karthikeyan/stuff/python/cpython/Lib/unittest/case.py:550: DeprecationWarning: It is deprecated to return a value!=None from a test case (>) warnings.warn(f'It is deprecated to return a value!=None from a ' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 10:30:39 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 21 Aug 2021 14:30:39 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1629556239.06.0.885003457275.issue38291@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +26327 pull_request: https://github.com/python/cpython/pull/27872 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 10:36:24 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 21 Aug 2021 14:36:24 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629556584.17.0.500883219355.issue41322@roundup.psfhosted.org> Andrei Kulakov added the comment: Karthikeyan: I was looking into them yesterday, and: - distutils ones can probably be left as is because distutils are set for removal in 3.12 - test_constructor should be fixed, I can do that today. - test_null_strings in test_capi I'm not sure, I think it can also be fixed here: https://github.com/python/cpython/blob/main/Modules/_testcapimodule.c#L2388 .. by replacing return line with Py_RETURN_NONE; but I haven't worked with C tests before and it looks like some other C api tests also return non-null and not None values, but they didn't trigger the deprecation when running a test PR I made yesterday here: https://github.com/python/cpython/pull/27869/checks?check_run_id=3387700689 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 10:42:29 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 21 Aug 2021 14:42:29 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629556949.14.0.309242761659.issue41322@roundup.psfhosted.org> Andrei Kulakov added the comment: I should just add that none of the these tests are actually a problem, i.e. they all do run properly and not running duplicate times (except that I'm not sure about the 2 distutils tests, but that shouldn't matter much as distutils is deprecated and up for removal). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 10:49:54 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 21 Aug 2021 14:49:54 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629557394.32.0.175020347303.issue41322@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Deprecation warnings are not on by default in tests. You can pass -Wall while running tests to turn on all warnings. ./python -Wall -m test test_capi 0:00:00 load avg: 2.46 Run tests sequentially 0:00:00 load avg: 2.46 [1/1] test_capi /home/karthikeyan/stuff/python/cpython/Lib/unittest/case.py:550: DeprecationWarning: It is deprecated to return a value!=None from a test case () warnings.warn(f'It is deprecated to return a value!=None from a ' == Tests result: SUCCESS == 1 test OK. Total duration: 5.2 sec Tests result: SUCCESS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 10:55:34 2021 From: report at bugs.python.org (Russell Crosser) Date: Sat, 21 Aug 2021 14:55:34 +0000 Subject: [issue44971] Named widget has NoneType after single line creation Message-ID: <1629557734.8.0.458190947867.issue44971@roundup.psfhosted.org> New submission from Russell Crosser : Declaring a widget in the following form: ... label2 = ttk.Label(root, text='Show2 Label').pack() ... leaves the widget with a NoneType, and unable to be assigned to (for instance to assign new text). If giving a widget a name, I expect to use it later in the program. This declaration works correctly: ... label2 = ttk.Label(root, text='Show2 Label') label2.pack() ... Simple tkinter program attached. Only tested with 3.9.6 on Win 10. ---------- components: Tkinter files: test_pack.py messages: 400032 nosy: rcrosser priority: normal severity: normal status: open title: Named widget has NoneType after single line creation type: crash versions: Python 3.9 Added file: https://bugs.python.org/file50228/test_pack.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 11:02:22 2021 From: report at bugs.python.org (Mark Shannon) Date: Sat, 21 Aug 2021 15:02:22 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1629558142.96.0.973379723433.issue44964@roundup.psfhosted.org> Mark Shannon added the comment: It is not `PyCode_Addr2Line()` that has changed, but `frame->f_lasti`. If you call `PyCode_Addr2Line(frame->f_code, 8)` in 3.9 you get the same behavior as calling `PyCode_Addr2Line(frame->f_code, 8)` in 3.10. Assuming the bytecode is unchanged. The difference is that for the nth instruction `frame->f_lasti` is n*2 for 3.9 and n for 3.10. People should be using `PyFrame_GetLineNumber()`, which is part of the API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 12:00:34 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 21 Aug 2021 16:00:34 +0000 Subject: [issue44971] Named widget has NoneType after single line creation In-Reply-To: <1629557734.8.0.458190947867.issue44971@roundup.psfhosted.org> Message-ID: <1629561634.16.0.239449308669.issue44971@roundup.psfhosted.org> Steven D'Aprano added the comment: I'm sorry if you don't like the design of the pack() method, but all the examples in the documentation show how it behaves. It is behaving as documented and designed. https://docs.python.org/3/library/tkinter.html The bug here is in your own code. You already know the correct way to write this, as you already stated: label2 = ttk.Label(root, text='Show2 Label') label2.pack() Writing it as ttk.Label(root, text='Show2 Label').pack() returns None, as designed, which then consequently fails when you try to operate on None. You say: "If giving a widget a name, I expect to use it later in the program." But you don't give the widget a name. What you are doing is the equivalent of this: temp = ttk.Label(root, text='Show2 Label') # hidden temp object label = temp.pack() # Returns None del temp # hidden temp object is garbage collected except that `temp` is never directly accessible by you. Or if you prefer another analogy: number = (1 + 2) - 3 and then get surprised that number is zero rather than 3 because "I gave (1+2) a name". No, you gave a name to the *whole expression*, which evaluates to 0, not 3. And in the Label case, the *whole expression* evaluates to None. Also, the code doesn't crash. It raises an exception, which is the expected behaviour for trying to access non-existent attributes. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 12:40:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 21 Aug 2021 16:40:14 +0000 Subject: [issue44964] Semantics of PyCode_Addr2Line() changed In-Reply-To: <1629482860.18.0.0801179280266.issue44964@roundup.psfhosted.org> Message-ID: <1629564014.35.0.632664503062.issue44964@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Are you ok if I add a small comment to the what's new of 3.10? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 13:23:48 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 17:23:48 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs Message-ID: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> New submission from Ryan Mast (nightlark) : Adding a workflow_dispatch trigger for the GitHub Actions jobs makes it possible to run the GHA CI jobs for commits to branches in a fork without opening a "draft/WIP" PR to one of the main release branches. It also runs the SSL tests which normally get skipped for PRs. The main constraint is that ---------- components: Build messages: 400036 nosy: pablogsal, rmast, vstinner, zach.ware priority: normal severity: normal status: open title: Add workflow_dispatch trigger for GitHub Actions jobs type: enhancement versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 13:24:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Aug 2021 17:24:42 +0000 Subject: [issue44970] Re-examine complex pow special case handling In-Reply-To: <1629552403.37.0.715300348368.issue44970@roundup.psfhosted.org> Message-ID: <1629566682.4.0.634090142363.issue44970@roundup.psfhosted.org> Serhiy Storchaka added the comment: The OverflowError should only be raised if finite arguments produce infinite result. Py_ADJUST_ERANGE2 is used improperly. But after fixing this error I get (nan+infj) for z**1, the same as for z*1. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 13:27:15 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 17:27:15 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629566835.69.0.665049200132.issue44972@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: * The main constraint is that the the `workflow_dispatch` trigger must be in the GHA workflow yaml files for the branch to be selectable as a target on the Actions tab when manually triggering a workflow. Having the change made to the main branch and backported would mean that new or rebased branches would have the trigger needed for manually running the CI job in forks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 13:27:40 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 17:27:40 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629566860.99.0.757550549713.issue44972@roundup.psfhosted.org> Change by Ryan Mast (nightlark) : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 13:36:16 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 17:36:16 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629567376.65.0.14674251504.issue44972@roundup.psfhosted.org> Change by Ryan Mast (nightlark) : ---------- keywords: +patch pull_requests: +26328 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27873 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 13:40:14 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 17:40:14 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629567614.01.0.675033501841.issue44972@roundup.psfhosted.org> Change by Ryan Mast (nightlark) : ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 13:40:35 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Sat, 21 Aug 2021 17:40:35 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629567635.15.0.766320213171.issue44972@roundup.psfhosted.org> Change by Ryan Mast (nightlark) : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 14:56:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 21 Aug 2021 18:56:28 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1629572188.38.0.855578543114.issue44963@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am marking this as a release blocker, given that this is probably going to trip a lot of users. ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 14:59:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 21 Aug 2021 18:59:02 +0000 Subject: [issue44965] [sqlite3] early exit for non-DML statements in executemany() In-Reply-To: <1629490047.04.0.534577541585.issue44965@roundup.psfhosted.org> Message-ID: <1629572342.3.0.259047571995.issue44965@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 878e7267016ba25d05d8736349fb897c756f311d by Erlend Egeberg Aasland in branch 'main': bpo-44965: Early exit for non-DML statements in sqlite3.Cursor.executemany() (GH-27865) https://github.com/python/cpython/commit/878e7267016ba25d05d8736349fb897c756f311d ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 14:59:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 21 Aug 2021 18:59:09 +0000 Subject: [issue44965] [sqlite3] early exit for non-DML statements in executemany() In-Reply-To: <1629490047.04.0.534577541585.issue44965@roundup.psfhosted.org> Message-ID: <1629572349.43.0.699751117973.issue44965@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 14:59:33 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Aug 2021 18:59:33 +0000 Subject: [issue44966] example code does not macth the very version(3.9) In-Reply-To: <1629508481.91.0.0767549415848.issue44966@roundup.psfhosted.org> Message-ID: <1629572373.06.0.318186442303.issue44966@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26331 pull_request: https://github.com/python/cpython/pull/27876 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 14:59:27 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Aug 2021 18:59:27 +0000 Subject: [issue44966] example code does not macth the very version(3.9) In-Reply-To: <1629508481.91.0.0767549415848.issue44966@roundup.psfhosted.org> Message-ID: <1629572367.75.0.836496575311.issue44966@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26330 pull_request: https://github.com/python/cpython/pull/27875 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 14:59:21 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 21 Aug 2021 18:59:21 +0000 Subject: [issue44966] example code does not macth the very version(3.9) In-Reply-To: <1629508481.91.0.0767549415848.issue44966@roundup.psfhosted.org> Message-ID: <1629572361.83.0.127237192744.issue44966@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 15a64d89a31b7e91f0361c305b7b27d8761db93d by Raymond Hettinger in branch 'main': bpo-44966: Fix out-of-date traceback message (GH-27867) https://github.com/python/cpython/commit/15a64d89a31b7e91f0361c305b7b27d8761db93d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 16:09:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 21 Aug 2021 20:09:15 +0000 Subject: [issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests In-Reply-To: <1629520052.97.0.572214305384.issue44968@roundup.psfhosted.org> Message-ID: <1629576555.39.0.311203639798.issue44968@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 585390fdd8661b4bc08bdfc27551292da9b4b9b8 by Serhiy Storchaka in branch 'main': bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870) https://github.com/python/cpython/commit/585390fdd8661b4bc08bdfc27551292da9b4b9b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 16:09:16 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Aug 2021 20:09:16 +0000 Subject: [issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests In-Reply-To: <1629520052.97.0.572214305384.issue44968@roundup.psfhosted.org> Message-ID: <1629576556.91.0.498904835137.issue44968@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26332 pull_request: https://github.com/python/cpython/pull/27877 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 16:09:21 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Aug 2021 20:09:21 +0000 Subject: [issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests In-Reply-To: <1629520052.97.0.572214305384.issue44968@roundup.psfhosted.org> Message-ID: <1629576561.26.0.294312254765.issue44968@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26333 pull_request: https://github.com/python/cpython/pull/27878 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 16:29:26 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Aug 2021 20:29:26 +0000 Subject: [issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests In-Reply-To: <1629520052.97.0.572214305384.issue44968@roundup.psfhosted.org> Message-ID: <1629577766.73.0.172896594372.issue44968@roundup.psfhosted.org> miss-islington added the comment: New changeset d5781e973079a20b2370686d6e080316d6c9f90d by Miss Islington (bot) in branch '3.9': bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870) https://github.com/python/cpython/commit/d5781e973079a20b2370686d6e080316d6c9f90d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 16:30:16 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 21 Aug 2021 20:30:16 +0000 Subject: [issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests In-Reply-To: <1629520052.97.0.572214305384.issue44968@roundup.psfhosted.org> Message-ID: <1629577816.69.0.938059520898.issue44968@roundup.psfhosted.org> miss-islington added the comment: New changeset 88a1920c7b7b0fb73c4037b460c6a4a8c0aa10f0 by Miss Islington (bot) in branch '3.10': bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870) https://github.com/python/cpython/commit/88a1920c7b7b0fb73c4037b460c6a4a8c0aa10f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 18:29:25 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 21 Aug 2021 22:29:25 +0000 Subject: [issue42085] Add dedicated slot for sending values In-Reply-To: <1603136296.98.0.312180912341.issue42085@roundup.psfhosted.org> Message-ID: <1629584965.67.0.9168809394.issue42085@roundup.psfhosted.org> Dennis Sweeney added the comment: Is there documentation anywhere for the semantics of am_send? I only see the signature followed by "See PyIter_Send for details", but the doc for PyIter_Send doesn't mention am_send. In particular, it would be nice to document the relationship between PyIter_Send, am_send, and tp_iternext. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 20:01:47 2021 From: report at bugs.python.org (Myst) Date: Sun, 22 Aug 2021 00:01:47 +0000 Subject: [issue43093] Make modules picklable In-Reply-To: <1612207064.95.0.494686404563.issue43093@roundup.psfhosted.org> Message-ID: <1629590507.28.0.804810358059.issue43093@roundup.psfhosted.org> Change by Myst : ---------- nosy: +LeMyst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 20:35:43 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 00:35:43 +0000 Subject: [issue44966] example code does not macth the very version(3.9) In-Reply-To: <1629508481.91.0.0767549415848.issue44966@roundup.psfhosted.org> Message-ID: <1629592543.49.0.0423227002195.issue44966@roundup.psfhosted.org> miss-islington added the comment: New changeset 95a9ba173ecaeec0cb8bf57cfcd916d64fa6f861 by Miss Islington (bot) in branch '3.10': bpo-44966: Fix out-of-date traceback message (GH-27867) https://github.com/python/cpython/commit/95a9ba173ecaeec0cb8bf57cfcd916d64fa6f861 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 20:37:01 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 22 Aug 2021 00:37:01 +0000 Subject: [issue44966] example code does not macth the very version(3.9) In-Reply-To: <1629508481.91.0.0767549415848.issue44966@roundup.psfhosted.org> Message-ID: <1629592621.04.0.822654007172.issue44966@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 407b3e0bb028c30fbf5efcf58c70c50eaa6712b0 by Miss Islington (bot) in branch '3.9': bpo-44966: Fix out-of-date traceback message (GH-27867) (GH-27876) https://github.com/python/cpython/commit/407b3e0bb028c30fbf5efcf58c70c50eaa6712b0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 20:37:32 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 22 Aug 2021 00:37:32 +0000 Subject: [issue44966] example code does not macth the very version(3.9) In-Reply-To: <1629508481.91.0.0767549415848.issue44966@roundup.psfhosted.org> Message-ID: <1629592652.63.0.906236491341.issue44966@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 Aug 21 22:40:47 2021 From: report at bugs.python.org (hai shi) Date: Sun, 22 Aug 2021 02:40:47 +0000 Subject: [issue30924] RPM build doc_files needs files separated into separate lines In-Reply-To: <1499968200.32.0.508510692032.issue30924@psf.upfronthosting.co.za> Message-ID: <1629600047.35.0.704884216887.issue30924@roundup.psfhosted.org> hai shi added the comment: > Should this be closed? Copy from PEP-632: In Python 3.10 and 3.11, distutils will be formally marked as deprecated. All known issues will be closed at this time. I close this bpo. If there have some block issues to discuss, we can reopen it again:) ---------- nosy: +shihai1991 resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 21 23:42:50 2021 From: report at bugs.python.org (hai shi) Date: Sun, 22 Aug 2021 03:42:50 +0000 Subject: [issue44913] segfault in call to embedded PyModule_New In-Reply-To: <1628951281.11.0.836111617554.issue44913@roundup.psfhosted.org> Message-ID: <1629603770.32.0.682495978946.issue44913@roundup.psfhosted.org> hai shi added the comment: How about this one? int foo(void) { printf(stderr, "foo BEGIN\n"); if (!Py_IsInitialized()) { fprintf(stderr, "python already initialized\n"); return -1; } const char *module_name = "foo"; PyGILState_STATE state = PyGILState_Ensure(); PyObject *module_handle = PyModule_New(module_name); if (module_handle == 0) { fprintf(stderr,"PyModule_New(module_data_name=%s) failed\n", module_name); exit(1); } fprintf(stdout, "point is: %p\n", module_handle); fprintf(stderr, "foo END\n"); PyGILState_Release(state); return 0; } ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 00:42:50 2021 From: report at bugs.python.org (Rondevous) Date: Sun, 22 Aug 2021 04:42:50 +0000 Subject: [issue44940] Clarify the documentation of re.findall() In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629607370.92.0.934159315358.issue44940@roundup.psfhosted.org> Rondevous added the comment: Oops, I was wrong about re.finditer :D Sorry, I think didn't check that properly. Just saw the changes. The patch looks good :) Thanks a lot! ---------- title: Suggest the use of non-capturing groups in re.findall() and re.finditer() docs -> Clarify the documentation of re.findall() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 02:39:43 2021 From: report at bugs.python.org (Tushar Sadhwani) Date: Sun, 22 Aug 2021 06:39:43 +0000 Subject: [issue44973] @classmethod can be stacked on @property, but @staticmethod cannot Message-ID: <1629614383.81.0.292978789456.issue44973@roundup.psfhosted.org> New submission from Tushar Sadhwani : Starting with Python3.9, `@classmethod` can be stacked on top of `@property`, but it seems that `@staticmethod` cannot. >>> class C: ... @classmethod ... @property ... def cm(cls): ... return cls.__name__ ... @staticmethod ... @property ... def magic_number(): ... return 42 ... >>> C.cm 'C' >>> C.magic_number >>> This feels like inconsistent behaviour, plus, having staticmethod properties can be useful for creating read-only class attributes, for eg: class C: @staticmethod @property def FINE_STRUCTURE_CONSTANT(): return 1 / 137 This would make it hard to accidentally modify the constant inside the class. ---------- messages: 400051 nosy: tusharsadhwani priority: normal severity: normal status: open title: @classmethod can be stacked on @property, but @staticmethod cannot type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 03:24:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 07:24:30 +0000 Subject: [issue44940] Clarify the documentation of re.findall() In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629617070.71.0.0946838229861.issue44940@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 64f9e7b19dc1603fcbd07c17c9860085b9d21465 by Serhiy Storchaka in branch 'main': bpo-44940: Clarify the documentation of re.findall() (GH-27849) https://github.com/python/cpython/commit/64f9e7b19dc1603fcbd07c17c9860085b9d21465 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 03:24:46 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 07:24:46 +0000 Subject: [issue44940] Clarify the documentation of re.findall() In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629617086.53.0.935507841838.issue44940@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26335 pull_request: https://github.com/python/cpython/pull/27880 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 03:24:42 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 07:24:42 +0000 Subject: [issue44940] Clarify the documentation of re.findall() In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629617082.9.0.92845477675.issue44940@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26334 pull_request: https://github.com/python/cpython/pull/27879 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 03:34:02 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 07:34:02 +0000 Subject: [issue44955] Method stopTestRun() is not always called for skipped tests In-Reply-To: <1629374326.22.0.989975388504.issue44955@roundup.psfhosted.org> Message-ID: <1629617642.16.0.971899328373.issue44955@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26336 pull_request: https://github.com/python/cpython/pull/27881 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 03:34:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 07:34:04 +0000 Subject: [issue44955] Method stopTestRun() is not always called for skipped tests In-Reply-To: <1629374326.22.0.989975388504.issue44955@roundup.psfhosted.org> Message-ID: <1629617644.13.0.521424072065.issue44955@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a9640d75531d6cbbfd254b65435f238c26bf5cd9 by Serhiy Storchaka in branch 'main': bpo-44955: Always call stopTestRun() for implicitly created TestResult objects (GH-27831) https://github.com/python/cpython/commit/a9640d75531d6cbbfd254b65435f238c26bf5cd9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 03:34:07 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 07:34:07 +0000 Subject: [issue44955] Method stopTestRun() is not always called for skipped tests In-Reply-To: <1629374326.22.0.989975388504.issue44955@roundup.psfhosted.org> Message-ID: <1629617647.12.0.84302684753.issue44955@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26337 pull_request: https://github.com/python/cpython/pull/27882 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 03:45:13 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 07:45:13 +0000 Subject: [issue44940] Clarify the documentation of re.findall() In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629618313.16.0.581670957845.issue44940@roundup.psfhosted.org> miss-islington added the comment: New changeset 519bcc698c436e12bd6c1ff6f2517060719c60d5 by Miss Islington (bot) in branch '3.10': bpo-44940: Clarify the documentation of re.findall() (GH-27849) https://github.com/python/cpython/commit/519bcc698c436e12bd6c1ff6f2517060719c60d5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 03:55:41 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 07:55:41 +0000 Subject: [issue44955] Method stopTestRun() is not always called for skipped tests In-Reply-To: <1629374326.22.0.989975388504.issue44955@roundup.psfhosted.org> Message-ID: <1629618941.57.0.963108186621.issue44955@roundup.psfhosted.org> miss-islington added the comment: New changeset d63114caf9384ead7baf872598acdff25315a5bf by Miss Islington (bot) in branch '3.10': bpo-44955: Always call stopTestRun() for implicitly created TestResult objects (GH-27831) https://github.com/python/cpython/commit/d63114caf9384ead7baf872598acdff25315a5bf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 04:04:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 08:04:54 +0000 Subject: [issue44968] Fix/remove test_subprocess_wait_no_same_group from test_asyncio tests In-Reply-To: <1629520052.97.0.572214305384.issue44968@roundup.psfhosted.org> Message-ID: <1629619494.7.0.578612097037.issue44968@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you for your report Ryan. Indeed, there was a bug introduced during refactoring (one unneeded "yield" was kept), and there was a bug before refactoring (the transport was not closed). I'll open a new issue about "Unknown child process pid". ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 04:16:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 08:16:21 +0000 Subject: [issue44974] Warning about "Unknown child process pid" in test_asyncio Message-ID: <1629620181.19.0.253216813733.issue44974@roundup.psfhosted.org> New submission from Serhiy Storchaka : Ryan Mast reported about a warning about "Unknown child process pid" after finishing test_asyncio (see msg400018 and https://github.com/python/cpython/pull/27870#issuecomment-903072119 for details). I cannot reproduce it locally. Ryan, could you help with locating the source of this warning? First suspect is test_close_dont_kill_finished. If it is not, it may be other test calling kill(). ---------- components: Tests, asyncio messages: 400057 nosy: asvetlov, rmast, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Warning about "Unknown child process pid" in test_asyncio type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 04:48:49 2021 From: report at bugs.python.org (ty) Date: Sun, 22 Aug 2021 08:48:49 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1629622129.44.0.296906779226.issue44493@roundup.psfhosted.org> ty added the comment: Hello and PING. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 04:56:49 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 22 Aug 2021 08:56:49 +0000 Subject: [issue44975] [typing] Runtime protocols with ClassVar data members should support issubclass Message-ID: <1629622609.34.0.447069289698.issue44975@roundup.psfhosted.org> New submission from Ken Jin : This is a feature request by a user at https://github.com/python/typing/issues/822. A copy of their request: Currently issubclass cannot be used for runtime_checkable protocols with data members, because those attributes could be set in __init__. I propose to relax this restriction to allow protocols with ClassVar members, as those should be present in the class definition. I'm unsure if I need to update PEP 544 too. I don't remember if PEPs can be updated when 'Accepted', or was it 'Final' PEPs that can't be updated anymore? ---------- assignee: kj components: Library (Lib) messages: 400059 nosy: Jelle Zijlstra, gvanrossum, kj priority: normal severity: normal status: open title: [typing] Runtime protocols with ClassVar data members should support issubclass type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 05:01:24 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 22 Aug 2021 09:01:24 +0000 Subject: [issue44975] [typing] Runtime protocols with ClassVar data members should support issubclass In-Reply-To: <1629622609.34.0.447069289698.issue44975@roundup.psfhosted.org> Message-ID: <1629622884.82.0.869660261421.issue44975@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +26338 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 05:03:03 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 09:03:03 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1629622983.35.0.812019170704.issue44547@roundup.psfhosted.org> Mark Dickinson added the comment: I think there's no reason not to keep __trunc__ and math.trunc - they're natural counterparts to floor and ceil, and there's probably at least some code out there already using math.trunc. It's the involvement of __trunc__ in the int() builtin that I'd quite like to deprecate and eventually remove. I think at this point it complicates the object model for no particularly good reason. But this is getting off-topic for this issue; I'll open a new one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 05:05:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 09:05:47 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1629623147.29.0.661728086112.issue41620@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a bug because there is a difference between the following cases: @skip("skipped") def test1(self): ... @other_decorator @skip("skipped") def test2(self): ... def test2(self): self.skipTest("skipped") ... None is only returned in the first case. In other two cases a TestResult is returned with information about skipping. It is obvious that it was unintentionally. I just have fixed similar bug about calling stopTestRun() (issue44955). Iman, please add tests and a NEWS entry. You can use tests added in issue44955 as an example. ---------- components: +Library (Lib) nosy: +serhiy.storchaka stage: -> test needed type: -> behavior versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 05:06:30 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 22 Aug 2021 09:06:30 +0000 Subject: [issue44976] [sqlite3] lazy creation of result rows Message-ID: <1629623190.98.0.383271331638.issue44976@roundup.psfhosted.org> New submission from Erlend E. Aasland : Currently, we build the first result row in the _pysqlite_query_execute() loop if sqlite3_step() returned SQLITE_ROW. When the user asks for a row (for example, using sqlite3.Cursor.fetchone()), this pre-built row is returned, and the next row is prepared. Suggesting to lazily build result rows instead. Cons: - no result tuples are built unless sqlite3.Cursor.fetch*() is called - no need to keep the next result row (tuple) in pysqlite_Cursor; rows are built on demand - pysqlite_cursor_iternext() is vastly simplified (50% less lines of code) - the main loop in _pysqlite_query_execute() is further simplified Cons: - code churn git diff?main --shortstat: 2 files changed, 29 insertions(+), 58 deletions(-) ---------- components: Extension Modules messages: 400062 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal severity: normal status: open title: [sqlite3] lazy creation of result rows type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 05:08:58 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 22 Aug 2021 09:08:58 +0000 Subject: [issue44976] [sqlite3] lazy creation of result rows In-Reply-To: <1629623190.98.0.383271331638.issue44976@roundup.psfhosted.org> Message-ID: <1629623338.02.0.661397957161.issue44976@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +26339 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27884 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 05:17:57 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 09:17:57 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__? Message-ID: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> New submission from Mark Dickinson : The int constructor, when applied to a general Python object `obj`, first looks for an __int__ method, then for an __index__ method, and then finally for a __trunc__ method. The delegation to __trunc__ used to be useful: it meant that users could write a custom class SomeNumber with the property that: - SomeNumber instances supported 'int' calls, returning a truncated value, but - SomeNumber instances weren't usable in indexing, chr() calls, and all the various other calls that implicitly invoked __int__. class SomeNumber: def __trunc__(self): However, with Python >= 3.10, we no longer use __int__ implicitly for argument conversion in internal code. So the second point above is no longer a concern, and SomeNumber can now simply be written as class SomeNumber: def __int__(self): This decouples int from __trunc__ and leaves __trunc__ as simply the support for the math.trunc function. ---------- messages: 400063 nosy: mark.dickinson priority: normal severity: normal status: open title: Deprecate delegation of int to __trunc__? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 05:19:56 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 09:19:56 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__? In-Reply-To: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> Message-ID: <1629623996.0.0.851280826681.issue44977@roundup.psfhosted.org> Mark Dickinson added the comment: > This decouples int from __trunc__ and leaves __trunc__ as simply the support for the math.trunc function. Argh; copy and paste fail - I left out the crucial line. I propose deprecating the delegation of int to __trunc__: calls to int(a) where type(a) implements __trunc__ but not __int__ or __index__ would raise a DeprecationWarning, and at some point in the future int(a) would become a TypeError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 05:26:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 22 Aug 2021 09:26:33 +0000 Subject: [issue44976] [sqlite3] lazy creation of result rows In-Reply-To: <1629623190.98.0.383271331638.issue44976@roundup.psfhosted.org> Message-ID: <1629624393.76.0.783934477524.issue44976@roundup.psfhosted.org> Erlend E. Aasland added the comment: Historical note: The current behaviour was introduced in pysqlite v2.0.2 (May 21 2005), in order to be able to finalise statements and thus close cursors as soon as possible. However, that effect was cancelled just after a couple of months, by the addition of the LRU cache and the ability to reuse prepared statements. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 06:35:42 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 22 Aug 2021 10:35:42 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629628542.31.0.145124710242.issue24234@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 06:45:03 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 10:45:03 +0000 Subject: [issue44978] Argument Clinic should not exclude __complex__ methods Message-ID: <1629629103.05.0.72351239388.issue44978@roundup.psfhosted.org> New submission from Mark Dickinson : The argument clinic currently refuses to handle a __complex__ method. However, unlike __int__ and __float__, __complex__ should require no special handling by the argument clinic, since there's no dedicated slot for the __complex__ method. PR arriving shortly. ---------- components: Demos and Tools messages: 400066 nosy: mark.dickinson priority: normal severity: normal status: open title: Argument Clinic should not exclude __complex__ methods type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 06:48:39 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 10:48:39 +0000 Subject: [issue44978] Argument Clinic should not exclude __complex__ methods In-Reply-To: <1629629103.05.0.72351239388.issue44978@roundup.psfhosted.org> Message-ID: <1629629319.0.0.1016874845.issue44978@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +26340 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27886 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 07:03:45 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 11:03:45 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629630225.17.0.859497954224.issue24234@roundup.psfhosted.org> Mark Dickinson added the comment: If the goal is to have `isinstance(obj, typing.SupportsComplex)` pass for objects that are convertible to complex, then we'll need `int.__complex__` and `float.__complex__` implementations as well as `complex.__complex__`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 07:16:34 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 11:16:34 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629630994.62.0.645316546429.issue24234@roundup.psfhosted.org> Mark Dickinson added the comment: > [...] we'll need `int.__complex__` and `float.__complex__` implementations as well as `complex.__complex__`. The real problem here is that the "typing.SupportsComplex" protocol isn't a good match for code that needs to know that a given value `x` can be treated as though it were a complex number. The test that best matches "usable as a complex number" seems to be that type(x) implements at least one of `__index__`, `__float__` or `__complex__`, or that `x` is a subclass of complex. It looks to me as though the right thing to do here is to just implement complex.__complex__, but not int.__complex__ or float.__complex__. Then at least we can remove the subclass test from the above and express the test purely in terms of special methods: __index__, __float__ and __complex__. And then perhaps it's for the typing module to find a more convenient way to express the union of typing.SupportsIndex, typing.SupportsFloat and typing.SupportsComplex. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 08:13:41 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 12:13:41 +0000 Subject: [issue44978] Argument Clinic should not exclude __complex__ methods In-Reply-To: <1629629103.05.0.72351239388.issue44978@roundup.psfhosted.org> Message-ID: <1629634421.94.0.798257074723.issue44978@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset c5c3fbe2a16a8fcb77eb98eda53efb3e03b863ca by Mark Dickinson in branch 'main': bpo-44978: allow Argument Clinic to handle __complex__ special methods (GH-27886) https://github.com/python/cpython/commit/c5c3fbe2a16a8fcb77eb98eda53efb3e03b863ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 08:23:00 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 12:23:00 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629634980.11.0.0297071445583.issue24234@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +26341 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27887 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 08:26:49 2021 From: report at bugs.python.org (Madhu) Date: Sun, 22 Aug 2021 12:26:49 +0000 Subject: [issue44913] segfault in call to embedded PyModule_New In-Reply-To: <1629603770.32.0.682495978946.issue44913@roundup.psfhosted.org> Message-ID: <20210822.175704.2257033459608092404.enometh@meer.net> Madhu added the comment: * hai shi <1629603770.32.0.682495978946.issue44913 at roundup.psfhosted.org> Wrote on Sun, 22 Aug 2021 03:42:50 +0000 > hai shi added the comment: > How about this one? > > if (!Py_IsInitialized()) { > return -1; > } [When this extension is loaded into a C program rather than a python script, then Python should be initialized here rather than quitting] > PyGILState_STATE state = PyGILState_Ensure(); > PyObject *module_handle = PyModule_New(module_name); > if (module_handle == 0) > { > fprintf(stderr,"PyModule_New(module_data_name=%s) failed\n", > module_name); > exit(1); > } > fprintf(stdout, "point is: %p\n", module_handle); > fprintf(stderr, "foo END\n"); > PyGILState_Release(state); Yes. Thanks. Calling PyGILState_Ensure and PyGILState_Release around the call to PyModule_New does avoid the segfault. It is a little tricky to do this in pam-python - because although there is one entrypoint into the extension (which can be wrapped within the calls to PyGILState_Ensure/Release), python is initialized within that entrypoint, but I think this can be solved another way. Thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 08:30:50 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 12:30:50 +0000 Subject: [issue44978] Argument Clinic should not exclude __complex__ methods In-Reply-To: <1629629103.05.0.72351239388.issue44978@roundup.psfhosted.org> Message-ID: <1629635450.22.0.131795095302.issue44978@roundup.psfhosted.org> Change by Mark Dickinson : ---------- assignee: -> mark.dickinson resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 08:37:01 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 12:37:01 +0000 Subject: [issue32082] atexit module: allow getting/setting list of handlers directly In-Reply-To: <1511171681.08.0.213398074469.issue32082@psf.upfronthosting.co.za> Message-ID: <1629635821.76.0.448092563808.issue32082@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks, Irit. Should we close this issue as a duplicate? It's not identical (being able to modify the list of handlers versus just being able to inspect it), but it's pretty close. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 08:38:25 2021 From: report at bugs.python.org (Antony Lee) Date: Sun, 22 Aug 2021 12:38:25 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1629635905.48.0.0227795289419.issue44019@roundup.psfhosted.org> Change by Antony Lee : ---------- keywords: +patch pull_requests: +26342 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27888 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 09:07:54 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 13:07:54 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1629637674.23.0.78241183709.issue39511@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 09:09:09 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 13:09:09 +0000 Subject: [issue27901] DOC: inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5 In-Reply-To: <1472585181.25.0.672560198795.issue27901@psf.upfronthosting.co.za> Message-ID: <1629637749.38.0.0572108087063.issue27901@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 09:10:15 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 13:10:15 +0000 Subject: [issue39301] Specification of bitshift on integers should clearly state floor division used In-Reply-To: <1578725984.98.0.631488660974.issue39301@roundup.psfhosted.org> Message-ID: <1629637815.41.0.397324109841.issue39301@roundup.psfhosted.org> Mark Dickinson added the comment: Closing; I think this is addressed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 09:18:41 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 13:18:41 +0000 Subject: [issue37082] Assignment expression symbol (walrus) not in built-in help() In-Reply-To: <1559067983.32.0.880606504508.issue37082@roundup.psfhosted.org> Message-ID: <1629638321.32.0.723392189918.issue37082@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 09:20:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 13:20:49 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__? In-Reply-To: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> Message-ID: <1629638449.68.0.411366192654.issue44977@roundup.psfhosted.org> Serhiy Storchaka added the comment: Completely agree. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 10:36:49 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 22 Aug 2021 14:36:49 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__? In-Reply-To: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> Message-ID: <1629643009.57.0.358331979213.issue44977@roundup.psfhosted.org> Raymond Hettinger added the comment: Afterwards, do __trunc__ and math.trunc() still need to exist? They were mostly unused. Now they would also be unnecessary. Just having them around would be a point of confusion. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 11:07:54 2021 From: report at bugs.python.org (Kirill Pinchuk) Date: Sun, 22 Aug 2021 15:07:54 +0000 Subject: [issue44979] pathlib: support relative path construction Message-ID: <1629644874.28.0.329999889777.issue44979@roundup.psfhosted.org> New submission from Kirill Pinchuk : Hi. I've been using this snippet for years and believe that it would be a nice addition to pathlib's functionality. Basically, it allows constructing path relative to the current file (instead of cwd). Comes quite handy when you're working with deeply nested resources like file fixtures in tests and many other cases. ``` @classmethod def relative(cls, path, depth=1): """ Return path that is constructed relatively to caller file. """ base = Path(sys._getframe(depth).f_code.co_filename).parent return (base / path).resolve() ``` ---------- components: Library (Lib) messages: 400075 nosy: cybergrind priority: normal severity: normal status: open title: pathlib: support relative path construction type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 11:09:48 2021 From: report at bugs.python.org (Bastian Neuburger) Date: Sun, 22 Aug 2021 15:09:48 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629644988.3.0.665439159109.issue44934@roundup.psfhosted.org> Change by Bastian Neuburger : ---------- keywords: +patch pull_requests: +26343 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27889 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 11:13:07 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 15:13:07 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__? In-Reply-To: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> Message-ID: <1629645187.43.0.302994200473.issue44977@roundup.psfhosted.org> Mark Dickinson added the comment: A GitHub code search shows a substantial number of uses of math.trunc out in the wild: https://github.com/search?q=math.trunc+extension%3Apy&type=Code So unfortunately, getting rid of math.trunc and __trunc__ looks a bit too much as though it would cause gratuitous breakage. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 11:13:55 2021 From: report at bugs.python.org (Kirill Pinchuk) Date: Sun, 22 Aug 2021 15:13:55 +0000 Subject: [issue44979] pathlib: support relative path construction In-Reply-To: <1629644874.28.0.329999889777.issue44979@roundup.psfhosted.org> Message-ID: <1629645235.14.0.560248467793.issue44979@roundup.psfhosted.org> Change by Kirill Pinchuk : ---------- keywords: +patch pull_requests: +26344 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27890 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 11:18:31 2021 From: report at bugs.python.org (Bastian Neuburger) Date: Sun, 22 Aug 2021 15:18:31 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629645511.56.0.202431865739.issue44934@roundup.psfhosted.org> Bastian Neuburger added the comment: Steve, I signed the CLA and created the PR, I don't know how long it takes until the info that the CLA is signed is propagated to bpo or github. Regarding failed builds: I will try to build again tomorrow when back at the office and can copy the errors, how would you like to receive them? For building I spun up a MS Windows 10 Edge Test VM, installed Visual Studio 2019 and then tried to run get_externals.bat; that already failed since the nuget config was empty and thus had no upstreams configured. Maybe this problem stems from the free test VM. After editing the nuget config, that script worked out fine and then I run build.bat, which seemed to be quite busy for at least 10 minutes, then I left my office. Upon return I saw plenty of errors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 11:25:48 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 22 Aug 2021 15:25:48 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__? In-Reply-To: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> Message-ID: <1629645948.87.0.542291736715.issue44977@roundup.psfhosted.org> Raymond Hettinger added the comment: Possibly, we could have math.trunc() call __int__, letting us deprecate __trunc__. That would let users avoid gratuitous aliasing such as that in _pydecimal.py: __trunc__ = __int__ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 11:54:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 15:54:26 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__? In-Reply-To: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> Message-ID: <1629647666.02.0.877848114017.issue44977@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not think that math.trunc() for UUID or IP4Address makes sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 11:56:51 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 22 Aug 2021 15:56:51 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__? In-Reply-To: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> Message-ID: <1629647811.57.0.5415502924.issue44977@roundup.psfhosted.org> Mark Dickinson added the comment: I think the needs are sufficiently different that __trunc__ still has value as its own thing, and it's a natural counterpart to __floor__ and __ceil__ (out of all the directed rounding modes, rounding towards zero probably turns up more often than rounding towards +inf or -inf). __int__ has the disadvantage that it must return an int, so it's not useful for other Python-based numeric systems with their own rational number / integer pairing. For example, with gmpy2, truncating an mpq instance returns an mpz instance, which is what I'd expect and want - if I'm working with huge values then it would be annoying for math.trunc to do the inefficient thing and return a plain int. >>> from gmpy2 import mpq >>> math.trunc(mpq(22, 7)) mpz(3) SymPy behaves similarly: >>> from sympy import Rational >>> type(math.trunc(Rational(22, 7))) On the other side, there are conversions to integer that it doesn't make sense to think of as truncation. It would be odd for a UUID to be a valid input to math.trunc, for example: >>> int(uuid.uuid4()) 43341414945793370480422623795805641537 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 13:25:36 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 22 Aug 2021 17:25:36 +0000 Subject: [issue44973] @classmethod can be stacked on @property, but @staticmethod cannot In-Reply-To: <1629614383.81.0.292978789456.issue44973@roundup.psfhosted.org> Message-ID: <1629653136.33.0.910614959745.issue44973@roundup.psfhosted.org> Raymond Hettinger added the comment: The classmethod and staticmethod decorators have somewhat different semantics. Accessing a classmethod with C.cm creates a bound method object which has both __call__ and __get__. In contrast, accessing a staticmethod with C.sm returns the underlying function. So there is no opportunity for a customized __get__ method as we have with classmethod. Also, even if C.sm did return a custom descriptor, the code example still can't be made to work because the __get__ method on property objects is hardwired to pass in an instance.? That means that the underlying method must have a "self" argument. Another issue is that properties have __set__ and __delete__ methods which could not be made to work without a reference to the class or instance. To make a read-only class variable, a metaclass would be needed. While it is possible to write a descriptor to make C.FINE_STRUCTURE_CONSTANT call a function that returns 1/137, there is no way for the descriptors to block the assignment: C.FINE_STRUCTURE_CONSTANT = 1 / 100 Thanks for the suggestion, but I don't think this can be made to work. ? https://docs.python.org/3/howto/descriptor.html#properties ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 13:32:04 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 22 Aug 2021 17:32:04 +0000 Subject: [issue44977] Deprecate delegation of int to __trunc__? In-Reply-To: <1629623877.06.0.26111591106.issue44977@roundup.psfhosted.org> Message-ID: <1629653524.34.0.316081765144.issue44977@roundup.psfhosted.org> Raymond Hettinger added the comment: I retract the suggestion to deprecate __trunc__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 13:38:02 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 22 Aug 2021 17:38:02 +0000 Subject: [issue44973] @classmethod can be stacked on @property, but @staticmethod cannot In-Reply-To: <1629614383.81.0.292978789456.issue44973@roundup.psfhosted.org> Message-ID: <1629653882.2.0.146676160426.issue44973@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:07:45 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 22 Aug 2021 18:07:45 +0000 Subject: [issue44980] Clean up a few tests that return a value!=None Message-ID: <1629655665.44.0.0754665054148.issue44980@roundup.psfhosted.org> New submission from Andrei Kulakov : In #41322 the behavior of returning a value!=None from test methods was deprecated, there are currently a few tests in Python that do that; it would be good to fix them to be consistent with our deprecation requirement and to avoid deprecation warnings in test runs; it may also possibly surface unexpected issues when reviewing these tests. - there are two distutils tests - test_quiet and test_no_optimize_flag -- probably not worth it to investigate them as distutils is set for removal in 3.12 - test_null_strings in CAPI - test_constructor in test_code I'll try to fix the two tests above today. ---------- components: Tests messages: 400083 nosy: andrei.avk priority: normal severity: normal status: open title: Clean up a few tests that return a value!=None _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:15:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 18:15:18 +0000 Subject: [issue44955] Method stopTestRun() is not always called for skipped tests In-Reply-To: <1629374326.22.0.989975388504.issue44955@roundup.psfhosted.org> Message-ID: <1629656118.09.0.992525763803.issue44955@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 4e5162fd369baf25dd16a42ccd0fa7756744f4d0 by Miss Islington (bot) in branch '3.9': bpo-44955: Always call stopTestRun() for implicitly created TestResult objects (GH-27831) (GH-27882) https://github.com/python/cpython/commit/4e5162fd369baf25dd16a42ccd0fa7756744f4d0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:15:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 18:15:41 +0000 Subject: [issue44940] Clarify the documentation of re.findall() In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629656141.96.0.583009835182.issue44940@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset d006392245c904547e5727144235c2f9d7948e96 by Miss Islington (bot) in branch '3.9': bpo-44940: Clarify the documentation of re.findall() (GH-27849) (GH-27880) https://github.com/python/cpython/commit/d006392245c904547e5727144235c2f9d7948e96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:16:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 18:16:13 +0000 Subject: [issue44940] Clarify the documentation of re.findall() In-Reply-To: <1629239046.75.0.423461536015.issue44940@roundup.psfhosted.org> Message-ID: <1629656173.62.0.736726780381.issue44940@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:18:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 18:18:44 +0000 Subject: [issue44955] Method stopTestRun() is not always called for skipped tests In-Reply-To: <1629374326.22.0.989975388504.issue44955@roundup.psfhosted.org> Message-ID: <1629656324.47.0.218621741706.issue44955@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 Aug 22 14:30:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 18:30:10 +0000 Subject: [issue44926] typing.get_type_hints() raises for type aliases with forward references In-Reply-To: <1629134116.67.0.00330387851755.issue44926@roundup.psfhosted.org> Message-ID: <1629657010.36.0.126603982301.issue44926@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9ffe582a018a2babd14e874ae2b169370633fe33 by Miss Islington (bot) in branch '3.10': bpo-44926: `get_type_hints`: Add note about type aliases with forward refs (GH-27859) (GH-27860) https://github.com/python/cpython/commit/9ffe582a018a2babd14e874ae2b169370633fe33 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:32:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 18:32:54 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629657174.04.0.789524841194.issue41322@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b1db308c6114bb18c06656c94c0ffa73ba954977 by andrei kulakov in branch 'main': bpo-41322: Add unit tests for deprecation of test return values (GH-27846) https://github.com/python/cpython/commit/b1db308c6114bb18c06656c94c0ffa73ba954977 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:34:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 18:34:23 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629657263.34.0.364555041337.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d1049d1d6b43296d4db1aa8668aa4ca807bf7adb by Mark Roseman in branch 'main': bpo-42560: rework external references in Tkinter docs (GH-27838) https://github.com/python/cpython/commit/d1049d1d6b43296d4db1aa8668aa4ca807bf7adb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:35:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 18:35:30 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629657330.2.0.995128326302.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 141c7a4fce8def67baa9d24f542c105b8502893e by Mark Roseman in branch 'main': bpo-42560: tweaks to intro of Tkinter docs- add macOS, drop ActiveState (GH-27835) https://github.com/python/cpython/commit/141c7a4fce8def67baa9d24f542c105b8502893e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:35:29 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 18:35:29 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629657329.76.0.715700270871.issue42560@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 12.0 -> 13.0 pull_requests: +26346 pull_request: https://github.com/python/cpython/pull/27891 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:35:34 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 18:35:34 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629657334.05.0.386283204821.issue42560@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26347 pull_request: https://github.com/python/cpython/pull/27892 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:36:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 18:36:37 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1629657397.54.0.464330829133.issue43913@roundup.psfhosted.org> Serhiy Storchaka added the comment: Functions registered with TestCase.addClassCleanup are called because TestCase has default implementation of tearDownClass. But you can suppress it by setting tearDownClass = None. So there is a similar issue with class cleanup functions. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:36:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 22 Aug 2021 18:36:52 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1629657412.37.0.0887112012882.issue43913@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:40:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 18:40:10 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629657610.4.0.260695093591.issue42560@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26348 pull_request: https://github.com/python/cpython/pull/27893 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:41:57 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 18:41:57 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629657717.23.0.871166134826.issue42560@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26350 pull_request: https://github.com/python/cpython/pull/27895 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:41:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 18:41:53 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629657713.16.0.118324986358.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d5dbe8bca792350f4997c027535e0ca498abd1bb by Mark Roseman in branch 'main': bpo-42560: reorganize Tkinter docs modules section for clarity (GH-27840) https://github.com/python/cpython/commit/d5dbe8bca792350f4997c027535e0ca498abd1bb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:41:53 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 18:41:53 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629657713.6.0.40621009863.issue42560@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26349 pull_request: https://github.com/python/cpython/pull/27894 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:43:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 18:43:17 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629657797.54.0.545951101178.issue42560@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26351 pull_request: https://github.com/python/cpython/pull/27896 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:45:09 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 18:45:09 +0000 Subject: [issue44957] typing docs: Mention PEP 604 syntax more prominently In-Reply-To: <1629381037.95.0.0399293112923.issue44957@roundup.psfhosted.org> Message-ID: <1629657909.38.0.381329657952.issue44957@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26352 pull_request: https://github.com/python/cpython/pull/27897 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:45:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 18:45:05 +0000 Subject: [issue44957] typing docs: Mention PEP 604 syntax more prominently In-Reply-To: <1629381037.95.0.0399293112923.issue44957@roundup.psfhosted.org> Message-ID: <1629657905.45.0.606705310501.issue44957@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset dabb6e8ddd7626266184ba022bcb76f74196248f by Sebastian Rittau in branch 'main': bpo-44957: Promote PEP 604 syntax in typing docs (GH-27833) https://github.com/python/cpython/commit/dabb6e8ddd7626266184ba022bcb76f74196248f ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 14:54:53 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 18:54:53 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629658493.7.0.948306729753.issue42560@roundup.psfhosted.org> miss-islington added the comment: New changeset 61ecd3e593e05c3d84adf5640458a01f8550aa74 by Miss Islington (bot) in branch '3.10': bpo-42560: tweaks to intro of Tkinter docs- add macOS, drop ActiveState (GH-27835) https://github.com/python/cpython/commit/61ecd3e593e05c3d84adf5640458a01f8550aa74 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:02:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 19:02:19 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629658939.64.0.685011102391.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e74cf8667d7d73e6cacd5d0aedcecbd20e711d6a by Miss Islington (bot) in branch '3.9': bpo-42560: tweaks to intro of Tkinter docs- add macOS, drop ActiveState (GH-27835) (GH-27892) https://github.com/python/cpython/commit/e74cf8667d7d73e6cacd5d0aedcecbd20e711d6a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:04:27 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 19:04:27 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629659067.85.0.749171921212.issue42560@roundup.psfhosted.org> miss-islington added the comment: New changeset 4d1e74f352d8bf70b726b373e19fd21274899d8e by Miss Islington (bot) in branch '3.10': bpo-42560: reorganize Tkinter docs modules section for clarity (GH-27840) https://github.com/python/cpython/commit/4d1e74f352d8bf70b726b373e19fd21274899d8e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:05:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 19:05:00 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629659100.85.0.461228308305.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8e90f15ac88c66ddb7b084bb5780a126d35168af by ?ukasz Langa in branch '3.10': [3.10] bpo-42560: rework external references in Tkinter docs (GH-27838) (GH-27893) https://github.com/python/cpython/commit/8e90f15ac88c66ddb7b084bb5780a126d35168af ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:06:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 19:06:10 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629659170.02.0.756496491691.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c579f0ba62974b90f348e50088e4c036e281f45e by ?ukasz Langa in branch '3.9': [3.9] bpo-42560: rework external references in Tkinter docs (GH-27838) (GH-27896) https://github.com/python/cpython/commit/c579f0ba62974b90f348e50088e4c036e281f45e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:05:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 19:05:49 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629659149.86.0.0761066527628.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 986750be5c7914f4b0120f5627fe848dcced103b by Miss Islington (bot) in branch '3.9': bpo-42560: reorganize Tkinter docs modules section for clarity (GH-27840) (GH-27895) https://github.com/python/cpython/commit/986750be5c7914f4b0120f5627fe848dcced103b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:16:59 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 22 Aug 2021 19:16:59 +0000 Subject: [issue44980] Clean up a few tests that return a value!=None In-Reply-To: <1629655665.44.0.0754665054148.issue44980@roundup.psfhosted.org> Message-ID: <1629659819.96.0.283142806172.issue44980@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch pull_requests: +26353 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27898 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:27:14 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 19:27:14 +0000 Subject: [issue4442] document immutable type subclassing via __new__ In-Reply-To: <1227719282.37.0.890069433685.issue4442@psf.upfronthosting.co.za> Message-ID: <1629660434.07.0.249685107895.issue4442@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +26354 pull_request: https://github.com/python/cpython/pull/27899 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:27:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 19:27:14 +0000 Subject: [issue4442] document immutable type subclassing via __new__ In-Reply-To: <1227719282.37.0.890069433685.issue4442@psf.upfronthosting.co.za> Message-ID: <1629660434.66.0.246131190865.issue4442@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset eec340ea3af27887fcaac4029ebdee99f3713bff by Raymond Hettinger in branch 'main': bpo-4442: Document use of __new__ for subclasses of immutable types (GH-27866) https://github.com/python/cpython/commit/eec340ea3af27887fcaac4029ebdee99f3713bff ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:46:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 19:46:16 +0000 Subject: [issue4442] document immutable type subclassing via __new__ In-Reply-To: <1227719282.37.0.890069433685.issue4442@psf.upfronthosting.co.za> Message-ID: <1629661576.47.0.640796700238.issue4442@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26355 pull_request: https://github.com/python/cpython/pull/27900 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:49:28 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 22 Aug 2021 19:49:28 +0000 Subject: [issue4442] document immutable type subclassing via __new__ In-Reply-To: <1227719282.37.0.890069433685.issue4442@psf.upfronthosting.co.za> Message-ID: <1629661768.16.0.835834832692.issue4442@roundup.psfhosted.org> miss-islington added the comment: New changeset 0627918f0b69a15aa16e4ccbb5d8eaae4f6a2caf by Miss Islington (bot) in branch '3.10': bpo-4442: Document use of __new__ for subclasses of immutable types (GH-27866) https://github.com/python/cpython/commit/0627918f0b69a15aa16e4ccbb5d8eaae4f6a2caf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:51:45 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 22 Aug 2021 19:51:45 +0000 Subject: [issue17359] Mention "__main__.py" explicitly in command line docs In-Reply-To: <1362512425.64.0.937549165034.issue17359@psf.upfronthosting.co.za> Message-ID: <1629661905.41.0.779974573776.issue17359@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 8.0 -> 9.0 pull_requests: +26356 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:51:45 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 22 Aug 2021 19:51:45 +0000 Subject: [issue24632] Improve documentation about __main__.py In-Reply-To: <1436856841.67.0.538500952598.issue24632@psf.upfronthosting.co.za> Message-ID: <1629661905.51.0.3651591102.issue24632@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 11.0 -> 12.0 pull_requests: +26357 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 15:53:20 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Sun, 22 Aug 2021 19:53:20 +0000 Subject: [issue44938] Expose PyErr_ChainExceptions in the stable API In-Reply-To: <1629222263.76.0.471437987741.issue44938@roundup.psfhosted.org> Message-ID: <1629662000.92.0.240718166697.issue44938@roundup.psfhosted.org> Chris Jerdonek added the comment: I agree with Serhiy that this API isn't necessarily the right one. It's just what happens to be there now. Also, we're still not clear on our stance towards cycles (see the issue25782 discussion). (Maybe the exposed version should result in an error if it would cause a cycle to be created.) Someone would need to think through what the API should be, though. ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 16:05:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 20:05:09 +0000 Subject: [issue44957] typing docs: Mention PEP 604 syntax more prominently In-Reply-To: <1629381037.95.0.0399293112923.issue44957@roundup.psfhosted.org> Message-ID: <1629662709.88.0.152965475066.issue44957@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Sebastian! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 16:14:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 20:14:35 +0000 Subject: [issue4442] document immutable type subclassing via __new__ In-Reply-To: <1227719282.37.0.890069433685.issue4442@psf.upfronthosting.co.za> Message-ID: <1629663275.7.0.226102536067.issue4442@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ac87b07a10e0ba2834e8de9cf0ea29a40fd882b1 by ?ukasz Langa in branch '3.9': [3.9] bpo-4442: Document use of __new__ for subclasses of immutable types (GH-27866) (GH-27900) https://github.com/python/cpython/commit/ac87b07a10e0ba2834e8de9cf0ea29a40fd882b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 16:15:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 20:15:13 +0000 Subject: [issue4442] document immutable type subclassing via __new__ In-Reply-To: <1227719282.37.0.890069433685.issue4442@psf.upfronthosting.co.za> Message-ID: <1629663313.9.0.846184194648.issue4442@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for the patch, Raymond! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 16:42:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 20:42:14 +0000 Subject: [issue44980] Clean up tests that return a value that isn't None In-Reply-To: <1629655665.44.0.0754665054148.issue44980@roundup.psfhosted.org> Message-ID: <1629664934.61.0.251688182447.issue44980@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- title: Clean up a few tests that return a value!=None -> Clean up tests that return a value that isn't None _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 16:43:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 22 Aug 2021 20:43:31 +0000 Subject: [issue41322] unittest: deprecate test methods returning non-None values In-Reply-To: <1594979217.32.0.316534480608.issue41322@roundup.psfhosted.org> Message-ID: <1629665011.52.0.5793352618.issue41322@roundup.psfhosted.org> ?ukasz Langa added the comment: This can be re-closed. Deprecation warnings raised by the test suite are being fixed in BPO-44980 which already has an open pull request. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 16:55:35 2021 From: report at bugs.python.org (Kolen Cheung) Date: Sun, 22 Aug 2021 20:55:35 +0000 Subject: [issue44981] `module has no attribute` when `__all__` includes certain unicode characters Message-ID: <1629665735.18.0.342540973812.issue44981@roundup.psfhosted.org> New submission from Kolen Cheung : With Python 3.9.6 on macOS, In a file all_bug.py, ```py __all__ = ("?",) ? = "?" ``` Then run `from all_bug import *`, resulted in AttributeError: module 'all_bug' has no attribute '?' This happens with some other unicode characters as well, but not all. I can provide them if needed. Removing the `__all__` line will successfully import ? and be used. ---------- messages: 400106 nosy: christian.kolen priority: normal severity: normal status: open title: `module has no attribute` when `__all__` includes certain unicode characters type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 18:10:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 22 Aug 2021 22:10:47 +0000 Subject: [issue44938] Expose PyErr_ChainExceptions in the stable API In-Reply-To: <1629222263.76.0.471437987741.issue44938@roundup.psfhosted.org> Message-ID: <1629670247.43.0.844239140515.issue44938@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: As long as the cycles don't actually end in a crash or an infinite cycle, I think is fine to not include them in the contact. Even if that were included I don't think is actually a problem. Many APIs in C or C++ require the user to not form cycles, for instance, shared pointers in the c++ stdlib. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 18:55:13 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 22 Aug 2021 22:55:13 +0000 Subject: [issue44979] pathlib: support relative path construction In-Reply-To: <1629644874.28.0.329999889777.issue44979@roundup.psfhosted.org> Message-ID: <1629672913.26.0.766598793866.issue44979@roundup.psfhosted.org> Eric V. Smith added the comment: To be clear, by "file", you mean python source file, or I guess .pyc file if only that exists. I can't say I've given it much thought. What about built-in modules? Or frozen modules? I'm not sure this is a great idea. In general, we've frowned on code that uses sys._getframe, and in particular that looks arbitrarily up the stack. At the very least, you should find out if other python implementations can use this function. I suggest bringing this up on the python-ideas mailing list. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 19:02:02 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 22 Aug 2021 23:02:02 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629673322.14.0.0976386811126.issue24234@roundup.psfhosted.org> Guido van Rossum added the comment: What about __bytes__? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 19:05:27 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 22 Aug 2021 23:05:27 +0000 Subject: [issue44981] `module has no attribute` when `__all__` includes certain unicode characters In-Reply-To: <1629665735.18.0.342540973812.issue44981@roundup.psfhosted.org> Message-ID: <1629673527.19.0.441757761854.issue44981@roundup.psfhosted.org> Eric V. Smith added the comment: Python normalizes identifiers with NFKC (see PEP 3131): >>> e0 = "?" >>> import unicodedata >>> e1 = unicodedata.normalize("NFKC", e0) >>> e0 == e1 False >>> unicodedata.name(e0) 'GREEK LUNATE EPSILON SYMBOL' >>> unicodedata.name(e1) 'GREEK SMALL LETTER EPSILON' If you use GREEK SMALL LETTER EPSILON as your identifier, you should be okay. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 20:13:53 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 23 Aug 2021 00:13:53 +0000 Subject: [issue44981] `module has no attribute` when `__all__` includes certain unicode characters In-Reply-To: <1629665735.18.0.342540973812.issue44981@roundup.psfhosted.org> Message-ID: <1629677633.18.0.0803080299923.issue44981@roundup.psfhosted.org> Steven D'Aprano added the comment: Eric, I think you may have been too hasty to close this as "not a bug". It has tripped people up before. See #41542 which has also been closed (I also think prematurely). We normalise variable names with NFKC, so we should normalise the values in __all__ as well, at least when doing an import. Note that this is different from #42680 where the right answer is just to document. We shouldn't normalise strings as dict keys. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 20:44:56 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 23 Aug 2021 00:44:56 +0000 Subject: [issue44981] `module has no attribute` when `__all__` includes certain unicode characters In-Reply-To: <1629665735.18.0.342540973812.issue44981@roundup.psfhosted.org> Message-ID: <1629679496.25.0.531869036831.issue44981@roundup.psfhosted.org> Eric V. Smith added the comment: I'd be okay with changing it to a 3.11 enhancement to normalize elements of __all__, or maybe a request to change the documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 20:45:26 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 23 Aug 2021 00:45:26 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629679526.0.0.305444114125.issue24234@roundup.psfhosted.org> Dong-hee Na added the comment: @guido >>> issubclass(bytes, typing.SupportsBytes) False IMHO, supporting is reasonable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 21:35:02 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 23 Aug 2021 01:35:02 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1629679526.0.0.305444114125.issue24234@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: So let?s add that in a separate PR. -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 21:37:29 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 23 Aug 2021 01:37:29 +0000 Subject: [issue34234] Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7 In-Reply-To: <1532604480.11.0.56676864532.issue34234@psf.upfronthosting.co.za> Message-ID: <1629682649.5.0.7601219927.issue34234@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 nosy_count: 2.0 -> 3.0 pull_requests: +26358 pull_request: https://github.com/python/cpython/pull/27901 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 21:41:47 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 23 Aug 2021 01:41:47 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629682907.24.0.578936697219.issue24234@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +26359 pull_request: https://github.com/python/cpython/pull/27901 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 21:42:46 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 23 Aug 2021 01:42:46 +0000 Subject: [issue34234] Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7 In-Reply-To: <1532604480.11.0.56676864532.issue34234@psf.upfronthosting.co.za> Message-ID: <1629682966.29.0.604633594471.issue34234@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: -26358 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 22:05:06 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 23 Aug 2021 02:05:06 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <1629684306.51.0.164765376562.issue41102@roundup.psfhosted.org> Andrei Kulakov added the comment: Liu: Thanks! Google zip also shows 674 files in this archive, so it appears that it's not a Python-only issue. Can you test it with a few zip programs, ideally on a 2 or more platforms, and check which of them report more than 674 files? (I simply opened the google drive link and google showed the listing and the total # of 674 files) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 22:07:36 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 23 Aug 2021 02:07:36 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <1629684456.16.0.747382025583.issue41102@roundup.psfhosted.org> Andrei Kulakov added the comment: Liu: also please delete the quoted text when replying via email, otherwise it's hard to read on the issue page; much thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 22 23:29:01 2021 From: report at bugs.python.org (Xiaolong Liu) Date: Mon, 23 Aug 2021 03:29:01 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <2021082311285373004924@126.com> Xiaolong Liu added the comment: Andrei: Exactly, different extraction tool gave different results. File no. tool platform 674 the built-in tool on Win10 win10 674 winrar win10 1399 7zip win10 1399 360zip win10 674 unzip Ubuntu 20.10 1399 7zip Ubuntu 20.10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 00:30:55 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 23 Aug 2021 04:30:55 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <1629693055.81.0.26360839699.issue41102@roundup.psfhosted.org> Andrei Kulakov added the comment: Liu: builtin MacOS archive tool also reports 674. since Google archiver, and built-in tools on all major platforms report 674 files; it looks like 7zip might be the outlier here [note also that 7zip have their own format]. Unless it can be shown that Python and all of the archivers showing 674 have a common bug, I think there's not much we can do, as Python seems to be reading the archive in a defacto standard way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 01:09:32 2021 From: report at bugs.python.org (hai shi) Date: Mon, 23 Aug 2021 05:09:32 +0000 Subject: [issue44913] segfault in call to embedded PyModule_New In-Reply-To: <1628951281.11.0.836111617554.issue44913@roundup.psfhosted.org> Message-ID: <1629695372.88.0.481350414879.issue44913@roundup.psfhosted.org> hai shi added the comment: > which can be wrapped within the calls to PyGILState_Ensure/Release. OK, it's a good idea. But I think this enhancement will break the back compatibility. > python is initialized within that entrypoint python is initialized when you run python :) ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 01:16:20 2021 From: report at bugs.python.org (Xiaolong Liu) Date: Mon, 23 Aug 2021 05:16:20 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <2021082313161311038510@126.com> Xiaolong Liu added the comment: Andrei: The zipped file was created by zipfile module of Python. That's the reason I posted it here. I achived more than 2000 files to the abnormal zipped file. And no tool can extract whole files archived within. 7zip got the first part, and other tools got the left. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 01:32:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Aug 2021 05:32:38 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <1629696758.91.0.987123901079.issue41102@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is not a bug in archivers, it is just a broken archive. The ZIP archive contains a central directory which lists all files in the archive, so the archiver can just read the central directory without reading all archive to get the list of files. There are also local headers containing file names for every file. In 000.zip the central directory does not match local headers, it contains only the part of files. It is not fault of archivers that they trust the central directory, because it is a purpose of the central directory. There are specialized tools which allow to restore files not in the central directory, similarly as there are tools which allow to restore just deleted files on the disk. But it is not a task of general archivers. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 01:34:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Aug 2021 05:34:57 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <1629696897.22.0.256306624957.issue41102@roundup.psfhosted.org> Serhiy Storchaka added the comment: If the zipped file was created by zipfile module of Python, it is a bug. Could you reproduce the sequence of actions that creates such broken archive? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 01:54:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Aug 2021 05:54:21 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629698061.65.0.415441950421.issue24234@roundup.psfhosted.org> Serhiy Storchaka added the comment: Defining complex.__complex__ and bytes.__bytes__ would not solve anything, because >>> issubclass(int, SupportsComplex) False >>> issubclass(float, SupportsComplex) False >>> issubclass(bytearray, SupportsBytes) False >>> issubclass(memoryview, SupportsBytes) False If SupportsComplex and SupportsBytes are just for "has __complex__/__bytes__ method", they are virtually useless. If their meaning is "can be converted to complex/bytes", it is different story, and it should be fixed be adding subclasshooks which check existence of alternate methods (__float__, __index__, supporting the buffer protocol). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 02:34:57 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Aug 2021 06:34:57 +0000 Subject: [issue4442] document immutable type subclassing via __new__ In-Reply-To: <1227719282.37.0.890069433685.issue4442@psf.upfronthosting.co.za> Message-ID: <1629700497.0.0.896966094595.issue4442@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 04:16:16 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 23 Aug 2021 08:16:16 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629706576.13.0.368042467559.issue24234@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 6082bb5addab93755ab6e2bd2ed6021b391e10d1 by Mark Dickinson in branch 'main': bpo-24234: implement complex.__complex__ (GH-27887) https://github.com/python/cpython/commit/6082bb5addab93755ab6e2bd2ed6021b391e10d1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 05:11:46 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 23 Aug 2021 09:11:46 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1629709906.62.0.0647757305403.issue44019@roundup.psfhosted.org> Mark Dickinson added the comment: This seems like a reasonable addition to me. Victor: any thoughts? ---------- nosy: +mark.dickinson, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 06:02:02 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 23 Aug 2021 10:02:02 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629712922.02.0.689276213735.issue24234@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 24b63c695ae0a95b06379eaadace66735abac1e2 by Dong-hee Na in branch 'main': bpo-24234: Implement bytes.__bytes__ (GH-27901) https://github.com/python/cpython/commit/24b63c695ae0a95b06379eaadace66735abac1e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 06:05:09 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 23 Aug 2021 10:05:09 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629713109.9.0.0739812132055.issue24234@roundup.psfhosted.org> Mark Dickinson added the comment: > If SupportsComplex and SupportsBytes are just for "has __complex__/__bytes__ method", they are virtually useless. I agree that "SupportsComplex" isn't directly useful in user-land. I think its main value is as a building block in things like `Union[SupportsComplex, SupportsFloat, SupportsIndex]`. For me, the gain from implementing complex.__complex__ is that the test "can be used as a complex number" can now be expressed purely in terms of the protocols offered, without reference to concrete types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 06:30:45 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 23 Aug 2021 10:30:45 +0000 Subject: [issue44979] pathlib: support relative path construction In-Reply-To: <1629644874.28.0.329999889777.issue44979@roundup.psfhosted.org> Message-ID: <1629714645.88.0.555472699456.issue44979@roundup.psfhosted.org> Antoine Pitrou added the comment: I am rejecting this for the reasons explained in the Github PR: """This seems like an extremely specific API. Perhaps you want to propose it for inclusion in pytest, but I don't think it belongs in pathlib. (also, it's not difficult to spell out `Path(__file__)`)""" ---------- nosy: +pitrou resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 06:35:13 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 23 Aug 2021 10:35:13 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629714913.83.0.191990446893.issue24234@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +26360 pull_request: https://github.com/python/cpython/pull/27902 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 06:36:45 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 23 Aug 2021 10:36:45 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629715005.84.0.0199751360329.issue24234@roundup.psfhosted.org> Mark Dickinson added the comment: We've got some buildbot failures; GH-27902 should fix them. Apologies for not catching this while reviewing GH-27901. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 06:42:35 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 23 Aug 2021 10:42:35 +0000 Subject: [issue44981] `module has no attribute` when `__all__` includes certain unicode characters In-Reply-To: <1629665735.18.0.342540973812.issue44981@roundup.psfhosted.org> Message-ID: <1629715355.44.0.845287792514.issue44981@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 07:13:04 2021 From: report at bugs.python.org (Gianluca Gabrielli) Date: Mon, 23 Aug 2021 11:13:04 +0000 Subject: [issue43075] ReDoS in urllib.request In-Reply-To: <1611994306.46.0.333529770265.issue43075@roundup.psfhosted.org> Message-ID: <1629717184.99.0.621127914951.issue43075@roundup.psfhosted.org> Gianluca Gabrielli added the comment: RedHat has now assigned CVE-2021-3733 to this security bug. ---------- nosy: +crazybyte _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 07:45:04 2021 From: report at bugs.python.org (Madhu) Date: Mon, 23 Aug 2021 11:45:04 +0000 Subject: [issue44913] segfault in call to embedded PyModule_New In-Reply-To: <1629695372.88.0.481350414879.issue44913@roundup.psfhosted.org> Message-ID: <20210823.171447.1197282322255614747.enometh@meer.net> Madhu added the comment: * hai shi <1629695372.88.0.481350414879.issue44913 at roundup.psfhosted.org> Wrote on Mon, 23 Aug 2021 05:09:32 +0000 > hai shi added the comment: >> which can be wrapped within the calls to PyGILState_Ensure/Release. > OK, it's a good idea. But I think this enhancement will break the back > compatibility. I don't understand. Wherever I make a Py C call from the extension (libfoo1.so), I have to wrap it up within calls to PyGILState_Ensure/Release to avoid segfaults right? That's how I understood your comment. So this is on the user to avoid the segfaults, right? And you saying my extension will not be backward compatible, i.e. it will not work on older versions of python? (pam-python still supports py27, I think) Or are you saying something can be done in Python's components to handle this use case transparently? so the user won't have to put GIL locks in his code (They aren't required in the normal extension case AFAICT) >> python is initialized within that entrypoint > python is initialized when you run python :) [Yes, but if the extension is loaded into a C program (i.e. not from python then the extension (libfoo1.so) has to call Py_Initialize at that point.] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 08:27:41 2021 From: report at bugs.python.org (Shane Mai) Date: Mon, 23 Aug 2021 12:27:41 +0000 Subject: [issue39232] asyncio crashes when tearing down the proactor event loop In-Reply-To: <1578335360.75.0.333919607495.issue39232@roundup.psfhosted.org> Message-ID: <1629721661.04.0.750137469404.issue39232@roundup.psfhosted.org> Shane Mai added the comment: I added some code to wait for all tasks completion before exit: currentTask = asyncio.current_task() for t in asyncio.all_tasks(): if currentTask != t: await t and still got the exception Then I think it created additional thread somewhere and created an event_loop inside it. To dig it out I sub-classed threading.Thread. I also wait for all tasks in all threads before exiting: loops: list[asyncio.AbstractEventLoop] = [] class MyThread(threading.Thread): def start(self): global loops loops.append(asyncio.get_event_loop()) super().start() async def func1(): async with aiohttp.ClientSession() as session: async with session.get('https://www.okex.com/api/v5/public/time') as resp: print(resp.status) print(await resp.json()) threading.Thread = MyThread import aiohttp async def main(): global loops loops.append(asyncio.get_running_loop()) print(sys.argv) task = asyncio.create_task(func1()) await task print('done.') currentTask = asyncio.current_task() for loop in loops: for t in asyncio.all_tasks(loop): if currentTask != t: await t print('done2.') #await asyncio.sleep(1) #if __file__ == '__main__': asyncio.run(main()) Then I found out the thread is created inside _loop.getaddrinfo: (files are from python 3.9.6) File aiohttp\resolver.py, line 31, in ThreadedResolver.resolve FILE asyncio\base_events.py, line 856, in BaseEventLoop(ProactorEventLoop).getaddrinfo And it is strange that another thread is created when program exit: FILE asyncio\base_events.py, line 563, in BaseEventLoop(ProactorEventLoop).shutdown_default_executor But sad it seems vscode cannot break a __del__ call. If I break somewhere else first then it would not crash:( ---------- nosy: +machine.gw _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 09:05:14 2021 From: report at bugs.python.org (hai shi) Date: Mon, 23 Aug 2021 13:05:14 +0000 Subject: [issue44913] segfault in call to embedded PyModule_New In-Reply-To: <1628951281.11.0.836111617554.issue44913@roundup.psfhosted.org> Message-ID: <1629723914.11.0.131250369192.issue44913@roundup.psfhosted.org> hai shi added the comment: > Or are you saying something can be done in Python's components to handle this use case transparently? so the user won't have to put GIL locks in his code. Sorry, I don't explain it good enough. You have said what I wanted to say:) > Yes, but if the extension is loaded into a C program (i.e. not from python then the extension (libfoo1.so) has to call Py_Initialize at that point. You are right. I just only saw your dload.py, so I don't know how you start the python prcoess in your env;). I haven't the experience of the pam-python:(. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 09:22:52 2021 From: report at bugs.python.org (Adam Meily) Date: Mon, 23 Aug 2021 13:22:52 +0000 Subject: [issue28474] WinError(): Python int too large to convert to C long In-Reply-To: <1476862081.01.0.00079290874453.issue28474@psf.upfronthosting.co.za> Message-ID: <1629724972.54.0.0652669057973.issue28474@roundup.psfhosted.org> Adam Meily added the comment: I can potentially take a stab at writing up a PR for this. I've also seen this affecting other locations that eventually call FormatMessage, including: - ctypes.format_error() - this original issue - os.strerror() - OSError(winerror=X) I will most likely look into fixing all three. ---------- nosy: +meilyadam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 09:27:53 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 23 Aug 2021 13:27:53 +0000 Subject: [issue44982] Add vendor information Message-ID: <1629725273.33.0.352265860161.issue44982@roundup.psfhosted.org> New submission from Filipe La?ns : In the effort of making the UX better with vendored Python versions, I think it would make sense to track and expose vendor information. Initially, the vendor information would be comprised of two fields, the vendor string (eg. `Debian`) and the vendor name (eg. `debian`). If specified, it would change the interpreter/installation in the following ways: - The vendor string would be shown in places like the IDLE shell (eg. [1]) - The vendor name would be added to the installation paths (/usr/lib/python3.9 would become /usr/lib/python3.9-debian) - This would include scripts, so the interpreter would be called python3-debian, the vendors can then rename or symlink it to python3 if they want to have that be the default Python on the system Additionally, I think we should add two new functions to the platform module, platform.vendor() and platform.vendor_name(). Overall, I think this would help out users identify the Python installation and avoid clashes between Python installations, even allowing parallel installations. If I remember everything correctly, this should fix Matthias issues with bpo-43976. Matthias, could you confirm? Any thoughts? [1] new IDLE shell output Debian Python 3.9.6 (default, Jun 30 2021, 10:22:16) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> ---------- messages: 400135 nosy: FFY00, christian.heimes, doko, jaraco, steve.dower, willingc priority: normal severity: normal status: open title: Add vendor information type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 09:32:50 2021 From: report at bugs.python.org (Takuo Matsuoka) Date: Mon, 23 Aug 2021 13:32:50 +0000 Subject: [issue44983] Wrong definition of a starred expression in the Language Reference Message-ID: <1629725570.26.0.70854073558.issue44983@roundup.psfhosted.org> New submission from Takuo Matsuoka : Being unaware of the processes here, I have posted the issue to the python-idea mailing list. Please refer to it. https://mail.python.org/archives/list/python-ideas at python.org/message/TCWYZIIRZWIR7CDJWDAUBCAMU2CBFB3Y/ Thank you. ---------- assignee: docs at python components: Documentation messages: 400136 nosy: Takuo Matsuoka, docs at python priority: normal severity: normal status: open title: Wrong definition of a starred expression in the Language Reference type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 09:44:28 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 23 Aug 2021 13:44:28 +0000 Subject: [issue40951] csv skipinitialspace no longer working In-Reply-To: <1591914518.12.0.392827187881.issue40951@roundup.psfhosted.org> Message-ID: <1629726268.14.0.472916496356.issue40951@roundup.psfhosted.org> Andrei Kulakov added the comment: I cannot reproduce with 3.7.7, when run with the linked example, the output looks fine: ['country_id', 'country_name', 'region_id'] ['AR', 'Argentina', '2'] ['AU', 'Australia', '3'] ['BE', 'Belgium', '1'] ['BR', 'Brazil', '2'] ['CA', 'Canada', '2'] I think this can be closed as not a bug unless more detail is provided. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 09:59:21 2021 From: report at bugs.python.org (Matthias Klose) Date: Mon, 23 Aug 2021 13:59:21 +0000 Subject: [issue44982] Add vendor information In-Reply-To: <1629725273.33.0.352265860161.issue44982@roundup.psfhosted.org> Message-ID: <1629727161.65.0.391201064153.issue44982@roundup.psfhosted.org> Matthias Klose added the comment: A bunch of people, consisting of Filipe Lains himself, Geoffrey Thomas, Donald Stufft, Tzu-Ping Chung, Pradyun Gedam, Stefano Rivera, Elana Hashman, and myself (Matthias Klose), and with feedback from Carol Willing and Christian Heimes were preparing a PEP to address issues with vendored or system Python versions. It looks like Filipe was unable to give feedback or follow-up after the initial meetings at PyCon. I am unsure if having two different interpreters is a good solution, and it certainly requires some cooperation with distros. ---------- nosy: +Marcus.Smith, dstufft, ncoghlan, paul.moore, pradyunsg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 10:46:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Aug 2021 14:46:11 +0000 Subject: [issue44984] Rewrite test_null_strings in _testcapi Message-ID: <1629729971.91.0.181277754556.issue44984@roundup.psfhosted.org> New submission from Serhiy Storchaka : test_null_strings in Modules/_testcapimodule.c was initially added in 7580146b5c7025976f0907a9893e01dc3d3d3457 for testing PyObject_Str(NULL) and PyObject_Unicode(NULL). PyObject_Unicode() was removed in 3.0, so now the test calls PyObject_Str(NULL) twice that does not make sense. On other hand, PyObject_Bytes(NULL) and PyObject_Repr(NULL) are not tested. Additionally, there are now problems with unittest tests returning non-None. So this test should be completely rewritten. ---------- components: Tests messages: 400139 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Rewrite test_null_strings in _testcapi type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 10:51:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Aug 2021 14:51:34 +0000 Subject: [issue44984] Rewrite test_null_strings in _testcapi In-Reply-To: <1629729971.91.0.181277754556.issue44984@roundup.psfhosted.org> Message-ID: <1629730294.62.0.943777491094.issue44984@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26362 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27904 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 11:08:11 2021 From: report at bugs.python.org (Xiaolong Liu) Date: Mon, 23 Aug 2021 15:08:11 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <2021082323080007934816@126.com> Xiaolong Liu added the comment: Serhiy: Thanks for your explanation. The file was created by zipfile module. I used the script hundreds of times, while only once (the uploaded zipped file) was abnormal. Since the project ended a long time ago, I cannot reproduce the error right now. I will post the related code snippet I used. import zipfile import pathlib def fileIsValid(filename): filename = pathlib.Path(filename) return True if filename.is_file() and filename.stat().st_size > 0 else False def compress2zip(sourceFile,zipFile,destinationFile): if not fileIsValid(zipFile): pathlib.Path(zipFile).parent.mkdir(parents=True, exist_ok=True) with zipfile.ZipFile(zipFile,'w',compression=zipfile.ZIP_DEFLATED) as myzip: myzip.write(sourceFile,destinationFile) dest_size = myzip.getinfo(destinationFile).file_size else: with zipfile.ZipFile(zipFile,'a',compression=zipfile.ZIP_DEFLATED) as myzip: if not destinationFile in myzip.namelist(): myzip.write(sourceFile,destinationFile) dest_size = myzip.getinfo(destinationFile).file_size source_size = pathlib.Path(sourceFile).stat().st_size if source_size == dest_size: print('Succeeded -- compress -- %s' % str(destinationFile)) return True else: print('Failed -- compress -- %s' %str(destinationFile)) return False files = list(pathlib.Path('000-original').glob('*.geojson')) zipFile = pathlib.Path('0000.zip') for file in files: comp_re = compress2zip(file, zipFile, file.name) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 11:10:22 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 23 Aug 2021 15:10:22 +0000 Subject: [issue44982] Add vendor information In-Reply-To: <1629725273.33.0.352265860161.issue44982@roundup.psfhosted.org> Message-ID: <1629731422.02.0.313935609304.issue44982@roundup.psfhosted.org> Filipe La?ns added the comment: > I am unsure if having two different interpreters is a good solution, and it certainly requires some cooperation with distros. That is not the goal with this! I think both this issue and the PEP are parallel. My goal here is to streamline the vendor patching of CPython, not propose parallel interpreters as an alternative. Having discussed with you about your motivations and approach on packaging Python in Debian, I would definitely not expect you to adopt multiple interpreters in Debian. The way this proposal mostly functionally impacts Debian is by isolating its namespace from the normal one, allowing you to drop changes like the dist-packages renaming -- because pip install will write to /usr/local/lib/python3.9-debian/site-packages and /usr/local Python installs will be looking at /usr/local/lib/python3.9/site-packages) -- and if I am not missing anything, unblocking bpo-43976. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 11:34:49 2021 From: report at bugs.python.org (Xiaolong Liu) Date: Mon, 23 Aug 2021 15:34:49 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <2021082323343625521719@126.com> Xiaolong Liu added the comment: It seems the indents were automatically removed in the message box. I shared the code snippet formmated here: https://www.online-python.com/cDojvl2CMS ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 11:53:21 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 23 Aug 2021 15:53:21 +0000 Subject: [issue44981] wildcard imports should normalise names in `__all__` In-Reply-To: <1629665735.18.0.342540973812.issue44981@roundup.psfhosted.org> Message-ID: <1629734001.39.0.00942824947683.issue44981@roundup.psfhosted.org> Steven D'Aprano added the comment: Okay, reopening the ticket with a new description. `from module import *` should use the same NFKC normalisation on the names in `__all__`. To be clear, I don't propose that `__all__` should be modified. ---------- resolution: not a bug -> stage: resolved -> status: closed -> open title: `module has no attribute` when `__all__` includes certain unicode characters -> wildcard imports should normalise names in `__all__` type: behavior -> enhancement versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 12:06:48 2021 From: report at bugs.python.org (Mehrzad) Date: Mon, 23 Aug 2021 16:06:48 +0000 Subject: [issue44985] Inconsistent returned value of inspect.getfullargspec(object.__init__). Message-ID: <1629734808.74.0.392472113635.issue44985@roundup.psfhosted.org> New submission from Mehrzad : The inspection `inspect.getfullargspec(object.__init__)` shows that `object.__init__` takes both varargs (starred) and varkw (double-starred) arguments.* However, it is impossible to call `object.__init__` with varargs or varkw arguments. If one tries to call `object.__init__(SomeClass(), ...)` with either of those arguments, the following error is raised: `TypeError: SomeClass.__init__() takes exactly one argument (the instance to initialize)`. This error is not raised if `SomeClass()` is replaced with some literal, e.g. a number. * I can not certify whether it is intended behavior or a bug, because the signature of `obj.__init__` takes those arguments. ---------- components: Distutils, Interpreter Core, Parser files: object_init.py messages: 400144 nosy: Mehrzad, dstufft, eric.araujo, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Inconsistent returned value of inspect.getfullargspec(object.__init__). type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file50229/object_init.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 12:15:16 2021 From: report at bugs.python.org (Brett Cannon) Date: Mon, 23 Aug 2021 16:15:16 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629735316.41.0.978804104644.issue44972@roundup.psfhosted.org> Brett Cannon added the comment: Add Lukasz to get his opinion on this idea. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 12:28:42 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Mon, 23 Aug 2021 16:28:42 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629736122.2.0.531265855124.issue44972@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: Another observation, first-time contributors need a maintainer to approve the workflows for their PRs -- from the looks of it that isn't an instant process and could take a few days, so this also gives first-time contributors a way to check their changes against the jobs that will run as part of the required CI checks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 12:32:04 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 23 Aug 2021 16:32:04 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629736324.35.0.528387125396.issue44972@roundup.psfhosted.org> Steve Dower added the comment: > first-time contributors need a maintainer to approve the workflows for their PRs This is an important security consideration, so I'd rather not go and change it. On the main request, provided the workflow_dispatch is only triggerable by non-contributors in their own fork (without any of our tokens/etc.) then it's fine by me. If it allows anyone to trigger CI builds against the main repo, I'd rather not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 12:37:51 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 23 Aug 2021 16:37:51 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629736671.66.0.862600033588.issue44934@roundup.psfhosted.org> Steve Dower added the comment: I kicked off the build on the PR so we can see what errors it finds. Nothing jumps out as obviously wrong in the changes, but it only takes one missing reference to a file to break it all. If you want to share the errors from your test machine, copy-pasting all the output into a text file and attaching it here is best. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 12:46:48 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Mon, 23 Aug 2021 16:46:48 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629737208.15.0.776233028428.issue44972@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: > On the main request, provided the workflow_dispatch is only triggerable by non-contributors in their own fork (without any of our tokens/etc.) then it's fine by me. If it allows anyone to trigger CI builds against the main repo, I'd rather not. It should require write permissions in a repository to use the trigger, so they'll only be able to run workflows in the context of their fork: https://github.community/t/who-can-manually-trigger-a-workflow-using-workflow-dispatch/128592/4 I think you could also test this out by going to my fork and seeing if it lets you trigger the workflow: https://github.com/nightlark/cpython/actions/workflows/build.yml ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 13:12:14 2021 From: report at bugs.python.org (Aaron) Date: Mon, 23 Aug 2021 17:12:14 +0000 Subject: [issue43306] Error in multiprocessing.Pool's initializer doesn't stop execution In-Reply-To: <1614095710.79.0.438522017133.issue43306@roundup.psfhosted.org> Message-ID: <1629738734.84.0.302466810346.issue43306@roundup.psfhosted.org> Aaron added the comment: I ran into this bug answering this question on Stack Overflow: https://stackoverflow.com/questions/68890437/cannot-use-result-from-multiprocess-pool-directly I have minimized the code required to replicate the behavior, but it boils down to: when using "spawn" to create a multiprocessing pool, if an exception occurs during the bootstrapping phase of the new child or during the initialization function with any start method, it is just cleaned up, and another takes its place (which will also fail). This creates an infinite loop of creating child workers, workers exiting due to an exception, and re-populating the pool with new workers. ``` import multiprocessing multiprocessing.set_start_method("spawn") # bootstraping only problem with spawn def task(): print("task") if __name__ == "__main__": with multiprocessing.Pool() as p: p.apply(task) else: raise Exception("raise in child during bootstraping phase") ################################################# # or ################################################# import multiprocessing # multiprocessing.set_start_method("fork") # fork or spawn doesn't matter def task(): print("task") def init(): raise Exception("raise in child during initialization function") if __name__ == "__main__": with multiprocessing.Pool(initializer=init) as p: p.apply(task) ``` If Pool._join_exited_workers could determine if a worker exited before bootstrapping, or the initialization function completed, It would indicate a likely significant problem. I'm fine with exceptions in the worker target function not being re-raised in the parent, however it seems the Pool should stop trying if it's failing to create new workers. ---------- nosy: +athompson6735 versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 13:13:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 17:13:59 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1629738839.8.0.858250067701.issue38291@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1a995b0ceefdf7eb59963f3ab395c47d8da226e3 by Ken Jin in branch 'main': bpo-38291: Update 3.10 WhatsNew with typing.{io|re} DeprecationWarning (GH-27872) https://github.com/python/cpython/commit/1a995b0ceefdf7eb59963f3ab395c47d8da226e3 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 13:13:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 17:13:59 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1629738839.8.0.858250067701.issue38291@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1a995b0ceefdf7eb59963f3ab395c47d8da226e3 by Ken Jin in branch 'main': bpo-38291: Update 3.10 WhatsNew with typing.{io|re} DeprecationWarning (GH-27872) https://github.com/python/cpython/commit/1a995b0ceefdf7eb59963f3ab395c47d8da226e3 ---------- message_count: 26.0 -> 27.0 nosy: +lukasz.langa nosy_count: 10.0 -> 11.0 pull_requests: +26363 pull_request: https://github.com/python/cpython/pull/27907 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 13:24:00 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 23 Aug 2021 17:24:00 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629739440.09.0.868304755137.issue37596@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 13:32:39 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 17:32:39 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1629739959.47.0.188663932494.issue38291@roundup.psfhosted.org> miss-islington added the comment: New changeset 27f2f62ad490afc8e4dd6d80351916a9d06b97e3 by Miss Islington (bot) in branch '3.10': bpo-38291: Update 3.10 WhatsNew with typing.{io|re} DeprecationWarning (GH-27872) https://github.com/python/cpython/commit/27f2f62ad490afc8e4dd6d80351916a9d06b97e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 13:37:53 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 23 Aug 2021 17:37:53 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629740273.9.0.499350583019.issue37596@roundup.psfhosted.org> Brandt Bucher added the comment: Could this issue be fixed in marshal itself? Off the top of my head, one possible option could be to use the marshalled bytes of each elements as a sort key, rather than the elements themselves. So serialize, *then* sort? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 13:42:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Aug 2021 17:42:59 +0000 Subject: [issue44981] wildcard imports should normalise names in `__all__` In-Reply-To: <1629665735.18.0.342540973812.issue44981@roundup.psfhosted.org> Message-ID: <1629740579.48.0.287398877147.issue44981@roundup.psfhosted.org> Serhiy Storchaka added the comment: Should getattr() normalize attribute name? If no, it will produce surprises further along the way. If yes, it will add significant overhead. Even star-import can get significant impact. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 13:48:14 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 23 Aug 2021 17:48:14 +0000 Subject: [issue44981] wildcard imports should normalise names in `__all__` In-Reply-To: <1629665735.18.0.342540973812.issue44981@roundup.psfhosted.org> Message-ID: <1629740894.88.0.6759057112.issue44981@roundup.psfhosted.org> Eric V. Smith added the comment: How about making it an error to have non-NFKC normalized names in __all__? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 13:51:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 23 Aug 2021 17:51:34 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629741094.59.0.576036766104.issue37596@roundup.psfhosted.org> Serhiy Storchaka added the comment: No, it cannot be fixed in marshal itself. s = {("string", 1), ("string", 2), ("string", 3)} All tuples contain references to the same string. The first serialized tuple will contain serialization of the string, all other will contain references to it. So the binary representation of the tuple depends on whether it is serialized first on not first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:02:38 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 23 Aug 2021 18:02:38 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629741758.55.0.79777721632.issue44972@roundup.psfhosted.org> Steve Dower added the comment: > I think you could also test this out by going to my fork ... Good point, and I can't trigger a build on your fork. This seems okay to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:05:18 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 18:05:18 +0000 Subject: [issue44984] Rewrite test_null_strings in _testcapi In-Reply-To: <1629729971.91.0.181277754556.issue44984@roundup.psfhosted.org> Message-ID: <1629741918.11.0.985625402356.issue44984@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26364 pull_request: https://github.com/python/cpython/pull/27908 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:05:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 18:05:17 +0000 Subject: [issue44984] Rewrite test_null_strings in _testcapi In-Reply-To: <1629729971.91.0.181277754556.issue44984@roundup.psfhosted.org> Message-ID: <1629741917.19.0.0286665787126.issue44984@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4d689173861257c69adc6dc1dca4171946ddb57f by Serhiy Storchaka in branch 'main': bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904) https://github.com/python/cpython/commit/4d689173861257c69adc6dc1dca4171946ddb57f ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:06:45 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 23 Aug 2021 18:06:45 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629742005.7.0.0753219498006.issue37596@roundup.psfhosted.org> Brandt Bucher added the comment: Ah, yeah. Could we add a flag to disable the reference mechanism, just for frozenset elements? It would make marshalled frozensets a bit bigger (unless we re-marshalled each one after sorting)... but I still prefer that to adding more logic/subclasses to frozenset. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:13:17 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 23 Aug 2021 18:13:17 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1629742397.48.0.977451575246.issue44962@roundup.psfhosted.org> Change by Thomas Grainger : ---------- keywords: +patch pull_requests: +26365 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:17:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 18:17:37 +0000 Subject: [issue44984] Rewrite test_null_strings in _testcapi In-Reply-To: <1629729971.91.0.181277754556.issue44984@roundup.psfhosted.org> Message-ID: <1629742657.86.0.691086164739.issue44984@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26366 pull_request: https://github.com/python/cpython/pull/27910 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:31:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 18:31:02 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629743462.42.0.551706660459.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 08830a4f75553682e8d1ea6cdabd4c3472c59e28 by Mark Roseman in branch 'main': bpo-42560: rewrite of Tkinter docs "life preserver" (GH-27842) https://github.com/python/cpython/commit/08830a4f75553682e8d1ea6cdabd4c3472c59e28 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:31:38 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 18:31:38 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629743498.28.0.230398745248.issue42560@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26368 pull_request: https://github.com/python/cpython/pull/27912 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:31:10 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 18:31:10 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629743470.98.0.266642005737.issue42560@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26367 pull_request: https://github.com/python/cpython/pull/27911 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:43:57 2021 From: report at bugs.python.org (Aaron) Date: Mon, 23 Aug 2021 18:43:57 +0000 Subject: [issue43306] Error in multiprocessing.Pool's initializer doesn't stop execution In-Reply-To: <1614095710.79.0.438522017133.issue43306@roundup.psfhosted.org> Message-ID: <1629744237.35.0.728387677801.issue43306@roundup.psfhosted.org> Aaron added the comment: What should the behavior be if an exception is raised in a pool worker during bootstrapping / initialization function execution? I think an exception should be raised in the process owning the Pool, and in the fix I'm tinkering around with I just raise a RuntimeError currently. I can see an argument also for raising different exceptions (or having different behavior) for bootstrapping error vs init function, but implementation is more complicated. My current implementation simply creates a lock in _repopulate_pool_static, acquires it, and waits for the worker function to release it. By polling every 100ms I also detect if the process exited before releasing the lock in which case I raise a Runtime error. I just started testing this implementation, but I'll provide it for anyone else who wants to test / comment. ---------- Added file: https://bugs.python.org/file50230/pool.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:48:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 18:48:13 +0000 Subject: [issue44984] Rewrite test_null_strings in _testcapi In-Reply-To: <1629729971.91.0.181277754556.issue44984@roundup.psfhosted.org> Message-ID: <1629744493.15.0.667983947362.issue44984@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b0df288c946143352237f28c78481d935ba1502c by ?ukasz Langa in branch '3.9': [3.9] bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904) (GH-27910) https://github.com/python/cpython/commit/b0df288c946143352237f28c78481d935ba1502c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:51:00 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 18:51:00 +0000 Subject: [issue44980] Clean up tests that return a value that isn't None In-Reply-To: <1629655665.44.0.0754665054148.issue44980@roundup.psfhosted.org> Message-ID: <1629744660.06.0.362933801409.issue44980@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26370 pull_request: https://github.com/python/cpython/pull/27914 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:50:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 18:50:55 +0000 Subject: [issue44980] Clean up tests that return a value that isn't None In-Reply-To: <1629655665.44.0.0754665054148.issue44980@roundup.psfhosted.org> Message-ID: <1629744655.04.0.596882680988.issue44980@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 27b761a11a14521617a01257eb3767150bec3a74 by andrei kulakov in branch 'main': bpo-44980: fix test_constructor to return None value (GH-27898) https://github.com/python/cpython/commit/27b761a11a14521617a01257eb3767150bec3a74 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 14:50:55 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 18:50:55 +0000 Subject: [issue44980] Clean up tests that return a value that isn't None In-Reply-To: <1629655665.44.0.0754665054148.issue44980@roundup.psfhosted.org> Message-ID: <1629744655.18.0.640750365431.issue44980@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26369 pull_request: https://github.com/python/cpython/pull/27913 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:00:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 19:00:54 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629745254.63.0.106106742448.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1eb451031a64b4f28d737ee7f394252ae9a76118 by Mark Roseman in branch 'main': bpo-42560: add warning to Tkinter docs about outdated pre-8.5 documentation online (GH-27836) https://github.com/python/cpython/commit/1eb451031a64b4f28d737ee7f394252ae9a76118 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:00:55 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 19:00:55 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629745255.1.0.0798501542053.issue42560@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26371 pull_request: https://github.com/python/cpython/pull/27915 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:07:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 23 Aug 2021 19:07:00 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1629745620.49.0.886659629269.issue44972@roundup.psfhosted.org> Erlend E. Aasland added the comment: > first-time contributors need a maintainer to approve the workflows for their PRs How is manually dispatched workflows different from just opening a PR to your own fork? I do that from time to time in order to run the CI before opening a PR against the CPython repo. ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:10:53 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 23 Aug 2021 19:10:53 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629745853.62.0.594283834401.issue37596@roundup.psfhosted.org> Brandt Bucher added the comment: This rough proof-of-concept seems to have the desired effect: diff --git a/Python/marshal.c b/Python/marshal.c index 1260704c74..70f9c4b109 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -503,9 +503,23 @@ w_complex_object(PyObject *v, char flag, WFILE *p) W_TYPE(TYPE_SET, p); n = PySet_GET_SIZE(v); W_SIZE(n, p); - while (_PySet_NextEntry(v, &pos, &value, &hash)) { + PyObject *pairs = PyList_New(0); + for (Py_ssize_t i = 0; _PySet_NextEntry(v, &pos, &value, &hash); i++) { + PyObject *pair = PyTuple_New(2); + PyObject *dump = PyMarshal_WriteObjectToString(value, p->version); + PyTuple_SET_ITEM(pair, 0, dump); + Py_INCREF(value); + PyTuple_SET_ITEM(pair, 1, value); + PyList_Append(pairs, pair); + Py_DECREF(pair); + } + PyList_Sort(pairs); + for (Py_ssize_t i = 0; i < n; i++) { + PyObject *pair = PyList_GET_ITEM(pairs, i); + PyObject *value = PyTuple_GET_ITEM(pair, 1); w_object(value, p); } + Py_DECREF(pairs); } else if (PyCode_Check(v)) { PyCodeObject *co = (PyCodeObject *)v; I can clean it up and convert it to a PR if we decide we want to go this route. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:11:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 23 Aug 2021 19:11:29 +0000 Subject: [issue32397] textwrap output may change if you wrap a paragraph twice In-Reply-To: <1513865443.17.0.213398074469.issue32397@psf.upfronthosting.co.za> Message-ID: <1629745889.99.0.519679151797.issue32397@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- type: behavior -> enhancement versions: +Python 3.11 -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:20:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 19:20:32 +0000 Subject: [issue44980] Clean up tests that return a value that isn't None In-Reply-To: <1629655665.44.0.0754665054148.issue44980@roundup.psfhosted.org> Message-ID: <1629746432.58.0.511340320321.issue44980@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset de49eacee85dbd56bfa261200604766ca6042d66 by Miss Islington (bot) in branch '3.9': bpo-44980: fix test_constructor to return None value (GH-27898) (GH-27914) https://github.com/python/cpython/commit/de49eacee85dbd56bfa261200604766ca6042d66 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:21:10 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 19:21:10 +0000 Subject: [issue44980] Clean up tests that return a value that isn't None In-Reply-To: <1629655665.44.0.0754665054148.issue44980@roundup.psfhosted.org> Message-ID: <1629746470.37.0.883750078331.issue44980@roundup.psfhosted.org> miss-islington added the comment: New changeset 10955353ce25a52741e8f72fdbb6f4b150ee4dc7 by Miss Islington (bot) in branch '3.10': bpo-44980: fix test_constructor to return None value (GH-27898) https://github.com/python/cpython/commit/10955353ce25a52741e8f72fdbb6f4b150ee4dc7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:22:32 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 19:22:32 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629746552.54.0.286040586713.issue42560@roundup.psfhosted.org> miss-islington added the comment: New changeset 8351df6e3652a41ffc720066a68b666bbef1df67 by Miss Islington (bot) in branch '3.10': bpo-42560: add warning to Tkinter docs about outdated pre-8.5 documentation online (GH-27836) https://github.com/python/cpython/commit/8351df6e3652a41ffc720066a68b666bbef1df67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:27:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 19:27:51 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629746871.67.0.299753408655.issue42560@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e41912c6348362489d2514565a70782591f23902 by Mark Roseman in branch 'main': bpo-42560: simplify/merge architecture info in Tkinter docs (GH-27839) https://github.com/python/cpython/commit/e41912c6348362489d2514565a70782591f23902 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:27:54 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 19:27:54 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629746874.99.0.180345406033.issue42560@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26372 pull_request: https://github.com/python/cpython/pull/27920 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:30:26 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 19:30:26 +0000 Subject: [issue44984] Rewrite test_null_strings in _testcapi In-Reply-To: <1629729971.91.0.181277754556.issue44984@roundup.psfhosted.org> Message-ID: <1629747026.1.0.61325379625.issue44984@roundup.psfhosted.org> miss-islington added the comment: New changeset 6ff7fefc914541ec5afdd3c8193da80818cb0817 by Miss Islington (bot) in branch '3.10': bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904) https://github.com/python/cpython/commit/6ff7fefc914541ec5afdd3c8193da80818cb0817 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 15:54:41 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 23 Aug 2021 19:54:41 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1629748481.98.0.301351441956.issue44962@roundup.psfhosted.org> Change by Thomas Grainger : ---------- pull_requests: +26373 pull_request: https://github.com/python/cpython/pull/27921 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 16:06:34 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 23 Aug 2021 20:06:34 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1629749194.72.0.153071192957.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26374 pull_request: https://github.com/python/cpython/pull/27922 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 16:07:16 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 23 Aug 2021 20:07:16 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1629749236.13.0.800942657475.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- Removed message: https://bugs.python.org/msg399133 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 16:08:06 2021 From: report at bugs.python.org (Bastian Neuburger) Date: Mon, 23 Aug 2021 20:08:06 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629749286.59.0.521516598157.issue44934@roundup.psfhosted.org> Bastian Neuburger added the comment: Attached is the full output of: - msbuild.exe -version - get_externals.bat - build.bat For the first few build tasks there are git related errors, which make sense since I ran the build from a downloaded zip release of the source instead of a git clone. I assume the first "real" error occurs when building the wix targets, just grep for MSB4062, this is when things go downhill. ---------- Added file: https://bugs.python.org/file50231/buildout.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 16:08:27 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 23 Aug 2021 20:08:27 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629749307.37.0.494414490764.issue42560@roundup.psfhosted.org> miss-islington added the comment: New changeset e4795103025aeef295a8c5f75cc7c33801f93a24 by Miss Islington (bot) in branch '3.10': bpo-42560: simplify/merge architecture info in Tkinter docs (GH-27839) https://github.com/python/cpython/commit/e4795103025aeef295a8c5f75cc7c33801f93a24 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 16:09:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 23 Aug 2021 20:09:35 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1629749375.43.0.589456772563.issue43853@roundup.psfhosted.org> Erlend E. Aasland added the comment: > What about new tests and NEWS update? See PR 27642 for the expanded tests, and PR 27922 for amending news entries. I didn't combine the two, as I figured you might have more comments on the former PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 16:12:53 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 23 Aug 2021 20:12:53 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1629749573.78.0.787559649536.issue44962@roundup.psfhosted.org> Thomas Grainger added the comment: > weakref.WeakSet is not thread-safe, which means concurrent create_task's in different threads (even on separate event loops) is not safe. actually it looks like WeakSet is *supposed* to be thread-safe ``` import patchy patchy.patch( "weakref:WeakSet._commit_removals", """\ @@ -1,5 +1,10 @@ def _commit_removals(self): - l = self._pending_removals + pop = self._pending_removals.pop discard = self.data.discard - while l: - discard(l.pop()) + while True: + try: + item = pop() + except IndexError: + return + else: + discard(item) """ ) import itertools import asyncio import concurrent.futures import sys import threading threads = 200 def test_all_tasks_threading() -> None: async def foo() -> None: await asyncio.sleep(0) async def create_tasks() -> None: for i in range(1000): asyncio.create_task(foo()) await asyncio.sleep(0) results = [] with concurrent.futures.ThreadPoolExecutor(threads) as tpe: for f in concurrent.futures.as_completed( tpe.submit(asyncio.run, create_tasks()) for i in range(threads) ): results.append(f.result()) assert results == [None] * threads def main(): for i in itertools.count(): test_all_tasks_threading() print(f"worked {i}") return 0 if __name__ == "__main__": sys.exit(main()) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 16:32:45 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 23 Aug 2021 20:32:45 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <1629750765.08.0.799546395901.issue41102@roundup.psfhosted.org> Andrei Kulakov added the comment: Liu: apologies for the confusion, I missed that when coming back to the thread for the 2nd time. I took a look at the code and one potential issue I see is that you are opening the file in 'w' mode if stat size is 0 (or if file isn't valid), and in 'a' mode otherwise. It's better to just use the 'a' mode as then the file will be created if it doesn't exist. This may lead to file being opened in 'w' mode after some files already were meant to be written, - due to buffering. A second issue is that you're closing and reopening the archive for each file written. I'm not sure if you had a reason for that but it's better to open the archive and write all of the files if you have them ready. It's hard to say exactly what lead to this incomplete archive without a reproducible way to create it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 16:57:21 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 23 Aug 2021 20:57:21 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629752241.87.0.809984126915.issue44934@roundup.psfhosted.org> Steve Dower added the comment: Oh I remember this one. The Wix toolset still requires .NET 3.5, which you have to install manually these days. Because it's being launched as a console app, the UI never gets triggered. I thought we had this in the devguide already... but maybe not (or not prominently enough). Might be worth trying to add some detection for it - hopefully a new version of Wix will move to newer .NET too. See https://docs.microsoft.com/en-us/dotnet/framework/install/dotnet-35-windows-10 for install instructions. It should work after that. The CI build succeeded, but it'll need manual testing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 17:13:37 2021 From: report at bugs.python.org (Bastian Neuburger) Date: Mon, 23 Aug 2021 21:13:37 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629753217.46.0.114188706046.issue44934@roundup.psfhosted.org> Bastian Neuburger added the comment: Ah ok. Do you know if VS 2019 will do the job at all? I encountered a few (unrelated) projects on github that state they will only build with VS 2017. I will install .NET 3.5 via the VS 2019 installer (should do the trick, right?) and see how it turns out. Could you attach the msi installer build artifact from the build you kicked off so I can test if the appendpath stuff works as expected? Or did you already have a look at it? P.S.: bpo now recognizes that I signed the CLA, github not yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 18:01:46 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 23 Aug 2021 22:01:46 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629756106.98.0.350449420404.issue44934@roundup.psfhosted.org> Steve Dower added the comment: I don't think we upload the artifact from the MSI builds, sorry. If Visual Studio has an option for the older version of .NET, then yeah, that'll do it. But because it was an OS component, you may have to do it through the OS dialog in the link I posted. GitHub will get the CLA update soon enough. It's always a little slower - bpo is the canonical source. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 18:22:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Aug 2021 22:22:51 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629757371.15.0.0563867869756.issue37596@roundup.psfhosted.org> Raymond Hettinger added the comment: > I can clean it up and convert it to a PR if we decide > we want to go this route. +1 This is by far the smallest intervention that has been discussed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 18:54:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 23 Aug 2021 22:54:09 +0000 Subject: [issue44984] Rewrite test_null_strings in _testcapi In-Reply-To: <1629729971.91.0.181277754556.issue44984@roundup.psfhosted.org> Message-ID: <1629759249.58.0.909819844701.issue44984@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Serhiy! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 18:58:09 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 23 Aug 2021 22:58:09 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629759489.32.0.827209560459.issue37596@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's pure python code for expirmentation: from marshal import dumps, loads def marshal_set(s): return dumps(sorted((dumps(value), value) for value in s)) def unmarshal_set(m): return {value for dump, value in loads(m)} def test(s): assert unmarshal_set(marshal_set(s)) == s test({("string", 1), ("string", 2), ("string", 3)}) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 19:22:20 2021 From: report at bugs.python.org (=?utf-8?q?Mat=C3=ADas_Senger?=) Date: Mon, 23 Aug 2021 23:22:20 +0000 Subject: [issue44986] Date formats in help messages of argparse Message-ID: <1629760940.67.0.392348377667.issue44986@roundup.psfhosted.org> New submission from Mat?as Senger : If the help message of an argument in argparse contains a date format, e.g. %Y-%m-%d, it crashes when printing the help after being invoked with the -h option. Uploaded an example. ---------- components: Library (Lib) files: deleteme.py messages: 400183 nosy: mail.de.senger priority: normal severity: normal status: open title: Date formats in help messages of argparse type: crash versions: Python 3.11 Added file: https://bugs.python.org/file50232/deleteme.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 19:26:17 2021 From: report at bugs.python.org (Roundup Robot) Date: Mon, 23 Aug 2021 23:26:17 +0000 Subject: [issue44986] Date formats in help messages of argparse In-Reply-To: <1629760940.67.0.392348377667.issue44986@roundup.psfhosted.org> Message-ID: <1629761177.94.0.254170896361.issue44986@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +26375 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27923 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 19:43:13 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 23 Aug 2021 23:43:13 +0000 Subject: [issue44690] Adopt binacii.a2b_base64's strict mode in base64.b64decode In-Reply-To: <1626818256.45.0.373140812425.issue44690@roundup.psfhosted.org> Message-ID: <1629762193.48.0.656562633578.issue44690@roundup.psfhosted.org> Gregory P. Smith added the comment: I'm not worried about the regex vs binascii C implementation performance at all. ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 19:44:36 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 23 Aug 2021 23:44:36 +0000 Subject: [issue44690] Adopt binacii.a2b_base64's strict mode in base64.b64decode In-Reply-To: <1626818256.45.0.373140812425.issue44690@roundup.psfhosted.org> Message-ID: <1629762276.75.0.615194660211.issue44690@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset fa6304a5225787054067bb56089632146d288b20 by Idan Moral in branch 'main': bpo-44690: Adopt binacii.a2b_base64's strict mode in base64.b64decode (GH-27272) https://github.com/python/cpython/commit/fa6304a5225787054067bb56089632146d288b20 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 19:45:16 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 23 Aug 2021 23:45:16 +0000 Subject: [issue44690] Adopt binacii.a2b_base64's strict mode in base64.b64decode In-Reply-To: <1626818256.45.0.373140812425.issue44690@roundup.psfhosted.org> Message-ID: <1629762316.8.0.823547792673.issue44690@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 20:19:22 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 24 Aug 2021 00:19:22 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629764362.6.0.501440196345.issue37596@roundup.psfhosted.org> Raymond Hettinger added the comment: Here's pure python code for experimentation: from marshal import dumps, loads def marshal_set(s): return dumps(sorted(s, key=dumps)) def unmarshal_set(m): return frozenset(loads(m)) def test(s): assert unmarshal_set(marshal_set(s)) == s test({("string", 1), ("string", 2), ("string", 3)}) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 20:19:36 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 24 Aug 2021 00:19:36 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629764376.93.0.537890617564.issue37596@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- Removed message: https://bugs.python.org/msg400182 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 20:28:14 2021 From: report at bugs.python.org (Bastian Neuburger) Date: Tue, 24 Aug 2021 00:28:14 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629764894.91.0.997752216861.issue44934@roundup.psfhosted.org> Bastian Neuburger added the comment: Update: .NET 3.5 installation worked out fine via VS 2019 installer, I also added the VS2017 build tools as a precaution since the VM builds take some time. Afterwards build.bat still failed during wix steps, complaining about missing python.exe in PCBuild/win32, not sure if the 32bit interpreter should be fetched/built automagically. Then I tried build.bat -x64, which ran succesfully and provided attached installer. To test it (in administrative shell): 1. git clone https://github.com/bneuburg/python_msi_appendpath 2. cd python_appendpath_installer 3. .\python-3.11.0.7539-amd64.exe /quiet InstallAllUsers=1 AppendPath=1 Include_test=0 Running this in an administrative shell appended InstallDir and Installdir/Scripts to the sytem PATH and created the PATHEXT entries for PY and PYC as well. So far so good! I only noticed the following problem: The first uninstall also succesfully removed all environment variables, however after reinstalling and re-uninstalling, only the PATHEXT were removed, the Python entries in PATH were not removed. This was also independent of the order of software removal (Python Launcher first or second). Thus I had a look at it with orca.exe [1]: 1. Install with appendpath=1 2. Get list of installed msis with: wmic product get /format:csv > software.csv 3. Search for appendpath in software.csv which will return the location of the msi somewhere in c:\windows\installer 4. Right click that file and select 'Edit with Orca' In the environment table it has entries in the following form for a Local Machine install (c.f. for attached screenshot): Environment | Name | Value | Component PATH_LM | =-*PATH | [~]:[InstallDirectory] | AppendPath_LM which according to Microsoft documentation [2] seems to be as intended (add on install, remove on uninstall). But it just doesn't, also see Sascha's comment above. When looking at Orca I also noticed that I forgot to change the position of InstallDirectory in PATH for the CU install from first to last, I updated the PR accordingly. Since you have a Microsoft e-mail address: Any chances you could ask the MSI pros there what is going on? I'll be busy with offline stuff for a few weeks, but if you have any ideas how to troubleshoot this, let me know. I found a discussion where the order of the prefixes for names was slightly changed [3], i.e. *=- instead of =-* but I don't know if this matters at all or how to test it. Sorry for the text book, things like that really keep me digging. [1] https://docs.microsoft.com/de-de/windows/win32/msi/orca-exe [2] https://docs.microsoft.com/en-us/windows/win32/msi/environment-table [3] https://www.itninja.com/question/add-to-path-envronment-variable ---------- Added file: https://bugs.python.org/file50233/orca.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 20:45:09 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 24 Aug 2021 00:45:09 +0000 Subject: [issue44985] Inconsistent returned value of inspect.getfullargspec(object.__init__). In-Reply-To: <1629734808.74.0.392472113635.issue44985@roundup.psfhosted.org> Message-ID: <1629765909.39.0.956739438988.issue44985@roundup.psfhosted.org> Eric V. Smith added the comment: Well, as you note, technically object.__init__ does take args and kwargs. It just raises an exception if if finds any. What are you proposing to change here? ---------- components: -Distutils, Parser nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 21:12:03 2021 From: report at bugs.python.org (Mark Roseman) Date: Tue, 24 Aug 2021 01:12:03 +0000 Subject: [issue42560] Improve Tkinter Documentation In-Reply-To: <1607020537.02.0.420924180434.issue42560@roundup.psfhosted.org> Message-ID: <1629767523.1.0.649885744504.issue42560@roundup.psfhosted.org> Mark Roseman added the comment: ?ukasz, thank you very much for your help with getting these changes merged in! I hope others will chime in with suggestions and/or edits to the newer or substantially revised sections. There is most definitely lots of room for improvement. One specific request... does anyone have solid recommendations for other resources (including books, paid video courses, etc.) that extensively cover Tkinter and use current best practices (grid, ttk, etc.)? This would be for the "see also" section. While I think the two free tutorial/reference resources on tkdocs.com make the most sense, I'm a bit queasy about the self-promotion optics of also highlighting Modern Tkinter as prominently as it is now in the books section. That still leaves the "handy reference" section to deal with, which currently consists of a mish-mash of material. When I have a chance, I'll work on a PR with a list of classes and common methods (but not arguments or explanations) as suggested before. While the pieces that were already merged in were probably low on the controversy scale, it's still unclear what the right way forward is with the actual reference part and I expect some more discussion on that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 21:34:00 2021 From: report at bugs.python.org (Diego Ramirez) Date: Tue, 24 Aug 2021 01:34:00 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1629768840.24.0.84091402687.issue44603@roundup.psfhosted.org> Change by Diego Ramirez : ---------- nosy: +DiddiLeija _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 21:35:15 2021 From: report at bugs.python.org (Xiaolong Liu) Date: Tue, 24 Aug 2021 01:35:15 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <2021082409350754303113@126.com> Xiaolong Liu added the comment: Andrei: Never mind. Yes. It is hardly impossible to sort out a problem when it cannot be reproduced. Just close it plz. Anyway, many thanks for your suggestions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 21:40:26 2021 From: report at bugs.python.org (Diego Ramirez) Date: Tue, 24 Aug 2021 01:40:26 +0000 Subject: [issue44892] [configparser] Module configparser fails when the config file contains a "%" inside a commentary In-Reply-To: <1628713941.43.0.342717269726.issue44892@roundup.psfhosted.org> Message-ID: <1629769226.15.0.474821954914.issue44892@roundup.psfhosted.org> Change by Diego Ramirez : ---------- nosy: +uranusjr title: [configparser] Module configparser fails when the file contains a "%" inside a commentary -> [configparser] Module configparser fails when the config file contains a "%" inside a commentary _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 21:57:10 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 24 Aug 2021 01:57:10 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <1629770230.09.0.0410545025877.issue41102@roundup.psfhosted.org> Andrei Kulakov added the comment: Liu: Thanks for the report! By the way on re-reading my message, of course by opening and closing archive on each file using the `with` block, you take care of the first issue I mentioned (although it's not very efficient). And I assume there was no multiprocessing / multithreading involved in creating the zip files? (I know it's not in the code you posted, but just to be sure?) I agree with closing this until someone else runs into it and is able to reproduce reliably. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 22:07:52 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 24 Aug 2021 02:07:52 +0000 Subject: [issue44987] Speed up unicode normalization of ASCII strings Message-ID: <1629770872.82.0.815585920926.issue44987@roundup.psfhosted.org> New submission from Steven D'Aprano : I think there is an opportunity to speed up some unicode normalisations significantly. In 3.9 at least, the normalisation appears to be dependent on the length of the string: >>> setup="from unicodedata import normalize; s = 'reverse'" >>> t1 = Timer('normalize("NFKC", s)', setup=setup) >>> setup="from unicodedata import normalize; s = 'reverse'*1000" >>> t2 = Timer('normalize("NFKC", s)', setup=setup) >>> >>> min(t1.repeat(repeat=7)) 0.04854234401136637 >>> min(t2.repeat(repeat=7)) 9.98313440399943 But ASCII strings are always in normalised form, for all four normalisation forms. In CPython, with PEP 393 (Flexible String Representation), it should be a constant-time operation to detect whether a string is pure ASCII, and avoid scanning the string or attempting the normalisation. ---------- components: Unicode messages: 400192 nosy: ezio.melotti, steven.daprano, vstinner priority: normal severity: normal status: open title: Speed up unicode normalization of ASCII strings type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 22:17:14 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 24 Aug 2021 02:17:14 +0000 Subject: [issue44981] wildcard imports should normalise names in `__all__` In-Reply-To: <1629740579.48.0.287398877147.issue44981@roundup.psfhosted.org> Message-ID: <20210824021642.GK22866@ando.pearwood.info> Steven D'Aprano added the comment: On Mon, Aug 23, 2021 at 05:42:59PM +0000, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > Should getattr() normalize attribute name? If no, it will produce > surprises further along the way. If yes, it will add significant > overhead. Good point. In pure Python, normalising the string in getattr does have significant cost, about 125% slower on my computer using 3.9: >>> from functools import partial >>> import unicodedata >>> normalise = partial(unicodedata.normalize, "NFKC") >>> def mygetattr(obj, name, _normalise=normalise, _getattr=getattr): ... return _getattr(obj, _normalise(name)) ... >>> t1 = Timer('getattr([], "reverse")') >>> t2 = Timer('mygetattr([], "reverse")', setup='from __main__ import mygetattr') >>> >>> min(t1.repeat(repeat=7)) 0.08972279605222866 >>> min(t2.repeat(repeat=7)) 0.20272555301198736 >>> (0.20272555301198736-0.08972279605222866)/0.08972279605222866 1.2594653971102117 But for ASCII strings at least, I think there is an opportunity to avoid that cost entirely. See #44987. > Even star-import can get significant impact. I'm less worried about that for three reasons: 1. It only affects star-import, which is not "best practice", so only a small number of scripts will be affected. 2. In the most overwhelming common case, you do any star-imports once, at the beginning of the module, not repeatedly. Star-imports will not be part of a tight, performance critical loop. So it is a one-off cost. 3. The cost of an import is a lot more than just the getattr, so any normalisation cost is a correspondingly smaller part of the total. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 22:29:36 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 24 Aug 2021 02:29:36 +0000 Subject: [issue42538] AsyncIO strange behaviour In-Reply-To: <1606911447.68.0.828780901691.issue42538@roundup.psfhosted.org> Message-ID: <1629772176.98.0.650121749693.issue42538@roundup.psfhosted.org> Nick Coghlan added the comment: While filed later, issue44665 correctly describes the problem reported here: asyncio is behaving as expected, but the docs don't make it clear that you need to save a reference to the result of ensure_future()/create_task() if you don't want to risk the task unexpectedly disappearing mid execution. So marking this as a duplicate of that docs issue. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 22:30:11 2021 From: report at bugs.python.org (Nick Coghlan) Date: Tue, 24 Aug 2021 02:30:11 +0000 Subject: [issue42538] AsyncIO strange behaviour In-Reply-To: <1606911447.68.0.828780901691.issue42538@roundup.psfhosted.org> Message-ID: <1629772211.72.0.696205033294.issue42538@roundup.psfhosted.org> Change by Nick Coghlan : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> asyncio.create_task() documentation should mention user needs to keep reference to the task _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 23:21:13 2021 From: report at bugs.python.org (=?utf-8?b?5byg5bO76ZOt?=) Date: Tue, 24 Aug 2021 03:21:13 +0000 Subject: [issue44988] Use the newest tcl/tk support Message-ID: <1629775273.4.0.869869625405.issue44988@roundup.psfhosted.org> New submission from ??? <3180471716 at qq.com>: The newest tcl/tk(8.7) has been released. If python uses the newest tcl/tk, tkinter will be better in these respects: 1. progressbar will be added text on it. 2. the scrollbar, text and canvas will be moved more smoothly. 3. tcl/tk8.7 includes tk_sysnotify and tk_systray, which provide users with a modern way match OS to show the messages. Therefore, I suggest that python should use the newest tcl to bring new feature to Python GUI. ---------- components: Tkinter messages: 400195 nosy: smart-space priority: normal severity: normal status: open title: Use the newest tcl/tk support type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 23:30:59 2021 From: report at bugs.python.org (Roundup Robot) Date: Tue, 24 Aug 2021 03:30:59 +0000 Subject: [issue44988] Use the newest tcl/tk support In-Reply-To: <1629775273.4.0.869869625405.issue44988@roundup.psfhosted.org> Message-ID: <1629775859.49.0.000375257034431.issue44988@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +26376 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27925 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 23 23:33:20 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 24 Aug 2021 03:33:20 +0000 Subject: [issue44989] Fix documentation for truth testing Message-ID: <1629776000.21.0.00803055274817.issue44989@roundup.psfhosted.org> New submission from Steven D'Aprano : Truth testing states that "Any object can be tested for truth value" but from 3.9 onwards, doing so with NotImplemented is deprecated and will be made a TypeError. https://docs.python.org/3/library/stdtypes.html#truth-value-testing It is also not true for third-party objects such as numpy arrays (which raise ValueError) and pandas dataframes. I think that truth testing should have been considered a fundamental operation that (in the absence of bugs) always succeeds, but #35712 says different. Not that I'm bitter *wink* In any case, at the very least the exception for NotImplemented should be documented. ---------- assignee: docs at python components: Documentation messages: 400196 nosy: docs at python, steven.daprano priority: normal severity: normal status: open title: Fix documentation for truth testing versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 00:23:33 2021 From: report at bugs.python.org (Xiaolong Liu) Date: Tue, 24 Aug 2021 04:23:33 +0000 Subject: [issue41102] ZipFile.namelist() does not match the actual files in .zip file In-Reply-To: <1593001145.16.0.222635534542.issue41102@roundup.psfhosted.org> Message-ID: <202108241223282705283@126.com> Xiaolong Liu added the comment: Andrei: No multiprocessing or multithreading was used when creating the zip file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 00:48:15 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 24 Aug 2021 04:48:15 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629780495.83.0.612911755789.issue37596@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +26377 pull_request: https://github.com/python/cpython/pull/27926 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 01:04:39 2021 From: report at bugs.python.org (hai shi) Date: Tue, 24 Aug 2021 05:04:39 +0000 Subject: [issue44913] segfault in call to embedded PyModule_New In-Reply-To: <1628951281.11.0.836111617554.issue44913@roundup.psfhosted.org> Message-ID: <1629781479.54.0.258864977155.issue44913@roundup.psfhosted.org> hai shi added the comment: This bpo isn't a bug, so I close it now. If there are some enhancements need to be discussed, we can reopen it:) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 04:33:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Aug 2021 08:33:07 +0000 Subject: [issue43598] test_subprocess logs multiple ResourceWarning warnings In-Reply-To: <1616460115.42.0.31373302099.issue43598@roundup.psfhosted.org> Message-ID: <1629793987.89.0.679773787693.issue43598@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Resource warnings in test_subprocess _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 04:34:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Aug 2021 08:34:15 +0000 Subject: [issue38912] test_asyncio altered the execution environment In-Reply-To: <1574729421.23.0.927917235759.issue38912@roundup.psfhosted.org> Message-ID: <1629794055.97.0.571259506047.issue38912@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 04:53:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 24 Aug 2021 08:53:55 +0000 Subject: [issue44988] Use the newest tcl/tk support In-Reply-To: <1629775273.4.0.869869625405.issue44988@roundup.psfhosted.org> Message-ID: <1629795235.11.0.274024626918.issue44988@roundup.psfhosted.org> Terry J. Reedy added the comment: I am sympathetic to the idea, but is 8.7 out of beta yet? Do you have a link to the release page? Is it backward compatible, so that tkinter code written to run on current 8.6 would run on new binaries? In any case, such a change would only be done in a future release. There should be separate patches for Windows and macOS. ---------- nosy: +markroseman, serhiy.storchaka, terry.reedy versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 05:13:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 24 Aug 2021 09:13:39 +0000 Subject: [issue34990] year 2038 problem in compileall.py In-Reply-To: <1539602536.3.0.788709270274.issue34990@psf.upfronthosting.co.za> Message-ID: <1629796419.36.0.267701242839.issue34990@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset bb21e28fd08f894ceff2405544a2f257d42b1354 by Ammar Askar in branch 'main': bpo-34990: Treat the pyc header's mtime in compileall as an unsigned int (GH-19708) https://github.com/python/cpython/commit/bb21e28fd08f894ceff2405544a2f257d42b1354 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 05:14:21 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Aug 2021 09:14:21 +0000 Subject: [issue34990] year 2038 problem in compileall.py In-Reply-To: <1539602536.3.0.788709270274.issue34990@psf.upfronthosting.co.za> Message-ID: <1629796461.73.0.61213260829.issue34990@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26378 pull_request: https://github.com/python/cpython/pull/27928 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 05:14:26 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Aug 2021 09:14:26 +0000 Subject: [issue34990] year 2038 problem in compileall.py In-Reply-To: <1539602536.3.0.788709270274.issue34990@psf.upfronthosting.co.za> Message-ID: <1629796466.35.0.344416595306.issue34990@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26379 pull_request: https://github.com/python/cpython/pull/27929 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 06:06:46 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 24 Aug 2021 10:06:46 +0000 Subject: [issue33710] Deprecate gettext.lgettext() In-Reply-To: <1527764456.73.0.682650639539.issue33710@psf.upfronthosting.co.za> Message-ID: <1629799606.4.0.488951990043.issue33710@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: It seems like the docs have a note that these functions were removed in Python 3.10 but they probably missed the release. Doc : https://docs.python.org/3.10/library/gettext.html#gettext.lgettext ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 06:12:02 2021 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 24 Aug 2021 10:12:02 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1629799922.21.0.990050844049.issue44962@roundup.psfhosted.org> Change by Thomas Grainger : ---------- nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 06:18:35 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 24 Aug 2021 10:18:35 +0000 Subject: [issue44990] Change layout of frames back to specials-locals-stack (from locals-specials-stack) Message-ID: <1629800315.67.0.0305853602791.issue44990@roundup.psfhosted.org> New submission from Mark Shannon : The two plausible layouts from evaluation stack frames are described here: https://github.com/faster-cpython/ideas/issues/31#issuecomment-844263795 We opted for layout A, although it is a bit more complex to manage and slightly more expensive in terms of pointers. The reason for this was that it theoretically allows zero-copying Python-to-Python calls. I now believe this was the wrong decision and we should have chosen layout B. B is cheaper. It needs 2 pointers, not 3, meaning that there is another register available for use in the interpreter. Also the linkage area doesn't need the nlocalsplus field. The benefit of zero-copy calls is much smaller than I thought: * Any calls from a generator functions do not benefit * An additional check is needed to make sure that both frames are in the same stack chunk * Any jitted code will keep stack values in registers, so stores will still be needed in either case. * The average number of arguments copied is low (typically 2 or 3). Even in the ideal case (interpreter, no generator, same stack chunk) changing to layout B will cost 2/3 memory moves (independent of each other), but will gain us extra code for checking chunks, and one move (moving nlocalsplus). So at best we only save 1/2 moves. In other cases layout B is better. One final improvement to layout B: saving the stackdepth as an offset from locals[0] not from stack[0] further speeds frame handling. ---------- assignee: Mark.Shannon messages: 400202 nosy: Mark.Shannon, pablogsal priority: normal severity: normal status: open title: Change layout of frames back to specials-locals-stack (from locals-specials-stack) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 06:44:18 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 24 Aug 2021 10:44:18 +0000 Subject: [issue43826] Resource warnings in test_subprocess In-Reply-To: <1618291734.0.0.346590897335.issue43826@roundup.psfhosted.org> Message-ID: <1629801858.28.0.94757612291.issue43826@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: New changeset 7179930ab5f5b2dea039023bec968aadc03e3775 by Karthikeyan Singaravelan in branch 'main': bpo-43826: Fix resource warning due to unclosed objects. (GH-25381) https://github.com/python/cpython/commit/7179930ab5f5b2dea039023bec968aadc03e3775 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 07:04:56 2021 From: report at bugs.python.org (Mehrzad) Date: Tue, 24 Aug 2021 11:04:56 +0000 Subject: [issue44985] Inconsistent returned value of inspect.getfullargspec(object.__init__). In-Reply-To: <1629734808.74.0.392472113635.issue44985@roundup.psfhosted.org> Message-ID: <1629803096.68.0.455371193911.issue44985@roundup.psfhosted.org> Mehrzad added the comment: My suggestion: Although both `object(...)` and `object.__init__(...)`, run through the same method, they are semantically and intentionally different. 1. `ObjectType(...)`; implicit call of `object.__init__`: The user intends to create an object. If extra arguments given, the following error should rise: 'TypeError: Obj() takes no arguments' This error is already raised from `object.__new__` before `object.__init__` is invoked -- the init function is not reached at all. 2. `object.__init__(object_instance, ...)`; explicit call of `object.__init__`: The user intends to call the `__init__` function for some reason beyond object instance creation. If n-ary arguments given, the following error should *not* rise: 'ObjectType.__init__() takes exactly one argument (the instance to initialize)' One reason I suggest the error should be eliminated is the message is confusing; while `object.__init__` has been called, the name of the non-existing `ObjectType.__init__` method appears on the error message. 3. `object_instance.__init__(...)` where `type(object_instance) == object`: Same behavior as (2). 4. `object_instance.__init__(...)` where `type(object_instance)` is a subclass of `object`: Same behavior as (3). This is one possible solution I can think of -- which also makes the title sort of misleading. This is of course in the case that there are no use-cases making the `object.__init__` exception necessary. However, even in those cases, the implicit and explicit init calls might be distinguishable and the exception may be raised outside `object.__init__`, e.g. by the parser before calling the init. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 08:22:05 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 24 Aug 2021 12:22:05 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1629807725.65.0.462500544499.issue42064@roundup.psfhosted.org> Petr Viktorin added the comment: I think the module could use a more comprehensive review for GIL handling, rather than doing it piecewise in individual PRs. I recommend that any function passed to SQLite (and only those) should - be named `*_callback`, for clarity - acquire the GIL at the very start - release the GIL at the very end ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 08:24:16 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Aug 2021 12:24:16 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1629807856.67.0.115229489055.issue42064@roundup.psfhosted.org> miss-islington added the comment: New changeset 9ed523159c7ba840dbf403e02498eeae1b5d3ed9 by Erlend Egeberg Aasland in branch 'main': bpo-42064: Pass module state to `sqlite3` UDF callbacks (GH-27456) https://github.com/python/cpython/commit/9ed523159c7ba840dbf403e02498eeae1b5d3ed9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 08:36:28 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 24 Aug 2021 12:36:28 +0000 Subject: [issue43826] Resource warnings in test_subprocess In-Reply-To: <1618291734.0.0.346590897335.issue43826@roundup.psfhosted.org> Message-ID: <1629808588.72.0.849622375763.issue43826@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 09:07:12 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 24 Aug 2021 13:07:12 +0000 Subject: [issue44991] [sqlite3] cleanup GIL handling Message-ID: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> New submission from Erlend E. Aasland : Quoting msg400205 by Petr in bpo-42064: I think the module could use a more comprehensive review for GIL handling, rather than doing it piecewise in individual PRs. I recommend that any function passed to SQLite (and only those) should - be named `*_callback`, for clarity - acquire the GIL at the very start - release the GIL at the very end ---------- assignee: erlendaasland components: Extension Modules messages: 400207 nosy: erlendaasland, petr.viktorin priority: normal severity: normal status: open title: [sqlite3] cleanup GIL handling type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 09:07:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 24 Aug 2021 13:07:44 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1629810464.64.0.037123142204.issue42064@roundup.psfhosted.org> Erlend E. Aasland added the comment: Petr: > I think the module could use a more comprehensive review for GIL handling [...] I agree. I created bpo-44991 for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 09:36:59 2021 From: report at bugs.python.org (Brian Lee) Date: Tue, 24 Aug 2021 13:36:59 +0000 Subject: [issue44992] functools.lru_cache does not consider strings and numpy strings as equivalent Message-ID: <1629812219.83.0.183087595287.issue44992@roundup.psfhosted.org> New submission from Brian Lee : This seems like unexpected behavior: Two keys that are equal and have equal hashes should yield cache hits, but they do not. Python 3.9.6 (default, Aug 18 2021, 19:38:01) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> import functools >>> >>> import numpy as np >>> >>> @functools.lru_cache(maxsize=None) ... def f(x): ... return x ... >>> py_str = 'hello world' >>> np_str = np.str_(py_str) >>> >>> assert py_str == np_str >>> assert hash(py_str) == hash(np_str) >>> >>> assert f.cache_info().currsize == 0 >>> f(py_str) 'hello world' >>> assert f.cache_info().currsize == 1 >>> f(np_str) 'hello world' >>> assert f.cache_info().currsize == 2 >>> print(f.cache_info()) CacheInfo(hits=0, misses=2, maxsize=None, currsize=2) ---------- components: Library (Lib) messages: 400209 nosy: brilee priority: normal severity: normal status: open title: functools.lru_cache does not consider strings and numpy strings as equivalent versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 10:04:09 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 24 Aug 2021 14:04:09 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1629813849.5.0.592400691388.issue42064@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +26380 pull_request: https://github.com/python/cpython/pull/27931 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 10:19:43 2021 From: report at bugs.python.org (David Rebbe) Date: Tue, 24 Aug 2021 14:19:43 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero Message-ID: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> New submission from David Rebbe : enum.auto() By default, the initial value starts at 1. Per the documentation here: https://docs.python.org/3/library/enum.html#enum.auto This doesn't really follow expected behavior in majority of programming languages nor python. Most will expect starting value to be zero. I personally skipped over this as I've never seen an enum start at 1 in any language before. Excuse my ignorance if this is more common place then I realize. I propose an optional argument to the class to allow different starting values: enum.auto(0) ---------- messages: 400210 nosy: David Rebbe2 priority: normal severity: normal status: open title: enum.auto() starts with one instead of zero versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 10:29:49 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 24 Aug 2021 14:29:49 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629815389.75.0.425830808791.issue44993@roundup.psfhosted.org> Vedran ?a?i? added the comment: For IntEnum, maybe. But for Enum, the whole point of auto() is that the values don't really matter. The rationale was that with IntEnum, truth testing (which is often used in Python to realize Optional) would distinguish None, and then all true Enums would actually be true in the boolean sense. In a way, most real examples of enums already have some "fake" value which they map to 0. In Python, you idiomatically use None for that. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 10:53:16 2021 From: report at bugs.python.org (David Rebbe) Date: Tue, 24 Aug 2021 14:53:16 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629816796.84.0.910108030283.issue44993@roundup.psfhosted.org> David Rebbe added the comment: Understandable and I do believe IntEnum should default as zero as its the default type most will choose when trying to mimic other languages. C/C++ has the same problem where the value isn't suppose to matter but as soon as you go across the compiled / interpreted application (libraries and network communication) the value of the enum becomes important. I have corrected all my code to have a "fake" value of 0 instead of using enum.auto() as the first value, but it would be nice to not have to use that workaround. Maybe a new class CIntEnum would be acceptable? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 11:02:16 2021 From: report at bugs.python.org (Mark Roseman) Date: Tue, 24 Aug 2021 15:02:16 +0000 Subject: [issue7057] tkinter doc: more 3.x updates In-Reply-To: <1254697168.63.0.205098696566.issue7057@psf.upfronthosting.co.za> Message-ID: <1629817336.01.0.062645054034.issue7057@roundup.psfhosted.org> Mark Roseman added the comment: yes this should be closed.. with latest doc updates, most of these are no longer at all relevant ---------- nosy: +markroseman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 11:07:35 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 24 Aug 2021 15:07:35 +0000 Subject: [issue34990] year 2038 problem in compileall.py In-Reply-To: <1539602536.3.0.788709270274.issue34990@psf.upfronthosting.co.za> Message-ID: <1629817655.08.0.420682537606.issue34990@roundup.psfhosted.org> Ammar Askar added the comment: New changeset 9d3b6b2472f7c7ef841e652825de652bc8af85d7 by Miss Islington (bot) in branch '3.9': [3.9] bpo-34990: Treat the pyc header's mtime in compileall as an unsigned int (GH-19708) https://github.com/python/cpython/commit/9d3b6b2472f7c7ef841e652825de652bc8af85d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 11:09:19 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 24 Aug 2021 15:09:19 +0000 Subject: [issue34990] year 2038 problem in compileall.py In-Reply-To: <1539602536.3.0.788709270274.issue34990@psf.upfronthosting.co.za> Message-ID: <1629817759.28.0.600018685923.issue34990@roundup.psfhosted.org> Ammar Askar added the comment: New changeset 0af681b652c43f0ba90988400ecc1e7934fbfc5d by Miss Islington (bot) in branch '3.10': [3.10] bpo-34990: Treat the pyc header's mtime in compileall as an unsigned int (GH-19708) https://github.com/python/cpython/commit/0af681b652c43f0ba90988400ecc1e7934fbfc5d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 11:13:34 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 24 Aug 2021 15:13:34 +0000 Subject: [issue34990] year 2038 problem in compileall.py In-Reply-To: <1539602536.3.0.788709270274.issue34990@psf.upfronthosting.co.za> Message-ID: <1629818014.23.0.258958340674.issue34990@roundup.psfhosted.org> Change by Ammar Askar : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 11:39:53 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 24 Aug 2021 15:39:53 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629819593.07.0.362732192087.issue44993@roundup.psfhosted.org> Vedran ?a?i? added the comment: I think you should be even more explicit. If values matter, they _should_ be seen in code. (All of them, not just the first one.) auto() just means "this value doesn't really matter". And it's not really hard to write concrete values instead of auto(), in many instances it's even easier. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 12:17:53 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 24 Aug 2021 16:17:53 +0000 Subject: [issue44992] functools.lru_cache does not consider strings and numpy strings as equivalent In-Reply-To: <1629812219.83.0.183087595287.issue44992@roundup.psfhosted.org> Message-ID: <1629821873.78.0.652244344422.issue44992@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the report but this is an allowed behavior and not a bug. Per the docs?: If typed is set to true, function arguments of different types will be cached separately. For example, f(3) and f(3.0) will always be treated as distinct calls with distinct results. If typed is false, the implementation will usually but not always regard them as equivalent calls and only cache a single result. ? https://docs.python.org/3.10/library/functools.html#module-functools In this particular case, exact type matches for str and int have an alternate path that tends to save space. The cost is that str or int equivalents are cached separately. That doesn't tend to be a problem in practice because functions are mostly called with the same types over and over again. Note, we also treat equivalent calling patterns as distinct, f(a=1, b=2), is cached separately from f(b=2, a=1). ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 12:43:54 2021 From: report at bugs.python.org (David Rebbe) Date: Tue, 24 Aug 2021 16:43:54 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629823434.84.0.263061508387.issue44993@roundup.psfhosted.org> David Rebbe added the comment: I only created this issue because its a deviation from any standard that exists AFAIK. Nothing I know of starts at 1 in programming and I more than likely won't be the last one to make this mistake. If indexing in Python started at 1 or any other accessor for that matter started with 1 I could understand it but it doesn't. Its even an ongoing online joke that "arrays start at 1". Most other language enum types are not explicit in value definitions because they don't matter, they now have to matter and be explicit in python due to this deviation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 13:01:52 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Aug 2021 17:01:52 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1629824512.63.0.666314855193.issue39452@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26381 pull_request: https://github.com/python/cpython/pull/27932 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 13:01:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 24 Aug 2021 17:01:49 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1629824509.48.0.830567803146.issue39452@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7cba23164cf82f6619db002cd30021b5dfb1f809 by Jack DeVries in branch 'main': bpo-39452: Rewrite and expand __main__.rst (#26883) https://github.com/python/cpython/commit/7cba23164cf82f6619db002cd30021b5dfb1f809 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 13:11:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 24 Aug 2021 17:11:20 +0000 Subject: [issue44990] Change layout of frames back to specials-locals-stack (from locals-specials-stack) In-Reply-To: <1629800315.67.0.0305853602791.issue44990@roundup.psfhosted.org> Message-ID: <1629825080.1.0.44960958941.issue44990@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +26382 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 13:30:02 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 24 Aug 2021 17:30:02 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629826202.91.0.201919934466.issue44993@roundup.psfhosted.org> Vedran ?a?i? added the comment: Honestly, I think it's backwards. Either they _do_ matter because of some external factor (you mention network interoperability, though I'd like you to clarify... what exactly did you send over the network?), or they don't matter (if done right, you shouldn't even _notice_ that they start at 1 --- unless you test their truth value, which was the reason for the original departure from the usual practice in the first place). You mention indexing... I _hope_ you're not using IntEnums for indexing tuples (or lists). :-o In such a scenario, you're really much better off cutting the middleman and using objects with attributes directly (an interesting insight: due to the way most objects in Python are implemented, you _still_ have the middlemen integers in the process -- only they are called "hash values" and they _truly_ don't matter:). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 13:55:54 2021 From: report at bugs.python.org (David Rebbe) Date: Tue, 24 Aug 2021 17:55:54 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629827754.07.0.0119873750557.issue44993@roundup.psfhosted.org> David Rebbe added the comment: Welcome to enums, they don't matter until they do. I'm personally not a fan of enums for APIs but they exist all the time. Indexing was an example case that nothing starts at 1. See the attached file to demonstrate differences. ---------- Added file: https://bugs.python.org/file50234/enum_comparison.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 14:11:55 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 24 Aug 2021 18:11:55 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629828715.01.0.924253389691.issue44993@roundup.psfhosted.org> Vedran ?a?i? added the comment: _But why should it matter that starting value is the same_ unless you actually use IntEnums for indexing? About your code: what do you _actually_ mean by "equivalent"? I hope you don't think that the memory representation is the same. You keep mentioning APIs and networks, but never concretely... do you intend to say that you somehow serialize those values, send them over the wire and then deserialize them into another language? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 14:21:26 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 24 Aug 2021 18:21:26 +0000 Subject: [issue44991] [sqlite3] cleanup GIL handling In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1629829286.61.0.683256992202.issue44991@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +26383 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27934 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 14:22:17 2021 From: report at bugs.python.org (Brian Lee) Date: Tue, 24 Aug 2021 18:22:17 +0000 Subject: [issue44992] functools.lru_cache does not guarantee cache hits for equal values In-Reply-To: <1629812219.83.0.183087595287.issue44992@roundup.psfhosted.org> Message-ID: <1629829337.71.0.74510811072.issue44992@roundup.psfhosted.org> Brian Lee added the comment: Thanks for clarifying - I see now that the docs specifically call out the lack of guarantees here with "usually but not always regard them as equivalent". I did want to specifically explain the context of my bug; 1. NumPy's strings have some unexpected behavior because they have fixed-length strings (represented inline) and var-length strings (which are pointers to Python strings). Various arcana dictate which version you get, and wrappers like pandas.read_csv can also throw a wrench in the mix. It is quite easy for the nominal "string type" to change from under you, which is how I stumbled on this bug. 2. I was using functools.cache as a way to intern objects and short-circuit otherwise very expensive equality calculations by reducing them to pointer comparisons - hence my desire for exact cache hits when typed=False. While I agree this is Working As Documented, it does not Work As Expected in my opinion. I would expect the stdlib optimized implementation to follow the same behavior as this naive implementation, which does consider "hello world" and np.str_("hello world") to be equivalent. def cache(func): _cache = {} @functools.wraps(func) def wrapped(*args, **kwargs): cache_key = tuple(args) + tuple(kwargs.items()) if cache_key not in _cache: _cache[cache_key] = func(*args, **kwargs) return _cache[cache_key] return wrapped ---------- title: functools.lru_cache does not consider strings and numpy strings as equivalent -> functools.lru_cache does not guarantee cache hits for equal values _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 14:25:45 2021 From: report at bugs.python.org (David Rebbe) Date: Tue, 24 Aug 2021 18:25:45 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629829545.77.0.519766985509.issue44993@roundup.psfhosted.org> David Rebbe added the comment: Definition of equivalent 1: equal in force, amount, or value Are you referring to memory space as what is actually stored in RAM? If so, that seems to be outside the scope here. I don't think anyone expected an interpreted language to have the same memory space as a compiled binary from C for example. Concretely anything to do with Serialization, API (ctypes), network communication (non-serialization), etc will fail. Regardless of the reasons above, 1 is never the intended default value of anything default initialized in any language I've ever come across. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 14:31:48 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 24 Aug 2021 18:31:48 +0000 Subject: [issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...) In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1629829908.43.0.809940237436.issue44991@roundup.psfhosted.org> Erlend E. Aasland added the comment: I'd like to propose further enhancements: - use intermingled declarations in the affected functions; this will make GIL acquisition stand more out, and it also improves readability and makes it easier to trace refs - take the naming step further: I'd like to normalise PyObject * callback variable names, the extremely long function_pinboard_* names, and also drop the C callback prefixes ('_' and 'pysqlite_') If you agree, I'll create separate PR's for those; one for each refactor. I think it will enhance readability a lot. ---------- title: [sqlite3] cleanup GIL handling -> [sqlite3] cleanup callbacks (GIL handling, naming, ...) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 15:02:20 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A9r=C3=A9mie_Detrey?=) Date: Tue, 24 Aug 2021 19:02:20 +0000 Subject: [issue44864] [argparse] Do not translate user-provided strings in `ArgumentParser.add_subparsers()` In-Reply-To: <1628412158.14.0.0114857952802.issue44864@roundup.psfhosted.org> Message-ID: <1629831740.43.0.438377476818.issue44864@roundup.psfhosted.org> J?r?mie Detrey added the comment: Hi Terry, Thanks for the feedback! I've just added a blurb to the PR. Regarding the issue type, even though this is indeed translation-related, I'd lean toward a bug report rather than an enhancement request: the fact that user-provided strings get fed to the localization function by the `argparse` module is contrary to the expected behavior, and thus should qualify as a bug. However, since this is very minor, I'm totally fine with this being applied only to future versions! Thanks again! Kind regards, J?r?mie. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 15:09:12 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 24 Aug 2021 19:09:12 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629832152.58.0.790783396527.issue44993@roundup.psfhosted.org> Eric V. Smith added the comment: Other than it?s not what you expect, do you have a concrete example of what problem this is causing you? We?re unlikely to change anything without knowing what problem is being solved. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 15:08:58 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A9r=C3=A9mie_Detrey?=) Date: Tue, 24 Aug 2021 19:08:58 +0000 Subject: [issue44865] [argparse] Missing translations In-Reply-To: <1628431949.27.0.450799323412.issue44865@roundup.psfhosted.org> Message-ID: <1629832138.0.0.236987355649.issue44865@roundup.psfhosted.org> J?r?mie Detrey added the comment: Hi again! As for #44864, I've just added a short blurb to the PR. The fact that a few strings are missing calls to the localization function (whereas most of the other strings in `argparse` are already localized) might push this issue toward the bug-fix side, but, as for #44864, this is very minor and I really don't mind if it only gets merged into future releases. Thanks! Kind regards, J?r?mie. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 15:18:27 2021 From: report at bugs.python.org (David Rebbe) Date: Tue, 24 Aug 2021 19:18:27 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629832707.44.0.172342847466.issue44993@roundup.psfhosted.org> David Rebbe added the comment: Seems like there is a misunderstanding here as to why this is an issue. I can write an example up that would expand on the file I attached, but I feel like anyone that has experience in the above situations would identify this as an issue. Can I ask why Python strayed from something that is considered a standard in almost all other languages? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 15:22:38 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 24 Aug 2021 19:22:38 +0000 Subject: [issue44934] Windows installer: Append Python to PATH instead of prepending it In-Reply-To: <1629196552.09.0.837835076265.issue44934@roundup.psfhosted.org> Message-ID: <1629832958.1.0.694115972961.issue44934@roundup.psfhosted.org> Steve Dower added the comment: Removing environment variables is "known" to be unreliable - another reason I don't like modifying them from an installer. It's meant to remove the item from the list based on value, so if anything has changed then it's not a huge surprise it will fail. I'm more inclined to think that the "[~]:" prefix might be up to something. I forget exactly what it means, but if it's not all resolving to an empty string, it might concatenate fine but then mess up the removal? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 15:33:22 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 24 Aug 2021 19:33:22 +0000 Subject: [issue44864] [argparse] Do not translate user-provided strings in `ArgumentParser.add_subparsers()` In-Reply-To: <1628412158.14.0.0114857952802.issue44864@roundup.psfhosted.org> Message-ID: <1629833602.87.0.841846692083.issue44864@roundup.psfhosted.org> Terry J. Reedy added the comment: 'bug', for the tracker, mean a divergence between implementation and doc. Hence my question about the current doc. We could decide that either is wrong and should be changed. A change to meet 'expectations' and fix a 'design bug' is an enhancement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 15:47:12 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 24 Aug 2021 19:47:12 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629834432.17.0.167458597848.issue44993@roundup.psfhosted.org> Eric V. Smith added the comment: I think everyone understands, we just feel that it doesn't matter. You can see if PEP 435 answers your question. Changing to an enhancement request for 3.11, for the proposal to add a optional argument to auto(). ---------- nosy: +ethan.furman type: -> enhancement versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 16:06:06 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 24 Aug 2021 20:06:06 +0000 Subject: [issue44988] Use the newest tcl/tk support In-Reply-To: <1629775273.4.0.869869625405.issue44988@roundup.psfhosted.org> Message-ID: <1629835566.72.0.485596639669.issue44988@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the suggestion but 8.7 isn't even in beta yet, the most recent official release was 8.7a5. So it is way too early to consider moving the python.org installers to it. https://www.tcl.tk/software/tcltk/8.7.html ---------- nosy: +ned.deily resolution: -> third party stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 16:30:52 2021 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 24 Aug 2021 20:30:52 +0000 Subject: [issue39562] Asynchronous comprehensions don't work in asyncio REPL In-Reply-To: <1580923705.71.0.29233909242.issue39562@roundup.psfhosted.org> Message-ID: <1629837052.59.0.130272201547.issue39562@roundup.psfhosted.org> Anthony Sottile added the comment: this maybe shouldn't have been backported to 3.8.x as the change in compiler flags appears to break pyc files in subtle ways: https://stackoverflow.com/q/68910329/812183 ---------- nosy: +Anthony Sottile _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 16:32:18 2021 From: report at bugs.python.org (Julian Berman) Date: Tue, 24 Aug 2021 20:32:18 +0000 Subject: [issue44994] datetime's C implementation verifies fromisoformat is ASCII, but the pure python implementation does not Message-ID: <1629837138.94.0.0862501406939.issue44994@roundup.psfhosted.org> New submission from Julian Berman : This line (which contains a non-ASCII digit): python3.9 -c "import datetime; datetime.date.fromisoformat('1963-06-1?')" raises: Traceback (most recent call last): File "", line 1, in ValueError: Invalid isoformat string: '1963-06-1?' under the C implementation of the datetime module, but when the pure Python implementation is the one imported, succeeds (and produces `datetime.date(1963, 6, 14)`) The pure Python implementation should instead explicitly check and raise when encountering a non-ASCII string. (On PyPy, which always uses the pure-Python implementation, this contributes to a behavioral difference) ---------- components: Library (Lib) messages: 400235 nosy: Julian, p-ganssle priority: normal severity: normal status: open title: datetime's C implementation verifies fromisoformat is ASCII, but the pure python implementation does not type: behavior versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 16:43:44 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 24 Aug 2021 20:43:44 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629837824.32.0.00591357302214.issue44993@roundup.psfhosted.org> Ethan Furman added the comment: Firstly (or Zeroithly ;) my apologies for not noticing this earlier. In the functional API section: ------------------------------ The reason for defaulting to 1 as the starting number and not 0 is that 0 is False in a boolean sense, but enum members all evaluate to True. --- To the best of my knowledge, Python Enums are different from other languages' enums in several respects; apparently this is one of them. Having the default first value be 1 has been there since the beginning, and isn't going to change now. Rather than allowing numbers to be assigned using the function that says the assigned number doesn't matter, I would rather add `start=x` in the header, the way I have it in `aenum`: from aenum import Enum, auto class ZeroEnum(Enum, start=0): nothing = auto() something = auto() list(ZeroEnum) # [, ] class ZeroBaseEnum(Enum, start=0): pass class ZeroEnum2(ZeroBaseEnum): nothing = auto() something = auto() list(ZeroEnum2) # [, ] Whether the `0` goes in the header, or in auto (which it isn't), people will still need to read the docs to find out about it (unless somebody asks an SO question, of course). ---------- assignee: -> ethan.furman resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 16:45:30 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 24 Aug 2021 20:45:30 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629837930.53.0.0669337491034.issue44993@roundup.psfhosted.org> Ethan Furman added the comment: My apologies for my apologies -- for some reason I thought this was first posted in August of 2020. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 16:54:18 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 24 Aug 2021 20:54:18 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1629838458.6.0.829289677395.issue39452@roundup.psfhosted.org> miss-islington added the comment: New changeset ec5a03168f02ef92f98a94796bc6378fc73622e8 by Miss Islington (bot) in branch '3.10': bpo-39452: Rewrite and expand __main__.rst (GH-26883) https://github.com/python/cpython/commit/ec5a03168f02ef92f98a94796bc6378fc73622e8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 16:55:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 24 Aug 2021 20:55:28 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1629838528.26.0.607045492717.issue39452@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks a lot, G?ry and Jack! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 16:56:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 24 Aug 2021 20:56:08 +0000 Subject: [issue24632] Improve documentation about __main__.py In-Reply-To: <1436856841.67.0.538500952598.issue24632@psf.upfronthosting.co.za> Message-ID: <1629838568.48.0.491727786467.issue24632@roundup.psfhosted.org> ?ukasz Langa added the comment: Solved as part of BPO-39452. ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 16:57:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 24 Aug 2021 20:57:22 +0000 Subject: [issue17359] Mention "__main__.py" explicitly in command line docs In-Reply-To: <1362512425.64.0.937549165034.issue17359@psf.upfronthosting.co.za> Message-ID: <1629838642.59.0.860384699802.issue17359@roundup.psfhosted.org> ?ukasz Langa added the comment: Solved as part of BPO-39452. ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 17:32:14 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 24 Aug 2021 21:32:14 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629840734.92.0.933164908277.issue44993@roundup.psfhosted.org> Ethan Furman added the comment: David, what is the actual use-case that tripped you up? There are a few ways to create Enums from other systems (json files, cpp files, etc.). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 19:25:04 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 24 Aug 2021 23:25:04 +0000 Subject: [issue44986] Date formats in help messages of argparse In-Reply-To: <1629760940.67.0.392348377667.issue44986@roundup.psfhosted.org> Message-ID: <1629847504.5.0.51487196441.issue44986@roundup.psfhosted.org> Raymond Hettinger added the comment: I don't think anything like this should be done. Besides breaking existing '%%' markup, it invents a new %-formatting notation. ---------- nosy: +rhettinger type: crash -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 20:09:01 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 25 Aug 2021 00:09:01 +0000 Subject: [issue44986] Date formats in help messages of argparse In-Reply-To: <1629760940.67.0.392348377667.issue44986@roundup.psfhosted.org> Message-ID: <1629850141.94.0.414027367965.issue44986@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- Removed message: https://bugs.python.org/msg400243 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 22:16:58 2021 From: report at bugs.python.org (=?utf-8?b?5byg5bO76ZOt?=) Date: Wed, 25 Aug 2021 02:16:58 +0000 Subject: [issue44988] Use the newest tcl/tk support In-Reply-To: <1629775273.4.0.869869625405.issue44988@roundup.psfhosted.org> Message-ID: <1629857818.17.0.216853411433.issue44988@roundup.psfhosted.org> ??? <3180471716 at qq.com> added the comment: OK, I see. Thanks for your consideration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 24 22:35:15 2021 From: report at bugs.python.org (=?utf-8?b?5p2o6Z2S?=) Date: Wed, 25 Aug 2021 02:35:15 +0000 Subject: [issue44995] "Hide the prompts and output" works abnormal Message-ID: <1629858915.39.0.643058961708.issue44995@roundup.psfhosted.org> New submission from ?? : ?url?https://docs.python.org/3/tutorial/classes.html ?chapter?9.4. Random Remarks ?problem description? When I click on the demo "Hide the prompts and output" switch, the class definition statements were also hided. Please take a look as the appended screenshot. ---------- assignee: docs at python components: Documentation files: screenshot.png messages: 400245 nosy: docs at python, yangqing priority: normal severity: normal status: open title: "Hide the prompts and output" works abnormal versions: Python 3.9 Added file: https://bugs.python.org/file50235/screenshot.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 03:28:27 2021 From: report at bugs.python.org (Julian Berman) Date: Wed, 25 Aug 2021 07:28:27 +0000 Subject: [issue44995] "Hide the prompts and output" works abnormal In-Reply-To: <1629858915.39.0.643058961708.issue44995@roundup.psfhosted.org> Message-ID: <1629876507.78.0.85498946051.issue44995@roundup.psfhosted.org> Change by Julian Berman : ---------- keywords: +patch nosy: +Julian nosy_count: 2.0 -> 3.0 pull_requests: +26384 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27939 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 03:34:14 2021 From: report at bugs.python.org (Julian Berman) Date: Wed, 25 Aug 2021 07:34:14 +0000 Subject: [issue44986] Date formats in help messages of argparse In-Reply-To: <1629760940.67.0.392348377667.issue44986@roundup.psfhosted.org> Message-ID: <1629876854.11.0.837434206503.issue44986@roundup.psfhosted.org> Julian Berman added the comment: This is documented already I believe: https://docs.python.org/3/library/argparse.html#help > As the help string supports %-formatting, if you want a literal % to appear in the help string, you must escape it as %%. ---------- nosy: +Julian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 04:59:23 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 08:59:23 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1629881963.09.0.932300351032.issue42064@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26385 pull_request: https://github.com/python/cpython/pull/27940 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 05:18:40 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 25 Aug 2021 09:18:40 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629883120.09.0.417051239398.issue37596@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 05:24:41 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A9r=C3=A9mie_Detrey?=) Date: Wed, 25 Aug 2021 09:24:41 +0000 Subject: [issue44864] [argparse] Do not translate user-provided strings in `ArgumentParser.add_subparsers()` In-Reply-To: <1628412158.14.0.0114857952802.issue44864@roundup.psfhosted.org> Message-ID: <1629883481.87.0.753708120327.issue44864@roundup.psfhosted.org> J?r?mie Detrey added the comment: Hi, Thank you for the clarification! In fact, I'm afraid the localization feature of `argparse` is undocumented. (At least, I couldn't find anything about it in the documentation.) A hint that modules should only take care of their own strings can however be inferred from : ?In most coding situations, strings are translated where they are coded.? But the fact remains that the `argparse` module deals with user-provided strings in a non-consistent way: all other user-provided strings (such as the `usage`, `description`, or `epilog` parameters to `ArgumentParser`'s constructor, for instance) are not translated by `argparse` (leaving this responsibility with the caller); only the `title` and `description` parameters to `ArgumentParser.add_subparsers()` will be translated if provided. This behavior discrepancy is what prompted me to report this as a bug in the first place, but since this is an undocumented feature anyway, I'm perfectly fine with this being categorized as an enhancement instead. Kind regards, J?r?mie. ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 05:34:17 2021 From: report at bugs.python.org (Ruben Vorderman) Date: Wed, 25 Aug 2021 09:34:17 +0000 Subject: [issue43613] gzip.compress and gzip.decompress are sub-optimally implemented. In-Reply-To: <1616567239.03.0.950381696666.issue43613@roundup.psfhosted.org> Message-ID: <1629884057.73.0.753735180772.issue43613@roundup.psfhosted.org> Change by Ruben Vorderman : ---------- keywords: +patch pull_requests: +26386 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27941 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 05:34:17 2021 From: report at bugs.python.org (Ruben Vorderman) Date: Wed, 25 Aug 2021 09:34:17 +0000 Subject: [issue43612] zlib.compress should have a wbits argument In-Reply-To: <1616565860.52.0.251244097489.issue43612@roundup.psfhosted.org> Message-ID: <1629884057.82.0.346858570613.issue43612@roundup.psfhosted.org> Change by Ruben Vorderman : ---------- pull_requests: +26387 pull_request: https://github.com/python/cpython/pull/27941 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 05:55:33 2021 From: report at bugs.python.org (Nils) Date: Wed, 25 Aug 2021 09:55:33 +0000 Subject: [issue44996] tarfile missing TarInfo.offset_data member in documentation Message-ID: <1629885333.99.0.21899352511.issue44996@roundup.psfhosted.org> New submission from Nils : The title says it all: `TarInfo` objects are missing their `offset_data` member in all documentation versions. ---------- assignee: docs at python components: Documentation messages: 400248 nosy: docs at python, nilsnolde priority: normal severity: normal status: open title: tarfile missing TarInfo.offset_data member in documentation versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 06:03:29 2021 From: report at bugs.python.org (=?utf-8?b?6YOR5LmL5Li6?=) Date: Wed, 25 Aug 2021 10:03:29 +0000 Subject: [issue44997] _sqlite3 extention failed to build Message-ID: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> New submission from ??? : building '_sqlite3' extension creating build/temp.macosx-11.5-universal2-3.11/Users/jett/cpython/Modules/_sqlite gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -fno-semantic-interposition -flto -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-instr-generate -I./Include/internal -IModules/_sqlite -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I./Include -I. -I/usr/local/include -I/Users/jett/cpython/Include -I/Users/jett/cpython -c /Users/jett/cpython/Modules/_sqlite/connection.c -o build/temp.macosx-11.5-universal2-3.11/Users/jett/cpython/Modules/_sqlite/connection.o /Users/jett/cpython/Modules/_sqlite/connection.c:1179:10: error: implicit declaration of function 'sqlite3_enable_load_extension' is invalid in C99 [-Werror,-Wimplicit-function-declaration] rc = sqlite3_enable_load_extension(self->db, onoff); ^ /Users/jett/cpython/Modules/_sqlite/connection.c:1215:10: error: implicit declaration of function 'sqlite3_load_extension' is invalid in C99 [-Werror,-Wimplicit-function-declaration] rc = sqlite3_load_extension(self->db, extension_name, 0, &errmsg); ^ /Users/jett/cpython/Modules/_sqlite/connection.c:1215:10: note: did you mean 'sqlite3_auto_extension'? /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sqlite3.h:6551:16: note: 'sqlite3_auto_extension' declared here SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void)); ^ 2 errors generated. This is the error message from clang on macOS 11.5.1 configure options: ./configure --prefix=/Users/jett/python311 --enable-optimizations --enable-loadable-sqlite-extensions --enable-ipv6 --enable-big-digits=30 --with-lto=full --with-experimental-isolated-subinterpreters --with-static-libpython --enable-universalsdk --with-universal-archs=universal2 ---------- components: Build messages: 400249 nosy: jett8998 priority: normal severity: normal status: open title: _sqlite3 extention failed to build type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 06:09:33 2021 From: report at bugs.python.org (=?utf-8?b?6YOR5LmL5Li6?=) Date: Wed, 25 Aug 2021 10:09:33 +0000 Subject: [issue44998] tests failed Message-ID: <1629886173.59.0.970748469767.issue44998@roundup.psfhosted.org> New submission from ??? : running build_scripts creating build/scripts-3.11 copying and adjusting /Users/jett/cpython/Tools/scripts/pydoc3 -> build/scripts-3.11 copying and adjusting /Users/jett/cpython/Tools/scripts/idle3 -> build/scripts-3.11 copying and adjusting /Users/jett/cpython/Tools/scripts/2to3 -> build/scripts-3.11 changing mode of build/scripts-3.11/pydoc3 from 644 to 755 changing mode of build/scripts-3.11/idle3 from 644 to 755 changing mode of build/scripts-3.11/2to3 from 644 to 755 renaming build/scripts-3.11/pydoc3 to build/scripts-3.11/pydoc3.11 renaming build/scripts-3.11/idle3 to build/scripts-3.11/idle3.11 renaming build/scripts-3.11/2to3 to build/scripts-3.11/2to3-3.11 touch profile-gen-stamp # Next, run the profile task to generate the profile information. /Library/Developer/CommandLineTools/usr/bin/make run_profile_task LLVM_PROFILE_FILE="code-%p.profclangr" ./python.exe -m test --pgo --timeout=1200 || true 0:00:00 load avg: 5.31 Run tests sequentially (timeout: 20 min) 0:00:00 load avg: 5.31 [ 1/44] test_array 0:00:00 load avg: 5.31 [ 2/44] test_base64 0:00:00 load avg: 5.31 [ 3/44] test_binascii -- test_base64 failed (env changed) 0:00:00 load avg: 5.31 [ 4/44] test_binop 0:00:00 load avg: 5.31 [ 5/44] test_bisect 0:00:00 load avg: 5.31 [ 6/44] test_bytes 0:00:02 load avg: 5.31 [ 7/44] test_bz2 -- test_bytes failed (env changed) 0:00:02 load avg: 5.31 [ 8/44] test_cmath 0:00:02 load avg: 5.31 [ 9/44] test_codecs 0:00:03 load avg: 5.31 [10/44] test_collections 0:00:03 load avg: 5.31 [11/44] test_complex 0:00:04 load avg: 5.31 [12/44] test_dataclasses 0:00:04 load avg: 5.31 [13/44] test_datetime 0:00:07 load avg: 4.97 [14/44] test_decimal -------------------------------------------------------------------------------------------------- NOTICE -------------------------------------------------------------------------------------------------- test_decimal may generate "malloc can't allocate region" warnings on macOS systems. This behavior is known. Do not report a bug unless tests are also failing. See bpo-40928. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ python.exe(34042,0x100a27d40) malloc: can't allocate region :*** mach_vm_map(size=842105263157903360, flags: 100) failed (error code=3) python.exe(34042,0x100a27d40) malloc: *** set a breakpoint in malloc_error_break to debug python.exe(34042,0x100a27d40) malloc: can't allocate region :*** mach_vm_map(size=842105263157903360, flags: 100) failed (error code=3) python.exe(34042,0x100a27d40) malloc: *** set a breakpoint in malloc_error_break to debug python.exe(34042,0x100a27d40) malloc: can't allocate region :*** mach_vm_map(size=421052631578951680, flags: 100) failed (error code=3) python.exe(34042,0x100a27d40) malloc: *** set a breakpoint in malloc_error_break to debug python.exe(34042,0x100a27d40) malloc: can't allocate region :*** mach_vm_map(size=421052631578951680, flags: 100) failed (error code=3) python.exe(34042,0x100a27d40) malloc: *** set a breakpoint in malloc_error_break to debug 0:00:09 load avg: 4.73 [15/44] test_difflib 0:00:10 load avg: 4.73 [16/44] test_embed test test_embed failed 0:00:12 load avg: 4.73 [17/44] test_float -- test_embed failed (33 failures) 0:00:12 load avg: 4.73 [18/44] test_fstring 0:00:13 load avg: 4.73 [19/44] test_functools 0:00:13 load avg: 4.73 [20/44] test_generators 0:00:13 load avg: 4.73 [21/44] test_hashlib 0:00:13 load avg: 4.73 [22/44] test_heapq 0:00:14 load avg: 4.73 [23/44] test_int 0:00:14 load avg: 4.59 [24/44] test_itertools 0:00:16 load avg: 4.59 [25/44] test_json 0:00:17 load avg: 4.59 [26/44] test_long -- test_json failed (env changed) 0:00:19 load avg: 4.59 [27/44] test_lzma 0:00:19 load avg: 4.59 [28/44] test_math -- test_lzma skipped 0:00:20 load avg: 4.30 [29/44] test_memoryview 0:00:21 load avg: 4.30 [30/44] test_operator 0:00:21 load avg: 4.30 [31/44] test_ordered_dict 0:00:21 load avg: 4.30 [32/44] test_patma 0:00:22 load avg: 4.30 [33/44] test_pickle 0:00:24 load avg: 4.04 [34/44] test_pprint 0:00:24 load avg: 4.04 [35/44] test_re 0:00:25 load avg: 4.04 [36/44] test_set 0:00:26 load avg: 4.04 [37/44] test_sqlite 0:00:26 load avg: 4.04 [38/44] test_statistics -- test_sqlite skipped 0:00:27 load avg: 4.04 [39/44] test_struct 0:00:28 load avg: 4.04 [40/44] test_tabnanny -- test_struct failed (env changed) 0:00:28 load avg: 4.04 [41/44] test_time -- test_tabnanny failed (env changed) 0:00:30 load avg: 3.88 [42/44] test_unicode 0:00:31 load avg: 3.88 [43/44] test_xml_etree -- test_unicode failed (env changed) 0:00:31 load avg: 3.88 [44/44] test_xml_etree_c Total duration: 32.5 sec Tests result: FAILURE /Library/Developer/CommandLineTools/usr/bin/make build_all_merge_profile /usr/local/bin/llvm-profdata merge -output=code.profclangd *.profclangr warning: code-34042.profclangr: unsupported instrumentation profile format version warning: code-34080.profclangr: unsupported instrumentation profile format version warning: code-34092.profclangr: unsupported instrumentation profile format version warning: code-34100.profclangr: unsupported instrumentation profile format version warning: code-34109.profclangr: unsupported instrumentation profile format version warning: code-34120.profclangr: unsupported instrumentation profile format version warning: code-34128.profclangr: unsupported instrumentation profile format version warning: code-34076.profclangr: unsupported instrumentation profile format version warning: code-34084.profclangr: unsupported instrumentation profile format version warning: code-34096.profclangr: unsupported instrumentation profile format version warning: code-34104.profclangr: unsupported instrumentation profile format version warning: code-34114.profclangr: unsupported instrumentation profile format version warning: code-34124.profclangr: unsupported instrumentation profile format version warning: code-34074.profclangr: unsupported instrumentation profile format version warning: code-34082.profclangr: unsupported instrumentation profile format version warning: code-34094.profclangr: unsupported instrumentation profile format version warning: code-34102.profclangr: unsupported instrumentation profile format version warning: code-34112.profclangr: unsupported instrumentation profile format version warning: code-34122.profclangr: unsupported instrumentation profile format version warning: code-34078.profclangr: unsupported instrumentation profile format version warning: code-34087.profclangr: unsupported instrumentation profile format version warning: code-34098.profclangr: unsupported instrumentation profile format version warning: code-34106.profclangr: unsupported instrumentation profile format version warning: code-34116.profclangr: unsupported instrumentation profile format version warning: code-34126.profclangr: unsupported instrumentation profile format version warning: code-34073.profclangr: unsupported instrumentation profile format version warning: code-34081.profclangr: unsupported instrumentation profile format version warning: code-34093.profclangr: unsupported instrumentation profile format version warning: code-34101.profclangr: unsupported instrumentation profile format version warning: code-34110.profclangr: unsupported instrumentation profile format version warning: code-34121.profclangr: unsupported instrumentation profile format version warning: code-34077.profclangr: unsupported instrumentation profile format version warning: code-34085.profclangr: unsupported instrumentation profile format version warning: code-34097.profclangr: unsupported instrumentation profile format version warning: code-34105.profclangr: unsupported instrumentation profile format version warning: code-34125.profclangr: unsupported instrumentation profile format version warning: code-34115.profclangr: unsupported instrumentation profile format version warning: code-34075.profclangr: unsupported instrumentation profile format version warning: code-34083.profclangr: unsupported instrumentation profile format version warning: code-34095.profclangr: unsupported instrumentation profile format version warning: code-34103.profclangr: unsupported instrumentation profile format version warning: code-34113.profclangr: unsupported instrumentation profile format version warning: code-34123.profclangr: unsupported instrumentation profile format version warning: code-34079.profclangr: unsupported instrumentation profile format version warning: code-34088.profclangr: unsupported instrumentation profile format version warning: code-34099.profclangr: unsupported instrumentation profile format version warning: code-34107.profclangr: unsupported instrumentation profile format version warning: code-34117.profclangr: unsupported instrumentation profile format version warning: code-34127.profclangr: unsupported instrumentation profile format version error: no profile can be merged make[1]: *** [build_all_merge_profile] Error 1 make: *** [profile-run-stamp] Error 2 this is the whole log, configure options: ./configure --prefix=/Users/jett/python311 --enable-optimizations --enable-loadable-sqlite-extensions --enable-ipv6 --enable-big-digits=30 --with-lto=full --with-experimental-isolated-subinterpreters --with-static-libpython --enable-universalsdk --with-universal-archs=universal2 ---------- components: Build messages: 400250 nosy: jett8998 priority: normal severity: normal status: open title: tests failed type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 06:14:59 2021 From: report at bugs.python.org (santhosh) Date: Wed, 25 Aug 2021 10:14:59 +0000 Subject: [issue44999] Argparse missing translates Message-ID: <1629886499.18.0.598632982374.issue44999@roundup.psfhosted.org> New submission from santhosh : Dear all, There are a few strings in the `argparse` module which are not translatable through the `gettext` API. Some have already been reported: - the "--version" help text at Lib/argparse.py:1105 (reported in issue 16786, fixed by PR 12711); - the "default" help text at Lib/argparse.py:697 (reported in 33775, fixed by PR 12711). However, some others remain: - the "default" help text for `BooleanOptionalAction` at Lib/argparse.py:878 (which, incidentally, will be duplicated when used with `ArgumentDefaultsHelpFormatter`); - the "argument %(argument_name)s: %(message)s" error message at Lib/argparse.py:751; - the formatted section heading at Lib/argparse.py:225: if the heading itself is translatable, the string "%(heading)s:" is not. More precisely, the colon right after the heading might also require localization, as some languages (e.g., French) typeset colons with a preceding non-breaking space (i.e., "%(heading)s :"). (Okay, I'll admit that this is nitpicking!) I'll submit a pull request with proposed fixes for these strings. Kind regards, Santhosh ---------- components: Parser messages: 400251 nosy: lys.nikolaou, pablogsal, santhu_reddy12 priority: normal severity: normal status: open title: Argparse missing translates type: performance versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 06:28:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 10:28:55 +0000 Subject: [issue44976] [sqlite3] lazy creation of result rows In-Reply-To: <1629623190.98.0.383271331638.issue44976@roundup.psfhosted.org> Message-ID: <1629887335.93.0.27740697982.issue44976@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3df0fc89bc2714f5ef03e36a926bc795dcd5e05a by Erlend Egeberg Aasland in branch 'main': bpo-44976: Lazy creation of sqlite3 result rows (GH-27884) https://github.com/python/cpython/commit/3df0fc89bc2714f5ef03e36a926bc795dcd5e05a ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 06:29:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 10:29:18 +0000 Subject: [issue44976] [sqlite3] lazy creation of result rows In-Reply-To: <1629623190.98.0.383271331638.issue44976@roundup.psfhosted.org> Message-ID: <1629887358.62.0.537173187055.issue44976@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 Wed Aug 25 06:45:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 10:45:57 +0000 Subject: [issue44999] Argparse missing translates In-Reply-To: <1629886499.18.0.598632982374.issue44999@roundup.psfhosted.org> Message-ID: <1629888357.51.0.608774571636.issue44999@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 06:45:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 10:45:54 +0000 Subject: [issue44999] Argparse missing translates In-Reply-To: <1629886499.18.0.598632982374.issue44999@roundup.psfhosted.org> Message-ID: <1629888354.85.0.35568224034.issue44999@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- components: -Parser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 06:59:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 10:59:46 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1629889186.29.0.748856125286.issue27334@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7ecd3425d45a37efbc745788dfe21df0286c785a by Erlend Egeberg Aasland in branch 'main': bpo-27334: roll back transaction if sqlite3 context manager fails to commit (GH-26202) https://github.com/python/cpython/commit/7ecd3425d45a37efbc745788dfe21df0286c785a ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 07:14:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 25 Aug 2021 11:14:38 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629890078.45.0.0955864024003.issue37596@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 33d95c6facdfda3c8c0feffa7a99184e4abc2f63 by Brandt Bucher in branch 'main': bpo-37596: Make `set` and `frozenset` marshalling deterministic (GH-27926) https://github.com/python/cpython/commit/33d95c6facdfda3c8c0feffa7a99184e4abc2f63 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 07:20:36 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 25 Aug 2021 11:20:36 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629890436.59.0.898767738339.issue37596@roundup.psfhosted.org> ?ukasz Langa added the comment: This is a bona fide enhancement and thus out of scope for backports. Since this is merged for 3.11, I'm closing the issue. Thanks, everyone, this was some non-trivial design and implementation effort! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 07:36:12 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 11:36:12 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1629891372.83.0.189962018858.issue27334@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26388 pull_request: https://github.com/python/cpython/pull/27942 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 07:43:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 11:43:59 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1629891839.55.0.754519295008.issue27334@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26389 pull_request: https://github.com/python/cpython/pull/27943 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 07:50:39 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 25 Aug 2021 11:50:39 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError Message-ID: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> New submission from Andre Roberge : Consider the following: Python 3.10.0rc1 ... >>> __debug__ True >>> del __debug__ Traceback (most recent call last): File "", line 1, in NameError: name '__debug__' is not defined >>> __debug__ True >>> __debug__ = False File "", line 1 SyntaxError: cannot assign to __debug__ I suggest that attempting to delete __debug__ should be a SyntaxError, similar to attempting to delete None and other constants. >>> del None File "", line 1 del None ^^^^ SyntaxError: cannot delete None = = = The same NameError exception is raised for Python 3.9 when attempting to delete __debug__. For Python 3.8, attempting to delete __debug__ silently fails, so the current behaviour is at least an improvement. ---------- components: Parser messages: 400256 nosy: aroberge, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: del __debug__ should be a SyntaxError type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 08:10:34 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 12:10:34 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1629893434.61.0.153086333524.issue27334@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26390 pull_request: https://github.com/python/cpython/pull/27944 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 08:27:30 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 12:27:30 +0000 Subject: [issue44997] _sqlite3 extention failed to build In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1629894450.44.0.555978039277.issue44997@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 08:28:02 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 12:28:02 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1629894482.55.0.440004229338.issue44997@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- title: _sqlite3 extention failed to build -> [sqlite3] build fails on macOS 11.5.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 08:32:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 12:32:33 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1629894753.92.0.319629214367.issue44997@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 08:32:24 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 12:32:24 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1629894744.24.0.578538190094.issue44997@roundup.psfhosted.org> Erlend E. Aasland added the comment: IIRC, macOS deprecated this functionality some releases ago. Seems like they've now removed it completely. I guess we could wrap this functionality with some preprocessor conditionals, and/or adjust the configure script to not accept --enable-loadable-sqlite-extensions for macOS 11.5.1 (11.5.x?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 08:44:28 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 25 Aug 2021 12:44:28 +0000 Subject: [issue44990] Change layout of frames back to specials-locals-stack (from locals-specials-stack) In-Reply-To: <1629800315.67.0.0305853602791.issue44990@roundup.psfhosted.org> Message-ID: <1629895468.16.0.920328930206.issue44990@roundup.psfhosted.org> Mark Shannon added the comment: New changeset f9242d50b18572ef0d584a1c815ed08d1a38e4f4 by Mark Shannon in branch 'main': bpo-44990: Change layout of evaluation frames. "Layout B" (GH-27933) https://github.com/python/cpython/commit/f9242d50b18572ef0d584a1c815ed08d1a38e4f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 08:58:56 2021 From: report at bugs.python.org (Julien Palard) Date: Wed, 25 Aug 2021 12:58:56 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1629896336.61.0.324672412107.issue42238@roundup.psfhosted.org> Change by Julien Palard : ---------- pull_requests: +26391 pull_request: https://github.com/python/cpython/pull/27945 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 09:03:47 2021 From: report at bugs.python.org (Julien Palard) Date: Wed, 25 Aug 2021 13:03:47 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1629896627.2.0.784651409821.issue42238@roundup.psfhosted.org> Julien Palard added the comment: 10 false positives today, see: https://github.com/python/cpython/pull/27945/files I think I now need to put a deadline on this issue, let's say: one year without true positives and I drop it, so 2021-07-19 for now. (In the meantime, I continue to convert each true positives to rstlint, I converted 3 of them so far.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 09:12:02 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 25 Aug 2021 13:12:02 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629897122.92.0.352993571902.issue37596@roundup.psfhosted.org> Raymond Hettinger added the comment: Should the error paths decref the key and return NULL as they do elsewhere in the function? ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 09:20:19 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 25 Aug 2021 13:20:19 +0000 Subject: [issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array In-Reply-To: <1578202492.29.0.981939629191.issue39218@roundup.psfhosted.org> Message-ID: <1629897619.87.0.89038086465.issue39218@roundup.psfhosted.org> Change by Tal Einat : ---------- nosy: -taleinat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 09:23:27 2021 From: report at bugs.python.org (wouter bolsterlee) Date: Wed, 25 Aug 2021 13:23:27 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs Message-ID: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> New submission from wouter bolsterlee : Various date parsing utilities in the email module, such as email.utils.parsedate(), are supposed to gracefully handle invalid input, typically by raising an appropriate exception or by returning None. The internal email._parseaddr._parsedate_tz() helper used by some of these date parsing routines tries to be robust against malformed input, but unfortunately it can still crash ungracefully when a non-empty but whitespace-only input is passed. This manifests as an unexpected IndexError. In practice, this can happen when parsing an email with only a newline inside a ?Date:? header, which unfortunately happens occasionally in the real world. Here's a minimal example: $ python Python 3.9.6 (default, Jun 30 2021, 10:22:16) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import email.utils >>> email.utils.parsedate('foo') >>> email.utils.parsedate(' ') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/email/_parseaddr.py", line 176, in parsedate t = parsedate_tz(data) File "/usr/lib/python3.9/email/_parseaddr.py", line 50, in parsedate_tz res = _parsedate_tz(data) File "/usr/lib/python3.9/email/_parseaddr.py", line 72, in _parsedate_tz if data[0].endswith(',') or data[0].lower() in _daynames: IndexError: list index out of range The fix is rather straight-forward; will open a pull request shortly. ---------- components: email messages: 400261 nosy: barry, r.david.murray, wbolster priority: normal severity: normal status: open title: Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs type: crash versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 09:27:33 2021 From: report at bugs.python.org (wouter bolsterlee) Date: Wed, 25 Aug 2021 13:27:33 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629898053.14.0.732017368015.issue45001@roundup.psfhosted.org> wouter bolsterlee added the comment: pull request with fix at https://github.com/python/cpython/pull/27946 ---------- keywords: +patch message_count: 1.0 -> 2.0 pull_requests: +26392 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27946 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 09:28:47 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 25 Aug 2021 13:28:47 +0000 Subject: [issue44946] Integer operations are inefficient for "medium" integers. In-Reply-To: <1629282332.14.0.448234766884.issue44946@roundup.psfhosted.org> Message-ID: <1629898127.39.0.092556157752.issue44946@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 15d50d7ed8afd3ab26b00210b5b4feaaadd5af51 by Mark Shannon in branch 'main': bpo-44946: Streamline operators and creation of ints for common case of single 'digit'. (GH-27832) https://github.com/python/cpython/commit/15d50d7ed8afd3ab26b00210b5b4feaaadd5af51 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 09:37:33 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 25 Aug 2021 13:37:33 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629898653.46.0.336101541207.issue37596@roundup.psfhosted.org> Brandt Bucher added the comment: Hm, not quite sure what you mean. Are you talking about just replacing each of the new gotos with ?Py_DECREF(pairs); return;?? Error handling for this whole module is a bit unconventional. Some of the error paths in this function decrement the recursion depth counter, but I *think* that?s actually incorrect here? it looks like it?s our caller?s (w_object) responsibility to do that, error or no error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 09:40:31 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 25 Aug 2021 13:40:31 +0000 Subject: [issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...) In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1629898831.4.0.457507112786.issue44991@roundup.psfhosted.org> Petr Viktorin added the comment: The general policy is to only improve style for code you touch for some other reasons. You're changing lots of the callback code in bpo-42064, so I reckon making things more readable is fine. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 09:58:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 25 Aug 2021 13:58:01 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1629899881.53.0.973260432376.issue27334@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a3c11cebf174e0c822eda8c545f7548269ce7a25 by Erlend Egeberg Aasland in branch 'main': bpo-27334: Fix reference leak introduced by GH-26202 (GH-27942) https://github.com/python/cpython/commit/a3c11cebf174e0c822eda8c545f7548269ce7a25 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 10:02:25 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 25 Aug 2021 14:02:25 +0000 Subject: [issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...) In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1629900145.22.0.446010496664.issue44991@roundup.psfhosted.org> Dong-hee Na added the comment: Obviously, this case could be code churn(we don't accept normally), but if other core-dev agree with the changes. I am fine. ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 10:03:21 2021 From: report at bugs.python.org (=?utf-8?b?6YOR5LmL5Li6?=) Date: Wed, 25 Aug 2021 14:03:21 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1629900201.26.0.584968465764.issue44997@roundup.psfhosted.org> ??? added the comment: Python build finished successfully! The necessary bits to build these optional modules were not found: _gdbm ossaudiodev spwd To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc pwd time running build_scripts creating build/scripts-3.11 copying and adjusting /Users/jett/cpython/Tools/scripts/pydoc3 -> build/scripts-3.11 copying and adjusting /Users/jett/cpython/Tools/scripts/idle3 -> build/scripts-3.11 copying and adjusting /Users/jett/cpython/Tools/scripts/2to3 -> build/scripts-3.11 changing mode of build/scripts-3.11/pydoc3 from 644 to 755 changing mode of build/scripts-3.11/idle3 from 644 to 755 changing mode of build/scripts-3.11/2to3 from 644 to 755 renaming build/scripts-3.11/pydoc3 to build/scripts-3.11/pydoc3.11 renaming build/scripts-3.11/idle3 to build/scripts-3.11/idle3.11 renaming build/scripts-3.11/2to3 to build/scripts-3.11/2to3-3.11 touch profile-gen-stamp # Next, run the profile task to generate the profile information. /Library/Developer/CommandLineTools/usr/bin/make run_profile_task LLVM_PROFILE_FILE="code-%p.profclangr" ./python.exe -m test --pgo --timeout=1200 || true 0:00:00 load avg: 7.14 Run tests sequentially (timeout: 20 min) 0:00:00 load avg: 7.14 [ 1/44] test_array 0:00:00 load avg: 7.14 [ 2/44] test_base64 0:00:00 load avg: 7.14 [ 3/44] test_binascii -- test_base64 failed (env changed) 0:00:00 load avg: 7.14 [ 4/44] test_binop 0:00:00 load avg: 7.14 [ 5/44] test_bisect 0:00:00 load avg: 7.14 [ 6/44] test_bytes 0:00:02 load avg: 6.73 [ 7/44] test_bz2 -- test_bytes failed (env changed) 0:00:02 load avg: 6.73 [ 8/44] test_cmath 0:00:02 load avg: 6.73 [ 9/44] test_codecs 0:00:03 load avg: 6.73 [10/44] test_collections 0:00:03 load avg: 6.73 [11/44] test_complex 0:00:04 load avg: 6.73 [12/44] test_dataclasses 0:00:04 load avg: 6.73 [13/44] test_datetime 0:00:07 load avg: 6.27 [14/44] test_decimal -------------------------------------------------------------------------------------------------- NOTICE -------------------------------------------------------------------------------------------------- test_decimal may generate "malloc can't allocate region" warnings on macOS systems. This behavior is known. Do not report a bug unless tests are also failing. See bpo-40928. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ python.exe(70362,0x102aafd40) malloc: can't allocate region :*** mach_vm_map(size=842105263157903360, flags: 100) failed (error code=3) python.exe(70362,0x102aafd40) malloc: *** set a breakpoint in malloc_error_break to debug python.exe(70362,0x102aafd40) malloc: can't allocate region :*** mach_vm_map(size=842105263157903360, flags: 100) failed (error code=3) python.exe(70362,0x102aafd40) malloc: *** set a breakpoint in malloc_error_break to debug python.exe(70362,0x102aafd40) malloc: can't allocate region :*** mach_vm_map(size=421052631578951680, flags: 100) failed (error code=3) python.exe(70362,0x102aafd40) malloc: *** set a breakpoint in malloc_error_break to debug python.exe(70362,0x102aafd40) malloc: can't allocate region :*** mach_vm_map(size=421052631578951680, flags: 100) failed (error code=3) python.exe(70362,0x102aafd40) malloc: *** set a breakpoint in malloc_error_break to debug 0:00:09 load avg: 6.27 [15/44] test_difflib 0:00:10 load avg: 6.27 [16/44] test_embed test test_embed failed 0:00:12 load avg: 5.85 [17/44] test_float -- test_embed failed (33 failures) 0:00:12 load avg: 5.85 [18/44] test_fstring 0:00:13 load avg: 5.85 [19/44] test_functools 0:00:13 load avg: 5.85 [20/44] test_generators 0:00:13 load avg: 5.85 [21/44] test_hashlib 0:00:14 load avg: 5.85 [22/44] test_heapq 0:00:14 load avg: 5.85 [23/44] test_int 0:00:14 load avg: 5.85 [24/44] test_itertools 0:00:16 load avg: 5.85 [25/44] test_json 0:00:17 load avg: 5.54 [26/44] test_long -- test_json failed (env changed) 0:00:19 load avg: 5.54 [27/44] test_lzma 0:00:19 load avg: 5.54 [28/44] test_math 0:00:21 load avg: 5.73 [29/44] test_memoryview 0:00:21 load avg: 5.73 [30/44] test_operator 0:00:22 load avg: 5.73 [31/44] test_ordered_dict 0:00:22 load avg: 5.73 [32/44] test_patma 0:00:22 load avg: 5.73 [33/44] test_pickle 0:00:25 load avg: 5.73 [34/44] test_pprint 0:00:25 load avg: 5.73 [35/44] test_re 0:00:26 load avg: 5.35 [36/44] test_set 0:00:27 load avg: 5.35 [37/44] test_sqlite Fatal Python error: drop_gil: drop_gil: GIL is not locked Python runtime state: initialized Current thread 0x0000000102aafd40 (most recent call first): File "/Users/jett/cpython/Lib/sqlite3/test/userfunctions.py", line 524 in test_aggr_exception_in_finalize File "/Users/jett/cpython/Lib/sqlite3/test/userfunctions.py", line 46 in wrapper File "/Users/jett/cpython/Lib/unittest/case.py", line 549 in _callTestMethod File "/Users/jett/cpython/Lib/unittest/case.py", line 593 in run File "/Users/jett/cpython/Lib/unittest/case.py", line 652 in __call__ File "/Users/jett/cpython/Lib/unittest/suite.py", line 122 in run File "/Users/jett/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/Users/jett/cpython/Lib/unittest/suite.py", line 122 in run File "/Users/jett/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/Users/jett/cpython/Lib/unittest/suite.py", line 122 in run File "/Users/jett/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/Users/jett/cpython/Lib/unittest/suite.py", line 122 in run File "/Users/jett/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/Users/jett/cpython/Lib/test/support/testresult.py", line 169 in run File "/Users/jett/cpython/Lib/test/support/__init__.py", line 998 in _run_suite File "/Users/jett/cpython/Lib/test/support/__init__.py", line 1123 in run_unittest File "/Users/jett/cpython/Lib/test/libregrtest/runtest.py", line 261 in _test_module File "/Users/jett/cpython/Lib/test/libregrtest/runtest.py", line 297 in _runtest_inner2 File "/Users/jett/cpython/Lib/test/libregrtest/runtest.py", line 335 in _runtest_inner File "/Users/jett/cpython/Lib/test/libregrtest/runtest.py", line 215 in _runtest File "/Users/jett/cpython/Lib/test/libregrtest/runtest.py", line 245 in runtest File "/Users/jett/cpython/Lib/test/libregrtest/main.py", line 437 in run_tests_sequential File "/Users/jett/cpython/Lib/test/libregrtest/main.py", line 535 in run_tests File "/Users/jett/cpython/Lib/test/libregrtest/main.py", line 708 in _main File "/Users/jett/cpython/Lib/test/libregrtest/main.py", line 655 in main File "/Users/jett/cpython/Lib/test/libregrtest/main.py", line 733 in main File "/Users/jett/cpython/Lib/test/__main__.py", line 2 in File "/Users/jett/cpython/Lib/runpy.py", line 86 in _run_code File "/Users/jett/cpython/Lib/runpy.py", line 196 in _run_module_as_main Extension modules: _testcapi, _testinternalcapi, _scproxy, _testbuffer (total: 4) /bin/sh: line 1: 70362 Abort trap: 6 LLVM_PROFILE_FILE="code-%p.profclangr" ./python.exe -m test --pgo --timeout=1200 /Library/Developer/CommandLineTools/usr/bin/make build_all_merge_profile /usr/local/bin/llvm-profdata merge -output=code.profclangd *.profclangr warning: code-70398.profclangr: unsupported instrumentation profile format version warning: code-70410.profclangr: unsupported instrumentation profile format version warning: code-70418.profclangr: unsupported instrumentation profile format version warning: code-70427.profclangr: unsupported instrumentation profile format version warning: code-70438.profclangr: unsupported instrumentation profile format version warning: code-70446.profclangr: unsupported instrumentation profile format version warning: code-70394.profclangr: unsupported instrumentation profile format version warning: code-70402.profclangr: unsupported instrumentation profile format version warning: code-70414.profclangr: unsupported instrumentation profile format version warning: code-70432.profclangr: unsupported instrumentation profile format version warning: code-70422.profclangr: unsupported instrumentation profile format version warning: code-70442.profclangr: unsupported instrumentation profile format version warning: code-70392.profclangr: unsupported instrumentation profile format version warning: code-70400.profclangr: unsupported instrumentation profile format version warning: code-70412.profclangr: unsupported instrumentation profile format version warning: code-70420.profclangr: unsupported instrumentation profile format version warning: code-70430.profclangr: unsupported instrumentation profile format version warning: code-70440.profclangr: unsupported instrumentation profile format version warning: code-70396.profclangr: unsupported instrumentation profile format version warning: code-70405.profclangr: unsupported instrumentation profile format version warning: code-70416.profclangr: unsupported instrumentation profile format version warning: code-70424.profclangr: unsupported instrumentation profile format version warning: code-70434.profclangr: unsupported instrumentation profile format version warning: code-70444.profclangr: unsupported instrumentation profile format version warning: code-70391.profclangr: unsupported instrumentation profile format version warning: code-70399.profclangr: unsupported instrumentation profile format version warning: code-70419.profclangr: unsupported instrumentation profile format version warning: code-70428.profclangr: unsupported instrumentation profile format version warning: code-70411.profclangr: unsupported instrumentation profile format version warning: code-70439.profclangr: unsupported instrumentation profile format version warning: code-70395.profclangr: unsupported instrumentation profile format version warning: code-70403.profclangr: unsupported instrumentation profile format version warning: code-70415.profclangr: unsupported instrumentation profile format version warning: code-70423.profclangr: unsupported instrumentation profile format version warning: code-70433.profclangr: unsupported instrumentation profile format version warning: code-70443.profclangr: unsupported instrumentation profile format version warning: code-70393.profclangr: unsupported instrumentation profile format version warning: code-70401.profclangr: unsupported instrumentation profile format version warning: code-70413.profclangr: unsupported instrumentation profile format version warning: code-70421.profclangr: unsupported instrumentation profile format version warning: code-70431.profclangr: unsupported instrumentation profile format version warning: code-70441.profclangr: unsupported instrumentation profile format version warning: code-70397.profclangr: unsupported instrumentation profile format version warning: code-70406.profclangr: unsupported instrumentation profile format version warning: code-70417.profclangr: unsupported instrumentation profile format version warning: code-70425.profclangr: unsupported instrumentation profile format version warning: code-70435.profclangr: unsupported instrumentation profile format version warning: code-70445.profclangr: unsupported instrumentation profile format version error: no profile can be merged make[1]: *** [build_all_merge_profile] Error 1 make: *** [profile-run-stamp] Error 2 build succeeded, tests are still failing without that arg. see #44998 I set fixed for this since this one issue is done, but #44998 is still a prob. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 10:06:47 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 14:06:47 +0000 Subject: [issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...) In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1629900407.79.0.222600739348.issue44991@roundup.psfhosted.org> Erlend E. Aasland added the comment: We'll do the changes Petr proposed first, and then I'll see how invasive the other changes will be. If the diffs end up being concise, I'll put them up for review :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 10:12:36 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 25 Aug 2021 14:12:36 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629900756.03.0.223333182044.issue45000@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 10:14:29 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 25 Aug 2021 14:14:29 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1629900869.65.0.585030532604.issue37596@roundup.psfhosted.org> Raymond Hettinger added the comment: Looking again, I think code is correct as-is (am not sure about the depth adjustment though). Stylistically, it is different from the other blocks w_complex_object() that always have a "return" after setting p->error. The new code jumps to "anyset_done" and then falls through the "elif" block rather than issuing a "return". Since nothing else happens below the if-elif-else chain, this is without consequence. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 10:14:46 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 25 Aug 2021 14:14:46 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629900886.05.0.559942229481.issue45000@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +26394 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27947 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 10:24:37 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 25 Aug 2021 14:24:37 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr In-Reply-To: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> Message-ID: <1629901477.16.0.742404727672.issue44929@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 24da544014f78e6f1440d5ce5c2d14794a020340 by Pablo Galindo Salgado in branch 'main': bpo-44929: [Enum] Fix global repr (GH-27789) https://github.com/python/cpython/commit/24da544014f78e6f1440d5ce5c2d14794a020340 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 10:29:58 2021 From: report at bugs.python.org (Carlos) Date: Wed, 25 Aug 2021 14:29:58 +0000 Subject: [issue42527] UnicodeEncode error in BaseHttpRequestHandler class when send unicode data. In-Reply-To: <1606840804.64.0.232983390658.issue42527@roundup.psfhosted.org> Message-ID: <1629901798.73.0.287421738033.issue42527@roundup.psfhosted.org> Change by Carlos : ---------- nosy: +jcarlosgalvezm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 10:35:52 2021 From: report at bugs.python.org (=?utf-8?b?6YOR5LmL5Li6?=) Date: Wed, 25 Aug 2021 14:35:52 +0000 Subject: [issue45002] won't match correct version of tcl/tk Message-ID: <1629902152.33.0.134354917611.issue45002@roundup.psfhosted.org> New submission from ??? : I used the following config: ./configure --prefix=/Users/jett/python311 --enable-optimizations --enable-ipv6 --enable-big-digits=30 --with-lto=full --with-experimental-isolated-subinterpreters --with-static-libpython --enable-universalsdk --with-universal-archs=universal2 --with-openssl=/opt/homebrew/opt/openssl at 1.1 export CFLAGS="-I/opt/homebrew/opt/xz/include -I/opt/homebrew/opt/tcl-tk/include" export CPPFLAGS="-I/opt/homebrew/opt/xz/include -I/opt/homebrew/opt/tcl-tk/include" export LDFLAGS="-L/opt/homebrew/opt/tcl-tk/lib" and got a version mismatch error: the executable is 8.6 and the library is 8.5 ---------- components: Build messages: 400272 nosy: jett8998 priority: normal severity: normal status: open title: won't match correct version of tcl/tk type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 11:21:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 25 Aug 2021 15:21:38 +0000 Subject: [issue14613] time.time can return NaN In-Reply-To: <1334751988.35.0.313625977941.issue14613@psf.upfronthosting.co.za> Message-ID: <1629904898.84.0.276031577226.issue14613@roundup.psfhosted.org> Irit Katriel added the comment: The versions field includes 3.2 and 3.3, but from the discussion it seems the problem was only observed in 2.7, and went away after a third party upgrade. It seems unlikely that we will be ably to make more progress on this issue. I propose we close it and investigate if a similar problem is reported on a current version. ---------- components: +Library (Lib) nosy: +iritkatriel resolution: -> third party status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 11:22:11 2021 From: report at bugs.python.org (Carlos) Date: Wed, 25 Aug 2021 15:22:11 +0000 Subject: [issue42527] UnicodeEncode error in BaseHttpRequestHandler class when send unicode data. In-Reply-To: <1606840804.64.0.232983390658.issue42527@roundup.psfhosted.org> Message-ID: <1629904931.63.0.613004790399.issue42527@roundup.psfhosted.org> Change by Carlos : ---------- keywords: +patch pull_requests: +26395 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27948 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 11:48:58 2021 From: report at bugs.python.org (Carlos) Date: Wed, 25 Aug 2021 15:48:58 +0000 Subject: [issue42527] UnicodeEncode error in BaseHttpRequestHandler class when send unicode data. In-Reply-To: <1606840804.64.0.232983390658.issue42527@roundup.psfhosted.org> Message-ID: <1629906538.16.0.131412943444.issue42527@roundup.psfhosted.org> Change by Carlos : ---------- versions: +Python 3.10, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 11:49:29 2021 From: report at bugs.python.org (Carlos) Date: Wed, 25 Aug 2021 15:49:29 +0000 Subject: [issue42527] UnicodeEncode error in BaseHttpRequestHandler class when send unicode data. In-Reply-To: <1606840804.64.0.232983390658.issue42527@roundup.psfhosted.org> Message-ID: <1629906569.43.0.913557139775.issue42527@roundup.psfhosted.org> Change by Carlos : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 11:52:29 2021 From: report at bugs.python.org (Hanan Basheer) Date: Wed, 25 Aug 2021 15:52:29 +0000 Subject: [issue11479] Add discussion of trailing backslash in raw string to tutorial In-Reply-To: <1299985803.24.0.199507309731.issue11479@psf.upfronthosting.co.za> Message-ID: <1629906749.83.0.0653094189214.issue11479@roundup.psfhosted.org> Change by Hanan Basheer <20b030018 at iitb.ac.in>: ---------- nosy: +dancinglightning nosy_count: 10.0 -> 11.0 pull_requests: +26396 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27949 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 12:41:20 2021 From: report at bugs.python.org (David Rebbe) Date: Wed, 25 Aug 2021 16:41:20 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629909680.74.0.33095171104.issue44993@roundup.psfhosted.org> David Rebbe added the comment: Thank you for referencing the PEP, I just managed to read through it and I still don't have a very good understanding why it needs to default to 1. PEP 435 states: "The reason for defaulting to 1 as the starting number and not 0 is that 0 is False in a boolean sense, but enum members all evaluate to True." I can't find anything in the PEP that states why enum members need to evaluate to True. What am I missing here? I was specifically tripped up with the generator I wrote that takes a C header and converts it to python ctype/enum objects. I have fixed the issue so its not a show stopper by any means its just not expected behavior for anyone with programming experience with enums outside Python. Here is the project in question where I discovered this: https://github.com/intrepidcs/python_ics/issues/105 enum in question: https://github.co/intrepidcs/python_ics/blob/master/ics/structures/e_device_settings_type.py which is generated from this: https://github.com/intrepidcs/python_ics/blob/master/include/ics/icsnVC40.h#L3410 Maybe it would be better to have an Enum type in the ctypes module instead to match all other language enums? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 12:58:10 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 25 Aug 2021 16:58:10 +0000 Subject: [issue45002] won't match correct version of tcl/tk In-Reply-To: <1629902152.33.0.134354917611.issue45002@roundup.psfhosted.org> Message-ID: <1629910690.44.0.930997341.issue45002@roundup.psfhosted.org> Ned Deily added the comment: Can you be more specific about what you mean by "executable" and "library"? In particular, please show the results of, where /path/to/python is replaced by the path to the python you have built or installed: otool -L $(/path/to/python -c 'import _tkinter;print(_tkinter.__file__)') Most likely the issue is that you need to use additional ./configure arguments rather than trying to modify CFLAGS et al: --with-tcltk-includes='-I...' override search for Tcl and Tk include files --with-tcltk-libs='-L...' override search for Tcl and Tk libs or set up the path to pkg-config info for Homebrew's Tcl and Tk packages. See the comments in setup.py for more info: https://github.com/python/cpython/blob/main/setup.py#L1898 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 13:26:48 2021 From: report at bugs.python.org (jakirkham) Date: Wed, 25 Aug 2021 17:26:48 +0000 Subject: [issue43976] Allow Python distributors to add custom site install schemes In-Reply-To: <1619713142.43.0.43081473036.issue43976@roundup.psfhosted.org> Message-ID: <1629912408.19.0.127368541762.issue43976@roundup.psfhosted.org> Change by jakirkham : ---------- nosy: +jakirkham _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 13:40:07 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 25 Aug 2021 17:40:07 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629913207.33.0.445855481987.issue44993@roundup.psfhosted.org> Ethan Furman added the comment: Putting an enum in the ctypes module is a decent idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 13:54:33 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Aug 2021 17:54:33 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629914073.9.0.402809321078.issue45000@roundup.psfhosted.org> miss-islington added the comment: New changeset 551da597a0996b0fb3af425f48aa5bc63ea6b963 by Dong-hee Na in branch 'main': bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947) https://github.com/python/cpython/commit/551da597a0996b0fb3af425f48aa5bc63ea6b963 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:02:05 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 25 Aug 2021 18:02:05 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629914525.69.0.850381909118.issue44993@roundup.psfhosted.org> Vedran ?a?i? added the comment: And CEnum is probably the best name for it. "Int" part is pretty much implied in "C" part. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:09:04 2021 From: report at bugs.python.org (Calo) Date: Wed, 25 Aug 2021 18:09:04 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ Message-ID: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> New submission from Calo : The Python Language Reference, Chapter 6 (Expressions), Section 7 (Binary arithmetic operations) in Python version 3.9 has a sentence which reads: "This operation can be customized using the special __div__() and __floordiv__() methods." To my knowledge, when Python 3 was released, true division became the default, and __div__ became useless as well. Thus, I believe this part of the documentation should be changed to "[...] __truediv__() and __floordiv__() methods." to avoid misleading others. P.S. This is my first time submitting a Python bug report, I'm just a Python enthusiast and I'm not familiar at all with these official bug reports (I have read https://docs.python.org/3/bugs.html though!), so please let me know and correct me if I've done something incorrectly! Thanks! ---------- assignee: docs at python components: Documentation messages: 400279 nosy: docs at python, objectivitix priority: normal severity: normal status: open title: Documentation wrote __div__ instead of __truediv__ versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:11:57 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 25 Aug 2021 18:11:57 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629915117.4.0.637047822716.issue45003@roundup.psfhosted.org> Raymond Hettinger added the comment: Would you like to submit a PR? ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:12:21 2021 From: report at bugs.python.org (neonene) Date: Wed, 25 Aug 2021 18:12:21 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build In-Reply-To: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> Message-ID: <1629915141.84.0.327464936372.issue44381@roundup.psfhosted.org> neonene added the comment: I'd like to leave my pyperformance (x64) results here. cpython: ae5259171b8ef62165e061b9dea7ad645a5131a2 (2021-8-23) 1) release + CFG : 1.00x 2) release + CFG,/Ob3 : 1.05x faster | 41 faster | 9 slower | 8 not significant 3) release (default) : 1.07x faster | 52 faster | 4 slower (regex_v8, | regex_effbot, | nbody, | hexiom) | 2 not significant 4) release + /Ob3 : 1.11x faster | 56 faster | 1 slower (regex_v8) | 1 not significant (regex_dna) 5) PGO + CFG : 1.15x faster | 53 faster | 2 slower (regex_dna, | pidigits) | 3 not significant 6) PGO + CFG,/Ob3 : 1.15x faster | 54 faster | 1 slower (regex_dna) | 3 not significant 7) PGO (default) : 1.21x faster | 56 faster | 1 slower (regex_dna) | 1 not significant (regex_effbot) 8) PGO + /Ob3 : 1.21x faster | 57 faster | 1 slower (regex_dna) | 0 not significant ---------- nosy: +neonene _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:14:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Aug 2021 18:14:07 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629915247.38.0.287220354917.issue44524@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 23384a1749359f0ae7aaae052073d44b59e715a1 by Ken Jin in branch 'main': bpo-44524: Don't modify MRO when inheriting from typing.Annotated (GH-27841) https://github.com/python/cpython/commit/23384a1749359f0ae7aaae052073d44b59e715a1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:14:09 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Aug 2021 18:14:09 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629915249.83.0.510993072007.issue44524@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26397 pull_request: https://github.com/python/cpython/pull/27950 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:14:00 2021 From: report at bugs.python.org (Calo) Date: Wed, 25 Aug 2021 18:14:00 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629915240.21.0.126673732637.issue45003@roundup.psfhosted.org> Calo added the comment: I'd like to! Wait, so is this approved now? I'd simply need to open a PR? If so, on which repository do I do it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:18:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 25 Aug 2021 18:18:05 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629915485.06.0.810749424839.issue45003@roundup.psfhosted.org> Serhiy Storchaka added the comment: https://github.com/python/cpython ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:19:59 2021 From: report at bugs.python.org (Calo) Date: Wed, 25 Aug 2021 18:19:59 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629915599.53.0.804065346853.issue45003@roundup.psfhosted.org> Calo added the comment: Got it, thank you very much! I found https://github.com/python/cpython/blob/main/Doc/reference/expressions.rst, I guess that's where I fork and edit ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:27:30 2021 From: report at bugs.python.org (Calo) Date: Wed, 25 Aug 2021 18:27:30 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629916050.65.0.651004330689.issue45003@roundup.psfhosted.org> Change by Calo : ---------- keywords: +patch pull_requests: +26398 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27951 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 14:36:58 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 25 Aug 2021 18:36:58 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1629916618.32.0.291475854102.issue44524@roundup.psfhosted.org> miss-islington added the comment: New changeset 06e9a35169e125488d4ae9228626eb95375f3a14 by Miss Islington (bot) in branch '3.10': bpo-44524: Don't modify MRO when inheriting from typing.Annotated (GH-27841) https://github.com/python/cpython/commit/06e9a35169e125488d4ae9228626eb95375f3a14 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:02:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 19:02:33 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1629918153.45.0.596849123472.issue27334@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 52702e8ba0d777ac92ec36038213976545c4759e by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-27334: roll back transaction if sqlite3 context manager fails to commit (GH-26202) (GH-27944) https://github.com/python/cpython/commit/52702e8ba0d777ac92ec36038213976545c4759e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:03:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 19:03:15 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1629918195.51.0.690872327313.issue43853@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7903a1096343d8018e889029f025d39bdd077170 by Erlend Egeberg Aasland in branch 'main': bpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922) https://github.com/python/cpython/commit/7903a1096343d8018e889029f025d39bdd077170 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:13:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 19:13:35 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1629918815.45.0.0969228705164.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26399 pull_request: https://github.com/python/cpython/pull/27952 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:18:39 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 25 Aug 2021 19:18:39 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1629919119.53.0.227458988168.issue43853@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26400 pull_request: https://github.com/python/cpython/pull/27953 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:24:46 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 25 Aug 2021 19:24:46 +0000 Subject: [issue45004] add Enum to ctypes Message-ID: <1629919486.36.0.748865538511.issue45004@roundup.psfhosted.org> New submission from Ethan Furman : In issue44993 it was suggested to add a cEnum whose main purpose would be to start counting at 0 instead of 1. Issues to consider: - should such an enum subclass `int`, or a C type? - should there be an enum for each C type? - will mixing Enum and c_types even work? ---------- messages: 400289 nosy: amaury.forgeotdarc, belopolsky, ethan.furman, meador.inge priority: normal severity: normal status: open title: add Enum to ctypes type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:25:09 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 25 Aug 2021 19:25:09 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1629919509.6.0.0285212128399.issue44993@roundup.psfhosted.org> Ethan Furman added the comment: David, I added a PR for the Enum handling/creation in the ics library. Syncing values with external libraries is definitely *not* what `auto` is intended for. As for why enum members evaluate as True: most objects in Python evaluate to True, unless they have a reason not to (such as an empty container or the number 0). One of the main ideas behind the creation of Enum is that the exact values didn't usually matter, but when they did they would be specified. `auto()` was added later to make the "doesn't usually matter" case easier. --- Vedran, or `cEnum`? ;-) One concern is should cEnum be Python's `int`, or a c_type int? That should be in a new issue, though. Okay, it's Issue45004. ---------- stage: -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:25:56 2021 From: report at bugs.python.org (Mjbmr) Date: Wed, 25 Aug 2021 19:25:56 +0000 Subject: [issue45005] Two Layers of SSL/TLS Message-ID: <1629919556.77.0.871117984975.issue45005@roundup.psfhosted.org> New submission from Mjbmr : A simple script, trying connect to second ssl through first sever doesn't work: import socket, ssl sock = socket.socket() sock.connect(('', 443)) ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE sock = ctx.wrap_socket(sock) sock.send(b'CONNECT :443 HTTP/1.1\r\n\r\n') print(sock.recv(1024)) ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE sock = ctx.wrap_socket(sock) sock.do_handshake() sock.send(b'CONNECT ifconf.me:80 HTTP/1.1\r\n\r\n') print(sock.recv(1024)) b'HTTP/1.1 200 Connection established\r\n\r\n' Traceback (most recent call last): File "C:\Users\Javad\Desktop\4.py", line 15, in sock = ctx.wrap_socket(sock) File "E:\Categories\Python\Python3.9.6\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "E:\Categories\Python\Python3.9.6\lib\ssl.py", line 1040, in _create self.do_handshake() File "E:\Categories\Python\Python3.9.6\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host ---------- assignee: christian.heimes components: SSL messages: 400291 nosy: christian.heimes, mjbmr priority: normal severity: normal status: open title: Two Layers of SSL/TLS versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:26:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 19:26:37 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1629919597.31.0.211022987146.issue43853@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0ec17a2494412ea7d76f7d0567b73c1fffa88c18 by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922) (GH-27952) https://github.com/python/cpython/commit/0ec17a2494412ea7d76f7d0567b73c1fffa88c18 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:30:50 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 25 Aug 2021 19:30:50 +0000 Subject: [issue45005] Two Layers of SSL/TLS In-Reply-To: <1629919556.77.0.871117984975.issue45005@roundup.psfhosted.org> Message-ID: <1629919850.08.0.993540291771.issue45005@roundup.psfhosted.org> Christian Heimes added the comment: You cannot wrap an SSLSocket in another SSLSocket. It doesn't work due to the way how OpenSSL's BIO layer wraps the system socket. You have to use SSLObject and SSLContext.wrap_bio() for the inner layer. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:34:26 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 25 Aug 2021 19:34:26 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build In-Reply-To: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> Message-ID: <1629920066.99.0.879878993997.issue44381@roundup.psfhosted.org> Steve Dower added the comment: That looks to me like no impact at all, which is great to see! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:50:04 2021 From: report at bugs.python.org (Mjbmr) Date: Wed, 25 Aug 2021 19:50:04 +0000 Subject: [issue45005] Two Layers of SSL/TLS In-Reply-To: <1629919556.77.0.871117984975.issue45005@roundup.psfhosted.org> Message-ID: <1629921004.44.0.0308802174417.issue45005@roundup.psfhosted.org> Mjbmr added the comment: Is there any public document about this or can you give me an example? I can't figure it out what's the incoming and outgoing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 15:50:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 19:50:28 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1629921028.59.0.88138241832.issue43853@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b34ca7e0515e6726cf5e938f7239de41df710cfd by Erlend Egeberg Aasland in branch '3.10': [3.10] bpo-43853: Amend NEWS entry for latest changes in sqlite3 (GH-27922). (GH-27953) https://github.com/python/cpython/commit/b34ca7e0515e6726cf5e938f7239de41df710cfd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 17:03:59 2021 From: report at bugs.python.org (Mjbmr) Date: Wed, 25 Aug 2021 21:03:59 +0000 Subject: [issue45005] Two Layers of SSL/TLS In-Reply-To: <1629919556.77.0.871117984975.issue45005@roundup.psfhosted.org> Message-ID: <1629925439.2.0.356156397689.issue45005@roundup.psfhosted.org> Change by Mjbmr : ---------- resolution: wont fix -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 17:30:38 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 25 Aug 2021 21:30:38 +0000 Subject: [issue40772] module 'resource' has no attribute 'RLIMIT_VMEM' In-Reply-To: <1590430147.26.0.291044051097.issue40772@roundup.psfhosted.org> Message-ID: <1629927038.63.0.808448910586.issue40772@roundup.psfhosted.org> Andrei Kulakov added the comment: The docs for resource module state: This module does not attempt to mask platform differences ? symbols not defined for a platform will not be available from this module on that platform. Therefore I think this can be closed. ---------- nosy: +andrei.avk type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 17:33:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 21:33:58 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1629927238.58.0.425105387889.issue44963@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 17:34:59 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 25 Aug 2021 21:34:59 +0000 Subject: [issue40772] module 'resource' has no attribute 'RLIMIT_VMEM' In-Reply-To: <1590430147.26.0.291044051097.issue40772@roundup.psfhosted.org> Message-ID: <1629927299.24.0.164968086506.issue40772@roundup.psfhosted.org> Andrei Kulakov added the comment: Also note that according to https://edwards.sdsu.edu/research/memory-and-core-usage-on-sge/, Linux systems use RLIMIT_AS instead of RLMIMIT_VMEM. My system (MacOS), also has RLIMIT_AS defined but not RLIMIT_VMEM. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 17:41:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 21:41:30 +0000 Subject: [issue42085] Add dedicated slot for sending values In-Reply-To: <1603136296.98.0.312180912341.issue42085@roundup.psfhosted.org> Message-ID: <1629927690.05.0.74771208279.issue42085@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am reopening this issue since am_send never got documented here: https://docs.python.org/3/c-api/typeobj.html#async-structs ---------- nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 18:07:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 25 Aug 2021 22:07:52 +0000 Subject: [issue44963] anext_awaitable is not a collections.abc.Generator In-Reply-To: <1629480240.94.0.904763304285.issue44963@roundup.psfhosted.org> Message-ID: <1629929272.82.0.67950234694.issue44963@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +26401 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27955 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 18:22:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 25 Aug 2021 22:22:53 +0000 Subject: [issue22764] object lifetime fragility in unittest tests In-Reply-To: <1414663065.15.0.782385301612.issue22764@psf.upfronthosting.co.za> Message-ID: <1629930173.75.0.593880620683.issue22764@roundup.psfhosted.org> Irit Katriel added the comment: I don't think this test still exists - I tried to search for it and found nothing. In any case, from the discussion it seems that that is left is to tweak the skip mechanism (assuming the patches were applied). I'll close this soon if nobody objects. ---------- nosy: +iritkatriel resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 19:54:26 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 25 Aug 2021 23:54:26 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629935666.97.0.674852362804.issue45000@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 19:58:49 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 25 Aug 2021 23:58:49 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629935929.28.0.979936303576.issue45000@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +26402 pull_request: https://github.com/python/cpython/pull/27956 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 20:03:25 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 26 Aug 2021 00:03:25 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629936205.47.0.175496729053.issue45000@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +26403 pull_request: https://github.com/python/cpython/pull/27957 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 20:30:48 2021 From: report at bugs.python.org (Andrew Nelson) Date: Thu, 26 Aug 2021 00:30:48 +0000 Subject: [issue40327] list(sys.modules.items()) can throw RuntimeError: dictionary changed size during iteration In-Reply-To: <1587284646.11.0.468516211586.issue40327@roundup.psfhosted.org> Message-ID: <1629937848.14.0.789745007341.issue40327@roundup.psfhosted.org> Andrew Nelson added the comment: Just to mention that we have seen similar issues whilst importing scipy in a multiprocessing context. See https://github.com/scipy/scipy/issues/11479 and https://stackoverflow.com/questions/68911221/python-runtimeerror-dictionary-changed-size-during-iteration-popping-out-rand. ---------- nosy: +Andrew Nelson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 20:36:31 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 26 Aug 2021 00:36:31 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629938191.7.0.887083169822.issue45000@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset c764dfbcbc12c4653fc8ab39773cf973c9db2757 by Dong-hee Na in branch 'main': bpo-45000: Update whatsnews about deleting __debug__ (GH-27956) https://github.com/python/cpython/commit/c764dfbcbc12c4653fc8ab39773cf973c9db2757 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 20:38:08 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 26 Aug 2021 00:38:08 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629938288.12.0.459605780454.issue45000@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +26404 pull_request: https://github.com/python/cpython/pull/27958 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 20:56:20 2021 From: report at bugs.python.org (Adam Meily) Date: Thu, 26 Aug 2021 00:56:20 +0000 Subject: [issue27484] Some Examples in Format String Syntax are incorrect or poorly worded In-Reply-To: <1468256216.77.0.446527786917.issue27484@psf.upfronthosting.co.za> Message-ID: <1629939380.53.0.892752995739.issue27484@roundup.psfhosted.org> Change by Adam Meily : ---------- nosy: +meilyadam nosy_count: 5.0 -> 6.0 pull_requests: +26405 pull_request: https://github.com/python/cpython/pull/27959 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 21:14:13 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 26 Aug 2021 01:14:13 +0000 Subject: [issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array In-Reply-To: <1578202492.29.0.981939629191.issue39218@roundup.psfhosted.org> Message-ID: <1629940453.2.0.817078014396.issue39218@roundup.psfhosted.org> Raymond Hettinger added the comment: The rounding correction in _ss() looks mathematically incorrect to me: ? (x? - x? + ??)? = ? (x? - x?)? - (? ??)? ? n If we drop this logic (which seems completely bogus), all the tests still pass and the code becomes cleaner: def _ss(data, c=None): if c is None: c = mean(data) T, total, count = _sum((y := x - c) * y for x in data) return (T, total) -- Algebraic form of the current code ---------------------- from sympy import symbols, simplify x1, x2, x3, e1, e2, e3 = symbols('x1 x2 x3 e1 e2 e3') n = 3 # high accuracy mean c = (x1 + x2 + x3) / n # sum of squared deviations with subtraction errors total = (x1 - c + e1)**2 + (x2 - c + e2)**2 + (x3 - c + e3)**2 # sum of subtraction errors = e1 + e2 + e3 total2 = (x1 - c + e1) + (x2 - c + e2) + (x3 - c + e3) # corrected sum of squared deviations total -= total2 ** 2 / n # exact sum of squared deviations desired = (x1 - c)**2 + (x2 - c)**2 + (x3 - c)**2 # expected versus actual print(simplify(desired - total)) This gives: (e1 + e2 + e3)**2/3 + (-2*x1 + x2 + x3)**2/9 + (x1 - 2*x2 + x3)**2/9 + (x1 + x2 - 2*x3)**2/9 - (3*e1 + 2*x1 - x2 - x3)**2/9 - (3*e2 - x1 + 2*x2 - x3)**2/9 - (3*e3 - x1 - x2 + 2*x3)**2/9 -- Substituting in concrete values ---------------------- x1, x2, x3, e1, e2, e3 = 11, 17, 5, 0.3, 0.1, -0.2 This gives: 75.74000000000001 uncorrected total 75.72666666666667 "corrected" total 72.0 desired result ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 21:20:31 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 26 Aug 2021 01:20:31 +0000 Subject: [issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array In-Reply-To: <1578202492.29.0.981939629191.issue39218@roundup.psfhosted.org> Message-ID: <1629940831.78.0.0873634163397.issue39218@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- keywords: +patch pull_requests: +26406 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27960 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 21:28:22 2021 From: report at bugs.python.org (Adam Meily) Date: Thu, 26 Aug 2021 01:28:22 +0000 Subject: [issue28474] WinError(): Python int too large to convert to C long In-Reply-To: <1476862081.01.0.00079290874453.issue28474@psf.upfronthosting.co.za> Message-ID: <1629941302.06.0.176159552849.issue28474@roundup.psfhosted.org> Change by Adam Meily : ---------- keywords: +patch pull_requests: +26407 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27959 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 21:49:26 2021 From: report at bugs.python.org (=?utf-8?b?6YOR5LmL5Li6?=) Date: Thu, 26 Aug 2021 01:49:26 +0000 Subject: [issue45002] won't match correct version of tcl/tk In-Reply-To: <1629902152.33.0.134354917611.issue45002@roundup.psfhosted.org> Message-ID: <1629942566.96.0.627547308849.issue45002@roundup.psfhosted.org> ??? added the comment: now it's more like: *** WARNING: renaming "_tkinter" since importing it failed: dlopen(/Users/jett/cpython/build/lib.macosx-11.5-universal2-3.11/_tkinter.cpython-311-darwin.so, 2): Symbol not found: _TclBN_mp_clear Referenced from: /Users/jett/cpython/build/lib.macosx-11.5-universal2-3.11/_tkinter.cpython-311-darwin.so Expected in: flat namespace in /Users/jett/cpython/build/lib.macosx-11.5-universal2-3.11/_tkinter.cpython-311-darwin.so Python build finished successfully! The necessary bits to build these optional modules were not found: _gdbm ossaudiodev spwd To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc pwd time Following modules built successfully but were removed because they could not be imported: _tkinter and this: jett at zhengzhweidembp iucn % /Users/jett/python311/bin/python3.11 guimain.py Traceback (most recent call last): File "/Users/jett/Desktop/GitHub/Repos/iucn/guimain.py", line 1, in from tkinter import * ^^^^^^^^^^^^^^^^^^^^^ File "/Users/jett/python311/lib/python3.11/tkinter/__init__.py", line 37, in import _tkinter # If this fails your Python may not be configured for Tk ^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named '_tkinter' ans this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 22:26:18 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 26 Aug 2021 02:26:18 +0000 Subject: [issue45002] won't match correct version of tcl/tk In-Reply-To: <1629902152.33.0.134354917611.issue45002@roundup.psfhosted.org> Message-ID: <1629944778.74.0.254135861315.issue45002@roundup.psfhosted.org> Ned Deily added the comment: It is difficult to offer suggestions based on minimal information. You may be running into an arch mismatch: since you are requesting a universal2 build (x86_64 and arm64), all the third-party libraries your build links with must also be built with both architectures. Or it still could be a mismatched path problem. You can use the otool -L command I suggested before on the renamed _tkinter.so file left in your build/lib.macosx-11.5-universal2-3.11 directory to determine what path to the Tcl and Tk libraries it is using; it should be an absolute path to the Homebrew libraries. You can also use the "file" command on the _tkinter file and on the Tcl and Tk library files to determine which archs are present in each. If this is your first attempt at building Python on macOS, I suggest you start with a simpler ./configure command and then consider adding other options after you have that working. To start with you should only need something like: ./configure --prefix=... --with-openssl=... --with-tcltk-includes=... --with-tcltk-libs=... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 22:30:22 2021 From: report at bugs.python.org (Kelvin Zhang) Date: Thu, 26 Aug 2021 02:30:22 +0000 Subject: [issue45006] Add data_offset field to ZipInfo Message-ID: <1629945022.64.0.0597946135718.issue45006@roundup.psfhosted.org> New submission from Kelvin Zhang : Currently python's zipfile module does not have a way query starting offset of compressed data. This might be handy when the user wants to copy compressed data as is. Therefore I propose adding a data_offset field to zipfile.ZipInfo, which stores the offset to beginning of compressed data. ---------- components: Library (Lib) messages: 400306 nosy: zhangxp1998 priority: normal severity: normal status: open title: Add data_offset field to ZipInfo type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 22:32:09 2021 From: report at bugs.python.org (Kelvin Zhang) Date: Thu, 26 Aug 2021 02:32:09 +0000 Subject: [issue45006] Add data_offset field to ZipInfo In-Reply-To: <1629945022.64.0.0597946135718.issue45006@roundup.psfhosted.org> Message-ID: <1629945129.06.0.664118257514.issue45006@roundup.psfhosted.org> Change by Kelvin Zhang : ---------- keywords: +patch pull_requests: +26408 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27961 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 23:34:24 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 26 Aug 2021 03:34:24 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released Message-ID: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> New submission from Ned Deily : OpenSSL 1.1.1l was released on 2021-08-24 so the Windows build and macOS binary installers should be updated to it. https://www.openssl.org/source/ However, it appears that 1.1.1l introduced a build failure on older macOS systems that would affect some python.org macOS installer builds so we should wait for an official fix before updating the macOS builds. I will take care of that part. https://github.com/openssl/openssl/issues/16407 ---------- assignee: christian.heimes components: SSL, Windows, macOS messages: 400307 nosy: christian.heimes, ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden, zach.ware priority: high severity: normal stage: needs patch status: open title: OpenSSL 1.1.1l is released versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Aug 25 23:48:04 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 26 Aug 2021 03:48:04 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1629949684.85.0.777386905326.issue44997@roundup.psfhosted.org> Ned Deily added the comment: > I guess we could wrap this functionality with some preprocessor conditionals, and/or adjust the configure script to not accept --enable-loadable-sqlite-extensions for macOS 11.5.1 (11.5.x?). FTR, this is only a problem if you link with the Apple-supplied system libsqlite3. So any change would need need to take into account the possibility of using your own or other third-party copy of libsqlite3, for example, like the python.org macOS binary installers do. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 01:28:34 2021 From: report at bugs.python.org (William Fisher) Date: Thu, 26 Aug 2021 05:28:34 +0000 Subject: [issue45008] asyncio.gather should not "dedup" awaitables Message-ID: <1629955714.55.0.00221644523212.issue45008@roundup.psfhosted.org> New submission from William Fisher : asyncio.gather uses a dictionary to de-duplicate futures and coros. However, this can lead to problems when you pass an awaitable object (implements __await__ but isn't a future or coro). 1. Two or more awaitables may compare for equality/hash, but still expect to produce different results (See the RandBits class in gather_test.py) 2. If an awaitable doesn't support hashing, asyncio.gather doesn't work. Would it be possible for non-future, non-coro awaitables to opt out of the dedup logic? The attached file shows an awaitable RandBits class. Each time you await it, you should get a different result. Using gather, you will always get the same result. ---------- components: asyncio files: gather_test.py messages: 400309 nosy: asvetlov, byllyfish, yselivanov priority: normal severity: normal status: open title: asyncio.gather should not "dedup" awaitables type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50236/gather_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 01:31:26 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 26 Aug 2021 05:31:26 +0000 Subject: [issue42085] Add dedicated slot for sending values In-Reply-To: <1603136296.98.0.312180912341.issue42085@roundup.psfhosted.org> Message-ID: <1629955886.28.0.459841442424.issue42085@roundup.psfhosted.org> Dennis Sweeney added the comment: It did get added to the correct docs: https://docs.python.org/3.10/c-api/typeobj.html#c.PyAsyncMethods.am_send (the 3.10 and 3.11 docs, not the 3.9 docs ;-) But as I mentioned, I feel that there could be more details about the semantics/contract. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 01:49:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 05:49:11 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629956951.14.0.62415923697.issue45003@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 806e25fd3173a80021e6df87b81263b5f6056f38 by Objectivitix in branch 'main': bpo-45003: Change __div__ to __truediv__ in py3 language reference. (GH-27951) https://github.com/python/cpython/commit/806e25fd3173a80021e6df87b81263b5f6056f38 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 01:49:14 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 05:49:14 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629956954.1.0.440854538668.issue45003@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26409 pull_request: https://github.com/python/cpython/pull/27962 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 01:49:42 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 05:49:42 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629956982.46.0.172279457347.issue45003@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26410 pull_request: https://github.com/python/cpython/pull/27963 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 02:34:58 2021 From: report at bugs.python.org (Gopesh Singh) Date: Thu, 26 Aug 2021 06:34:58 +0000 Subject: [issue45009] Get last modified date of Folders and Files using pathlib module Message-ID: <1629959698.42.0.950387812936.issue45009@roundup.psfhosted.org> New submission from Gopesh Singh : I am trying to get Last modified dates of Folders and Files mounted on Azure Databricks. I am using following Code: ``` root_dir = "/dbfs/mnt/ADLS1/LANDING/parent" def get_directories(root_dir): for child in Path(root_dir).iterdir(): if child.is_file(): print(child, datetime.fromtimestamp(getmtime(child)).date()) else: print(child, datetime.fromtimestamp(getmtime(child)).date()) get_directories(child) ``` The issue is that it is giving wrong dates for some folders. When I put a wait time of 1 second (time.sleep(.000005)) for each iteration, it gives correct results. Otherwise, it sometimes give current date or date of folder listed from last iteration. Seems, when the processing is fast, it is not able to pick correct modified date. I have explained this issue on other portal: https://stackoverflow.com/questions/68917983/get-last-modified-date-of-folders-and-files-in-azure-databricks ---------- components: Library (Lib) messages: 400312 nosy: gopeshsingh priority: normal severity: normal status: open title: Get last modified date of Folders and Files using pathlib module type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 02:40:01 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 06:40:01 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629960001.11.0.373269810043.issue45003@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26411 pull_request: https://github.com/python/cpython/pull/27964 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 02:42:21 2021 From: report at bugs.python.org (Gopesh Singh) Date: Thu, 26 Aug 2021 06:42:21 +0000 Subject: [issue45009] Get last modified date of Folders and Files using pathlib module In-Reply-To: <1629959698.42.0.950387812936.issue45009@roundup.psfhosted.org> Message-ID: <1629960141.47.0.715591057182.issue45009@roundup.psfhosted.org> Gopesh Singh added the comment: Adding further details: // from os.path import getmtime from datetime import datetime from pathlib import Path import time // System: Operating System: Ubuntu 18.04.5 LTS Python: 3.8.8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 02:49:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 06:49:49 +0000 Subject: [issue45010] Remove support of special method __div__ in unittest.mock Message-ID: <1629960589.05.0.156438795424.issue45010@roundup.psfhosted.org> New submission from Serhiy Storchaka : Special method __div__ was used in Python 2, but is not used in Python 3. I think it can be removed from the list of supported special methods in unittest.mock. ---------- components: Library (Lib) messages: 400314 nosy: michael.foord, serhiy.storchaka priority: normal severity: normal status: open title: Remove support of special method __div__ in unittest.mock versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 02:51:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 06:51:17 +0000 Subject: [issue45010] Remove support of special method __div__ in unittest.mock In-Reply-To: <1629960589.05.0.156438795424.issue45010@roundup.psfhosted.org> Message-ID: <1629960677.96.0.192729373444.issue45010@roundup.psfhosted.org> Serhiy Storchaka added the comment: It was kept in the previous clean up in issue23641 because I had doubts. But now I do not see reasons to keep it. Rather keeping it can confuse users. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 02:56:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 06:56:22 +0000 Subject: [issue45010] Remove support of special method __div__ in unittest.mock In-Reply-To: <1629960589.05.0.156438795424.issue45010@roundup.psfhosted.org> Message-ID: <1629960982.51.0.283605321707.issue45010@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26412 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27965 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 03:03:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 07:03:26 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629961406.28.0.82651030858.issue45003@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 46970fdd8ddc18823519d1e1c57136f6bc2a8dac by Miss Islington (bot) in branch '3.9': bpo-45003: Change __div__ to __truediv__ in py3 language reference. (GH-27951) (GH-27962) https://github.com/python/cpython/commit/46970fdd8ddc18823519d1e1c57136f6bc2a8dac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 03:04:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 07:04:09 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629961449.95.0.57308997322.issue45003@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset ea39933b4b76da35874be79f2384e24b38c37351 by Miss Islington (bot) in branch '3.10': bpo-45003: Change __div__ to __truediv__ in py3 language reference. (GH-27951) (GH-27963) https://github.com/python/cpython/commit/ea39933b4b76da35874be79f2384e24b38c37351 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 03:04:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 07:04:44 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1629961484.08.0.763728227296.issue44997@roundup.psfhosted.org> Erlend E. Aasland added the comment: > FTR, this is only a problem if you link with the Apple-supplied system libsqlite3 [...] Sure, but that should be relatively trivial to detect. AFAIK, the SQLite command line shell seems to be located at the same path every release, so I would guess that also applies for the library. Alternatively, we could dump the compile options and grep for SQLITE_OMIT_LOAD_EXTENSION, but that implies locating the SQLite command line shell that corresponds to the library that we're using. Probably trickier, but would definitely be useful if/when we add support for the SQLite serialize API, RTree callbacks, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 03:04:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 07:04:54 +0000 Subject: [issue45003] Documentation wrote __div__ instead of __truediv__ In-Reply-To: <1629914944.6.0.138972683464.issue45003@roundup.psfhosted.org> Message-ID: <1629961494.56.0.13504895734.issue45003@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 03:08:04 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 07:08:04 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1629961684.6.0.61643861082.issue43853@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks for merging the NEWS amendments, Pablo. We can close this issue after landing PR 27642. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 03:08:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 07:08:33 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1629961713.25.0.0767333164696.issue45007@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 03:26:16 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 07:26:16 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1629962776.52.0.617788705814.issue44997@roundup.psfhosted.org> Erlend E. Aasland added the comment: ...or we can just leave it as it. Seems like these reports only pops up once in a while. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 04:21:11 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 26 Aug 2021 08:21:11 +0000 Subject: [issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array In-Reply-To: <1578202492.29.0.981939629191.issue39218@roundup.psfhosted.org> Message-ID: <1629966071.84.0.756903553498.issue39218@roundup.psfhosted.org> Mark Dickinson added the comment: > The rounding correction in _ss() looks mathematically incorrect to me [...] I don't think it was intended as a rounding correction - I think it's just computing the variance (prior to the division by n or n-1) of the `(x - c)` terms using the standard "expectation of x^2 - (expectation of x)^2" formula: sum((x - c)**2 for x in data) - (sum(x - c for x in data)**2) / n So I guess it *can* be thought of as a rounding correction, but what it's correcting for is an inaccurate value of "c"; it's not correcting for inaccuracies in the subtraction results. That is, if you were to add an artificial error into c at some point before computing "total" and "total2", that correction term should take you back to something approaching the true sum of squares of deviations. So mathematically, I think it's correct, but not useful, because mathematically "total2" will be zero. Numerically, it's probably not helpful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 04:34:05 2021 From: report at bugs.python.org (mattip) Date: Thu, 26 Aug 2021 08:34:05 +0000 Subject: [issue45011] tests fail when using pure-python instead of _asycio Message-ID: <1629966845.23.0.661629183218.issue45011@roundup.psfhosted.org> New submission from mattip : PyPy has no asyncio c-extension module _asyncio. I see stdlib test failures when running the tests in test/test_asyncio/*.py. If I disable _asyncio in Lib/asyncio/events.py (at the end of the file) I see similar failures in CPython3.8 on Ubuntu 20.04 in test_buffered_proto.py test_buffered_proto_create_connection test_sslproto.py test_create_connection_memory_leak, test_handshake_timeout, test_start_tls_client_buf_proto_1, Also this test depends on _CFuture test_futures.py ---------- components: asyncio messages: 400322 nosy: asvetlov, mattip, yselivanov priority: normal severity: normal status: open title: tests fail when using pure-python instead of _asycio _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 04:38:33 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 26 Aug 2021 08:38:33 +0000 Subject: [issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array In-Reply-To: <1578202492.29.0.981939629191.issue39218@roundup.psfhosted.org> Message-ID: <1629967113.12.0.905388258672.issue39218@roundup.psfhosted.org> Mark Dickinson added the comment: > what it's correcting for is an inaccurate value of "c" [...] In more detail: Suppose "m" is the true mean of the x in data, but all we have is an approximate mean "c" to work with. Write "e" for the error in that approximation, so that c = m + e. Then (using Python notation, but treating the expressions as exact mathematical expressions computed in the reals): sum((x-c)**2 for x in data) == sum((x-m-e)**2 for x in data) == sum((x - m)**2 for x in data) - 2 * sum((x - m)*e for x in data) + sum(e**2 for x in data) == sum((x - m)**2 for x in data) - 2 * e * sum((x - m) for x in data) + sum(e**2 for x in data) == sum((x - m)**2 for x in data) + sum(e**2 for x in data) (because sum((x - m) for x in data) is 0) == sum((x - m)**2 for x in data) + n*e**2 So the error in our result arising from the error in computing m is that n*e**2 term. And that's the term that's being subtracted here, because sum(x - c for x in data) ** 2 / n == sum(x - m - e for x in data) ** 2 / n == (sum(x - m for x in data) - sum(e for x in data))**2 / n == (0 - n * e)**2 / n == n * e**2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 04:45:32 2021 From: report at bugs.python.org (Julien Palard) Date: Thu, 26 Aug 2021 08:45:32 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1629967532.03.0.129112116855.issue42238@roundup.psfhosted.org> Julien Palard added the comment: New changeset 21fa8547921d28b80b8a88d034081cab000d5480 by Julien Palard in branch 'main': bpo-42238: [doc] Some more make suspicious false positives. (GH-27945) https://github.com/python/cpython/commit/21fa8547921d28b80b8a88d034081cab000d5480 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 04:46:55 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 26 Aug 2021 08:46:55 +0000 Subject: [issue14613] time.time can return NaN In-Reply-To: <1334751988.35.0.313625977941.issue14613@psf.upfronthosting.co.za> Message-ID: <1629967615.22.0.356095845314.issue14613@roundup.psfhosted.org> Mark Dickinson added the comment: > I propose we close it [...] Seconded! ---------- stage: test needed -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 04:47:44 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 26 Aug 2021 08:47:44 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1629967664.52.0.339482757839.issue24234@roundup.psfhosted.org> Mark Dickinson added the comment: All done, I think. Closing. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 05:16:27 2021 From: report at bugs.python.org (=?utf-8?q?Mat=C3=ADas_Senger?=) Date: Thu, 26 Aug 2021 09:16:27 +0000 Subject: [issue44986] Date formats in help messages of argparse In-Reply-To: <1629760940.67.0.392348377667.issue44986@roundup.psfhosted.org> Message-ID: <1629969387.99.0.0831054414634.issue44986@roundup.psfhosted.org> Mat?as Senger added the comment: With this change there should be no need to escape anything, and it is still compatible with the old formatting. Plus, with the current implementation if you forget to escape something like %Y the error message is not helpful at all and only happens when invoked with -h option. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 05:32:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 26 Aug 2021 09:32:16 +0000 Subject: [issue25867] os.stat raises exception when using unicode and no locale is set In-Reply-To: <1450168391.42.0.368048088305.issue25867@psf.upfronthosting.co.za> Message-ID: <1629970336.74.0.80086073115.issue25867@roundup.psfhosted.org> Irit Katriel added the comment: It's doing this now, so seems like it has been fixed: % env -i ./python.exe Python 3.11.0a0 ... >>> import os >>> os.stat(u"\xf0") Traceback (most recent call last): File "", line 1, in FileNotFoundError: [Errno 2] No such file or directory: '?' >>> ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 05:45:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 09:45:22 +0000 Subject: [issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory In-Reply-To: <1614855277.19.0.209861526791.issue43398@roundup.psfhosted.org> Message-ID: <1629971122.61.0.531843358681.issue43398@roundup.psfhosted.org> Erlend E. Aasland added the comment: This issue has been fixed by recent sqlite3 improvements. Suggesting to still expand the test suite with tests for defect connection factories. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 05:46:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 09:46:00 +0000 Subject: [issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory In-Reply-To: <1614855277.19.0.209861526791.issue43398@roundup.psfhosted.org> Message-ID: <1629971160.53.0.325280898143.issue43398@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26413 status: pending -> open pull_request: https://github.com/python/cpython/pull/27966 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 05:47:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 09:47:35 +0000 Subject: [issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory In-Reply-To: <1614855277.19.0.209861526791.issue43398@roundup.psfhosted.org> Message-ID: <1629971255.51.0.319742181957.issue43398@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 05:51:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Aug 2021 09:51:38 +0000 Subject: [issue42085] Add dedicated slot for sending values In-Reply-To: <1603136296.98.0.312180912341.issue42085@roundup.psfhosted.org> Message-ID: <1629971498.51.0.0193114310003.issue42085@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Oh, my bad. I can't find the enum values of the return type, though (PySendResult). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 05:52:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Aug 2021 09:52:10 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629971530.7.0.519528142677.issue45000@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6ea6cf22e9d084c27a4fffbbd298098a6ad5b776 by Dong-hee Na in branch '3.10': [3.10] bpo-45000: Update whatsnews about deleting __debug__ (GH-27956) (GH-27958) https://github.com/python/cpython/commit/6ea6cf22e9d084c27a4fffbbd298098a6ad5b776 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 05:52:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Aug 2021 09:52:32 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629971552.7.0.041299633339.issue45000@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 Thu Aug 26 05:52:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 26 Aug 2021 09:52:30 +0000 Subject: [issue45000] del __debug__ should be a SyntaxError In-Reply-To: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org> Message-ID: <1629971550.3.0.959287777885.issue45000@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 32c1caa87f68a650f2d009a589a1db30484499cb by Dong-hee Na in branch '3.10': bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947) (GH-27957) https://github.com/python/cpython/commit/32c1caa87f68a650f2d009a589a1db30484499cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 06:07:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 10:07:38 +0000 Subject: [issue45011] tests fail when using pure-python instead of _asyncio In-Reply-To: <1629966845.23.0.661629183218.issue45011@roundup.psfhosted.org> Message-ID: <1629972458.32.0.340144312496.issue45011@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka title: tests fail when using pure-python instead of _asycio -> tests fail when using pure-python instead of _asyncio _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 06:11:16 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 26 Aug 2021 10:11:16 +0000 Subject: [issue44945] Specialize BINARY_ADD using PEP 659 machinery. In-Reply-To: <1629281508.42.0.164315730868.issue44945@roundup.psfhosted.org> Message-ID: <1629972676.7.0.214158415094.issue44945@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +26414 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27967 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 06:24:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 10:24:49 +0000 Subject: [issue45011] tests fail when using pure-python instead of _asyncio In-Reply-To: <1629966845.23.0.661629183218.issue45011@roundup.psfhosted.org> Message-ID: <1629973489.02.0.329579381768.issue45011@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26415 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27968 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 06:27:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 26 Aug 2021 10:27:07 +0000 Subject: [issue45011] tests fail when using pure-python instead of _asyncio In-Reply-To: <1629966845.23.0.661629183218.issue45011@roundup.psfhosted.org> Message-ID: <1629973627.83.0.987935702058.issue45011@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not know why asyncio.events._get_running_loop was patched in FunctionalTestCaseMixin. ---------- nosy: +lukasz.langa, pablogsal priority: normal -> release blocker type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 06:58:04 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 10:58:04 +0000 Subject: [issue36073] sqlite crashes with converters mutating cursor In-Reply-To: <1550821487.87.0.741979609564.issue36073@roundup.psfhosted.org> Message-ID: <1629975484.67.0.886297533583.issue36073@roundup.psfhosted.org> Erlend E. Aasland added the comment: This issue was fixed by GH-27884 (bpo-44976). I suggest to expand the test suite with the reproducer Sergey provided before closing the issue. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 06:59:30 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 10:59:30 +0000 Subject: [issue36073] sqlite crashes with converters mutating cursor In-Reply-To: <1550821487.87.0.741979609564.issue36073@roundup.psfhosted.org> Message-ID: <1629975570.42.0.150684074765.issue36073@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- status: pending -> open Removed message: https://bugs.python.org/msg400334 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 07:00:16 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 11:00:16 +0000 Subject: [issue36073] sqlite crashes with converters mutating cursor In-Reply-To: <1550821487.87.0.741979609564.issue36073@roundup.psfhosted.org> Message-ID: <1629975616.69.0.113321174052.issue36073@roundup.psfhosted.org> Erlend E. Aasland added the comment: After GH-27884 (bpo-44976) there is no longer a segfault. I suggest to expand the test suite with the reproducer Sergey provided. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 07:04:41 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 11:04:41 +0000 Subject: [issue36073] sqlite crashes with converters mutating cursor In-Reply-To: <1550821487.87.0.741979609564.issue36073@roundup.psfhosted.org> Message-ID: <1629975881.11.0.639161344316.issue36073@roundup.psfhosted.org> Erlend E. Aasland added the comment: Er, a little bit too fast there. There is still a crash, but it is of course postponed bco. bpo-44976. New reproducer: import sqlite3 as sqlite con = sqlite.connect(':memory:', detect_types=sqlite.PARSE_COLNAMES) cur = con.cursor() sqlite.converters['CURSOR_INIT'] = lambda x: cur.__init__(con) cur.execute('create table test(x foo)') cur.execute('insert into test(x) values (?)', ('foo',)) for row in cur.execute('select x as "x [CURSOR_INIT]", x from test'): print(row) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 07:53:33 2021 From: report at bugs.python.org (=?utf-8?q?Stanis=C5=82aw_Skonieczny_=28Uosiu=29?=) Date: Thu, 26 Aug 2021 11:53:33 +0000 Subject: [issue45012] DirEntry.stat method should release GIL Message-ID: <1629978813.83.0.528049638414.issue45012@roundup.psfhosted.org> New submission from Stanis?aw Skonieczny (Uosiu) : We have an application that crawls filesystem using `os.scandir`. It uses multiple threads for various things. Application is used on variety of filesystems, some of them might be slow or occasionally unresponsive. We have found out that sometimes whole crawling process is stuck and no thread makes any progress, even threads that are really simple, makes no IO and do not hold any locks. After running py-spy on process that was stuck we saw that one of the threads has entered `dentry.stat(follow_symlinks=False)` line and still holds the GIL. Other threads are stuck, because they are waiting for the GIL. This situation can take a long time. I think that `DirEntry` should release GIL when stat cache is empty and syscall is performed. This bug has already been fixed in `scandir` module. See: https://github.com/benhoyt/scandir/issues/131 ---------- components: Library (Lib) messages: 400337 nosy: Stanis?aw Skonieczny (Uosiu) priority: normal severity: normal status: open title: DirEntry.stat method should release GIL type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 07:55:03 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 26 Aug 2021 11:55:03 +0000 Subject: [issue25867] os.stat raises exception when using unicode and no locale is set In-Reply-To: <1450168391.42.0.368048088305.issue25867@psf.upfronthosting.co.za> Message-ID: <1629978903.15.0.870392750857.issue25867@roundup.psfhosted.org> Eryk Sun added the comment: > It's doing this now, so seems like it has been fixed Yes. In POSIX systems since Python 3.7, if the LC_CTYPE locale is the legacy "C" or "POSIX" locale, by default it tries to coerce LC_CTYPE to "C.UTF-8", "C.utf8", or "UTF-8". If coercion fails or is disabled (e.g. by defining LC_ALL), the interpreter will still use UTF-8 for the filesystem encoding if UTF-8 mode isn't disabled. If UTF-8 mode is also disabled, then ASCII is used. For example: $ LC_CTYPE=C PYTHONCOERCECLOCALE= PYTHONUTF8= python -c 'import sys; print(sys.getfilesystemencoding())' utf-8 $ LC_CTYPE=C PYTHONCOERCECLOCALE=0 PYTHONUTF8= python -c 'import sys; print(sys.getfilesystemencoding())' utf-8 $ LC_CTYPE=C PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 python -c 'import sys; print(sys.getfilesystemencoding())' ascii ---------- nosy: +eryksun resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 08:22:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 12:22:05 +0000 Subject: [issue44967] pydoc should return non-zero exit code when a query is not found In-Reply-To: <1629516147.02.0.928809585196.issue44967@roundup.psfhosted.org> Message-ID: <1629980525.7.0.718482105164.issue44967@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8868d48712aee2b490efaf60bed8dfe9fb14d6b7 by Gregory Anders in branch 'main': bpo-44967: pydoc: return non-zero exit code when query is not found (GH-27868) https://github.com/python/cpython/commit/8868d48712aee2b490efaf60bed8dfe9fb14d6b7 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 08:22:34 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 12:22:34 +0000 Subject: [issue44967] pydoc should return non-zero exit code when a query is not found In-Reply-To: <1629516147.02.0.928809585196.issue44967@roundup.psfhosted.org> Message-ID: <1629980554.35.0.599551053282.issue44967@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for the report and fix, Gregory! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 08:41:25 2021 From: report at bugs.python.org (Luke Rossi) Date: Thu, 26 Aug 2021 12:41:25 +0000 Subject: [issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows Message-ID: <1629981685.43.0.0137911951391.issue45013@roundup.psfhosted.org> New submission from Luke Rossi : I saw 33105, but believe this to be a different issue as path length 260 is valid. I did testing by crafting a path that is exactly 260 by hand - A path 259 in length reports .isfile() as True. ---------- components: Library (Lib) messages: 400341 nosy: serhiy.storchaka, ubermidget2 priority: normal severity: normal status: open title: os.path.isfile fails on path exactly 260 Chars long in Windows type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 08:44:37 2021 From: report at bugs.python.org (Luke Rossi) Date: Thu, 26 Aug 2021 12:44:37 +0000 Subject: [issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows In-Reply-To: <1629981685.43.0.0137911951391.issue45013@roundup.psfhosted.org> Message-ID: <1629981877.74.0.831378378696.issue45013@roundup.psfhosted.org> Luke Rossi added the comment: I saw 33105, but believe this to be a different issue as path length 260 is valid. I did testing by crafting a path that is exactly 260 by hand - A path 259 in length reports .isfile() as True. The Stack Error: [WinError 3] The system cannot find the path specified ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 08:48:41 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 12:48:41 +0000 Subject: [issue45011] tests fail when using pure-python instead of _asyncio In-Reply-To: <1629966845.23.0.661629183218.issue45011@roundup.psfhosted.org> Message-ID: <1629982121.14.0.0695367715012.issue45011@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26417 pull_request: https://github.com/python/cpython/pull/27970 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 08:48:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 12:48:32 +0000 Subject: [issue45011] tests fail when using pure-python instead of _asyncio In-Reply-To: <1629966845.23.0.661629183218.issue45011@roundup.psfhosted.org> Message-ID: <1629982112.59.0.903322356744.issue45011@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7dc505b8655b3e48b93a4274dfd26e5856d9c64f by Serhiy Storchaka in branch 'main': bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968) https://github.com/python/cpython/commit/7dc505b8655b3e48b93a4274dfd26e5856d9c64f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 08:48:36 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 12:48:36 +0000 Subject: [issue45011] tests fail when using pure-python instead of _asyncio In-Reply-To: <1629966845.23.0.661629183218.issue45011@roundup.psfhosted.org> Message-ID: <1629982116.88.0.0533365672574.issue45011@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26416 pull_request: https://github.com/python/cpython/pull/27969 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 09:09:21 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 26 Aug 2021 13:09:21 +0000 Subject: [issue40635] Documentation for socket.getfqdn incorrect? In-Reply-To: <1589562146.75.0.739099613667.issue40635@roundup.psfhosted.org> Message-ID: <1629983361.18.0.143772239785.issue40635@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 3.0 -> 4.0 pull_requests: +26418 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27971 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 09:40:24 2021 From: report at bugs.python.org (Takuo Matsuoka) Date: Thu, 26 Aug 2021 13:40:24 +0000 Subject: [issue45014] SyntaxError describing the error using a wrong term Message-ID: <1629985224.61.0.965048817379.issue45014@roundup.psfhosted.org> New submission from Takuo Matsuoka : The error is this: >>> *() File "", line 1 SyntaxError: can't use starred expression here I think it's right SyntaxError is raised here, but the message is incorrect. Indeed, many starred expressions are actually allowed there. E.g., >>> *(), () I happen to have filed in this issue tracker the problem that the definition of a starred expression given in the Language Reference is incorrect. https://bugs.python.org/issue44983 It appears all correct starred expressions and only them are allowed at the point of the error. Thus the error appears to be one because "*()" is not a starred expression in the correct sense. I think the wording in the message should be corrected. ---------- components: Interpreter Core messages: 400344 nosy: Takuo Matsuoka priority: normal severity: normal status: open title: SyntaxError describing the error using a wrong term type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 09:41:38 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 13:41:38 +0000 Subject: [issue45011] tests fail when using pure-python instead of _asyncio In-Reply-To: <1629966845.23.0.661629183218.issue45011@roundup.psfhosted.org> Message-ID: <1629985298.22.0.234448094877.issue45011@roundup.psfhosted.org> miss-islington added the comment: New changeset 9f814beadb3ee2c7b37e949a2acf72117a449ffd by Miss Islington (bot) in branch '3.10': bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968) https://github.com/python/cpython/commit/9f814beadb3ee2c7b37e949a2acf72117a449ffd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 09:49:02 2021 From: report at bugs.python.org (Takuo Matsuoka) Date: Thu, 26 Aug 2021 13:49:02 +0000 Subject: [issue45015] Language Reference failing to describe the treatment of starred expressions Message-ID: <1629985742.7.0.870981642172.issue45015@roundup.psfhosted.org> New submission from Takuo Matsuoka : The issue is described as Issue (1) here: https://mail.python.org/archives/list/python-ideas at python.org/message/BEGGQEU6MG7RYIY7HB4I6VQ23L6TXB6H/ Please look at "Note" just before "Issues treated" there as well. What's mentioned in this note is also filed in this issue tracker with ID 44983 https://bugs.python.org/issue44983 Coming back to Issue (1), the discrepancy is in the definitions of yield_expression, return_stmt, augmented_assignment_stmt, and for_stmt. (That is, the only exception is the definition of subscription https://docs.python.org/3/reference/expressions.html#subscriptions making the exception look inconsistent and confusing.) https://docs.python.org/3/reference/expressions.html#yield-expressions https://docs.python.org/3/reference/simple_stmts.html#the-return-statement https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements https://docs.python.org/3/reference/compound_stmts.html#the-for-statement (In case someone is interested in what are proposed over there, a summary of the proposal can also be found at https://mail.python.org/archives/list/python-ideas at python.org/message/KF37FMD5K5M2ZVTJO6IS3J6M7HHE4VRU/ ) ---------- assignee: docs at python components: Documentation messages: 400346 nosy: Takuo Matsuoka, docs at python priority: normal severity: normal status: open title: Language Reference failing to describe the treatment of starred expressions versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:30:21 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Thu, 26 Aug 2021 14:30:21 +0000 Subject: [issue45009] Get last modified date of Folders and Files using pathlib module In-Reply-To: <1629959698.42.0.950387812936.issue45009@roundup.psfhosted.org> Message-ID: <1629988221.68.0.867804282814.issue45009@roundup.psfhosted.org> Vedran ?a?i? added the comment: It probably has nothing to do with your bug, but your title is wrong. You are _not_ getting mtime using pathlib (but using os.path instead). That is done like using this approach: https://docs.python.org/3/library/pathlib.html#pathlib.Path.stat Just to eliminate irrelevant details, could you try _actually_ implement the algorithm using the above, and see if the results differ? ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:31:11 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 26 Aug 2021 14:31:11 +0000 Subject: [issue33092] The bytecode for f-string formatting is inefficient. In-Reply-To: <1521289990.47.0.467229070634.issue33092@psf.upfronthosting.co.za> Message-ID: <1629988271.41.0.829021324306.issue33092@roundup.psfhosted.org> Mark Shannon added the comment: No significant change in performance https://gist.github.com/markshannon/34a780d65e69b5a573a83f3fdb0139aa I think this merely indicates that there are little to no f-strings in the pyperformance benchmark suite. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:38:03 2021 From: report at bugs.python.org (Gopesh Singh) Date: Thu, 26 Aug 2021 14:38:03 +0000 Subject: [issue45009] Get last modified date of Folders and Files using os.path module In-Reply-To: <1629959698.42.0.950387812936.issue45009@roundup.psfhosted.org> Message-ID: <1629988683.38.0.231538516142.issue45009@roundup.psfhosted.org> Gopesh Singh added the comment: Updated title. As I used getmtime of os.path module. ---------- title: Get last modified date of Folders and Files using pathlib module -> Get last modified date of Folders and Files using os.path module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:43:10 2021 From: report at bugs.python.org (Gopesh Singh) Date: Thu, 26 Aug 2021 14:43:10 +0000 Subject: [issue45009] Get last modified date of Folders and Files using os.path module In-Reply-To: <1629959698.42.0.950387812936.issue45009@roundup.psfhosted.org> Message-ID: <1629988990.33.0.499320455841.issue45009@roundup.psfhosted.org> Gopesh Singh added the comment: Thanks Vedram for the response. Changed the title. But I get the same issue with Path.stat(). When I put a sleep time for each iteration, it works fine. Else, it gives current date as modified date. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:49:18 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 14:49:18 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629989358.35.0.318098853442.issue45001@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26420 pull_request: https://github.com/python/cpython/pull/27973 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:49:14 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 14:49:14 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629989354.18.0.721590336396.issue45001@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26419 pull_request: https://github.com/python/cpython/pull/27972 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:49:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 14:49:22 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629989362.56.0.202685163195.issue45001@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 989f6a3800f06b2bd31cfef7c3269a443ad94fac by wouter bolsterlee in branch 'main': bpo-45001: Make email date parsing more robust against malformed input (GH-27946) https://github.com/python/cpython/commit/989f6a3800f06b2bd31cfef7c3269a443ad94fac ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:49:23 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 14:49:23 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629989363.04.0.810345156267.issue45001@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26421 pull_request: https://github.com/python/cpython/pull/27974 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:49:28 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 14:49:28 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629989368.13.0.213244181959.issue45001@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26422 pull_request: https://github.com/python/cpython/pull/27975 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:49:33 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 14:49:33 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629989373.58.0.59392913263.issue45001@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26423 pull_request: https://github.com/python/cpython/pull/27976 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 10:52:28 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 26 Aug 2021 14:52:28 +0000 Subject: [issue40772] module 'resource' has no attribute 'RLIMIT_VMEM' In-Reply-To: <1590430147.26.0.291044051097.issue40772@roundup.psfhosted.org> Message-ID: <1629989548.6.0.545937952879.issue40772@roundup.psfhosted.org> Ronald Oussoren added the comment: According to https://man7.org/linux/man-pages/man2/getrlimit.2.html there is no RLIMIT_VMEM on linux, RLIMIT_AS is the closest equivalent. ---------- nosy: +ronaldoussoren resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 11:06:25 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 26 Aug 2021 15:06:25 +0000 Subject: [issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows In-Reply-To: <1629981685.43.0.0137911951391.issue45013@roundup.psfhosted.org> Message-ID: <1629990385.12.0.668018855832.issue45013@roundup.psfhosted.org> Eryk Sun added the comment: The legacy maximum buffer size is 260 characters, but remember that strings in C are terminated by a null character (i.e. "\0"). So the maximum path length is actually 259 characters when opening files. In Windows 10 with Python 3.6+, you can enable the `LongPathsEnabled` system setting to extend the limit up to about 32760 characters. In many cases you can also use the "\\\\?\\" extended-path prefix to access a long path (e.g. r"\\?\C:\some\long\path"), but the path has to be fully qualified and can only use backslash as the separator, not forward slash. ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 11:08:57 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 26 Aug 2021 15:08:57 +0000 Subject: [issue44990] Change layout of frames back to specials-locals-stack (from locals-specials-stack) In-Reply-To: <1629800315.67.0.0305853602791.issue44990@roundup.psfhosted.org> Message-ID: <1629990537.26.0.0827839684098.issue44990@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 11:09:37 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 26 Aug 2021 15:09:37 +0000 Subject: [issue44946] Integer operations are inefficient for "medium" integers. In-Reply-To: <1629282332.14.0.448234766884.issue44946@roundup.psfhosted.org> Message-ID: <1629990577.29.0.789830071318.issue44946@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 11:13:28 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 26 Aug 2021 15:13:28 +0000 Subject: [issue45016] Multiprocessing freeze support unclear Message-ID: <1629990808.31.0.282439521542.issue45016@roundup.psfhosted.org> New submission from Ronald Oussoren : The requirements on a freezing tool to work with the freeze support in the multiprocessing library are unclear. In particular, I'm trying to support multiprocessing in py2app and cannot rely on the documentation to implement that support. The particular issue I run into: - With py2app "sys.executable" points to a regular interpreter - py2app sets sys.frozen to "macosx_app" or "macosx_plugin" - Multiprocessing.spawn.get_command_line() assumes that a special command-line should be used when "sys.frozen" is set and there is no way to disable this. The easiest way for me to fix this issue is to drop setting sys.frozen in py2app, although I have no idea what other code this might break. ---------- components: Library (Lib) messages: 400354 nosy: ronaldoussoren priority: normal severity: normal status: open title: Multiprocessing freeze support unclear versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 11:25:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 26 Aug 2021 15:25:23 +0000 Subject: [issue45017] move opcode-related logic from modulefinder to dis Message-ID: <1629991523.03.0.713771310872.issue45017@roundup.psfhosted.org> New submission from Irit Katriel : The modulefinder library module has logic that understands particular opcodes (such as the scan_opcodes method). This should be encapsulated in the dis module, and modulefinder should not process opcodes directly. ---------- components: Library (Lib) messages: 400355 nosy: iritkatriel priority: normal severity: normal status: open title: move opcode-related logic from modulefinder to dis type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 11:28:19 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 26 Aug 2021 15:28:19 +0000 Subject: [issue45017] move opcode-related logic from modulefinder to dis In-Reply-To: <1629991523.03.0.713771310872.issue45017@roundup.psfhosted.org> Message-ID: <1629991699.84.0.591029825489.issue45017@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 11:47:34 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 15:47:34 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629992854.71.0.656380804481.issue45001@roundup.psfhosted.org> miss-islington added the comment: New changeset 9a79242567d79f42ad1a953cce2b1c4a94df23ea by Miss Islington (bot) in branch '3.10': bpo-45001: Make email date parsing more robust against malformed input (GH-27946) https://github.com/python/cpython/commit/9a79242567d79f42ad1a953cce2b1c4a94df23ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 11:48:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 15:48:23 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629992903.8.0.639046808343.issue45001@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2cdbd3b8b2bb4fa0dbcc04ce305fbafaeedd9e67 by Miss Islington (bot) in branch '3.9': bpo-45001: Make email date parsing more robust against malformed input (GH-27946) (GH-27973) https://github.com/python/cpython/commit/2cdbd3b8b2bb4fa0dbcc04ce305fbafaeedd9e67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 11:49:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 15:49:15 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629992955.57.0.23006636103.issue45001@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 81148c6f91092c3aa207a53b657b2548a20b230c by Miss Islington (bot) in branch '3.8': bpo-45001: Make email date parsing more robust against malformed input (GH-27946) (GH-27974) https://github.com/python/cpython/commit/81148c6f91092c3aa207a53b657b2548a20b230c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 11:51:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 15:51:01 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1629993061.29.0.13197580947.issue45001@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 12:35:52 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 26 Aug 2021 16:35:52 +0000 Subject: [issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array In-Reply-To: <1578202492.29.0.981939629191.issue39218@roundup.psfhosted.org> Message-ID: <1629995752.18.0.333980013308.issue39218@roundup.psfhosted.org> Raymond Hettinger added the comment: > what it's correcting for is an inaccurate value of "c" [...] I'll leave the logic as-is and just add a note about what is being corrected. > Numerically, it's probably not helpful. To make a difference, the mean would have to have huge magnitude relative to the variance; otherwise, squaring the error would drown it out to zero. The mean() should already be accurate to within a 1/2 ulp. The summation and division are exact. There is only a single rounding when the result converts from Fraction to a float or decimal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 12:42:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 16:42:14 +0000 Subject: [issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index Message-ID: <1629996134.04.0.676364219847.issue45018@roundup.psfhosted.org> New submission from ?ukasz Langa : Consider the following: >>> it = iter(range(2**32 + 2)) >>> for _ in range(2**32): ... _ = next(it) >>> it2 = pickle.loads( ... pickle.dumps(it) ... ) >>> assert next(it) == next(it2) This assert currently fails because the reduce method for range iterator objects serializes to `int` instead of `long`. (note that running this example might take tens of minutes on your box) ---------- messages: 400360 nosy: lukasz.langa priority: normal severity: normal stage: patch review status: open title: Pickling a range iterator with an index of over sizeof(int) stores an invalid index type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 12:42:57 2021 From: report at bugs.python.org (Jordan Limor) Date: Thu, 26 Aug 2021 16:42:57 +0000 Subject: [issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index In-Reply-To: <1629996134.04.0.676364219847.issue45018@roundup.psfhosted.org> Message-ID: <1629996177.24.0.936727675649.issue45018@roundup.psfhosted.org> Change by Jordan Limor : ---------- keywords: +patch nosy: +chilaxan nosy_count: 1.0 -> 2.0 pull_requests: +26424 pull_request: https://github.com/python/cpython/pull/27938 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 13:56:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 17:56:57 +0000 Subject: [issue45011] tests fail when using pure-python instead of _asyncio In-Reply-To: <1629966845.23.0.661629183218.issue45011@roundup.psfhosted.org> Message-ID: <1630000617.94.0.54814597842.issue45011@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 970533e65c1a1129dfc1cc1867f6ad075f7f5bf6 by Miss Islington (bot) in branch '3.9': [3.9] bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968) (GH-27970) https://github.com/python/cpython/commit/970533e65c1a1129dfc1cc1867f6ad075f7f5bf6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:06:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 18:06:39 +0000 Subject: [issue45011] tests fail when using pure-python instead of _asyncio In-Reply-To: <1629966845.23.0.661629183218.issue45011@roundup.psfhosted.org> Message-ID: <1630001199.0.0.836904400446.issue45011@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:19:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 18:19:51 +0000 Subject: [issue45010] Remove support of special method __div__ in unittest.mock In-Reply-To: <1629960589.05.0.156438795424.issue45010@roundup.psfhosted.org> Message-ID: <1630001991.16.0.0399421448031.issue45010@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f9cd40f5e242d3c64cc20a5064500f5fe864f91f by Serhiy Storchaka in branch 'main': bpo-45010: Remove support of special method __div__ in unittest.mock (GH-27965) https://github.com/python/cpython/commit/f9cd40f5e242d3c64cc20a5064500f5fe864f91f ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:20:10 2021 From: report at bugs.python.org (Diana Van Straaten) Date: Thu, 26 Aug 2021 18:20:10 +0000 Subject: [issue30274] Rename 'name' to 'fullname' argument to ExtensionFileLoader In-Reply-To: <1493936689.45.0.0881901800669.issue30274@psf.upfronthosting.co.za> Message-ID: <1630002010.19.0.847584762974.issue30274@roundup.psfhosted.org> Diana Van Straaten added the comment: I want to work on it. ---------- nosy: +zemlya3018 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:30:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 18:30:32 +0000 Subject: [issue45010] Remove support of special method __div__ in unittest.mock In-Reply-To: <1629960589.05.0.156438795424.issue45010@roundup.psfhosted.org> Message-ID: <1630002632.41.0.352962731646.issue45010@roundup.psfhosted.org> ?ukasz Langa added the comment: Agreed, let's get rid of it. Thanks! I grepped for this and there's still one left-over here: https://github.com/python/cpython/blob/f9cd40f5e242d3c64cc20a5064500f5fe864f91f/Lib/importlib/metadata/_meta.py#L40-L41 Fortunately, this was already fixed upstream: https://github.com/python/importlib_metadata/issues/334 Next time Jason syncs importlib.metadata with upstream this will be solved as well. Currently we're synced with 4.6.0 while the fix went in in 4.6.4. Also fortunately, this is low-pri since this is only in type annotations. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:40:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 18:40:31 +0000 Subject: [issue40635] Documentation for socket.getfqdn incorrect? In-Reply-To: <1589562146.75.0.739099613667.issue40635@roundup.psfhosted.org> Message-ID: <1630003231.85.0.874661403368.issue40635@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset fdcb675eed47b1f6054fae381af4388b16a6fff4 by andrei kulakov in branch 'main': bpo-40635: Fix getfqdn() docstring and docs (GH-27971) https://github.com/python/cpython/commit/fdcb675eed47b1f6054fae381af4388b16a6fff4 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:40:37 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 18:40:37 +0000 Subject: [issue40635] Documentation for socket.getfqdn incorrect? In-Reply-To: <1589562146.75.0.739099613667.issue40635@roundup.psfhosted.org> Message-ID: <1630003237.7.0.380269852358.issue40635@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26425 pull_request: https://github.com/python/cpython/pull/27977 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:40:41 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 18:40:41 +0000 Subject: [issue40635] Documentation for socket.getfqdn incorrect? In-Reply-To: <1589562146.75.0.739099613667.issue40635@roundup.psfhosted.org> Message-ID: <1630003241.66.0.666448038145.issue40635@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26426 pull_request: https://github.com/python/cpython/pull/27978 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:44:19 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 26 Aug 2021 18:44:19 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630003459.82.0.77984910435.issue44997@roundup.psfhosted.org> Ronald Oussoren added the comment: Note that sqlite3_enable_load_extension was unavailable way before macOS 11.5.1, the symbol is not present on 10.15 (I used 'nm /usr/lib/libsqlite3.dylib' to check for symbol availability). Just checking for MACOS and a system include directory should do the trick for giving a nicer error message, something like: diff --git a/setup.py b/setup.py index bc2ea16089..ae5d827339 100644 --- a/setup.py +++ b/setup.py @@ -1601,6 +1601,9 @@ def detect_sqlite(self): if '--enable-loadable-sqlite-extensions' not in sysconfig.get_config_var("CONFIG_ARGS"): sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1")) + elif MACOS and sqlite_incdir == os.path.join(MACOS_SDK_ROOT, 'usr/include'): + raise DistutilsError("System version of SQLite3 does not support loadable extensions") + if MACOS: # In every directory on the search path search for a dynamic # library and then a static library, instead of first looking With this patch I get a nice error message when trying to build with loadable sqlite extensions: make (main)cpython CC='gcc' LDSHARED='gcc -bundle -undefined dynamic_lookup ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python.exe -E ../setup.py build running build running build_ext error: System version of SQLite3 does not support loadable extensions make: *** [sharedmods] Error 1 My clone of the CPython repository is a bit of a mess at the moment, otherwise I'd have created a PR for this. Feel free to run with this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:46:11 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 18:46:11 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630003571.52.0.537940800486.issue44997@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:47:01 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 18:47:01 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630003621.31.0.688227510308.issue44997@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks, Ronald, that's a nice improvement. I'll create a PR for it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 14:48:39 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 26 Aug 2021 18:48:39 +0000 Subject: [issue44933] python3.9-intel64 hardened runtime not enabled In-Reply-To: <1629191936.44.0.533137792291.issue44933@roundup.psfhosted.org> Message-ID: <1630003719.3.0.527198711916.issue44933@roundup.psfhosted.org> Ronald Oussoren added the comment: @ned: the "reliable way to run under rosetta" is using "arch -x86_64 python3". I don't particularly like having another executable to accomplish the same goal. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:03:03 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 26 Aug 2021 19:03:03 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630004583.65.0.229569720701.issue44997@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +26427 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27979 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:06:19 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 26 Aug 2021 19:06:19 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. Message-ID: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> New submission from Eric Snow : Currently we freeze the 3 main import-related modules, as well as one module for testing. Adding more modules or otherwise making any adjustments requires manually editing several files (frozen.c, Makefile.pre.in, ...). Those files aren't particularly obvious and it's easy to miss one. So it would be helpful to have a tool that generates the necessary lines in the relevant files, to avoid manual editing. I'll be putting up a PR shortly. ---------- assignee: eric.snow components: Build messages: 400369 nosy: brett.cannon, eric.snow, gvanrossum priority: normal severity: normal stage: needs patch status: open title: Freezing modules has manual steps but could be automated. type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:13:44 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 26 Aug 2021 19:13:44 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1630005224.43.0.846622811155.issue45019@roundup.psfhosted.org> Change by Eric Snow : ---------- keywords: +patch pull_requests: +26428 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:23:58 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 26 Aug 2021 19:23:58 +0000 Subject: [issue45020] Freeze all modules imported during startup. Message-ID: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> New submission from Eric Snow : Currently we freeze the 3 main import-related modules into the python binary (along with one test module). This allows us to bootstrap the import machinery from Python modules. It also means we get better performance importing those modules. If we freeze modules that are likely to be used during execution then we get even better startup times. I'll be putting up a PR that does so, freezing all the modules that are imported during startup. This could also be done for any stdlib modules that are commonly imported. (also see #45019 and https://github.com/faster-cpython/ideas/issues/82) ---------- assignee: eric.snow components: Build messages: 400370 nosy: brett.cannon, eric.snow, gvanrossum, nedbat priority: normal severity: normal stage: needs patch status: open title: Freeze all modules imported during startup. type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:24:20 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 26 Aug 2021 19:24:20 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630005860.49.0.739983943403.issue45020@roundup.psfhosted.org> Eric Snow added the comment: FYI, with my branch I'm getting a 15% improvement to startup for "./python -c pass". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:32:11 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 26 Aug 2021 19:32:11 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630006331.16.0.892840013424.issue45020@roundup.psfhosted.org> Eric Snow added the comment: I'm aware of two potentially problematic consequences to this change: * making changes to those source files for the modules will not be reflected during execution until after "make" is run * tricks to inject hooks ASAP (e.g. coverage.py swaps the encodings module) may lose their entry point For the former, I'm not sure there's a way around it. We may consider the inconvenience worth it in order to get the performance benefits. For the latter, the obvious solution is to introduce a startup hook (e.g. on the CLI) like we've talked about doing for years. (I wasn't able to find previous discussions on that topic after a quick search.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:34:28 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Thu, 26 Aug 2021 19:34:28 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <4554daaa-829d-d4fa-5a81-2b37f75b1dc1@egenix.com> Marc-Andre Lemburg added the comment: Not sure whether you are aware, but the PyRun project I'm maintaining does that and goes beyond this by freezing almost the complete stdlib and statically linking most C extensions into a single binary: https://www.egenix.com/products/python/PyRun/ Startup is indeed better, but not as much as you might think. You do save stat calls and can share resources across processes. The big time consumer is turning marshal'ed code objects back into Python objects, though. If that could be made faster by e.g. using a more efficient storage format such as one which is platform dependent, it'd be a much bigger win than the freezing approach. ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:39:53 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 26 Aug 2021 19:39:53 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630006793.19.0.105907095265.issue45020@roundup.psfhosted.org> Change by Ronald Oussoren : ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:43:46 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 26 Aug 2021 19:43:46 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630007026.62.0.131074571998.issue45020@roundup.psfhosted.org> Eric Snow added the comment: > The big time consumer is turning marshal'ed code objects back > into Python objects, though. If that could be made faster by > e.g. using a more efficient storage format such as one which is > platform dependent, it'd be a much bigger win than the freezing > approach. That's something Guido has been exploring. :) See: https://github.com/faster-cpython/ideas/issues/84 (and others) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:45:24 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 26 Aug 2021 19:45:24 +0000 Subject: [issue30274] Rename 'name' to 'fullname' argument to ExtensionFileLoader In-Reply-To: <1493936689.45.0.0881901800669.issue30274@psf.upfronthosting.co.za> Message-ID: <1630007124.7.0.146396421753.issue30274@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +26429 pull_request: https://github.com/python/cpython/pull/27981 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:52:02 2021 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 26 Aug 2021 19:52:02 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630007522.38.0.221715539406.issue45020@roundup.psfhosted.org> Change by Ned Batchelder : ---------- nosy: -nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:55:00 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 19:55:00 +0000 Subject: [issue40635] Documentation for socket.getfqdn incorrect? In-Reply-To: <1589562146.75.0.739099613667.issue40635@roundup.psfhosted.org> Message-ID: <1630007700.59.0.332831036418.issue40635@roundup.psfhosted.org> miss-islington added the comment: New changeset 719af92e108ea3b31729cb09077673b8f13905d2 by Miss Islington (bot) in branch '3.10': bpo-40635: Fix getfqdn() docstring and docs (GH-27971) https://github.com/python/cpython/commit/719af92e108ea3b31729cb09077673b8f13905d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:55:31 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 19:55:31 +0000 Subject: [issue40635] Documentation for socket.getfqdn incorrect? In-Reply-To: <1589562146.75.0.739099613667.issue40635@roundup.psfhosted.org> Message-ID: <1630007731.39.0.916509243659.issue40635@roundup.psfhosted.org> miss-islington added the comment: New changeset f1e3fc4631da5e6ca1ea047c82bd9b42db9dd9ae by Miss Islington (bot) in branch '3.9': bpo-40635: Fix getfqdn() docstring and docs (GH-27971) https://github.com/python/cpython/commit/f1e3fc4631da5e6ca1ea047c82bd9b42db9dd9ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:55:50 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 26 Aug 2021 19:55:50 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630007750.06.0.0797534191047.issue45007@roundup.psfhosted.org> Steve Dower added the comment: The new build and tags for Windows are up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 15:56:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 26 Aug 2021 19:56:07 +0000 Subject: [issue40635] Documentation for socket.getfqdn incorrect? In-Reply-To: <1589562146.75.0.739099613667.issue40635@roundup.psfhosted.org> Message-ID: <1630007767.29.0.0813232936446.issue40635@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 16:09:17 2021 From: report at bugs.python.org (nullptr) Date: Thu, 26 Aug 2021 20:09:17 +0000 Subject: [issue45021] Race condition in thread.py Message-ID: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> New submission from nullptr : The following code can sometimes hang up import random from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor from time import sleep def worker(): with ProcessPoolExecutor() as pool: r = list(pool.map(sleep, [0.01] * 8)) if __name__ == '__main__': pool = ThreadPoolExecutor() i = 0 while True: if random.random() < 0.9: pool.submit(sleep, 0.001) else: r = pool.submit(worker) r = r.result() i += 1 print('alive', i) It's a bit hard to trigger that way but with some luck and many restarts it'll eventually freeze as r.result() never returns. The backtrace from a child process shows that the child is stuck in Lib/concurrent/futures/thread.py:_python_exit waiting for _global_shutdown_lock. The fork happened while the lock was already grabbed i.e. while executing ThreadPoolExecutor.submit ---------- components: Library (Lib) messages: 400378 nosy: xavier.lacroze priority: normal severity: normal status: open title: Race condition in thread.py versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 16:11:37 2021 From: report at bugs.python.org (Diana) Date: Thu, 26 Aug 2021 20:11:37 +0000 Subject: [issue34804] Repetition of 'for example' in documentation In-Reply-To: <1537939388.49.0.545547206417.issue34804@psf.upfronthosting.co.za> Message-ID: <1630008697.87.0.342060828251.issue34804@roundup.psfhosted.org> Diana added the comment: I will handle it. I will send a pull request within 3 days. ---------- nosy: +DonnaDia _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 16:14:46 2021 From: report at bugs.python.org (nullptr) Date: Thu, 26 Aug 2021 20:14:46 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630008886.85.0.464732398796.issue45021@roundup.psfhosted.org> Change by nullptr : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 16:55:48 2021 From: report at bugs.python.org (nullptr) Date: Thu, 26 Aug 2021 20:55:48 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630011348.25.0.304859273924.issue45021@roundup.psfhosted.org> nullptr added the comment: A more direct way to reproduce from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor from time import sleep def worker(): with ProcessPoolExecutor() as pool: r = list(pool.map(sleep, [0.01] * 8)) def submit(pool): pool.submit(submit, pool) if __name__ == '__main__': pool = ThreadPoolExecutor(2) pool.submit(submit, pool) i = 0 while True: r = pool.submit(worker) r = r.result() print(i) i += 1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 17:11:23 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 26 Aug 2021 21:11:23 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630012283.59.0.753904167062.issue45020@roundup.psfhosted.org> Eric Snow added the comment: > For the latter, the obvious solution is to introduce a startup hook I'm not sure why I said "obvious". Sorry about that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 17:13:17 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 26 Aug 2021 21:13:17 +0000 Subject: [issue45022] Update libffi to 3.4.2 Message-ID: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> New submission from Steve Dower : libffi is doing releases again! We're a few versions behind, so should pull in the latest. https://github.com/libffi/libffi/ Adding RMs for opinions on backporting, and Ned in case this impacts the macOS build. ---------- components: Build, Windows, ctypes messages: 400382 nosy: lukasz.langa, ned.deily, pablogsal, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal stage: needs patch status: open title: Update libffi to 3.4.2 type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 17:17:21 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 26 Aug 2021 21:17:21 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630012641.89.0.526842611331.issue45022@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +26430 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27982 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 17:18:27 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 26 Aug 2021 21:18:27 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630012707.48.0.84359095855.issue45022@roundup.psfhosted.org> Steve Dower added the comment: This first PR is just to avoid accidentally upgrading old builds. Otherwise, as soon as I push the new build into the cpython-bin-deps repository, it'll take precedence. This one needs backporting into 3.10 and 3.9, but should be a no-op. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 18:27:30 2021 From: report at bugs.python.org (Alessio Bogon) Date: Thu, 26 Aug 2021 22:27:30 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1630016850.19.0.323472706953.issue43468@roundup.psfhosted.org> Change by Alessio Bogon : ---------- nosy: +youtux _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 18:27:51 2021 From: report at bugs.python.org (Alessio Bogon) Date: Thu, 26 Aug 2021 22:27:51 +0000 Subject: [issue44140] WeakKeyDictionary should support lookup by id instead of hash In-Reply-To: <1621068171.99.0.542983196926.issue44140@roundup.psfhosted.org> Message-ID: <1630016871.36.0.947234769503.issue44140@roundup.psfhosted.org> Change by Alessio Bogon : ---------- nosy: +youtux _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 18:56:33 2021 From: report at bugs.python.org (Amber Wright) Date: Thu, 26 Aug 2021 22:56:33 +0000 Subject: [issue45023] Python doesn't exit with proper resultcode on SIGINT in multiprocessing.Process Message-ID: <1630018593.55.0.418512134995.issue45023@roundup.psfhosted.org> New submission from Amber Wright : The return code of python on linux/MacOS when the program is ended with a KeyboardInterrupt should be -2, when running with multiprocessing the exitcode is 1. I've attached a reproduced example. >From The Process.join() docs: https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Process.exitcode > A negative value -N indicates that the child was terminated by signal N. output: $ /usr/local/opt/python at 3.9/bin/python3 -m test Traceback (most recent call last): File "/usr/local/Cellar/python at 3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/Cellar/python at 3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/awright/docker/2108/test.py", line 49, in sys.exit(main()) File "/Users/awright/docker/2108/test.py", line 41, in main return target() File "/Users/awright/docker/2108/test.py", line 10, in target time.sleep(99999) KeyboardInterrupt proc.wait()=-2 Process SpawnProcess-1: Traceback (most recent call last): File "/usr/local/Cellar/python at 3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/usr/local/Cellar/python at 3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/Users/awright/docker/2108/test.py", line 10, in target time.sleep(99999) KeyboardInterrupt proc.exitcode=1 See also: https://bugs.python.org/issue1054041 and https://bugs.python.org/issue41602 ---------- components: Interpreter Core files: test.py messages: 400384 nosy: ambwrig priority: normal severity: normal status: open title: Python doesn't exit with proper resultcode on SIGINT in multiprocessing.Process versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50237/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 19:57:07 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 26 Aug 2021 23:57:07 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630022227.06.0.57239209838.issue45022@roundup.psfhosted.org> Steve Dower added the comment: New changeset 969ae7f7356584e30667b4e490ffa2ffa1810429 by Steve Dower in branch 'main': bpo-45022: Pin current libffi build to fixed version in preparation for upcoming update (GH-27982) https://github.com/python/cpython/commit/969ae7f7356584e30667b4e490ffa2ffa1810429 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 19:57:14 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 23:57:14 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630022234.44.0.485989880518.issue45022@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26431 pull_request: https://github.com/python/cpython/pull/27984 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 19:57:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 26 Aug 2021 23:57:17 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630022237.97.0.0934306453161.issue45022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26432 pull_request: https://github.com/python/cpython/pull/27985 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 20:25:57 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 27 Aug 2021 00:25:57 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630012283.59.0.753904167062.issue45020@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I noticed nedbat un-nosied himself. Probably he didn't realize you were calling him out because it's possible this would affect coverage.py? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 21:29:49 2021 From: report at bugs.python.org (Anup Parikh) Date: Fri, 27 Aug 2021 01:29:49 +0000 Subject: [issue45024] Cannot extend collections ABCs with protocol Message-ID: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> New submission from Anup Parikh : Since the container ABCs are normal classes, and Protocol cannot subclass normal classes, there's no way to create a protocol that extends the ABCs without explicitly listing out all the methods needed for the collection. e.g., can't do this: from typing import Iterable, Protocol class IterableWithMethod(Iterable, Protocol): def method(self) -> None: pass Since the ABCs don't provide any default implementations (I think?), maybe they should just be defined as runtime checkable protocols instead of ABCs? ---------- components: Library (Lib), Parser messages: 400387 nosy: anuppari, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Cannot extend collections ABCs with protocol type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 21:47:03 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 27 Aug 2021 01:47:03 +0000 Subject: [issue44993] enum.auto() starts with one instead of zero In-Reply-To: <1629814783.31.0.585894105546.issue44993@roundup.psfhosted.org> Message-ID: <1630028823.3.0.146806932235.issue44993@roundup.psfhosted.org> Change by Eric V. Smith : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 21:47:13 2021 From: report at bugs.python.org (Gregory Szorc) Date: Fri, 27 Aug 2021 01:47:13 +0000 Subject: [issue45025] Reliance on C bit fields is C API is undefined behavior Message-ID: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> New submission from Gregory Szorc : At least the PyASCIIObject struct in Include/cpython/unicodeobject.h uses bit fields. Various preprocessor macros like PyUnicode_IS_ASCII() and PyUnicode_KIND() access this struct's bit field. This is problematic because according to the C specification, the storage of bit fields is unspecified and may vary from compiler to compiler or architecture to architecture. Theoretically, a build of libpython with compiler A may not have the same storage layout of a bit field as a separate binary built with compiler B. These 2 binaries could be linked/loaded together, resulting in a crash or incorrect behavior at run-time. https://stackoverflow.com/questions/6043483/why-bit-endianness-is-an-issue-in-bitfields/6044223#6044223 To ensure bit field behavior is consistent, the same compiler must be used for all bit field interaction. Since it is effectively impossible to ensure this for programs like Python where multiple compilers are commonly at play (a 3rd party C extension will likely not be built on the same machine that built libpython), bit fields must not be exposed in the C API. If a bit field must exist, the bit field should not be declared in a public .h header and any APIs for accessing the bit field must be implemented as compiled functions such that only a single compiler will define the bit field storage layout. In order to avoid undefined behavior, Python's C API should avoid all use of bit fields. This issue is in response to https://github.com/PyO3/pyo3/issues/1824. ---------- components: C API messages: 400388 nosy: indygreg priority: normal severity: normal status: open title: Reliance on C bit fields is C API is undefined behavior type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 21:55:53 2021 From: report at bugs.python.org (Gregory Szorc) Date: Fri, 27 Aug 2021 01:55:53 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630029353.51.0.700685835566.issue45025@roundup.psfhosted.org> Change by Gregory Szorc : ---------- title: Reliance on C bit fields is C API is undefined behavior -> Reliance on C bit fields in C API is undefined behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 22:56:33 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 27 Aug 2021 02:56:33 +0000 Subject: [issue41818] Lib/pty.py major revision In-Reply-To: <1600557574.22.0.272934906824.issue41818@roundup.psfhosted.org> Message-ID: <1630032993.52.0.180151482507.issue41818@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset ae224bb566301d3602e9b090e37c1dcf5a48c914 by Soumendra Ganguly in branch 'main': bpo-41818: Add termios.tcgetwinsize(), termios.tcsetwinsize(). (GH-23686) https://github.com/python/cpython/commit/ae224bb566301d3602e9b090e37c1dcf5a48c914 ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 23:03:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 03:03:33 +0000 Subject: [issue45026] More compact range iterator Message-ID: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> New submission from Serhiy Storchaka : The proposed PR provides more compact implementation of the range iterator. It consumes less memory and produces smaller pickles. It is presumably faster because it performs simpler arithmetic operations on iteration (no multiplications). ---------- components: Interpreter Core messages: 400390 nosy: lukasz.langa, rhettinger, serhiy.storchaka priority: normal severity: normal status: open title: More compact range iterator type: resource usage versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 23:05:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 03:05:58 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1630033558.37.0.997596324492.issue45026@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26433 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27986 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 23:13:27 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 27 Aug 2021 03:13:27 +0000 Subject: [issue41818] Lib/pty.py major revision In-Reply-To: <1600557574.22.0.272934906824.issue41818@roundup.psfhosted.org> Message-ID: <1630034007.79.0.368744995661.issue41818@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +26434 pull_request: https://github.com/python/cpython/pull/27987 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 23:14:24 2021 From: report at bugs.python.org (Greg Werbin) Date: Fri, 27 Aug 2021 03:14:24 +0000 Subject: [issue45027] Allow basicConfig to configure any logger, not just root Message-ID: <1630034064.24.0.262638183252.issue45027@roundup.psfhosted.org> New submission from Greg Werbin : Hello all! I am proposing to add a "logger=" kwarg to logging.basicConfig(), which would cause the configuration to be applied to the specified logger. The value of this parameter could be a string or a logging.Logger object. Omitting logger= or passing logger=None would be equivalent to the current behavior, using the root logger. My rationale for this proposal is that the Python logging can be verbose to configure for "simple" use cases, and can be intimidating for new users, especially those who don't have prior experience with comparable logging frameworks in other languages. The simplicity of basicConfig() is great, but currently there is a very big usability gap between the "root logger only" case and the "fully manual configuration" case. This enhancement proposal would help to fill that gap. I observe that many Python users tend to use basicConfig() even when they would be better served by configuring only the logger(s) needed for their own app/library. And I think many of these same Python users would appreciate the reduced verbosity and greater convenience of having a "basic config" option that they could apply to various loggers independently. I know that I personally would use this enhanced basicConfig() all the time, and I hope that others feel the same way. I also believe that it would encourage adoption of sensible logging setups in a greater number of projects. Here are the Git diffs, as rendered by Github: * CPython: https://github.com/python/cpython/compare/main...gwerbin:gwerbin/basicconfig-any-logger * Mypy (typeshed): https://github.com/python/mypy/compare/master...gwerbin:gwerbin/basicconfig-any-logger ---------- components: Library (Lib) messages: 400391 nosy: gwerbin priority: normal severity: normal status: open title: Allow basicConfig to configure any logger, not just root type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 23:16:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 03:16:59 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1630034219.48.0.907649008024.issue45026@roundup.psfhosted.org> Serhiy Storchaka added the comment: Currently the range iterator contains four integers: index, start, step and len. On iteration index is increased until achieve len, the result is calculated as start+index*step. In the proposed PR the range iterator contains only three integers: index was removed. Instead len counts the number of iterations that left, and start is increased by step on every iteration. Less memory, simpler calculation. Pickle no longer contains index, but __setstate__ is kept for compatibility. The only incompatible change is that calling __setstate__ repeatedly will have different effect. Currently __setstate__ with the same values does not have effect, with this PR it will advance iterator. But Python only calls __setstate__ once for just created object when unpickle or copy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 23:29:38 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 27 Aug 2021 03:29:38 +0000 Subject: [issue41818] Lib/pty.py major revision In-Reply-To: <1600557574.22.0.272934906824.issue41818@roundup.psfhosted.org> Message-ID: <1630034978.21.0.644736293288.issue41818@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 245f1f260577a005fd631144b4377febef0b47ed by Gregory P. Smith in branch 'main': bpo-41818: ++ termios versionadded markers. (GH-27987) https://github.com/python/cpython/commit/245f1f260577a005fd631144b4377febef0b47ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Aug 26 23:42:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 27 Aug 2021 03:42:53 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630035773.02.0.440792768691.issue45020@roundup.psfhosted.org> Guido van Rossum added the comment: > The big time consumer is turning marshal'ed code objects back > into Python objects, though. If that could be made faster by > e.g. using a more efficient storage format such as one which is > platform dependent, it'd be a much bigger win than the freezing > approach. I've explored a couple of different approaches here (see the issue Eric linked to and a few adjacent ones) and this is a tricky issue. Marshal seems to be pretty darn efficient as a storage format, because it's very compact compared to the Python objects it creates. My final (?) proposal is creating static data structures embedded in the code that just *are* Python objects. Unfortunately on Windows the C compiler balks at this -- the C++ compiler handles it just fine, but it's not clear that we are able to statically link C++ object files into Python without depending on a lot of other C++ infrastructure. (In GCC and Clang this is apparently a language extension.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 00:40:58 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Fri, 27 Aug 2021 04:40:58 +0000 Subject: [issue44974] Warning about "Unknown child process pid" in test_asyncio In-Reply-To: <1629620181.19.0.253216813733.issue44974@roundup.psfhosted.org> Message-ID: <1630039258.37.0.887841133859.issue44974@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: I haven't gotten a chance to narrow it down much yet, it might be that it is occurs more often on systems with a low core count/higher load -- a bit hard to tell with it being intermittent though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 01:09:59 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 27 Aug 2021 05:09:59 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1630040999.13.0.421010922122.issue45026@roundup.psfhosted.org> Dennis Sweeney added the comment: Is it worth removing the len field as well and lazily using get_len_of_range() as needed? Then the hot function can look something like: static PyObject * rangeiter_next(rangeiterobject *r) { long result = r->start if (result < r->stop) { r->start += r->step; return PyLong_FromLong(result); } return NULL; } ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 01:10:59 2021 From: report at bugs.python.org (Ryan Mast (nightlark)) Date: Fri, 27 Aug 2021 05:10:59 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1630041059.52.0.375899425373.issue44972@roundup.psfhosted.org> Ryan Mast (nightlark) added the comment: > How is manually dispatched workflows different from just opening a PR to your own fork? I do that from time to time in order to run the CI before opening a PR against the CPython repo. Here are a few thoughts on how it is different: - They can be set up to take `inputs` that customize the behavior of the workflow run. Recently in another issue someone had asked about getting the Windows MSI installers from a CI build run but that workflow doesn't upload any artifacts; an input could be added that uploads the installers as artifacts in the cases they would useful while keeping the default behavior of not uploading artifacts for PRs, or an input could be added to enable additional debugging output/running extra tests to track down an issue - Multiple builds of the same commit can be started; if there's a test that fails intermittently you could queue up 10 runs of a workflow and come back later to see if it is still happening from a larger sample size - The jobs/workflows run can be more targeted; if you just want to build the docs part of a larger change set, you don't need to run the workflow for compiling + running tests. If all you care about is a generated installer, only that workflow needs to get run (less likely to hit the max concurrent builds for your account if you have workflows running in other non-cpython repositories) - Temporary PRs don't need closing to keep subsequent commits from runnings jobs if you don't care about their results, or after the PR gets merged in the upstream CPython repo - May be marginally faster to trigger a workflow run than opening a PR (in terms of slower loading pages/tabs on the GitHub website) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 01:18:37 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 27 Aug 2021 05:18:37 +0000 Subject: [issue44972] Add workflow_dispatch trigger for GitHub Actions jobs In-Reply-To: <1629566628.48.0.680378972885.issue44972@roundup.psfhosted.org> Message-ID: <1630041517.84.0.371330931603.issue44972@roundup.psfhosted.org> Erlend E. Aasland added the comment: Neat! Thanks :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 01:46:23 2021 From: report at bugs.python.org (Scott Macpherson) Date: Fri, 27 Aug 2021 05:46:23 +0000 Subject: [issue43513] venv: recreate symlinks on --upgrade In-Reply-To: <1615903030.34.0.439862030712.issue43513@roundup.psfhosted.org> Message-ID: <1630043183.84.0.55228835738.issue43513@roundup.psfhosted.org> Change by Scott Macpherson : ---------- nosy: +macpherson.scott _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 03:16:10 2021 From: report at bugs.python.org (Roundup Robot) Date: Fri, 27 Aug 2021 07:16:10 +0000 Subject: [issue34804] Repetition of 'for example' in documentation In-Reply-To: <1537939388.49.0.545547206417.issue34804@psf.upfronthosting.co.za> Message-ID: <1630048570.0.0.569977180502.issue34804@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +26435 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27989 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 03:24:03 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 07:24:03 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1630049043.81.0.921423908794.issue45026@roundup.psfhosted.org> Serhiy Storchaka added the comment: step can be negative. So the condition should be more complex: ((r->stop > 0) ? (result < r->stop) : (result > r->stop)). And it would look much more complex for longrangeiterobject. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 03:24:26 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 27 Aug 2021 07:24:26 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630049066.8.0.308933650627.issue45025@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 03:43:57 2021 From: report at bugs.python.org (Phani Kumar Yadavilli) Date: Fri, 27 Aug 2021 07:43:57 +0000 Subject: [issue45028] module 'unittest.mock' has no attribute 'AsyncMock' Message-ID: <1630050237.89.0.670577143839.issue45028@roundup.psfhosted.org> New submission from Phani Kumar Yadavilli : The unittest.mock does not have AsyncMock. I tested the same code in 3.9 it works fine. ---------- messages: 400400 nosy: wandermonk priority: normal severity: normal status: open title: module 'unittest.mock' has no attribute 'AsyncMock' type: compile error versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 03:49:00 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 27 Aug 2021 07:49:00 +0000 Subject: [issue45028] module 'unittest.mock' has no attribute 'AsyncMock' In-Reply-To: <1630050237.89.0.670577143839.issue45028@roundup.psfhosted.org> Message-ID: <1630050540.87.0.525095871851.issue45028@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: Can you please add a sample script to reproduce the problem. It will be also helpful to add how you run the script and also attach the error message you are getting. Given that you have selected Python 3.7 version AsyncMock was added in Python 3.8 . For Python 3.7 you might want to use the backport of mock. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 04:21:30 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 27 Aug 2021 08:21:30 +0000 Subject: [issue44945] Specialize BINARY_ADD using PEP 659 machinery. In-Reply-To: <1629281508.42.0.164315730868.issue44945@roundup.psfhosted.org> Message-ID: <1630052490.96.0.327373090322.issue44945@roundup.psfhosted.org> Mark Shannon added the comment: New changeset d3eaf0cc5b311ad023fd13e367f817d528403306 by Mark Shannon in branch 'main': bpo-44945: Specialize BINARY_ADD (GH-27967) https://github.com/python/cpython/commit/d3eaf0cc5b311ad023fd13e367f817d528403306 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 04:57:30 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 27 Aug 2021 08:57:30 +0000 Subject: [issue44945] Specialize BINARY_ADD using PEP 659 machinery. In-Reply-To: <1629281508.42.0.164315730868.issue44945@roundup.psfhosted.org> Message-ID: <1630054650.22.0.456032495025.issue44945@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 05:03:24 2021 From: report at bugs.python.org (Lyndon D'Arcy) Date: Fri, 27 Aug 2021 09:03:24 +0000 Subject: [issue45029] tkinter doc, hello world example - quit button clobbers method Message-ID: <1630055004.62.0.378999176997.issue45029@roundup.psfhosted.org> New submission from Lyndon D'Arcy : Below is the example as it is. Currently self.quit clobbers a built-in method of the same name. I would suggest renaming self.quit to self.quit_button or similar. ------------------------------------------------------- import tkinter as tk class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) self.master = master self.pack() self.create_widgets() def create_widgets(self): self.hi_there = tk.Button(self) self.hi_there["text"] = "Hello World\n(click me)" self.hi_there["command"] = self.say_hi self.hi_there.pack(side="top") self.quit = tk.Button(self, text="QUIT", fg="red", command=self.master.destroy) self.quit.pack(side="bottom") def say_hi(self): print("hi there, everyone!") root = tk.Tk() app = Application(master=root) app.mainloop() ----------------------------------------------------------- >>> help(app.quit) Help on method quit in module tkinter: quit() method of __main__.Application instance Quit the Tcl interpreter. All widgets will be destroyed. ---------- assignee: docs at python components: Documentation, Tkinter messages: 400403 nosy: docs at python, lyndon.darcy priority: normal severity: normal status: open title: tkinter doc, hello world example - quit button clobbers method versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 05:38:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 09:38:35 +0000 Subject: [issue45029] tkinter doc, hello world example - quit button clobbers method In-Reply-To: <1630055004.62.0.378999176997.issue45029@roundup.psfhosted.org> Message-ID: <1630057115.49.0.489925511502.issue45029@roundup.psfhosted.org> Serhiy Storchaka added the comment: I get different result: >>> app.quit >>> help(app.quit) Help on Button in module tkinter object: class Button(Widget) | Button(master=None, cnf={}, **kw) | | Button widget. | ... ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 05:48:43 2021 From: report at bugs.python.org (Phani Kumar Yadavilli) Date: Fri, 27 Aug 2021 09:48:43 +0000 Subject: [issue45028] module 'unittest.mock' has no attribute 'AsyncMock' In-Reply-To: <1630050540.87.0.525095871851.issue45028@roundup.psfhosted.org> Message-ID: Phani Kumar Yadavilli added the comment: from unittest import mock @mock.patch( "project.celerytasks.embedder.BulkEmbedder.fetch_embedding", mock.AsyncMock(return_value=embedding_response), ) def test_document_embedding(): doc = { "orgId": "orgtest" } doc = embed(document=doc, embedding_endpoint=embedding_endpoint) assert doc["subdocuments"] assert len(doc["title_embedding"]) == embedding_dim assert len(doc["subdocuments"]) == len(doc["paragraphs"]) assert len(doc["subdocuments"][0][embedding_name]) == embedding_dim Error: ____________________________________________________________________________________________________________________ ERROR collecting code/tests/test_embedder.py ____________________________________________________________________________________________________________________ tests/test_embedder.py:18: in mock.AsyncMock(return_value=embedding_response), E AttributeError: module 'unittest.mock' has no attribute 'AsyncMock' ============================================================================================================================== short test summary info =============================================================================================================================== ERROR tests/test_embedder.py - AttributeError: module 'unittest.mock' has no attribute 'AsyncMock' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ================================================================================================================================== 1 error in 6.02s ================================================================================================================================== Regards Phani kumar yadavilli On Fri, Aug 27, 2021 at 1:19 PM Karthikeyan Singaravelan < report at bugs.python.org> wrote: > > Karthikeyan Singaravelan added the comment: > > Can you please add a sample script to reproduce the problem. It will be > also helpful to add how you run the script and also attach the error > message you are getting. Given that you have selected Python 3.7 version > AsyncMock was added in Python 3.8 . For Python 3.7 you might want to use > the backport of mock. > > ---------- > nosy: +xtreak > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 05:57:14 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 27 Aug 2021 09:57:14 +0000 Subject: [issue44945] Specialize BINARY_ADD using PEP 659 machinery. In-Reply-To: <1629281508.42.0.164315730868.issue44945@roundup.psfhosted.org> Message-ID: <1630058234.82.0.568697750344.issue44945@roundup.psfhosted.org> Change by Mark Shannon : ---------- stage: resolved -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:03:25 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 27 Aug 2021 10:03:25 +0000 Subject: [issue44826] Specialize STORE_ATTR using PEP 659 machinery. In-Reply-To: <1628073282.4.0.475634168415.issue44826@roundup.psfhosted.org> Message-ID: <1630058605.09.0.950903680249.issue44826@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:07:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 27 Aug 2021 10:07:24 +0000 Subject: [issue45014] SyntaxError describing the error using a wrong term In-Reply-To: <1629985224.61.0.965048817379.issue45014@roundup.psfhosted.org> Message-ID: <1630058844.14.0.0995568774231.issue45014@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The error is correct: >>> *(2,3,4) File "", line 1 SyntaxError: can't use starred expression her The problem is that you are trying to use as top level while: *(), is equivalent to: (*(),) which is using them in a tuple ---------- nosy: +pablogsal resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:09:19 2021 From: report at bugs.python.org (Lyndon D'Arcy) Date: Fri, 27 Aug 2021 10:09:19 +0000 Subject: [issue45029] tkinter doc, hello world example - quit button clobbers method In-Reply-To: <1630057115.49.0.489925511502.issue45029@roundup.psfhosted.org> Message-ID: Lyndon D'Arcy added the comment: Apologies, my original post was unclear. The help(app.quit) which I posted is what we should get when the method isn't clobbered. What Serhiy has posted is what you get after running the example as-is. It shows that after running the example self.quit refers to a button object instead of the quit method. On Fri, 27 Aug 2021 at 7:38 pm, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > I get different result: > > >>> app.quit > > >>> help(app.quit) > Help on Button in module tkinter object: > > class Button(Widget) > | Button(master=None, cnf={}, **kw) > | > | Button widget. > | > ... > > ---------- > nosy: +serhiy.storchaka > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:09:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 27 Aug 2021 10:09:44 +0000 Subject: [issue44929] Some RegexFlag cannot be printed in the repr In-Reply-To: <1629151439.75.0.477829647633.issue44929@roundup.psfhosted.org> Message-ID: <1630058984.92.0.456186863873.issue44929@roundup.psfhosted.org> ?ukasz Langa added the comment: repr(re.RegexFlag(0)) no longer crashes so we can close this. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:27:33 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Aug 2021 10:27:33 +0000 Subject: [issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index In-Reply-To: <1629996134.04.0.676364219847.issue45018@roundup.psfhosted.org> Message-ID: <1630060053.82.0.794616126236.issue45018@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26437 pull_request: https://github.com/python/cpython/pull/27991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:27:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 27 Aug 2021 10:27:22 +0000 Subject: [issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index In-Reply-To: <1629996134.04.0.676364219847.issue45018@roundup.psfhosted.org> Message-ID: <1630060042.86.0.707383874348.issue45018@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 94a3d2a6329ab7941e93ad2f5bcbb8af2b8b80d2 by chilaxan in branch 'main': bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938) https://github.com/python/cpython/commit/94a3d2a6329ab7941e93ad2f5bcbb8af2b8b80d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:27:29 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Aug 2021 10:27:29 +0000 Subject: [issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index In-Reply-To: <1629996134.04.0.676364219847.issue45018@roundup.psfhosted.org> Message-ID: <1630060049.05.0.460194652214.issue45018@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26436 pull_request: https://github.com/python/cpython/pull/27990 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:37:44 2021 From: report at bugs.python.org (Jeroen Demeyer) Date: Fri, 27 Aug 2021 10:37:44 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1630060664.68.0.818144441846.issue44874@roundup.psfhosted.org> Change by Jeroen Demeyer : ---------- nosy: +jdemeyer nosy_count: 4.0 -> 5.0 pull_requests: +26438 pull_request: https://github.com/python/cpython/pull/12607 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:38:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 27 Aug 2021 10:38:23 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1630060703.81.0.715597875585.issue44874@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +26439 pull_request: https://github.com/python/cpython/pull/20104 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:48:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 27 Aug 2021 10:48:52 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1630061332.65.0.740335610012.issue44874@roundup.psfhosted.org> ?ukasz Langa added the comment: This isn't closed yet because we need a decision whether to issue warnings about Py_TRASHCAN_SAFE_BEGIN/END usage in 3.10 as well. This was suggested by Petr here: https://mail.python.org/archives/list/python-dev at python.org/message/KWFX6XX3HMZBQ2BYBVL7G74AIOPWO66Y/ I personally don't feel like it's worth going any further than 3.10: Python 3.8 is security fixes only at this point, we haven't received any reports from users about the breakage in 3.9 so far with 3.9.7 around the corner. So the backport is up to Pablo: should we raise the compiler warning on 3.10 as well? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:52:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 27 Aug 2021 10:52:16 +0000 Subject: [issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index In-Reply-To: <1629996134.04.0.676364219847.issue45018@roundup.psfhosted.org> Message-ID: <1630061536.1.0.212945790498.issue45018@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 02437641d20f58191558ba52570832ef3a30cfef by Miss Islington (bot) in branch '3.9': bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938) (GH-27991) https://github.com/python/cpython/commit/02437641d20f58191558ba52570832ef3a30cfef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:59:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 27 Aug 2021 10:59:14 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630061954.91.0.0637308603988.issue44997@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2ec9428e3516b6e7c6583687aa3b39fb96925577 by Erlend Egeberg Aasland in branch 'main': bpo-44997: macOS does not support loadable SQLite extensions (GH-27979) https://github.com/python/cpython/commit/2ec9428e3516b6e7c6583687aa3b39fb96925577 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:59:16 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Aug 2021 10:59:16 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630061956.3.0.588790596054.issue44997@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26440 pull_request: https://github.com/python/cpython/pull/27994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 06:59:19 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Aug 2021 10:59:19 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630061959.88.0.771557904216.issue44997@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26441 pull_request: https://github.com/python/cpython/pull/27995 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 07:00:37 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Aug 2021 11:00:37 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630062037.4.0.213666917377.issue44997@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26442 pull_request: https://github.com/python/cpython/pull/27996 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 07:05:05 2021 From: report at bugs.python.org (Luke Rossi) Date: Fri, 27 Aug 2021 11:05:05 +0000 Subject: [issue45013] os.path.isfile fails on path exactly 260 Chars long in Windows In-Reply-To: <1629981685.43.0.0137911951391.issue45013@roundup.psfhosted.org> Message-ID: <1630062305.61.0.0620120713402.issue45013@roundup.psfhosted.org> Luke Rossi added the comment: What an annoying edge case - makes sense that there isn't an easy fix. The extended path prefix worked perfectly - thanks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 07:13:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 27 Aug 2021 11:13:59 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1630062839.94.0.98530282121.issue44874@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I prefer to not backport this to 3.10 because technically we cannot introduce new deprecations in an rc and I don't want someone compiling with -Werror to crash between rcs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 07:14:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 27 Aug 2021 11:14:54 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1630062894.97.0.681982463296.issue44874@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 07:16:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 27 Aug 2021 11:16:13 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1630062973.53.0.181303892106.issue44874@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for your input, Pablo. In this case this can safely be closed. Thank you Irit for finding this and providing the PR! ? ? ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 07:27:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 27 Aug 2021 11:27:54 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630063674.43.0.337444619661.issue44997@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9c74678d53847f61df255435a0e5a6e3e1d657f5 by Miss Islington (bot) in branch '3.8': bpo-44997: macOS does not support loadable SQLite extensions (GH-27979) (GH-27996) https://github.com/python/cpython/commit/9c74678d53847f61df255435a0e5a6e3e1d657f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 07:29:32 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Aug 2021 11:29:32 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630063772.61.0.643317674772.issue44997@roundup.psfhosted.org> miss-islington added the comment: New changeset baa8d48230e3ab8a504f39ee800f8852897cb3be by Miss Islington (bot) in branch '3.10': bpo-44997: macOS does not support loadable SQLite extensions (GH-27979) https://github.com/python/cpython/commit/baa8d48230e3ab8a504f39ee800f8852897cb3be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 07:36:25 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 27 Aug 2021 11:36:25 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630064185.25.0.492868527292.issue44997@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9500dd5144cb911cf4e6fb027bb25b675f0e3643 by Miss Islington (bot) in branch '3.9': bpo-44997: macOS does not support loadable SQLite extensions (GH-27979) (GH-27995) https://github.com/python/cpython/commit/9500dd5144cb911cf4e6fb027bb25b675f0e3643 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 07:37:42 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 27 Aug 2021 11:37:42 +0000 Subject: [issue44997] [sqlite3] build fails on macOS 11.5.1 In-Reply-To: <1629885809.74.0.919600185255.issue44997@roundup.psfhosted.org> Message-ID: <1630064262.54.0.149230129601.issue44997@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for the fix, Ronald and Erlend! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 08:16:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 27 Aug 2021 12:16:36 +0000 Subject: [issue40608] PY3.8 GC segfault (Py_TRASHCAN_SAFE_BEGIN/END are not backwards compatible) In-Reply-To: <1589306849.27.0.146369076662.issue40608@roundup.psfhosted.org> Message-ID: <1630066596.31.0.0455134097922.issue40608@roundup.psfhosted.org> Irit Katriel added the comment: Superseeded by deprecation under Issue44874. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 10:04:01 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 27 Aug 2021 14:04:01 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630073041.69.0.220340638802.issue45020@roundup.psfhosted.org> Eric Snow added the comment: @Guido, @Mark Shannon, do you recall the other issue where folks objected to that other patch, due to local changes to source files not being reflected? Also, one thought that comes to mind is that we could ignore the frozen modules when in a dev environment (and opt in to using the frozen modules when an environment variable). ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 10:12:31 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 27 Aug 2021 14:12:31 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630073551.77.0.300849442543.issue45020@roundup.psfhosted.org> Mark Shannon added the comment: I don't recall, but... You can't modify any builtin modules. Freezing modules effectively makes them builtin from a user's perspective. There are plenty of modules that can't be modified: >>> sys.builtin_module_names ('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tokenize', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype') I don't see why adding a few more modules to that list would be a problem. Was the objection to feezing *all* modules, not just the core ones? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 10:19:20 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 27 Aug 2021 14:19:20 +0000 Subject: [issue45028] module 'unittest.mock' has no attribute 'AsyncMock' In-Reply-To: <1630050237.89.0.670577143839.issue45028@roundup.psfhosted.org> Message-ID: <1630073960.1.0.740368944249.issue45028@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: What version of Python are you using? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 10:21:51 2021 From: report at bugs.python.org (Phani Kumar Yadavilli) Date: Fri, 27 Aug 2021 14:21:51 +0000 Subject: [issue45028] module 'unittest.mock' has no attribute 'AsyncMock' In-Reply-To: <1630073960.1.0.740368944249.issue45028@roundup.psfhosted.org> Message-ID: Phani Kumar Yadavilli added the comment: I am using python 3.7. Regards Phani kumar yadavilli On Fri, Aug 27, 2021 at 7:49 PM Karthikeyan Singaravelan < report at bugs.python.org> wrote: > > Karthikeyan Singaravelan added the comment: > > What version of Python are you using? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 10:24:18 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 27 Aug 2021 14:24:18 +0000 Subject: [issue45028] module 'unittest.mock' has no attribute 'AsyncMock' In-Reply-To: <1630050237.89.0.670577143839.issue45028@roundup.psfhosted.org> Message-ID: <1630074258.53.0.201497870323.issue45028@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: AsyncMock is a feature of Python 3.8 . Please upgrade to Python 3.8 or use mock backport for AsyncMock in Python 3.7 https://github.com/testing-cabal/mock . I guess this can be closed as not a bug. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 10:26:38 2021 From: report at bugs.python.org (Phani Kumar Yadavilli) Date: Fri, 27 Aug 2021 14:26:38 +0000 Subject: [issue45028] module 'unittest.mock' has no attribute 'AsyncMock' In-Reply-To: <1630074258.53.0.201497870323.issue45028@roundup.psfhosted.org> Message-ID: Phani Kumar Yadavilli added the comment: Sure, will do that. Regards Phani kumar yadavilli On Fri, Aug 27, 2021 at 7:54 PM Karthikeyan Singaravelan < report at bugs.python.org> wrote: > > Karthikeyan Singaravelan added the comment: > > AsyncMock is a feature of Python 3.8 . Please upgrade to Python 3.8 or use > mock backport for AsyncMock in Python 3.7 > https://github.com/testing-cabal/mock . I guess this can be closed as not > a bug. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 10:33:05 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 27 Aug 2021 14:33:05 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630073551.77.0.300849442543.issue45020@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: We should ask Neil S. for the issue where Larry introduced this. That might have some discussion. But if I had to guess, it?s confusing that you can see *Python* source that you can?t edit (or rather, where editing doesn?t get reflected in the next Python run, unless you also compile it. I know that occasionally a debug session I add a print statement to a stdlib module. -- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 10:47:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 14:47:07 +0000 Subject: [issue45030] Integer overflow in __reduce__ of the range iterator Message-ID: <1630075627.02.0.307201647792.issue45030@roundup.psfhosted.org> New submission from Serhiy Storchaka : >>> it = iter(range(2**63-10, 2**63-1, 10)) >>> it.__reduce__() (, (range(9223372036854775798, -9223372036854775808, 10),), 0) >>> import pickle >>> it2 = pickle.loads(pickle.dumps(it)) >>> list(it) [9223372036854775798] >>> list(it2) [] ---------- components: Library (Lib) messages: 400428 nosy: rhettinger, serhiy.storchaka priority: normal severity: normal status: open title: Integer overflow in __reduce__ of the range iterator type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 10:52:22 2021 From: report at bugs.python.org (Jan Ripke) Date: Fri, 27 Aug 2021 14:52:22 +0000 Subject: [issue45031] [Windows] datetime.fromtimestamp(t) when t = 253402210800 fails on Python 3.8 Message-ID: <1630075942.93.0.0506592878726.issue45031@roundup.psfhosted.org> New submission from Jan Ripke : When executing the following statement on a Windows machine it fails. On a linux machine it returns the expected date (9999-31-12 00:00:00) The Error we get on Windows is: OSError: [Errno 22] Invalid argument In another manor it was reported before: https://bugs.python.org/issue29097 The code: from datetime import datetime epoch_time = 253402210800000/1000 print(datetime.fromtimestamp(epoch_time)) ---------- components: Windows messages: 400429 nosy: janripke, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: [Windows] datetime.fromtimestamp(t) when t = 253402210800 fails on Python 3.8 type: crash versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 11:24:11 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 27 Aug 2021 15:24:11 +0000 Subject: [issue45028] module 'unittest.mock' has no attribute 'AsyncMock' In-Reply-To: <1630050237.89.0.670577143839.issue45028@roundup.psfhosted.org> Message-ID: <1630077851.76.0.415875101122.issue45028@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: compile error -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 12:05:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 16:05:22 +0000 Subject: [issue45030] Integer overflow in __reduce__ of the range iterator In-Reply-To: <1630075627.02.0.307201647792.issue45030@roundup.psfhosted.org> Message-ID: <1630080322.67.0.59538455702.issue45030@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26443 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28000 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 12:22:46 2021 From: report at bugs.python.org (sedrubal) Date: Fri, 27 Aug 2021 16:22:46 +0000 Subject: [issue20779] Add pathlib.chown method In-Reply-To: <1393408310.22.0.917230781145.issue20779@psf.upfronthosting.co.za> Message-ID: <1630081366.61.0.488638747718.issue20779@roundup.psfhosted.org> Change by sedrubal : ---------- nosy: +sedrubal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 12:27:56 2021 From: report at bugs.python.org (sedrubal) Date: Fri, 27 Aug 2021 16:27:56 +0000 Subject: [issue13033] Add shutil.chowntree In-Reply-To: <1316769849.87.0.0298236424523.issue13033@psf.upfronthosting.co.za> Message-ID: <1630081676.51.0.971625951098.issue13033@roundup.psfhosted.org> Change by sedrubal : ---------- nosy: +sedrubal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 12:28:38 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Aug 2021 16:28:38 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630081718.86.0.316925191714.issue45022@roundup.psfhosted.org> miss-islington added the comment: New changeset 399cd466d0379d12e4af343a49ca7e8ec84997fa by Miss Islington (bot) in branch '3.9': bpo-45022: Pin current libffi build to fixed version in preparation for upcoming update (GH-27982) https://github.com/python/cpython/commit/399cd466d0379d12e4af343a49ca7e8ec84997fa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 12:28:58 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 27 Aug 2021 16:28:58 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630081738.49.0.538790876567.issue45022@roundup.psfhosted.org> miss-islington added the comment: New changeset db36fdb1f42f490b7c2a3484a69aa1e6c72b6a4c by Miss Islington (bot) in branch '3.10': bpo-45022: Pin current libffi build to fixed version in preparation for upcoming update (GH-27982) https://github.com/python/cpython/commit/db36fdb1f42f490b7c2a3484a69aa1e6c72b6a4c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 12:35:30 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 27 Aug 2021 16:35:30 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630082130.28.0.331805718997.issue45022@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +26444 pull_request: https://github.com/python/cpython/pull/28001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 12:39:14 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 27 Aug 2021 16:39:14 +0000 Subject: [issue45022] Update libffi to 3.4.2 In-Reply-To: <1630012397.4.0.321187135755.issue45022@roundup.psfhosted.org> Message-ID: <1630082354.22.0.883194746822.issue45022@roundup.psfhosted.org> Steve Dower added the comment: Realised that 3.8 needs the change to ensure it keeps using the same build of libffi. Obviously it won't be getting the new one (and since the new one is apparently a new API version, it may not even go into 3.10). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 13:01:33 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 27 Aug 2021 17:01:33 +0000 Subject: [issue45029] tkinter doc, hello world example - quit button clobbers method In-Reply-To: <1630055004.62.0.378999176997.issue45029@roundup.psfhosted.org> Message-ID: <1630083693.92.0.322558155757.issue45029@roundup.psfhosted.org> E. Paine added the comment: Thanks for reporting this issue. This was (very) recently fixed in issue42560 / PR27842. These changes include a new hello world example and can be seen in the 3.10 / 3.11 docs (https://docs.python.org/3.10/library/tkinter.html#a-hello-world-program). This change was backported to 3.9 docs, but the build bots have yet to rebuild the version hosted on docs.python.org. ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 13:13:38 2021 From: report at bugs.python.org (Jorge Rojas) Date: Fri, 27 Aug 2021 17:13:38 +0000 Subject: [issue45032] struct.unpack() returns NaN Message-ID: <1630084418.34.0.275202976554.issue45032@roundup.psfhosted.org> New submission from Jorge Rojas : Hi all! I have this case when trying to get a float value applying pack to these integer values: struct.unpack('f', struct.pack('HH', 0, 32704)) This happens when executing the unpack function to a float format, from a bit-array where the sign bit is not in a suitable position I think. Applying big-endian to the format, it returns a numeric value, but being little-endian it returns a NaN. > struct.unpack(' struct.unpack('>f', struct.pack('HH',0, 32704)) Out[169]: (6.905458702346266e-41,) The current documentation on struct.unpack doesn't anything about what conditions a NaN is returned, besides this might be a expected value. Maybe explaining how this value could be converted to an equivalent format to retrieve the proper value may help, or why this returns a NaN and how to avoid it. Thanks in advance. ---------- components: Library (Lib) messages: 400434 nosy: jrojas priority: normal severity: normal status: open title: struct.unpack() returns NaN type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 13:21:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 27 Aug 2021 17:21:17 +0000 Subject: [issue14088] sys.executable generating canonical path In-Reply-To: <1329928617.24.0.609517948319.issue14088@psf.upfronthosting.co.za> Message-ID: <1630084877.07.0.727330799709.issue14088@roundup.psfhosted.org> Irit Katriel added the comment: This is still unresolved: iritkatriel at Irits-MBP Lib % pwd /Users/iritkatriel/src/cpython-1/Lib iritkatriel at Irits-MBP Lib % ../python.exe -m test -v test_sys [snipped] ====================================================================== FAIL: test_executable (test.test_sys.SysModuleTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_sys.py", line 692, in test_executable self.assertEqual(os.path.abspath(sys.executable), sys.executable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: '/Users/iritkatriel/src/cpython-1/python.exe' != '/Users/iritkatriel/src/cpython-1/Lib/../python.exe' - /Users/iritkatriel/src/cpython-1/python.exe + /Users/iritkatriel/src/cpython-1/Lib/../python.exe ? +++++++ ---------- components: +Library (Lib) -None nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 14:02:05 2021 From: report at bugs.python.org (Diana) Date: Fri, 27 Aug 2021 18:02:05 +0000 Subject: [issue33426] [doc] Behavior of os.path.join does not match documentation In-Reply-To: <1525459146.45.0.682650639539.issue33426@psf.upfronthosting.co.za> Message-ID: <1630087325.98.0.733816044154.issue33426@roundup.psfhosted.org> Diana added the comment: Hi, I'm working on it. I will provide the pull request within 3 days. ---------- nosy: +DonnaDia _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 14:18:28 2021 From: report at bugs.python.org (Diana) Date: Fri, 27 Aug 2021 18:18:28 +0000 Subject: [issue33426] [doc] Behavior of os.path.join does not match documentation In-Reply-To: <1525459146.45.0.682650639539.issue33426@psf.upfronthosting.co.za> Message-ID: <1630088308.5.0.42049719902.issue33426@roundup.psfhosted.org> Change by Diana : ---------- keywords: +patch pull_requests: +26445 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28003 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 14:25:38 2021 From: report at bugs.python.org (Diana) Date: Fri, 27 Aug 2021 18:25:38 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1630088738.97.0.730796175012.issue44925@roundup.psfhosted.org> Diana added the comment: Hi, I can handle this. I will provide a pull request within 3 days. ---------- nosy: +DonnaDia _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 14:38:09 2021 From: report at bugs.python.org (Diana) Date: Fri, 27 Aug 2021 18:38:09 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1630089489.21.0.407882546993.issue44925@roundup.psfhosted.org> Change by Diana : ---------- keywords: +patch pull_requests: +26446 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28004 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 14:50:55 2021 From: report at bugs.python.org (Diana) Date: Fri, 27 Aug 2021 18:50:55 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1630090255.94.0.267039214325.issue24888@roundup.psfhosted.org> Diana added the comment: Hi, I will work on this. I will create a pull request within 3 days. ---------- nosy: +DonnaDia _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 15:39:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 19:39:33 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630093173.85.0.189228156707.issue25130@roundup.psfhosted.org> Serhiy Storchaka added the comment: Unfortunately Martin's comments are not available now, after shutting down the Rietveld service. Here is a new PR which contains extraction of PyPy changes related to calling gc.collect() for 3.8. I removed changes which look specific for PyPy and left changes which look common for every implementation without reference counting. ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 15:40:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 19:40:26 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630093226.42.0.357538236225.issue25130@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26447 pull_request: https://github.com/python/cpython/pull/28005 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 16:02:37 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 27 Aug 2021 20:02:37 +0000 Subject: [issue44983] Wrong definition of a starred expression in the Language Reference In-Reply-To: <1629725570.26.0.70854073558.issue44983@roundup.psfhosted.org> Message-ID: <1630094557.56.0.421871787659.issue44983@roundup.psfhosted.org> ?ric Araujo added the comment: Hello! For future tickets, please include all relevant info here rather that only links. Linked message is: According to the Language Reference, a starred expression is defined by starred_expression ::= expression | (starred_item ",")* [starred_item] https://docs.python.org/3/reference/expressions.html#expression-lists However, in view of the definition of an assignment statement assignment_stmt ::= (target_list "=")+ (starred_expression | yield_expression) https://docs.python.org/3/reference/simple_stmts.html#assignment-statements I believe the correct definition actually used is starred_expression ::= expression | (starred_item ",")+ [starred_item] (that is, use "+" instead of "*"). Should it be fixed? ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 16:04:36 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 27 Aug 2021 20:04:36 +0000 Subject: [issue44983] Wrong definition of a starred expression in the Language Reference In-Reply-To: <1629725570.26.0.70854073558.issue44983@roundup.psfhosted.org> Message-ID: <1630094676.08.0.862300466465.issue44983@roundup.psfhosted.org> ?ric Araujo added the comment: This should answer questions about the processes: https://devguide.python.org/tracker/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 16:28:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 20:28:09 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1630096089.58.0.480839441976.issue43913@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are several other bugs in the code for cleaning up classes and modules: * Functions registered with addClassCleanup() are not called if tearDownClass is set to None or its look up raises AttributeError. * Buffering in TestResult blows up when functions registered with addClassCleanup() and addModuleCleanup() produce raise exceptions. * Buffering in TestResult does not buffer output of functions registered with addClassCleanup() and addModuleCleanup(). * TestSuite.debug() blows up if functions registered with addClassCleanup() and addModuleCleanup() raise exceptions. * Errors in setUpModule() and function registered with addModuleCleanup() are reported in wrong order. And several lesser bugs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 16:46:55 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 27 Aug 2021 20:46:55 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1630097215.95.0.784216741974.issue43913@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26448 pull_request: https://github.com/python/cpython/pull/28006 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 17:14:30 2021 From: report at bugs.python.org (Roundup Robot) Date: Fri, 27 Aug 2021 21:14:30 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630098870.73.0.162218777342.issue45021@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +26449 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28007 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 17:16:25 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 27 Aug 2021 21:16:25 +0000 Subject: [issue19113] duplicate test names in Lib/ctypes/test/test_functions.py In-Reply-To: <1380385419.52.0.767012097586.issue19113@psf.upfronthosting.co.za> Message-ID: <1630098985.72.0.204895403233.issue19113@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 8.0 -> 9.0 pull_requests: +26450 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28008 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 17:22:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Aug 2021 21:22:02 +0000 Subject: [issue44989] Fix documentation for truth testing In-Reply-To: <1629776000.21.0.00803055274817.issue44989@roundup.psfhosted.org> Message-ID: <1630099322.39.0.844347206702.issue44989@roundup.psfhosted.org> Terry J. Reedy added the comment: I think that this proposal is either premature or not needed. (But did you have anything specific in mind.) As you indicated, there are two separate subissues here. 1. NotImplemented: Issue 35712 added "It should not be evaluated in a boolean context" to its entry in Library/constant.rst, followed by the notice of deprecation and intended removal. I don't think we should document the possible future change a second time elsewhere. I agree that if and when NotImplemented becomes an exception and 'bool(NotImplemented)' fails, then the exception should be added sentence you quoted. But I think it possible that the warning will be left indefinitely (and think it should be) and would instead propose that the claim of future removal be removed. 2. 2nd and 3rd party invalidation: I believe that several claims can be invalidated if one used special methods in ways not intended. The all have the unwritten caveat 'as long as special methods are not abused'. We have so far intentionally not added special mention of all such possible breakages. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 17:39:48 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Aug 2021 21:39:48 +0000 Subject: [issue44995] "Hide the prompts and output" works abnormal In-Reply-To: <1629858915.39.0.643058961708.issue44995@roundup.psfhosted.org> Message-ID: <1630100388.29.0.907599911587.issue44995@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 17:43:52 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 27 Aug 2021 21:43:52 +0000 Subject: [issue44998] macOS build test failure In-Reply-To: <1629886173.59.0.970748469767.issue44998@roundup.psfhosted.org> Message-ID: <1630100632.93.0.401295595365.issue44998@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren title: tests failed -> macOS build test failure _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 18:13:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 27 Aug 2021 22:13:55 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630102435.94.0.479227782818.issue45021@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +pitrou, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 18:17:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 27 Aug 2021 22:17:41 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630102661.75.0.586106569599.issue45021@roundup.psfhosted.org> Irit Katriel added the comment: I'm seeing this (intermittently) on main branch, could be related? iritkatriel at Irits-MBP cpython-1 % ./python.exe Lib/test/test_importlib/partial/pool_in_threads.py Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/partial/pool_in_threads.py", line 9, in t with multiprocessing.Pool(1): ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/partial/pool_in_threads.py", line 9, in t with multiprocessing.Pool(1): ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/partial/pool_in_threads.py", line 9, in t File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/partial/pool_in_threads.py", line 9, in t with multiprocessing.Pool(1): ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/partial/pool_in_threads.py", line 9, in t with multiprocessing.Pool(1): ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/partial/pool_in_threads.py", line 9, in t with multiprocessing.Pool(1): ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() ^^^^^^^^^^^^^^^^^^^^^^^ Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 303, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 303, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 303, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/partial/pool_in_threads.py", line 9, in t with multiprocessing.Pool(1): ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 326, in _repopulate_pool_static w.start() ^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 326, in _repopulate_pool_static w.start() ^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 326, in _repopulate_pool_static w.start() ^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) ^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) ^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) ^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) ^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/popen_spawn_posix.py", line 58, in _launch self.pid = util.spawnv_passfds(spawn.get_executable(), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/util.py", line 450, in spawnv_passfds errpipe_read, errpipe_write = os.pipe() ^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 212, in __init__ self._repopulate_pool() ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/popen_spawn_posix.py", line 54, in _launch child_r, parent_w = os.pipe() ^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) ^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) ^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 303, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/multiprocessing/pool.py", line 326, in _repopulate_pool_static w.start() ^^^^^^^^^ OSError: [Errno 24] Too many open files iritkatriel at Irits-MBP cpython-1 % /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 59 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-2xx2cl25': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-8ru9f83a': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-vn_5pkc4': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-2l68znmb': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-5onb3wo5': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-8yle2uvb': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-n0jgz2b_': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-18ikpx7f': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-ikdrzqcc': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) /Users/iritkatriel/src/cpython-1/Lib/multiprocessing/resource_tracker.py:237: UserWarning: resource_tracker: '/mp-1cecwdl7': [Errno 2] No such file or directory warnings.warn('resource_tracker: %r: %s' % (name, e)) ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 18:48:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 27 Aug 2021 22:48:43 +0000 Subject: [issue33511] Update config.sub In-Reply-To: <1526351643.4.0.682650639539.issue33511@psf.upfronthosting.co.za> Message-ID: <1630104523.94.0.239461011008.issue33511@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> update config.guess and config.sub _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 18:51:01 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 27 Aug 2021 22:51:01 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630104661.83.0.505319604788.issue45007@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +26451 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28009 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 19:17:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 27 Aug 2021 23:17:57 +0000 Subject: [issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h In-Reply-To: <1359956347.87.0.611737971795.issue17120@psf.upfronthosting.co.za> Message-ID: <1630106277.35.0.0481966916947.issue17120@roundup.psfhosted.org> Irit Katriel added the comment: I can't find pyconfig.h or "#define _POSIX_C_SOURCE" or "#define _XOPEN_SOURCE". If nobody will object I will soon close this issue as out of date. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 19:31:50 2021 From: report at bugs.python.org (nullptr) Date: Fri, 27 Aug 2021 23:31:50 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630107110.0.0.160455888207.issue45021@roundup.psfhosted.org> nullptr added the comment: I don't think so: this issue would only arise when using fork on linux and not spawn (win/osx) like it seems your system is doing ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 19:43:05 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 27 Aug 2021 23:43:05 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630107785.98.0.535523397157.issue45020@roundup.psfhosted.org> Eric Snow added the comment: Neil, do you recall the story here? ---------- nosy: +BTaskaya, brandtbucher, nascheme _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 19:56:25 2021 From: report at bugs.python.org (Zac Bentley) Date: Fri, 27 Aug 2021 23:56:25 +0000 Subject: [issue45033] Calls to PyErr_PrintEx in destructors cause calling async functions to incorrectly return None Message-ID: <1630108585.95.0.412897766167.issue45033@roundup.psfhosted.org> New submission from Zac Bentley : If an object's destructor contains native code which calls PyErr_PrintEx, and that object's refcount drops to zero as the result of an async function returning, the async function incorrectly returns None. I first identified this behavior while using Boost-python. A more detailed description, and steps to reproduce, are in the issue report I filed on that library: https://github.com/boostorg/python/issues/374 I'm not very familiar with interpreter internals, so it is possible that this is expected behavior. However, it does seem like at least a leaky abstraction between the mechanics of async calls (which use exception based control flow internally) and the PyErr_PrintEx function, which is typically invoked by callers interested in finding out about errors that they caused, not errors that are both caused elsewhere and whose propagation is important to preserving call stack state. ---------- components: C API, Interpreter Core, asyncio messages: 400448 nosy: asvetlov, yselivanov, zbentley priority: normal severity: normal status: open title: Calls to PyErr_PrintEx in destructors cause calling async functions to incorrectly return None type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 20:29:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 28 Aug 2021 00:29:32 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630110572.22.0.000406266939046.issue45020@roundup.psfhosted.org> Guido van Rossum added the comment: The plot thickens. By searching my extensive GMail archives for Jeethu Rao I found an email from Sept. 14 to python-dev by Larry Hastings titled "Store startup modules as C structures for 20%+ startup speed improvement?" It references an issue and a PR: https://bugs.python.org/issue34690 https://github.com/python/cpython/pull/9320 Here's a link to the python-dev thread: https://mail.python.org/pipermail/python-dev/2018-September/155188.html There's a lot of discussion there. I'll try to dig through it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 20:37:00 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 28 Aug 2021 00:37:00 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630111020.26.0.335168925986.issue45020@roundup.psfhosted.org> Guido van Rossum added the comment: Adding Larry in case he remembers more color. (Larry: the key question here is whether some version of this (like the one I've been working on, or a simpler one that Eric has prepared) is viable, given that any time someone works on one of the frozen or deep-frozen stdlib modules, they will have to run make (with the default target) to rebuild the Python binary with the deep-frozen files. (Honestly if I were working on any of those modules, I'd just comment out some lines from Eric's freeze_modules.py script and do one rebuild until I was totally satisfied with my work. Either way it's a suboptimal experience for people contributing to those modules. But we stand to gain a ~20% startup time improvement.) PS. The top comment links to Eric's work. ---------- nosy: +larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 20:39:42 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 28 Aug 2021 00:39:42 +0000 Subject: [issue45032] struct.unpack() returns NaN In-Reply-To: <1630084418.34.0.275202976554.issue45032@roundup.psfhosted.org> Message-ID: <1630111182.43.0.444781853816.issue45032@roundup.psfhosted.org> Steven D'Aprano added the comment: This is not a bug, and I'm unconvinced that it needs a documentation change. If you are using struct to assemble values, you need to know the meaning of the struct format. It returns a float NAN because you give it the bit pattern of a NAN. For C singles and doubles, some bit patterns give numbers, two give signed zeroes, two give signed INFs (infinities), and some give NANs. If your bit pattern happens to be a NAN, you will get a NAN. That is no more special or unexpected than this: >>> struct.unpack('>f', struct.pack('HH', 65, 7392)) (8.05471420288086,) >>> struct.unpack(' not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 21:02:05 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 28 Aug 2021 01:02:05 +0000 Subject: [issue45034] Improve struct.pack out of range error messages Message-ID: <1630112525.53.0.10403701832.issue45034@roundup.psfhosted.org> New submission from Steven D'Aprano : Packing errors using struct in 3.9 seem to be unnecessarily obfuscated to me. >>> import struct >>> struct.pack('H', 70000) Traceback (most recent call last): File "", line 1, in struct.error: ushort format requires 0 <= number <= (0x7fff * 2 + 1) Why "0x7fff * 2 + 1"? Why not the more straightforward "0xffff" or 65536? (I have a slight preference for hex.) Compare that to: >>> struct.pack('I', 4300000000) Traceback (most recent call last): File "", line 1, in struct.error: 'I' format requires 0 <= number <= 4294967295 which at least gives the actual value, but it would perhaps be a bit more useful in hex 0xffffffff. For the long-long format, the error message just gives up: >>> struct.pack('Q', 2**65) Traceback (most recent call last): File "", line 1, in struct.error: argument out of range Could be improved by: 'Q' format requires 0 <= number <= 0xffff_ffff_ffff_ffff ---------- components: Library (Lib) messages: 400452 nosy: steven.daprano priority: normal severity: normal status: open title: Improve struct.pack out of range error messages type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 21:27:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Aug 2021 01:27:45 +0000 Subject: [issue45032] struct.unpack() returns NaN In-Reply-To: <1630084418.34.0.275202976554.issue45032@roundup.psfhosted.org> Message-ID: <1630114065.21.0.908103795826.issue45032@roundup.psfhosted.org> Terry J. Reedy added the comment: Jorge, next time you have questions about how to use a module (and struct is fairly advanced), please ask on an appropriate forum, such as python-list. Then Steven's nice answer could be read by 100s of people instead of likely less than 10. I looked as the struct doc to see if I thought it needs anything and decided I agree with Stephen that not. Struct can pack and unpack various IEEE binary floating point formats. Anyone doing serious work with such knows that they include infinities and nans. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 21:48:38 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 28 Aug 2021 01:48:38 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630115318.9.0.994102735025.issue45020@roundup.psfhosted.org> Larry Hastings added the comment: Since nobody's said so in so many words (so far in this thread anyway): the prototype from Jeethu Rao in 2018 was a different technology than what Eric is doing. The "Programs/_freeze_importlib.c" Eric's playing with essentially inlines a .pyc file as C static data. The Jeethu Rao approach is more advanced: instead of serializing the objects, it stores the objects from the .pyc file as pre-initialized C static objects. So it saves the un-marshalling step, and therefore should be faster. To import the module you still need to execute the module body code object though--that seems unavoidable. The python-dev thread covers nearly everything I remember about this. The one thing I guess I never mentioned is that building and working with the prototype was frightful; it had both Python code and C code, and it was fragile and hard to get working. My hunch at the time was that it shouldn't be so fragile; it should be possible to write the converter in Python: read in .pyc file, generate .c file. It might have to make assumptions about the internal structure of the CPython objects it instantiates as C static data, but since we'd ship the tool with CPython this should be only a minor maintenance issue. In experimenting with the prototype, I observed that simply calling stat() to ensure the frozen .py file hadn't changed on disk lost us about half the performance win from this approach. I'm not much of a systems programmer, but I wonder if there are (system-proprietary?) library calls one could make to get the stat info for all files in a single directory all at once that might be faster overall. (Of course, caching this information at startup might make for a crappy experience for people who edit Lib/*.py files while the interpreter is running.) One more observation about the prototype: it doesn't know how to deal with any mutable types. marshal.c can deal with list, dict, and set. Does this matter? ISTM the tree of objects under a code object will never have a reference to one of these mutable objects, so it's probably already fine. Not sure what else I can tell you. It gave us a measurable improvement in startup time, but it seemed fragile, and it was annoying to work with/on, so after hacking on it for a week (at the 2018 core dev sprint in Redmond WA) I put it aside and moved on to other projects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 22:08:52 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 28 Aug 2021 02:08:52 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630116532.55.0.556384842283.issue45020@roundup.psfhosted.org> Larry Hastings added the comment: There should be a boolean flag that enables/disables cached copies of .py files from Lib/. You should be able to turn it off with either an environment variable or a command-line option, and when it's off it skips all the internal cached stuff and uses the normal .py / .pyc machinery. With that in place, it'd be great to pre-cache all the .py files automatically read in at startup. As for changes to the build process: the most analogous thing we have is probably Argument Clinic. For what it's worth, Clinic hasn't been very well integrated into the CPython build process. There's a pseudotarget that runs it for you in the Makefile, but it's only ever run manually, and I'm not sure there's *any* build automation for Windows developers. AFAIK it hasn't really been a problem. But then I'm not sure this is a very good analogy--the workflow for making Clinic changes is very different from people hacking on Lib/*.py. It might be sensible to add a mechanism that checks whether or not the pre-cached modules are current. Store a hash for each cached module and check that they all match. This could then be part of the release process, run from a GitHub hook, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 22:16:38 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 28 Aug 2021 02:16:38 +0000 Subject: [issue33084] statistics module: NaN handling in median, median_high an median_low In-Reply-To: <1629495446.36.0.117007738638.issue33084@roundup.psfhosted.org> Message-ID: <20210828021537.GC27215@ando.pearwood.info> Steven D'Aprano added the comment: See thread on Python-Ideas. https://mail.python.org/archives/list/python-ideas at python.org/thread/EDRF2NR4UOYMSKE64KDI2SWUMKPAJ3YM/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 23:05:05 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 28 Aug 2021 03:05:05 +0000 Subject: [issue25597] unittest.mock does not wrap dunder methods (__getitem__ etc) In-Reply-To: <1447174958.96.0.448093662654.issue25597@psf.upfronthosting.co.za> Message-ID: <1630119905.25.0.227176314356.issue25597@roundup.psfhosted.org> Andrei Kulakov added the comment: I went through dunder methods to check if any other operators or builtins work on objects without respective dunder methods: - del x works even though there is no object.__del__ - operator.length_hint() => 0 when there is no object.__length_hint__ So in addition to __bool__, these dunder methods would have to be special cased. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 23:08:12 2021 From: report at bugs.python.org (Eryk Sun) Date: Sat, 28 Aug 2021 03:08:12 +0000 Subject: [issue45031] [Windows] datetime.fromtimestamp(t) when t = 253402210800 fails on Python 3.8 In-Reply-To: <1630075942.93.0.0506592878726.issue45031@roundup.psfhosted.org> Message-ID: <1630120092.81.0.332810313574.issue45031@roundup.psfhosted.org> Eryk Sun added the comment: The supported range depends on the platform. The C runtime library in Windows can handle dates through the year 3000 [1]: >>> datetime.fromtimestamp(32536799999) datetime.datetime(3001, 1, 19, 7, 59, 59) >>> datetime.fromtimestamp(32536800000) Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument --- [1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/gmtime-gmtime32-gmtime64?view=msvc-160 ---------- nosy: +eryksun resolution: -> third party stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Aug 27 23:08:41 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 28 Aug 2021 03:08:41 +0000 Subject: [issue44809] Changelog missing removal of StrEnum etc. In-Reply-To: <1627906937.39.0.327433164161.issue44809@roundup.psfhosted.org> Message-ID: <1630120121.98.0.699955014711.issue44809@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 00:03:14 2021 From: report at bugs.python.org (Greg Werbin) Date: Sat, 28 Aug 2021 04:03:14 +0000 Subject: [issue45027] Allow basicConfig to configure any logger, not just root In-Reply-To: <1630034064.24.0.262638183252.issue45027@roundup.psfhosted.org> Message-ID: <1630123394.89.0.457809499711.issue45027@roundup.psfhosted.org> Change by Greg Werbin : ---------- keywords: +patch pull_requests: +26452 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28010 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 00:06:43 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 28 Aug 2021 04:06:43 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630123603.14.0.639670821622.issue45020@roundup.psfhosted.org> Guido van Rossum added the comment: > Since nobody's said so in so many words (so far in this thread anyway): the prototype from Jeethu Rao in 2018 was a different technology than what Eric is doing. The "Programs/_freeze_importlib.c" Eric's playing with essentially inlines a .pyc file as C static data. The Jeethu Rao approach is more advanced: instead of serializing the objects, it stores the objects from the .pyc file as pre-initialized C static objects. So it saves the un-marshalling step, and therefore should be faster. To import the module you still need to execute the module body code object though--that seems unavoidable. Yes, I know. We're discussing two separate ideas -- Eric's approach, which is doing the same we're doing for importlib for more stdlib modules; and "my" approach, dubbed "deep-freeze", which is similar to Jeethu's approach (details in https://github.com/faster-cpython/ideas/issues/84). What the two approaches have in common is that they require rebuilding the python binary whenever you edit any of the changed modules. I heard somewhere (I'm sorry, I honestly don't recall who said it first, possibly Eric himself) that Jeethu's approach was rejected because of that. FWIW in my attempts to time this, it looks like the perf benefits of Eric's approach are close to those of deep-freezing. And deep-freezing causes much more bloat of the source code and of the resulting binary. (At runtime the binary size is made up by matching heap savings, but to some people binary size is important too.) > The python-dev thread covers nearly everything I remember about this. The one thing I guess I never mentioned is that building and working with the prototype was frightful; it had both Python code and C code, and it was fragile and hard to get working. My hunch at the time was that it shouldn't be so fragile; it should be possible to write the converter in Python: read in .pyc file, generate .c file. It might have to make assumptions about the internal structure of the CPython objects it instantiates as C static data, but since we'd ship the tool with CPython this should be only a minor maintenance issue. Deep-freezing doesn't seem frightful to work with, to me at least. :-) Maybe the foundational work by Eric (e.g. generating sections of Makefile.pre.in) has helped. I don't understand entirely why Jeethu's prototype had part written in C. I never ran it so I don't know what the generated code looked like, but I have a feeling that for objects that don't reference other objects, it would generate a byte array containing the exact contents of the object structure (which it would get from constructing the object in memory and copying the bytes) which was then put together with the object header (containing the refcount and type) and cast to (PyObject *). In contrast, for deep-freeze I just reverse engineered what the structures look like and wrote a Python script to generate C code for an initialized instance of those structures. You can look at some examples here: https://github.com/gvanrossum/cpython/blob/codegen/Python/codegen__collections_abc.c . It's verbose but the C compiler handles it just fine (C compilers have evolved to handle *very* large generated programs). > In experimenting with the prototype, I observed that simply calling stat() to ensure the frozen .py file hadn't changed on disk lost us about half the performance win from this approach. I'm not much of a systems programmer, but I wonder if there are (system-proprietary?) library calls one could make to get the stat info for all files in a single directory all at once that might be faster overall. (Of course, caching this information at startup might make for a crappy experience for people who edit Lib/*.py files while the interpreter is running.) I think the only solution here was hinted at in the python-dev thread from 2018: have a command-line flag to turn it on or off (e.g. -X deepfreeze=1/0) and have a policy for what the default for that flag should be (e.g. on by default in production builds, off by default in developer builds -- anything that doesn't use --enable-optimizations). > One more observation about the prototype: it doesn't know how to deal with any mutable types. marshal.c can deal with list, dict, and set. Does this matter? ISTM the tree of objects under a code object will never have a reference to one of these mutable objects, so it's probably already fine. Correct, marshal supports things that you will never see in a code object. Perhaps the reason is that when marshal was invented, it wasn't so clear that code objects should be immutable -- that realization came later, when Greg Stein proposed making them ROM-able. That didn't work out, but the notion that code objects should be strictly mutable (to the python user, at least) was born and is now ingrained. > Not sure what else I can tell you. It gave us a measurable improvement in startup time, but it seemed fragile, and it was annoying to work with/on, so after hacking on it for a week (at the 2018 core dev sprint in Redmond WA) I put it aside and moved on to other projects. I'm not so quick to give up. I do believe I have seen similar startup time improvements. But Eric's version (i.e. this issue) is nearly as good, and the binary bloat is much less -- marshal is way more compact than in-memory objects. (Second message) > There should be a boolean flag that enables/disables cached copies of .py files from Lib/. You should be able to turn it off with either an environment variable or a command-line option, and when it's off it skips all the internal cached stuff and uses the normal .py / .pyc machinery. Yeah. > With that in place, it'd be great to pre-cache all the .py files automatically read in at startup. *All* the .py files? I think the binary bloat cause by deep-freezing the entire stdlib would be excessive. In fact, Eric's approach freezes everything in the encodings package, which turns out to be a lot of files and a lot of code (lots of simple data tables expressed in code), and I found that for basic startup time, it's best not to deep-freeze the encodings module except for __init__.py, aliases.py and utf_8.py. > As for changes to the build process: the most analogous thing we have is probably Argument Clinic. For what it's worth, Clinic hasn't been very well integrated into the CPython build process. There's a pseudotarget that runs it for you in the Makefile, but it's only ever run manually, and I'm not sure there's *any* build automation for Windows developers. AFAIK it hasn't really been a problem. But then I'm not sure this is a very good analogy--the workflow for making Clinic changes is very different from people hacking on Lib/*.py. I think we've got reasonably good automation for both Eric's approach and the deep-freeze approach -- all you need to do is run "make" when you've edited one of the (deep-)frozen modules. > It might be sensible to add a mechanism that checks whether or not the pre-cached modules are current. Store a hash for each cached module and check that they all match. This could then be part of the release process, run from a GitHub hook, etc. I think the automation that Eric developed is already good enough. (He even generates Windows project files.) See https://github.com/python/cpython/pull/27980 . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 01:14:39 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 28 Aug 2021 05:14:39 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630127679.66.0.551195032564.issue45020@roundup.psfhosted.org> Larry Hastings added the comment: > What the two approaches have in common is that they require rebuilding the python binary whenever you edit any of the changed modules. I heard somewhere (I'm sorry, I honestly don't recall who said it first, possibly Eric himself) that Jeethu's approach was rejected because of that. My dim recollection was that Jeethu's approach wasn't explicitly rejected, more that the community was more "conflicted" than "strongly interested", so I lost interest, and nobody else followed up. > I don't understand entirely why Jeethu's prototype had part written in C. My theory: it's easier to serialize C objects from C. It's maybe even slightly helpful? But it made building a pain. And yeah it just doesn't seem necessary. The code generator will be tied to the C representation no matter how you do it, so you might as well write it in a nice high-level language. > I never ran it so I don't know what the generated code looked like, [...] You can see an example of Jeethu's serialized objects here: https://raw.githubusercontent.com/python/cpython/267c93d61db9292921229fafd895b5ff9740b759/Python/frozenmodules.c Yours is generally more readable because you're using the new named structure initializers syntax. Though Jeethu's code is using some symbolic constants (e.g. PyUnicode_1BYTE_KIND) where you're just printing the actual value. > > With that in place, it'd be great to pre-cache all the .py files automatically read in at startup. > > *All* the .py files? I think the binary bloat cause by deep-freezing the entire stdlib would be excessive. I did say "all the .py files automatically read in at startup". In current trunk, there are 32 modules in sys.module at startup (when run non-interactively), and by my count 13 of those are written in Python. If we go with Eric's approach, that means we'd turn those .pyc files into static data. My quick experiment suggests that'd be less than 300k. On my 64-bit Linux system, a default build of current trunk (configure && make -j) yields a 23mb python executable, and a 44mb libpython3.11.a. If I build without -g, they are 4.3mb and 7mb respectively. So this speedup would add another 2.5% to the size of a stripped build. If even that 300k was a concern, the marshal approach would also permit us to compile all the deep-frozen modules into a separate shared library and unload it after we're done. I don't know what the runtime impact of "deep-freeze" is, but it seems like it'd be pretty minimal. You're essentially storing these objects in C static data instead of the heap, which should be about the same. Maybe it'd mean the code objects for the module bodies would stick around longer than they otherwise would? But that doesn't seem like it'd add that much overhead. It's interesting to think about applying these techniques to the entire standard library, but as you suggest that would probably be wasteful. On the other hand: if we made a viable tool that could consume some arbitrary set of .py files and produce a C file, and said C file could then be compiled into a shared library, end users could enjoy this speedup over the subset of the standard library their program used, and perhaps even their own source tree(s). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 01:36:18 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Sat, 28 Aug 2021 05:36:18 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630128978.95.0.152002043991.issue45020@roundup.psfhosted.org> Neil Schemenauer added the comment: [Larry] > The one thing I guess I never mentioned is that building and working with the > prototype was frightful; it had both Python code and C code, and it was > fragile and hard to get working. I took Larry's PR and did a fair amount of cleanup on it to make the build less painful and fragile. My branch is fairly easy to re-build. The major downsides remaining are that you couldn't update .py files and have them used (static ones take priority) and the generated C code is quite large. I didn't make any attempt to work on the serializer, other than to make it work with an alpha version of Python 3.10. https://github.com/nascheme/cpython/tree/static_frozen It was good enough to pass nearly(?) all tests and I did some profiling. It helped reduce startup time quite a bit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 02:36:16 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 28 Aug 2021 06:36:16 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630132576.34.0.180017366522.issue36521@roundup.psfhosted.org> Inada Naoki added the comment: I'd like to remove docstring from code object at all. func.__doc__ can be set by MAKE_FUNCTION or STORE_ATTR. Pros are: * Code objects can be bit smaller than adding co_doc. * Many code objects don't have docstrings. (e.g. lambdas, somprehensions, and PEP 649) * We can strip docstring on runtime and free some memory. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 02:43:22 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Sat, 28 Aug 2021 06:43:22 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home Message-ID: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> New submission from Tzu-ping Chung : This is similar to bpo-44860, but in the other direction: $ docker run -it --rm -h=p fedora:34 bash ... [root at p /]# yum install python3 -y ... [root at p /]# type python3 python3 is hashed (/usr/bin/python3) [root at p /]# python3 -V Python 3.9.6 [root at p /]# python3.9 -q >>> from distutils.command.install import install >>> from distutils.dist import Distribution >>> c = install(Distribution()) >>> c.home = '/foo' >>> c.finalize_options() >>> c.install_platlib '/foo/lib64/python' >>> import sysconfig >>> sysconfig.get_path('platlib', 'posix_home', vars={'home': '/root'}) '/foo/lib/python' sysconfig?s scheme should use `{platlib}` instead of hardcoding 'lib'. Note that on Python 3.10+ the platlib values from distutils and sysconfig do match (since the distutils scheme is automatically generated from sysconfig), but the issue remains; sysconfig?s scheme should likely include `{platlib}` (adding Victor and Miro to confirm this). ---------- components: Distutils, Library (Lib) messages: 400463 nosy: dstufft, eric.araujo, hroncok, uranusjr, vstinner priority: normal severity: normal status: open title: sysconfig's posix_home scheme has different platlib value to distutils's unix_home versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 02:54:08 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Sat, 28 Aug 2021 06:54:08 +0000 Subject: [issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home In-Reply-To: <1630133002.18.0.922476282003.issue45035@roundup.psfhosted.org> Message-ID: <1630133648.7.0.103770609576.issue45035@roundup.psfhosted.org> Change by Tzu-ping Chung : ---------- keywords: +patch pull_requests: +26454 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28011 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 04:27:10 2021 From: report at bugs.python.org (Ananya Datta) Date: Sat, 28 Aug 2021 08:27:10 +0000 Subject: [issue42272] Warning filter message/module documentation is misleading In-Reply-To: <1604606797.18.0.328122375746.issue42272@roundup.psfhosted.org> Message-ID: <1630139230.96.0.319293494247.issue42272@roundup.psfhosted.org> Ananya Datta added the comment: No comments ---------- nosy: +ananyadatta88 Added file: https://bugs.python.org/file50238/D365 Finance cert learning path.pdf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 05:11:01 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 28 Aug 2021 09:11:01 +0000 Subject: [issue45024] Cannot extend collections ABCs with protocol In-Reply-To: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> Message-ID: <1630141861.74.0.833529059689.issue45024@roundup.psfhosted.org> Ken Jin added the comment: Thanks for the bug report Anup. I'm mildly confused by what you meant, so please help me here: I interpreted your request as wanting any type that implements `method` and `__iter__` to be considered a subtype of `IterableWithMethod`. But this already works at runtime and with mypy. Are you perhaps saying that you want issubclass(Foo, IterableWithMethod) to work? ---------- components: -Parser nosy: +Jelle Zijlstra, gvanrossum, kj -lys.nikolaou, pablogsal status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 06:39:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 28 Aug 2021 10:39:34 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630147174.39.0.26370071045.issue36521@roundup.psfhosted.org> Irit Katriel added the comment: > I'd like to remove docstring from code object at all. > func.__doc__ can be set by MAKE_FUNCTION or STORE_ATTR. I think that would require a change in the signature of PyFunction_New. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 06:54:11 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 28 Aug 2021 10:54:11 +0000 Subject: [issue20658] os.environ.clear() fails with empty keys (posix.unsetenv) In-Reply-To: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> Message-ID: <1630148051.39.0.098410664985.issue20658@roundup.psfhosted.org> Irit Katriel added the comment: They keys are checked now, so I think this is resolved. (Tested on windows and Mac). >>> os.environ[''] = 'X' Traceback (most recent call last): File "", line 1, in File "/Users/iritkatriel/src/cpython/Lib/os.py", line 684, in __setitem__ putenv(key, value) ^^^^^^^^^^^^^^^^^^ OSError: [Errno 22] Invalid argument >>> os.environ['a=b'] = 'c' Traceback (most recent call last): File "", line 1, in File "/Users/iritkatriel/src/cpython/Lib/os.py", line 684, in __setitem__ putenv(key, value) ^^^^^^^^^^^^^^^^^^ ValueError: illegal environment variable name ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 06:58:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 28 Aug 2021 10:58:53 +0000 Subject: [issue19027] undefined symbol: _PyParser_Grammar In-Reply-To: <1379265648.95.0.708128098895.issue19027@psf.upfronthosting.co.za> Message-ID: <1630148333.52.0.789554746561.issue19027@roundup.psfhosted.org> Irit Katriel added the comment: We no longer have GRAMMAR_H or _PyParser_Grammar in the code. ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 07:17:45 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Sat, 28 Aug 2021 11:17:45 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630123603.14.0.639670821622.issue45020@roundup.psfhosted.org> Message-ID: Marc-Andre Lemburg added the comment: On 28.08.2021 06:06, Guido van Rossum wrote: > >> With that in place, it'd be great to pre-cache all the .py files automatically read in at startup. > > *All* the .py files? I think the binary bloat cause by deep-freezing the entire stdlib would be excessive. In fact, Eric's approach freezes everything in the encodings package, which turns out to be a lot of files and a lot of code (lots of simple data tables expressed in code), and I found that for basic startup time, it's best not to deep-freeze the encodings module except for __init__.py, aliases.py and utf_8.py. Eric's approach, as I understand it, is pretty much what PyRun does. It freezes almost the entire stdlib. The main aim was to save space and create a Python runtime with very few files for easy installation and shipment of products written in Python. For Python 3.8 (I haven't ported it to more recent Python versions yet), the uncompressed stripped binary is 15MB. UPX compressed, it's only 5MB: -rwxr-xr-x 1 lemburg lemburg 15M May 19 15:26 pyrun3.8 -rwxr-xr-x 1 lemburg lemburg 32M Aug 26 2020 pyrun3.8-debug -rwxr-xr-x 1 lemburg lemburg 5.0M May 19 15:26 pyrun3.8-upx There's no bloat, since you don't need the .py/.pyc files for the stdlib anymore. In fact, you save quite a bit of disk space compared to a full Python installation and additionally benefit from the memory mapping the OS does for sharing access to the marshal'ed byte code between processes. That said, some things don't work with such an approach, e.g. a few packages include additional data files which they expect to find on disk. Since those are not available anymore, they fail. For PyRun I have patched some of those packages to include the data in form of Python modules instead, so that it gets frozen as well, e.g. the Python grammar files. Whether this is a good approach for Python in general is a different question, though. PyRun is created on top of the existing released Python distribution, so it doesn't optimize for being able to work with the frozen code. In fact, early versions did not even have a REPL, since the main point was to run a single released app. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 09:15:14 2021 From: report at bugs.python.org (Techn010 Je11y) Date: Sat, 28 Aug 2021 13:15:14 +0000 Subject: [issue45036] turtle.onrelease() event doesn't get triggered sometimes Message-ID: <1630156514.02.0.346025167609.issue45036@roundup.psfhosted.org> New submission from Techn010 Je11y : (pls read with reference to attached code) I made a Paint-ish program with Turtle. As there isn't ondrag or onrelease for Screen, I created a turtle named bg so I could use ondrag and onrelease (see file attached ig) and eliminate the need for double-clicking(previously I used Screen.onclick to pen.up(), move it to cursor, and pen.down() then use turtle.drag() to draw). However, I noticed that it doesn't work(turtle doesn't penup when mouse is released sometimes) and added the print("...", i(or j)) bits(pls see code). On at least 1 instance 'start' was printed without a corresponding release. I'm a beginner so I apologise if it's just a bug in my code. I did not install anything related to python after I installed 3.9.6(64-bit btw). I do not have any other versions. I did not alter any part of what's installed. System info: Windows 10 Pro Education Version 10.0.19043(or 21H1), Build 19043.1165 Windows Feature Experience Pack 120.2212.3530.0 Lenovo L13 Gen 2, x64 based PC 11th Gen Intel Core i5-1135G7 @ 2.4GHz, 4 Cores, 8 logical processors 8GB ram Attached is my code(I'm sorry if it hurts your eyes) ---------- assignee: terry.reedy components: IDLE, Tkinter files: pain2exp.py messages: 400470 nosy: techn010je11y, terry.reedy priority: normal severity: normal status: open title: turtle.onrelease() event doesn't get triggered sometimes type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50239/pain2exp.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 09:20:00 2021 From: report at bugs.python.org (Ayush Parikh) Date: Sat, 28 Aug 2021 13:20:00 +0000 Subject: [issue45037] theme-change.py for tkinter lib Message-ID: <1630156800.16.0.673052638064.issue45037@roundup.psfhosted.org> Change by Ayush Parikh : ---------- components: Tkinter nosy: Ayushparikh-code priority: normal pull_requests: 26455 severity: normal status: open title: theme-change.py for tkinter lib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 10:22:16 2021 From: report at bugs.python.org (nullptr) Date: Sat, 28 Aug 2021 14:22:16 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630160536.39.0.890536156403.issue45021@roundup.psfhosted.org> nullptr added the comment: Simplifying the reproducing example a bit more: from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor from time import sleep def submit(pool): pool.submit(submit, pool) if __name__ == '__main__': pool = ThreadPoolExecutor(1) pool.submit(submit, pool) while True: with ProcessPoolExecutor() as workers: print('WORK') workers.submit(sleep, 0.01).result() print('DONE') print('OK') ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 10:33:31 2021 From: report at bugs.python.org (E. Paine) Date: Sat, 28 Aug 2021 14:33:31 +0000 Subject: [issue45037] theme-change.py for tkinter lib Message-ID: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> New submission from E. Paine : I'm slightly confused about the purpose of this PR. Is the intention to create a demo, or this designed to be used as an API? ---------- nosy: +epaine, serhiy.storchaka, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 10:36:07 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 28 Aug 2021 14:36:07 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630161367.78.0.261065671281.issue36521@roundup.psfhosted.org> Guido van Rossum added the comment: > I'd like to remove docstring from code object at all. > func.__doc__ can be set by MAKE_FUNCTION or STORE_ATTR. You'd just be moving the problem though -- the docstring would have be included in the co_consts array of the surrounding code object instead of the function object. This would actually make it harder to strip docstrings e.g. during unmarshalling, since you don't know which constants refer to docstrings. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 10:39:51 2021 From: report at bugs.python.org (Ayush Parikh) Date: Sat, 28 Aug 2021 14:39:51 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: Ayush Parikh added the comment: yes PR purpose is to show demo for themes change of tkinter window On Sat, Aug 28, 2021 at 8:03 PM E. Paine wrote: > > New submission from E. Paine : > > I'm slightly confused about the purpose of this PR. Is the intention to > create a demo, or this designed to be used as an API? > > ---------- > nosy: +epaine, serhiy.storchaka, terry.reedy > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 11:32:27 2021 From: report at bugs.python.org (Jonathan Isaac) Date: Sat, 28 Aug 2021 15:32:27 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: <1630164747.22.0.771627434732.issue45037@roundup.psfhosted.org> Jonathan Isaac added the comment: Get the code! ---------- nosy: +bonesisaac1982 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 11:33:50 2021 From: report at bugs.python.org (Jonathan Isaac) Date: Sat, 28 Aug 2021 15:33:50 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: <1630164830.41.0.573174044059.issue45037@roundup.psfhosted.org> Jonathan Isaac added the comment: Bugs ---------- components: +Parser nosy: +lys.nikolaou, pablogsal type: -> crash versions: +Python 3.11, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 11:35:18 2021 From: report at bugs.python.org (E. Paine) Date: Sat, 28 Aug 2021 15:35:18 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: <1630164918.62.0.546368079143.issue45037@roundup.psfhosted.org> Change by E. Paine : ---------- components: -Parser nosy: -bonesisaac1982, lys.nikolaou, pablogsal type: crash -> enhancement versions: -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 11:42:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 28 Aug 2021 15:42:25 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: <1630165345.82.0.556072584512.issue45037@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not think this should be included in the Tkinter library. As for demos, there were Tkinter demos in 2.7 (Demo/tkinter), but they were removed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 11:50:47 2021 From: report at bugs.python.org (E. Paine) Date: Sat, 28 Aug 2021 15:50:47 +0000 Subject: [issue45036] turtle.onrelease() event doesn't get triggered sometimes In-Reply-To: <1630156514.02.0.346025167609.issue45036@roundup.psfhosted.org> Message-ID: <1630165847.0.0.448742290324.issue45036@roundup.psfhosted.org> E. Paine added the comment: The issue is that the "release" function appears to be called before the "drag" function for the last coordinate. The fix is probably only lowering the pen when the mouse button is first clicked, as this is guaranteed to be called before "release". I ended up with something like the following (after removing the pen lower logic from the "release" function): def down(a, b): print("down") p.goto(a, b) p.down() bg.onclick(down) ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 11:52:27 2021 From: report at bugs.python.org (Jonathan Isaac) Date: Sat, 28 Aug 2021 15:52:27 +0000 Subject: [issue45038] Bugs Message-ID: <17b8d763338.2808.67a03304c92d9dfce54c3de1c7b1fd49@gmail.com> New submission from Jonathan Isaac : Jonathan Isaac Sent with Aqua Mail for Android https://www.mobisystems.com/aqua-mail ---------- messages: 400479 nosy: bonesisaac1982 priority: normal severity: normal status: open title: Bugs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 12:13:27 2021 From: report at bugs.python.org (Zachary Ware) Date: Sat, 28 Aug 2021 16:13:27 +0000 Subject: [issue45038] Bugs In-Reply-To: <17b8d763338.2808.67a03304c92d9dfce54c3de1c7b1fd49@gmail.com> Message-ID: <1630167207.16.0.964924701335.issue45038@roundup.psfhosted.org> Zachary Ware added the comment: If you don't describe them, we can't fix them ;) This looks rather like an accidental submission, so I'm going to go ahead and close it; if you do have a report you would like to submit, please edit the title and add a new comment and I'll be happy to reopen it. ---------- nosy: +zach.ware resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 12:26:32 2021 From: report at bugs.python.org (E. Paine) Date: Sat, 28 Aug 2021 16:26:32 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: <1630167992.96.0.20790576765.issue45037@roundup.psfhosted.org> E. Paine added the comment: > there were Tkinter demos in 2.7 (Demo/tkinter), but they were removed Why is this? Because people didn't want to change them all for the tkinter module names, or because they were deemed unnecessary? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 13:03:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 28 Aug 2021 17:03:10 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: <1630170190.81.0.175177808498.issue45037@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not know. There are no issue numbers in changesets which removed them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 13:07:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 28 Aug 2021 17:07:55 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1630170475.5.0.418121948631.issue44962@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 206b21ed9f64fedff67bfea7cf73e423e3e32393 by Thomas Grainger in branch 'main': bpo-44962: Fix a race in WeakKeyDict, WeakValueDict and WeakSet when two threads attempt to commit the last pending removal (GH-27921) https://github.com/python/cpython/commit/206b21ed9f64fedff67bfea7cf73e423e3e32393 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 13:07:55 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Aug 2021 17:07:55 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1630170475.1.0.261927676982.issue44962@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26456 pull_request: https://github.com/python/cpython/pull/28013 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 13:07:59 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Aug 2021 17:07:59 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1630170479.01.0.773339482564.issue44962@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26457 pull_request: https://github.com/python/cpython/pull/28014 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 13:22:29 2021 From: report at bugs.python.org (Ayush Parikh) Date: Sat, 28 Aug 2021 17:22:29 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630170190.81.0.175177808498.issue45037@roundup.psfhosted.org> Message-ID: Ayush Parikh added the comment: so can u review pr and make changes for me if required or guide me so that it can be merged ! On Sat, Aug 28, 2021 at 10:33 PM Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > I do not know. There are no issue numbers in changesets which removed them. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 13:46:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 28 Aug 2021 17:46:22 +0000 Subject: [issue45039] use ADDOP_LOAD_CONST consistently Message-ID: <1630172782.32.0.00459227167262.issue45039@roundup.psfhosted.org> New submission from Irit Katriel : The compiler generally uses ADDOP_LOAD_CONST to emit a LOAD_CONST, but there are two places that use ADDOP_O(c, LOAD_CONST, Py_None, consts); This is currently equivalent to ADDOP_LOAD_CONST(c, Py_None); It should be replaced because we may soon change ADDOP_LOAD_CONST. ---------- components: Interpreter Core messages: 400485 nosy: iritkatriel priority: normal severity: normal status: open title: use ADDOP_LOAD_CONST consistently versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 13:48:35 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Aug 2021 17:48:35 +0000 Subject: [issue45029] tkinter doc, hello world example - quit button clobbers method In-Reply-To: <1630055004.62.0.378999176997.issue45029@roundup.psfhosted.org> Message-ID: <1630172915.59.0.405274521487.issue45029@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26458 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27911 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 13:48:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 28 Aug 2021 17:48:52 +0000 Subject: [issue45039] use ADDOP_LOAD_CONST consistently In-Reply-To: <1630172782.32.0.00459227167262.issue45039@roundup.psfhosted.org> Message-ID: <1630172932.02.0.0717443503996.issue45039@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26459 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28015 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 13:53:26 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 28 Aug 2021 17:53:26 +0000 Subject: [issue39817] CRITICAL: TypeError: cannot pickle 'generator' In-Reply-To: <1583093867.42.0.0359831443421.issue39817@roundup.psfhosted.org> Message-ID: <1630173206.22.0.755309487715.issue39817@roundup.psfhosted.org> Andrei Kulakov added the comment: This issue has been resolved and closed in Pelican tracker; so it can be closed here as well, as not a bug. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 13:54:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Aug 2021 17:54:10 +0000 Subject: [issue45029] tkinter doc, hello world example - quit button clobbers method In-Reply-To: <1630055004.62.0.378999176997.issue45029@roundup.psfhosted.org> Message-ID: <1630173250.26.0.335775688046.issue45029@roundup.psfhosted.org> Terry J. Reedy added the comment: For whatever reason, the 3.9 backport, PR-27911, was closed. In any case, we will not edit the code we have replaced. Lyndon, when responding by email, please delete the old text as it is redundant and noisy when your email is added to the web page. ---------- nosy: +terry.reedy resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:09:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 28 Aug 2021 18:09:28 +0000 Subject: [issue45039] use ADDOP_LOAD_CONST consistently In-Reply-To: <1630172782.32.0.00459227167262.issue45039@roundup.psfhosted.org> Message-ID: <1630174168.32.0.0920747712229.issue45039@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +Mark.Shannon, gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:09:48 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Aug 2021 18:09:48 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1630174188.93.0.780544340602.issue44524@roundup.psfhosted.org> miss-islington added the comment: New changeset 81fa08c5ea2cf15254b951034b9d6c7358f96d79 by Miss Islington (bot) in branch '3.10': bpo-44524: Fix cryptic TypeError message when trying to subclass special forms in `typing` (GH-27710) https://github.com/python/cpython/commit/81fa08c5ea2cf15254b951034b9d6c7358f96d79 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:09:33 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Aug 2021 18:09:33 +0000 Subject: [issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index In-Reply-To: <1629996134.04.0.676364219847.issue45018@roundup.psfhosted.org> Message-ID: <1630174173.25.0.0392709013868.issue45018@roundup.psfhosted.org> miss-islington added the comment: New changeset cd986e903176d28ed795f65ba14e6fcbf2a65e3d by Miss Islington (bot) in branch '3.10': bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938) https://github.com/python/cpython/commit/cd986e903176d28ed795f65ba14e6fcbf2a65e3d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:09:29 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Aug 2021 18:09:29 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1630174169.98.0.772838414448.issue44962@roundup.psfhosted.org> miss-islington added the comment: New changeset 8aa64cc45bff516a6db1f3a3c037cbcce9417fea by Miss Islington (bot) in branch '3.10': bpo-44962: Fix a race in WeakKeyDict, WeakValueDict and WeakSet when two threads attempt to commit the last pending removal (GH-27921) https://github.com/python/cpython/commit/8aa64cc45bff516a6db1f3a3c037cbcce9417fea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:26:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 28 Aug 2021 18:26:08 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1630175168.23.0.063770673909.issue27334@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 2a80893e5c023a73ccd32cc319f4f0404f548c00 by Erlend Egeberg Aasland in branch '3.10': [3.10] bpo-27334: roll back transaction if sqlite3 context manager fails to commit (GH-26202) (GH-27943) https://github.com/python/cpython/commit/2a80893e5c023a73ccd32cc319f4f0404f548c00 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:29:02 2021 From: report at bugs.python.org (Carl Friedrich Bolz-Tereick) Date: Sat, 28 Aug 2021 18:29:02 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630175342.85.0.429710665944.issue25130@roundup.psfhosted.org> Change by Carl Friedrich Bolz-Tereick : ---------- nosy: +Carl.Friedrich.Bolz nosy_count: 6.0 -> 7.0 pull_requests: +26460 pull_request: https://github.com/python/cpython/pull/28002 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:33:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 28 Aug 2021 18:33:58 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630175638.3.0.982133000472.issue25130@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset eb263f9a356f5c5f21b8d5ce20bac92f31c40cad by Carl Friedrich Bolz-Tereick in branch 'main': bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002) https://github.com/python/cpython/commit/eb263f9a356f5c5f21b8d5ce20bac92f31c40cad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:33:59 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 28 Aug 2021 18:33:59 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630175639.92.0.965099464825.issue25130@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26461 pull_request: https://github.com/python/cpython/pull/28016 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:41:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 28 Aug 2021 18:41:15 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630176075.93.0.61387129682.issue25130@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26462 pull_request: https://github.com/python/cpython/pull/28017 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:41:36 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 28 Aug 2021 18:41:36 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1630176096.85.0.106885611723.issue27334@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks Luca, for the report, reproducer, and initial patch, Berker for helpful suggestion, and ?ukasz, Pablo, & Victor for reviewing and merging. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:54:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 28 Aug 2021 18:54:52 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1630176892.75.0.276932495145.issue44962@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 166ad706066a2aad84d0ae5b1594c88904fbb939 by Miss Islington (bot) in branch '3.9': bpo-44962: Fix a race in WeakKeyDict, WeakValueDict and WeakSet when two threads attempt to commit the last pending removal (GH-27921) (GH-28014) https://github.com/python/cpython/commit/166ad706066a2aad84d0ae5b1594c88904fbb939 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:55:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 28 Aug 2021 18:55:38 +0000 Subject: [issue44962] asyncio.create_task weakrefset race condition In-Reply-To: <1629468472.03.0.485220244129.issue44962@roundup.psfhosted.org> Message-ID: <1630176938.47.0.755269536975.issue44962@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Thomas! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 14:56:58 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 28 Aug 2021 18:56:58 +0000 Subject: [issue45018] Pickling a range iterator with an index of over sizeof(int) stores an invalid index In-Reply-To: <1629996134.04.0.676364219847.issue45018@roundup.psfhosted.org> Message-ID: <1630177018.9.0.907007318212.issue45018@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 15:24:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 28 Aug 2021 19:24:09 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630178649.92.0.621108306073.issue25130@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 779b9aef4fb2750f57ce07f0efbc8ce8406e43ab by Miss Islington (bot) in branch '3.10': bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002) (GH-28016) https://github.com/python/cpython/commit/779b9aef4fb2750f57ce07f0efbc8ce8406e43ab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 15:24:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 28 Aug 2021 19:24:42 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630178682.46.0.419365951912.issue25130@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 1046cd06b0e2f20b3be93de83d49b684956af98d by Serhiy Storchaka in branch '3.9': [3.9] bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002) (GH-28017) https://github.com/python/cpython/commit/1046cd06b0e2f20b3be93de83d49b684956af98d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 15:34:41 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 28 Aug 2021 19:34:41 +0000 Subject: [issue38435] Start the deprecation cycle for subprocess preexec_fn In-Reply-To: <1570731497.4.0.313201495913.issue38435@roundup.psfhosted.org> Message-ID: <1630179281.09.0.229896409855.issue38435@roundup.psfhosted.org> Gregory P. Smith added the comment: A worthwhile general suggestion on a new path forward for the mess of things between (v)fork+exec from Victor is over in https://bugs.python.org/issue42736#msg383869 TL;DR creating a subprocess.Preexec() recording object with specific interfaces for things that can be done, an instance of which gets passed in and the recorded actions are done as appropriate. ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 15:59:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 28 Aug 2021 19:59:44 +0000 Subject: [issue35391] threading.RLock exception handling while waiting In-Reply-To: <1543863891.16.0.788709270274.issue35391@psf.upfronthosting.co.za> Message-ID: <1630180784.38.0.305831133875.issue35391@roundup.psfhosted.org> Irit Katriel added the comment: Have you reproduced the issue on 3.8? I am unable to reproduce this on main (on a Mac). Adding Antoine since I think he fixed a few issues in this area. ---------- nosy: +iritkatriel, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 16:04:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 28 Aug 2021 20:04:04 +0000 Subject: [issue36258] Incorrect docstring of the ssl module In-Reply-To: <1552256345.94.0.910242914596.issue36258@roundup.psfhosted.org> Message-ID: <1630181044.38.0.412693446056.issue36258@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 16:10:30 2021 From: report at bugs.python.org (Diana) Date: Sat, 28 Aug 2021 20:10:30 +0000 Subject: [issue24388] Python readline module crashes in history_get on FreeBSD with libedit In-Reply-To: <1433545828.57.0.0902862993292.issue24388@psf.upfronthosting.co.za> Message-ID: <1630181430.56.0.218938709329.issue24388@roundup.psfhosted.org> Change by Diana : ---------- nosy: +DonnaDia nosy_count: 3.0 -> 4.0 pull_requests: +26463 pull_request: https://github.com/python/cpython/pull/28018 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 16:12:06 2021 From: report at bugs.python.org (Diana) Date: Sat, 28 Aug 2021 20:12:06 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1630181526.35.0.34292746608.issue24888@roundup.psfhosted.org> Change by Diana : ---------- keywords: +patch pull_requests: +26464 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28018 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 16:16:01 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Aug 2021 20:16:01 +0000 Subject: [issue45036] turtle.onrelease() event doesn't get triggered sometimes In-Reply-To: <1630156514.02.0.346025167609.issue45036@roundup.psfhosted.org> Message-ID: <1630181761.11.0.866151346222.issue45036@roundup.psfhosted.org> Terry J. Reedy added the comment: (turtle module has no relation to IDLE other than also using tkinter. The fact that turtledemo can be run from IDLE is incidental.) 3.10.0rc installed on Win 10. I first clicked randomly and never saw a missing 'release'. I noticed that the turtle occasionally jumped to where I clicked, with 'start n' being printed. I realized that I must have moved the mouse at least a pixel between click and release, triggering a move event. I then did multiple click-drag-releases. I am not sure if I ever saw a missing 'release', but sometimes saw an extra 'start' as I released, especially when releasing while moving the mouse. EP's comment explains this. A subsequent click and drag prints no 'start' (which really means 'pen down') because the pen was already down. I see two possible issues: 1. https://docs.python.org/3.9/library/turtle.html#using-events talks about events 'on this turtle'. Should that mean clicks anywhere on the screen or just literally 'on' the turtle image. If there were multiple turtles, should 'anywhere on the screen' be 'on' all' of them? The meaning of 'on' is turtle-specific, so this might be a turtle bug, depending on the intention. 2. The OS sends its graphics screen mouse move events corresponding to the physical mouse being moved. There are available to tk. ondrag is supposed to only notice those after button press (and by implication before button release). In other words, while the button is down. There should be not be drag events after the release event. This might be a turtle bug, but could be in tk or even the OS mouse driver ---------- assignee: terry.reedy -> components: +Library (Lib) -IDLE, Tkinter versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 16:16:36 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 28 Aug 2021 20:16:36 +0000 Subject: [issue45040] [sqlite3] optimise transaction control functions Message-ID: <1630181796.88.0.161602783336.issue45040@roundup.psfhosted.org> New submission from Erlend E. Aasland : pysqlite_connection_commit_impl(), pysqlite_connection_rollback_impl(), and begin_transaction() can be simplified: sqlite3_finalize() will pass on any error set by sqlite3_step(). This implies that we only need to check the return value of sqlite3_prepare_v2() and sqlite3_finalize(), which implies that we can execute sqlite3_prepare_v2(), sqlite3_step() and sqlite3_finalize() in a row inside a begin/end threads wrapper. As a result, error handling will be greatly simplified. Fewer lines of code, simpler error paths, increased readability, and increased code coverage. diffstat: 2 files changed, 27 insertions(+), 62 deletions(-) ---------- components: Extension Modules messages: 400501 nosy: erlendaasland priority: low severity: normal status: open title: [sqlite3] optimise transaction control functions type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 16:17:54 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 28 Aug 2021 20:17:54 +0000 Subject: [issue24388] Python readline module crashes in history_get on FreeBSD with libedit In-Reply-To: <1433545828.57.0.0902862993292.issue24388@psf.upfronthosting.co.za> Message-ID: <1630181874.28.0.831446794863.issue24388@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: -26463 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 16:28:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 28 Aug 2021 20:28:35 +0000 Subject: [issue45040] [sqlite3] optimise transaction control functions In-Reply-To: <1630181796.88.0.161602783336.issue45040@roundup.psfhosted.org> Message-ID: <1630182515.87.0.76216360465.issue45040@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +26465 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28019 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 16:35:26 2021 From: report at bugs.python.org (Anup Parikh) Date: Sat, 28 Aug 2021 20:35:26 +0000 Subject: [issue45024] Cannot extend collections ABCs with protocol In-Reply-To: <1630027789.49.0.847415585989.issue45024@roundup.psfhosted.org> Message-ID: <1630182926.64.0.275200307151.issue45024@roundup.psfhosted.org> Anup Parikh added the comment: Yeah, you got the gist of what I meant, though, I guess that was a confusing example since there are apparently protocols for Iterable. But not for many of the other collection ABCs such as Sequence, e.g., the following doesn't work: from typing import Sequence, Protocol class SequenceWithMethod(Sequence, Protocol): def method(self) -> None: pass In which case, anything that implements `method`, `__getitem__`, `__len__`, `__contains__`, `__iter__`, `__reversed__`, `index`, and `count` would be considered a subtype of `SequenceWithMethod` ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 17:01:13 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 28 Aug 2021 21:01:13 +0000 Subject: [issue35391] threading.RLock exception handling while waiting In-Reply-To: <1543863891.16.0.788709270274.issue35391@psf.upfronthosting.co.za> Message-ID: <1630184473.31.0.159868970859.issue35391@roundup.psfhosted.org> Antoine Pitrou added the comment: RLock is implemented in C nowadays so this problem doesn't occur anymore: https://github.com/python/cpython/blob/main/Modules/_threadmodule.c#L436-L459 You can of course, however, import the pure Python RLock under the name "_PyRLock", which is still vulnerable to this issue: https://github.com/python/cpython/blob/main/Lib/threading.py#L204-L206 ---------- type: crash -> behavior versions: -Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 17:01:34 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 28 Aug 2021 21:01:34 +0000 Subject: [issue35391] threading.RLock exception handling while waiting In-Reply-To: <1543863891.16.0.788709270274.issue35391@psf.upfronthosting.co.za> Message-ID: <1630184494.54.0.0436327682538.issue35391@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 17:09:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Aug 2021 21:09:36 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: <1630184976.37.0.0188747954522.issue45037@roundup.psfhosted.org> Terry J. Reedy added the comment: Ayush, when responding by email, please delete the text you are responding to. After posting on the webpage, the quoted copy becomes redundant and noisy. ---------- I suspect that whatever tkinter demo existed previously was dropped because no one wanted to maintain it and test it on all systems. Perhaps it was known to be buggy, at least on some systems. Or it was considered unnecessary given the available 3rd party resources. These have expanded since and some are listed at the beginning of the tkinter doc. Plus, there are numerous commented solutions on Stackoverflow. We recently replaced the initial code example in the tkinter doc with something simpler. I expect that there might be an issue on macOS. Some years ago, I and another person fixed up the turtledemo framework and the approximately 20 demo files. I few months ago I discovered that macOS currently ignores background color settings for buttons. There is a note about this deep in the tk docs but nothing that I know of in any tkinter docs. If I spend time on tkinter, it would be to improve the reference material and have it include such needed details. I ran the file and I don't consider it to be useful in relation to the problems people have with tkinter and ttk. I think this issue and the PR should be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 17:13:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Aug 2021 21:13:08 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: <1630185188.84.0.0768161427734.issue45037@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- Removed message: https://bugs.python.org/msg400475 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 17:13:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 28 Aug 2021 21:13:18 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: <1630185198.68.0.318827961436.issue45037@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- Removed message: https://bugs.python.org/msg400476 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 17:42:20 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 28 Aug 2021 21:42:20 +0000 Subject: [issue45041] [sqlite3] simplify executescript() Message-ID: <1630186940.75.0.867509999699.issue45041@roundup.psfhosted.org> New submission from Erlend E. Aasland : See also bpo-45040 Since sqlite3_finalize() will pass on any error message set by sqlite3_step(), we can greatly simplify SQLite C API usage and error handling in sqlite3.Cursor.executescript(), thus reducing the number of times we save/restore thread state, and also simplifying error handling greatly. We can also "inline" the commit before the main loop using the SQLite API directly, instead of calling self.commit() Diffstat for the proposed patch: 1 file changed, 25 insertions(+), 42 deletions(-) ---------- components: Extension Modules messages: 400505 nosy: erlendaasland priority: low severity: normal status: open title: [sqlite3] simplify executescript() type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 17:48:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 28 Aug 2021 21:48:59 +0000 Subject: [issue45041] [sqlite3] simplify executescript() In-Reply-To: <1630186940.75.0.867509999699.issue45041@roundup.psfhosted.org> Message-ID: <1630187339.3.0.526724438698.issue45041@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +26466 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28020 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 18:02:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 28 Aug 2021 22:02:50 +0000 Subject: [issue39817] CRITICAL: TypeError: cannot pickle 'generator' In-Reply-To: <1583093867.42.0.0359831443421.issue39817@roundup.psfhosted.org> Message-ID: <1630188170.73.0.205329525167.issue39817@roundup.psfhosted.org> Irit Katriel added the comment: Thank you Andrei. ---------- nosy: +iritkatriel resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 19:41:17 2021 From: report at bugs.python.org (Gregory Szorc) Date: Sat, 28 Aug 2021 23:41:17 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630194077.37.0.138862505783.issue45020@roundup.psfhosted.org> Gregory Szorc added the comment: When I investigated freezing the standard library for PyOxidizer, I ran into a rash of problems. The frozen importer doesn't behave like PathFinder. It doesn't (didn't?) set some common module-level attributes that are documented by the importer "specification" to be set and this failed a handful of tests and lead to runtime issues or breakage in 3rd party packages (such as random packages looking for a __file__ on a common stdlib module). Also, when I last looked at the CPython source, the frozen importer performed a linear scan of its indexed C array performing strcmp() on each entry until it found what it was looking for. So adding hundreds of modules could result in sufficient overhead and justify using a more efficient lookup algorithm. (PyOxidizer uses Rust's HashMap to index modules by name.) I fully support more aggressive usage of frozen modules in the standard library to speed up interpreter startup. However, if you want to ship this as enabled by default, from my experience with PyOxidizer, I highly recommend: * Make sure you run unit tests against the frozen modules. If you don't do this, subtle differences in how the different importers behave will lead to problems. * Shoring up the implementation of the frozen importer to make it better conform with the importer specification. * Be prepared for people to complain about the loss of __file__. e.g. https://github.com/indygreg/PyOxidizer/issues/69 / https://pyoxidizer.readthedocs.io/en/stable/oxidized_importer_behavior_and_compliance.html?highlight=__file__#file-and-cached-module-attributes ---------- nosy: +indygreg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 19:53:04 2021 From: report at bugs.python.org (Gregory Szorc) Date: Sat, 28 Aug 2021 23:53:04 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630194784.18.0.820796184618.issue45020@roundup.psfhosted.org> Gregory Szorc added the comment: Oh, PyOxidizer also ran into more general issues with the frozen importer in that it broke various importlib APIs. e.g. because the frozen importer only supports bytecode, you can't use .__loader__.get_source() to obtain the source of a module. This makes tracebacks more opaque and breaks legitimate API consumers relying on these importlib interfaces. The fundamental limitations with the frozen importer are why I implemented my own meta path importer (implemented in pure Rust), which is more fully featured, like the PathFinder importer that most people rely on today. That importer is available on PyPI (https://pypi.org/project/oxidized-importer/) and has its own API to facilitate PyOxidizer-like functionality (https://pyoxidizer.readthedocs.io/en/stable/oxidized_importer.html) if anyone wants to experiment with it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 19:56:49 2021 From: report at bugs.python.org (Zachary Ware) Date: Sat, 28 Aug 2021 23:56:49 +0000 Subject: [issue45038] Bugs In-Reply-To: <1630167207.16.0.964924701335.issue45038@roundup.psfhosted.org> Message-ID: <1630195009.88.0.240515591982.issue45038@roundup.psfhosted.org> Change by Zachary Ware : ---------- Removed message: https://bugs.python.org/msg400479 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 20:11:23 2021 From: report at bugs.python.org (Zachary Ware) Date: Sun, 29 Aug 2021 00:11:23 +0000 Subject: [issue45037] theme-change.py for tkinter lib In-Reply-To: <1630161211.19.0.0751952667525.issue45037@roundup.psfhosted.org> Message-ID: <1630195883.16.0.972416057368.issue45037@roundup.psfhosted.org> Zachary Ware added the comment: I agree with Serhiy and Terry that this is not the right place for this example and am closing the issue. ---------- nosy: +zach.ware resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 20:14:34 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 29 Aug 2021 00:14:34 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630196074.89.0.598800964836.issue45020@roundup.psfhosted.org> Guido van Rossum added the comment: Gregor, thanks for sharing your experience! I guess freezing the entire stdlib instead of just a smattering of modules (like we do here) exacerbated the problems in your case. Builtin modules (such as sys or time) don't have a __file__ attribute either, and nobody has ever complained about this (that I know of). I wonder how far our backwards compatibility guarantee should go -- would this mean we cannot turn any stdlib module written in Python into one written in C (or Rust :-)? It would be more serious if standard tests fail, but I haven't seen any evidence -- the tests all seem to pass for Eric's PR. Now, if there are stdlib modules that reference their own __file__ and we want to freeze those, we should switch those to using ResourceReader or importlib.resources of course. I agree that we should shore up the frozen importer -- probably in a separate PR though. (@Eric: do you think this is worth its own bpo issue?) I also noticed the linear scan (and it's being called up to 5 times for modules that *aren't* frozen :-). strcmp is *very* fast (isn't it a compiler intrinsic?), but perhaps we should time it and if it seems a problem we could sort the array and do a form of bisection. (A slight problem is that there's an API to mutate the list by changing a pointer, so we may have to detect when the pointer has changed and recompute the size by doing a scan for the sentinel, once.) Unfortunately I don't think we're yet in a world where we can accept any dependencies on Rust for CPython itself, so we would have to rewrite your example implementations in C if we wanted to use them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 21:36:32 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 29 Aug 2021 01:36:32 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630200992.87.0.339278030596.issue36521@roundup.psfhosted.org> Inada Naoki added the comment: > You'd just be moving the problem though -- the docstring would have be included in the co_consts array of the surrounding code object instead of the function object. As far as I know, surrounding code objects (e.g. global, class body) will be removed right after they are executed. So removing docstring by `func.__doc__ = None` can release memory for docstring, while we can not reduce startup time by this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 21:46:10 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 29 Aug 2021 01:46:10 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630201570.57.0.313393222381.issue36521@roundup.psfhosted.org> Inada Naoki added the comment: > This would actually make it harder to strip docstrings e.g. during unmarshalling, since you don't know which constants refer to docstrings. We can not strip class docstring anyway. One idea to strip docstring during startup: Add new opcode only for storing __doc__. We can use it for both of func and class. The opcode will store None if "remove docstring during startup" option is enabled. And surrounding code objects will be released after executing global/class body. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 21:55:29 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 29 Aug 2021 01:55:29 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630202129.22.0.530983333186.issue45020@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Aug 28 22:59:33 2021 From: report at bugs.python.org (Tim Peters) Date: Sun, 29 Aug 2021 02:59:33 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630205973.41.0.275295965424.issue34561@roundup.psfhosted.org> Tim Peters added the comment: The merge order was mentioned on python-dev today, and a quick web searched turned up a revision of Vincent Jug?'s "Adaptive Shivers Sort: An Alternative Sorting Algorithm" paper I hadn't seen before: https://arxiv.org/pdf/1809.08411.pdf Its "length-adaptive ShiversSort" variation sure _sounds_ like it was intended to address the issues we discussed here (some "bad" cases when very few runs are in play). The analyses in that paper show that length-adaptive ShiversSort, and powersort, have the same asymptotic best and worst-case behaviors. Average case? Who knows? Hard to believe it could really be an issue, because even the worst cases are pretty darn good. So length-adaptive ShiversSort is worth looking into. But, if someone has the energy to pursue it, I'd be happy, at this point, just to give plain old "adaptive ShiversSort" a try. The version of the paper linked to above even lists the precise changes needed to CPython's code to implement it (although a code review would ask for changes, most obviously that its "int x" is too narrow an integer type). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 00:27:40 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 29 Aug 2021 04:27:40 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630211260.6.0.988811919963.issue36521@roundup.psfhosted.org> Guido van Rossum added the comment: Why all the hating on docstrings? What have docstrings done wrong? I know there's the -OO flag that strips docstrings, but it doesn't work well and I think it was a mistake. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 01:29:23 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 29 Aug 2021 05:29:23 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630214963.65.0.385533461662.issue36521@roundup.psfhosted.org> Inada Naoki added the comment: > Why all the hating on docstrings? What have docstrings done wrong? Oh, I don't hate docstrings. I just want to move it from code object to function object. Remove docstring during unmarshal is your idea, not mine. My main motivation is reducing code size. See this example. ``` class Foo: def name(self): """Return my name""" return self._name def set_name(self, name): """Set my name""" self._name = name def age(self): """Return my age""" return self._age def set_age(self, age): """Set my age""" self._age = age >>> Foo.name.__code__.co_consts ('Return my name',) >>> Foo.set_name.__code__.co_consts ('Set my name', None) >>> Foo.age.__code__.co_consts ('Return my age',) >>> Foo.set_age.__code__.co_consts ('Set my age', None) ``` If docstring is not in co_consts, all co_consts are empty tuple. The empty tuple is nearly zero-cost because its a singleton. When comparing adding code.co_doc vs func.__doc__, "we can release old docstring" is a (small) pros. But it is no my main motivation. Classes and modules don't use co_consts[0] anyway. So setting `func.__doc__` is better for consistency too. > I know there's the -OO flag that strips docstrings, but it doesn't work well and I think it was a mistake. Some libraries (e.g. SQLAlchemy) have very huge docstrings. `-OO` can save 10% RAM. I like an idea adding per-file flag for "don't remove docstring in -OO mode", because docstrings can be used runtime in some cases (e.g. docopt). But it is out of scope of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 01:33:04 2021 From: report at bugs.python.org (Inada Naoki) Date: Sun, 29 Aug 2021 05:33:04 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630215184.59.0.679860049291.issue36521@roundup.psfhosted.org> Inada Naoki added the comment: > If docstring is not in co_consts, all co_consts are empty tuple. The empty tuple is nearly zero-cost because its a singleton. My wrong. Two setters will have `(None,)` tuple. But such tuple can be merged at compile time for now. And "common const" [1] approach will make them empty tuple. [1] https://github.com/iritkatriel/cpython/pull/27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 01:52:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 05:52:47 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630216367.11.0.740230058018.issue36521@roundup.psfhosted.org> Serhiy Storchaka added the comment: If we are going to move docstring out of co_consts, I would make it a code object attribute rather than argument of MAKE_FUNCTION. It saves time on function creation. Most functions do not change docstring after creation. It is the same as code docstring, so it consumes zero memory. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 04:12:04 2021 From: report at bugs.python.org (Padmashree Jha) Date: Sun, 29 Aug 2021 08:12:04 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1630224724.12.0.686767567433.issue24888@roundup.psfhosted.org> Padmashree Jha added the comment: You have to add shell=True to execute a shell command. check_output is trying to find an executable. Try this ---------- nosy: +padmashreejha717 versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 05:21:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 09:21:50 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630228910.55.0.0555975457284.issue25130@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26467 pull_request: https://github.com/python/cpython/pull/28021 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 06:08:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 10:08:10 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630231690.48.0.754802252344.issue25130@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 07d3d54f4e84b1259b800884b202701f69e408d8 by Serhiy Storchaka in branch 'main': bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) https://github.com/python/cpython/commit/07d3d54f4e84b1259b800884b202701f69e408d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 06:23:48 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 10:23:48 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630232628.59.0.835388483859.issue25130@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26468 pull_request: https://github.com/python/cpython/pull/28022 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 06:27:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 10:27:24 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630232844.96.0.731398984766.issue25130@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26469 pull_request: https://github.com/python/cpython/pull/28023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 06:43:51 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 10:43:51 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630233831.4.0.0247414250822.issue25130@roundup.psfhosted.org> miss-islington added the comment: New changeset a49398b643b3a2e6f9cc39729c528eb1e4385b1a by Miss Islington (bot) in branch '3.10': bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) https://github.com/python/cpython/commit/a49398b643b3a2e6f9cc39729c528eb1e4385b1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:01:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 11:01:30 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 Message-ID: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> New submission from Serhiy Storchaka : Here is a list of multiprocessing tests which are run in 3.8 but are not found in 3.9+: OtherTest.test_answer_challenge_auth_failure OtherTest.test_deliver_challenge_auth_failure TestInitializers.test_manager_initializer TestInitializers.test_pool_initializer TestSyncManagerTypes.test_array TestSyncManagerTypes.test_barrier TestSyncManagerTypes.test_bounded_semaphore TestSyncManagerTypes.test_condition TestSyncManagerTypes.test_dict TestSyncManagerTypes.test_event TestSyncManagerTypes.test_joinable_queue TestSyncManagerTypes.test_list TestSyncManagerTypes.test_lock TestSyncManagerTypes.test_namespace TestSyncManagerTypes.test_pool TestSyncManagerTypes.test_queue TestSyncManagerTypes.test_rlock TestSyncManagerTypes.test_semaphore TestSyncManagerTypes.test_value WithManagerTestBarrier.test_abort WithManagerTestBarrier.test_abort_and_reset WithManagerTestBarrier.test_action WithManagerTestBarrier.test_barrier WithManagerTestBarrier.test_barrier_10 WithManagerTestBarrier.test_default_timeout WithManagerTestBarrier.test_reset WithManagerTestBarrier.test_single_thread WithManagerTestBarrier.test_thousand WithManagerTestBarrier.test_timeout WithManagerTestBarrier.test_wait_return WithManagerTestCondition.test_notify WithManagerTestCondition.test_notify_all WithManagerTestCondition.test_notify_n WithManagerTestCondition.test_timeout WithManagerTestCondition.test_wait_result WithManagerTestCondition.test_waitfor WithManagerTestCondition.test_waitfor_timeout WithManagerTestContainers.test_dict WithManagerTestContainers.test_dict_iter WithManagerTestContainers.test_dict_proxy_nested WithManagerTestContainers.test_list WithManagerTestContainers.test_list_iter WithManagerTestContainers.test_list_proxy_in_list WithManagerTestContainers.test_namespace WithManagerTestEvent.test_event WithManagerTestLock.test_lock WithManagerTestLock.test_lock_context WithManagerTestLock.test_rlock WithManagerTestManagerRestart.test_rapid_restart WithManagerTestMyManager.test_mymanager WithManagerTestMyManager.test_mymanager_context WithManagerTestMyManager.test_mymanager_context_prestarted WithManagerTestPool.test_apply WithManagerTestPool.test_async WithManagerTestPool.test_async_timeout WithManagerTestPool.test_context WithManagerTestPool.test_empty_iterable WithManagerTestPool.test_enter WithManagerTestPool.test_imap WithManagerTestPool.test_imap_handle_iterable_exception WithManagerTestPool.test_imap_unordered WithManagerTestPool.test_imap_unordered_handle_iterable_exception WithManagerTestPool.test_make_pool WithManagerTestPool.test_map WithManagerTestPool.test_map_async WithManagerTestPool.test_map_async_callbacks WithManagerTestPool.test_map_chunksize WithManagerTestPool.test_map_handle_iterable_exception WithManagerTestPool.test_map_no_failfast WithManagerTestPool.test_map_unplicklable WithManagerTestPool.test_release_task_refs WithManagerTestPool.test_resource_warning WithManagerTestPool.test_starmap WithManagerTestPool.test_starmap_async WithManagerTestPool.test_terminate WithManagerTestPool.test_traceback WithManagerTestPool.test_wrapped_exception WithManagerTestQueue.test_closed_queue_put_get_exceptions WithManagerTestQueue.test_fork WithManagerTestQueue.test_get WithManagerTestQueue.test_no_import_lock_contention WithManagerTestQueue.test_put WithManagerTestQueue.test_qsize WithManagerTestQueue.test_queue_feeder_donot_stop_onexc WithManagerTestQueue.test_queue_feeder_on_queue_feeder_error WithManagerTestQueue.test_task_done WithManagerTestQueue.test_timeout WithManagerTestRemoteManager.test_remote WithManagerTestSemaphore.test_bounded_semaphore WithManagerTestSemaphore.test_semaphore WithManagerTestSemaphore.test_timeout WithProcessesTestManagerRestart.test_rapid_restart WithProcessesTestPicklingConnections.test_access WithProcessesTestPicklingConnections.test_pickling WithProcessesTestSharedMemory.test_shared_memory_ShareableList_basics WithProcessesTestSharedMemory.test_shared_memory_ShareableList_pickling WithProcessesTestSharedMemory.test_shared_memory_SharedMemoryManager_basics WithProcessesTestSharedMemory.test_shared_memory_SharedMemoryManager_reuses_resource_tracker WithProcessesTestSharedMemory.test_shared_memory_SharedMemoryServer_ignores_sigint WithProcessesTestSharedMemory.test_shared_memory_across_processes WithProcessesTestSharedMemory.test_shared_memory_basics WithProcessesTestSharedMemory.test_shared_memory_cleaned_after_process_termination WithThreadsTestManagerRestart.test_rapid_restart ---------- components: Tests keywords: 3.9regression messages: 400521 nosy: davin, pitrou, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Many multiprocessing tests are silently skipped since 3.9 type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:01:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 11:01:45 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630234905.16.0.144530015416.issue45042@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:03:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 11:03:15 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630234995.09.0.62252814006.issue25130@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset dab74d68e3f8391cb4b404b397ab80e2e0188d1f by Serhiy Storchaka in branch '3.9': [3.9] bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) (GH-28023) https://github.com/python/cpython/commit/dab74d68e3f8391cb4b404b397ab80e2e0188d1f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:04:43 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 11:04:43 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630235083.19.0.166529005444.issue25130@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 2a8127cafe1d196f858a3ecabf5f1df3eebf9a12 by Serhiy Storchaka in branch 'main': bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005) https://github.com/python/cpython/commit/2a8127cafe1d196f858a3ecabf5f1df3eebf9a12 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:08:10 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 11:08:10 +0000 Subject: [issue42278] Remove usage of tempfile.mktemp in stdlib In-Reply-To: <1604674672.14.0.368213492276.issue42278@roundup.psfhosted.org> Message-ID: <1630235290.55.0.787700095391.issue42278@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26472 pull_request: https://github.com/python/cpython/pull/28026 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:08:05 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 11:08:05 +0000 Subject: [issue42278] Remove usage of tempfile.mktemp in stdlib In-Reply-To: <1604674672.14.0.368213492276.issue42278@roundup.psfhosted.org> Message-ID: <1630235285.11.0.0527220835616.issue42278@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26471 pull_request: https://github.com/python/cpython/pull/28025 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:07:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 11:07:55 +0000 Subject: [issue42278] Remove usage of tempfile.mktemp in stdlib In-Reply-To: <1604674672.14.0.368213492276.issue42278@roundup.psfhosted.org> Message-ID: <1630235275.49.0.0713854113231.issue42278@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c9227df5a9d8e958a2324cf0deba8524d1ded26a by E-Paine in branch 'main': bpo-42278: Use tempfile.TemporaryDirectory rather than tempfile.mktemp in pydoc (GH-23200) https://github.com/python/cpython/commit/c9227df5a9d8e958a2324cf0deba8524d1ded26a ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:07:59 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 11:07:59 +0000 Subject: [issue42278] Remove usage of tempfile.mktemp in stdlib In-Reply-To: <1604674672.14.0.368213492276.issue42278@roundup.psfhosted.org> Message-ID: <1630235279.43.0.971307633486.issue42278@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +26470 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/28024 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:10:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 11:10:41 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630235441.23.0.8259832698.issue25130@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26473 pull_request: https://github.com/python/cpython/pull/28027 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:14:26 2021 From: report at bugs.python.org (Matt Schuster) Date: Sun, 29 Aug 2021 11:14:26 +0000 Subject: [issue45043] Typo (change 'two' to 'three') Message-ID: <1630235666.41.0.976708559831.issue45043@roundup.psfhosted.org> New submission from Matt Schuster : Reference https://docs.python.org/3/library/time.html?highlight=time%20time#module-time in 3.8, 3.9, 3.10, 3.11 (previous versions do not have same issue). Specifically under time.asctime([t]) and time.ctime([secs]) Change "day field is two characters long", should be "day field is three characters long" ---------- assignee: docs at python components: Documentation messages: 400525 nosy: docs at python, nofliesonyou priority: normal severity: normal status: open title: Typo (change 'two' to 'three') versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 07:16:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 11:16:29 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630235789.99.0.568282239334.issue25130@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26474 pull_request: https://github.com/python/cpython/pull/28028 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 08:01:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 12:01:19 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1630238479.57.0.751596429613.issue41620@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26475 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/28030 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 08:08:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 12:08:35 +0000 Subject: [issue25130] Make tests more PyPy compatible In-Reply-To: <1442340924.34.0.752221775968.issue25130@psf.upfronthosting.co.za> Message-ID: <1630238915.8.0.188443199336.issue25130@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 330aabbbbee39cbc556be01534b1dbf65d20f04c by Serhiy Storchaka in branch '3.9': [3.9] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005). (GH-28028) https://github.com/python/cpython/commit/330aabbbbee39cbc556be01534b1dbf65d20f04c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 08:34:46 2021 From: report at bugs.python.org (Jim Fasarakis-Hilliard) Date: Sun, 29 Aug 2021 12:34:46 +0000 Subject: [issue45044] Agreeing on error raised by large repeat value for sequences Message-ID: <1630240486.34.0.157153351878.issue45044@roundup.psfhosted.org> New submission from Jim Fasarakis-Hilliard : There's currently a slight disagreement between some of the sequences about what is raised when the value for `repeat` is too large. Currently, `str` and `bytes` raise an `OverflowError` while `bytearray`, `tuple`, `list` and `deque` raise a `MemoryError`. To make things more confusing, if we exercise a different path not currently caught by the check, both `str` and `bytes` raise `MemoryError`s: >>> b'abc' * maxsize Traceback (most recent call last): File "", line 1, in OverflowError: repeated bytes are too long >>> b'a' * maxsize Traceback (most recent call last): File "", line 1, in MemoryError Not sure what the original rationale for having these `OverflowError`s was but, should we change them to `MemoryError`s? ---------- messages: 400527 nosy: Jim Fasarakis-Hilliard priority: normal severity: normal status: open title: Agreeing on error raised by large repeat value for sequences type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 08:52:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 12:52:49 +0000 Subject: [issue45026] More compact range iterator In-Reply-To: <1630033413.29.0.592444888293.issue45026@roundup.psfhosted.org> Message-ID: <1630241569.07.0.951548549318.issue45026@roundup.psfhosted.org> Serhiy Storchaka added the comment: Microbenchmarks show some speed up: Iterating large range: $ ./python -m timeit -s 'r = range(0, 10**20, 3**35)' 'list(r)' Before: 2000 loops, best of 5: 199 usec per loop After: 2000 loops, best of 5: 113 usec per loop Unpickling: $ ./python -m timeit -s 'from pickle import dumps, loads; p = dumps([iter(range(i)) for i in range(1000)])' 'loads(p)' Before: 500 loops, best of 5: 476 usec per loop After: 500 loops, best of 5: 363 usec per loop I did not observe any difference in iterating small ranges and pickling. Smaller size in memory, smaller pickles. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 08:56:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 12:56:49 +0000 Subject: [issue42278] Remove usage of tempfile.mktemp in stdlib In-Reply-To: <1604674672.14.0.368213492276.issue42278@roundup.psfhosted.org> Message-ID: <1630241809.2.0.748897857517.issue42278@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 45409518c1cec5ee91d49f69a2f8eb4196d242f0 by Miss Islington (bot) in branch '3.9': bpo-42278: Use tempfile.TemporaryDirectory rather than tempfile.mktemp in pydoc (GH-23200) (GH-28025) https://github.com/python/cpython/commit/45409518c1cec5ee91d49f69a2f8eb4196d242f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 08:57:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 12:57:09 +0000 Subject: [issue42278] Remove usage of tempfile.mktemp in stdlib In-Reply-To: <1604674672.14.0.368213492276.issue42278@roundup.psfhosted.org> Message-ID: <1630241829.06.0.673190641253.issue42278@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 193443bb708cba3a72e99e61dd6615a94f22f9e1 by Miss Islington (bot) in branch '3.8': bpo-42278: Use tempfile.TemporaryDirectory rather than tempfile.mktemp in pydoc (GH-23200) (GH-28026) https://github.com/python/cpython/commit/193443bb708cba3a72e99e61dd6615a94f22f9e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 08:57:26 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 12:57:26 +0000 Subject: [issue42278] Remove usage of tempfile.mktemp in stdlib In-Reply-To: <1604674672.14.0.368213492276.issue42278@roundup.psfhosted.org> Message-ID: <1630241846.16.0.25704725595.issue42278@roundup.psfhosted.org> miss-islington added the comment: New changeset 532ebba6c8697d214a0d94514ad0b2464a59cb7c by Miss Islington (bot) in branch '3.10': bpo-42278: Use tempfile.TemporaryDirectory rather than tempfile.mktemp in pydoc (GH-23200) https://github.com/python/cpython/commit/532ebba6c8697d214a0d94514ad0b2464a59cb7c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 08:57:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 12:57:59 +0000 Subject: [issue42278] Remove usage of tempfile.mktemp in stdlib In-Reply-To: <1604674672.14.0.368213492276.issue42278@roundup.psfhosted.org> Message-ID: <1630241879.5.0.0625435402229.issue42278@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, E. Paine! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 09:10:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 13:10:13 +0000 Subject: [issue45043] Typo (change 'two' to 'three') In-Reply-To: <1630235666.41.0.976708559831.issue45043@roundup.psfhosted.org> Message-ID: <1630242613.06.0.72321289802.issue45043@roundup.psfhosted.org> Serhiy Storchaka added the comment: In what case the day field is three characters long? Could you show an example? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:08:37 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 14:08:37 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630246117.1.0.27177576651.issue44394@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26476 pull_request: https://github.com/python/cpython/pull/28031 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:08:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 14:08:31 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630246111.27.0.94467920075.issue44394@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 3fc5d84046ddbd66abac5b598956ea34605a4e5d by Victor Stinner in branch 'main': bpo-44394: Update libexpat copy to 2.4.1 (GH-26945) https://github.com/python/cpython/commit/3fc5d84046ddbd66abac5b598956ea34605a4e5d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:08:42 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 14:08:42 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630246122.12.0.62262890668.issue44394@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26477 pull_request: https://github.com/python/cpython/pull/28032 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:08:47 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 14:08:47 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630246127.8.0.274768265209.issue44394@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26478 pull_request: https://github.com/python/cpython/pull/28033 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:10:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 14:10:53 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630246253.78.0.40449955176.issue43124@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0897253f426068ea6a6fbe0ada01689af9ef1019 by Miguel Brito in branch 'main': bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) https://github.com/python/cpython/commit/0897253f426068ea6a6fbe0ada01689af9ef1019 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:11:02 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 14:11:02 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630246262.78.0.438462229102.issue43124@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26480 pull_request: https://github.com/python/cpython/pull/28035 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:11:08 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 14:11:08 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630246268.71.0.18213699073.issue43124@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26481 pull_request: https://github.com/python/cpython/pull/28036 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:10:57 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 14:10:57 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630246257.69.0.678677752403.issue43124@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26479 pull_request: https://github.com/python/cpython/pull/28034 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:11:20 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 14:11:20 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630246280.92.0.0392818745896.issue43124@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26483 pull_request: https://github.com/python/cpython/pull/28038 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:11:15 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 14:11:15 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630246275.05.0.677265355825.issue43124@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26482 pull_request: https://github.com/python/cpython/pull/28037 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:19:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 14:19:01 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630246741.51.0.896542810733.issue45007@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d3bdbbf9a4352a24fc2bfc7a63a024b244b61aba by Steve Dower in branch 'main': bpo-45007: Update to OpenSSL 1.1.1l in Windows build and CI (GH-28009) https://github.com/python/cpython/commit/d3bdbbf9a4352a24fc2bfc7a63a024b244b61aba ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:21:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 14:21:57 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630246917.09.0.852457172627.issue45007@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26484 pull_request: https://github.com/python/cpython/pull/28039 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:25:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 14:25:23 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630247123.31.0.980354109939.issue45007@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26485 pull_request: https://github.com/python/cpython/pull/28040 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:30:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 14:30:08 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630247408.98.0.690342276122.issue45007@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26486 pull_request: https://github.com/python/cpython/pull/28041 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:31:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 14:31:35 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630247495.11.0.374187259355.issue44394@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c9c2a0bc9820f93f1020f3498f6893a3544c9b76 by Miss Islington (bot) in branch '3.8': bpo-44394: Update libexpat copy to 2.4.1 (GH-26945) (GH-28033) https://github.com/python/cpython/commit/c9c2a0bc9820f93f1020f3498f6893a3544c9b76 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:32:58 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 14:32:58 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630247578.46.0.961310239528.issue44394@roundup.psfhosted.org> miss-islington added the comment: New changeset 270678564c16452614a8acd93763bdf64fb4d286 by Miss Islington (bot) in branch '3.10': bpo-44394: Update libexpat copy to 2.4.1 (GH-26945) https://github.com/python/cpython/commit/270678564c16452614a8acd93763bdf64fb4d286 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:36:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 14:36:44 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630247804.66.0.543888437978.issue44394@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 007221a43e566db08c0c5c00756d80dfd9dccafe by Miss Islington (bot) in branch '3.9': bpo-44394: Update libexpat copy to 2.4.1 (GH-26945) (GH-28032) https://github.com/python/cpython/commit/007221a43e566db08c0c5c00756d80dfd9dccafe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:43:47 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 29 Aug 2021 14:43:47 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630248226.99.0.135818818866.issue43124@roundup.psfhosted.org> miss-islington added the comment: New changeset 9e6c317ab133cd8fa48d5ecd8568314ef2e98634 by Miss Islington (bot) in branch '3.10': bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) https://github.com/python/cpython/commit/9e6c317ab133cd8fa48d5ecd8568314ef2e98634 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:45:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 14:45:29 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630248329.09.0.337654000559.issue43124@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 24416e419194f11b639146c0d8bed9df315aca5a by Miss Islington (bot) in branch '3.9': bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) (GH-28035) https://github.com/python/cpython/commit/24416e419194f11b639146c0d8bed9df315aca5a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 10:59:25 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sun, 29 Aug 2021 14:59:25 +0000 Subject: [issue45043] Typo (change 'two' to 'three') In-Reply-To: <1630235666.41.0.976708559831.issue45043@roundup.psfhosted.org> Message-ID: <1630249165.79.0.405964650352.issue45043@roundup.psfhosted.org> Vedran ?a?i? added the comment: Matt obviously meant the day of week, but in docs day is meant as day of month. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 11:04:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 15:04:27 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630249467.9.0.446102106662.issue43124@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b93aea4c7e4553950daa5d47c3ef2dc8a9c4edff by Miss Islington (bot) in branch '3.8': [3.8] bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) (GH-28036) https://github.com/python/cpython/commit/b93aea4c7e4553950daa5d47c3ef2dc8a9c4edff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 11:06:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 15:06:53 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630249613.22.0.072228525664.issue45007@roundup.psfhosted.org> ?ukasz Langa added the comment: I backported GH-28009 to 3.8 inclusive, given that 3.7 and 3.6 currently list older versions than 1.1.1k. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 11:07:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 15:07:55 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630249675.69.0.0696193034263.issue45007@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 5720bcac7b08fe961835927933601da18b92bcd1 by ?ukasz Langa in branch '3.9': [3.9] bpo-45007: Update to OpenSSL 1.1.1l in Windows build and CI (GH-28009) (GH-28040) https://github.com/python/cpython/commit/5720bcac7b08fe961835927933601da18b92bcd1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 11:09:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 15:09:19 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630249759.9.0.644550638574.issue43124@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Martin! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 11:17:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 15:17:28 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630250248.53.0.0981890296636.issue44394@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26487 pull_request: https://github.com/python/cpython/pull/28042 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 11:24:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 15:24:19 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630250659.04.0.168487791838.issue44394@roundup.psfhosted.org> ?ukasz Langa added the comment: 3.6 will need a separate backport because it's using expat 2.2.6 at the moment (from b2260e59ff1eaf20de4738099005ddf507b7b27d). 3.7 conflicted since it didn't include local changes to the vendored 2.2.8 that were introduced in 3.8+. I fixed that, the backport is up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 11:40:11 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 29 Aug 2021 15:40:11 +0000 Subject: [issue45044] Agreeing on error raised by large repeat value for sequences In-Reply-To: <1630240486.34.0.157153351878.issue45044@roundup.psfhosted.org> Message-ID: <1630251611.67.0.30506256823.issue45044@roundup.psfhosted.org> Raymond Hettinger added the comment: These should be left as they are because they indicate different problems and solutions. The Overflow errors are dependent on PY_SSIZE_T_MAX. They indicate the that size is to big to store in a variable. Changing from a 32-bit build to a 64-bit build can alleviate this problem even on a system with the same amount of memory. The MemoryErrors are dependent on the size of memory. They indicate that a malloc() or realloc() failed. This problem can be solved by adding memory. FWIW, this isn't just limited to sequence types. Throughout the implementation, failed memory allocations raise a MemoryError and know variable size overflows raise an OverflowError (for example, int and float objects). It would have been nice if the original exception hierarchy had a CapacityError that covered both MemoryError and OverflowError. But that ship sailed long ago and doesn't seem to have caused problems in practice. ---------------------------------- Examples: >>> bytes(1 << 62) Traceback (most recent call last): File "", line 1, in bytes(1 << 62) MemoryError >>> bytes(1 << 65) Traceback (most recent call last): File "", line 1, in bytes(1 << 65) OverflowError: cannot fit 'int' into an index-sized integer >>> bytearray(1 << 62) Traceback (most recent call last): File "", line 1, in bytearray(1 << 62) MemoryError >>> bytearray(1 << 65) Traceback (most recent call last): File "", line 1, in bytearray(1 << 65) OverflowError: cannot fit 'int' into an index-sized integer ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 11:56:09 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Aug 2021 15:56:09 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching Message-ID: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> New submission from Dong-hee Na : There are optimizable points that can be achieved by removing unnecessary tuple transformation and using vector calling convention. +---------------+--------+----------------------+ | Benchmark | base | opt | +===============+========+======================+ | bench pattern | 482 ns | 417 ns: 1.15x faster | +---------------+--------+----------------------+ ---------- components: Interpreter Core files: bench_pattern.py messages: 400549 nosy: corona10 priority: normal severity: normal status: open title: Optimize mapping patterns of structural pattern matching type: performance versions: Python 3.11 Added file: https://bugs.python.org/file50240/bench_pattern.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 11:58:53 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Aug 2021 15:58:53 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630252733.38.0.10182031556.issue45045@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +26488 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28043 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 12:08:08 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 29 Aug 2021 16:08:08 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630253288.16.0.0308576270144.issue45045@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 12:17:35 2021 From: report at bugs.python.org (Matt Schuster) Date: Sun, 29 Aug 2021 16:17:35 +0000 Subject: [issue45043] Typo (change 'two' to 'three') In-Reply-To: <1630235666.41.0.976708559831.issue45043@roundup.psfhosted.org> Message-ID: <1630253855.09.0.904949012927.issue45043@roundup.psfhosted.org> Matt Schuster added the comment: Yes, I meant the day of week. Ok, no problem as this is 'date of month'. Closing as 'not a bug'. Thanks!! ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 12:27:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 16:27:09 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630254429.1.0.833925502458.issue45007@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 803c60789b5b6566cb0b71f6b83464e61731d09b by ?ukasz Langa in branch '3.8': [3.8] bpo-45007: Update to OpenSSL 1.1.1l in Windows build and CI (GH-28009) (GH-28041) https://github.com/python/cpython/commit/803c60789b5b6566cb0b71f6b83464e61731d09b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 12:33:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sun, 29 Aug 2021 16:33:22 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630254802.72.0.830663705963.issue45007@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26489 pull_request: https://github.com/python/cpython/pull/28044 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 12:56:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 16:56:09 +0000 Subject: [issue45046] Add support of context managers in unittest Message-ID: <1630256169.0.0.0736015144313.issue45046@roundup.psfhosted.org> New submission from Serhiy Storchaka : Methods setUp() and tearDown() of TestClass allow to add some code executed before and after every test method. In many cases addCleanup() is more convenient than tearDown() -- you do not need to keep data for cleaning up as TestCase attributes, addCleanup() doe it for you. You should not worry about partial cleaning up if setUp() fails in the middle. You can also use addCleanup() in test methods, and corresponding resources will be cleaned only for these tests which created them. resource = open_resource() self.addCleanup(close_resource, resource) self.resource = resource # optional, if you need access to it in test methods Some resources are managed by context managers. It is so easy to create a context manager with the contextlib.contextmanager decorator, that its __enter__ and __exit__ methods can be only way to create and destroy resource. So the code looks like the following: cm = my_context_manager() cm.__enter__() # or self.resource = cm.__enter__() self.addCleanup(cm.__exit__, None, None, None) It looks not so nice. You need to use dunder methods, and pass thee Nones as arguments for __exit__. I propose to add helpers: methods enterContext(), enterClassContext(), enterAsyncContext() and function enterModuleContext() which wraps addCleanup/addClassCleanup/addAsyncCleanup/addModuleCleanup correspondently and allow to get rid of the boilerplate code. Example: self.enterContext(my_context_manager()) # or self.resource = self.enterContext(my_context_manager()) It solves the same problem as issue15351, but from different direction, so I opened a separate issue. ---------- components: Library (Lib) messages: 400552 nosy: chris.jerdonek, ezio.melotti, michael.foord, r.david.murray, rbcollins, serhiy.storchaka priority: normal severity: normal status: open title: Add support of context managers in unittest type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 12:59:10 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 29 Aug 2021 16:59:10 +0000 Subject: [issue40935] Links to Python3 docs for some libs return 404 In-Reply-To: <1591756890.13.0.690147132201.issue40935@roundup.psfhosted.org> Message-ID: <1630256350.4.0.282871741783.issue40935@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 13:01:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 17:01:15 +0000 Subject: [issue45046] Add support of context managers in unittest In-Reply-To: <1630256169.0.0.0736015144313.issue45046@roundup.psfhosted.org> Message-ID: <1630256475.43.0.656030276676.issue45046@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26490 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28045 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 13:02:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 17:02:58 +0000 Subject: [issue15351] Add to unittest.TestCase support for using context managers In-Reply-To: <1342280032.27.0.345733068822.issue15351@psf.upfronthosting.co.za> Message-ID: <1630256578.89.0.228670584784.issue15351@roundup.psfhosted.org> Serhiy Storchaka added the comment: Opened issue45046 for completely different approach to this problem. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 13:35:13 2021 From: report at bugs.python.org (Ayush Parikh) Date: Sun, 29 Aug 2021 17:35:13 +0000 Subject: [issue45047] Update demo files Message-ID: <1630258513.56.0.335503332351.issue45047@roundup.psfhosted.org> Change by Ayush Parikh : ---------- nosy: Ayushparikh-code priority: normal pull_requests: 26491 severity: normal status: open title: Update demo files type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 13:44:24 2021 From: report at bugs.python.org (Ayush Parikh) Date: Sun, 29 Aug 2021 17:44:24 +0000 Subject: [issue45047] Update demo files Message-ID: <1630259064.96.0.637389570489.issue45047@roundup.psfhosted.org> Change by Ayush Parikh : ---------- pull_requests: -26491 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 13:44:50 2021 From: report at bugs.python.org (Ayush Parikh) Date: Sun, 29 Aug 2021 17:44:50 +0000 Subject: [issue45047] Update demo files Message-ID: <1630259090.27.0.545972946063.issue45047@roundup.psfhosted.org> Change by Ayush Parikh : ---------- keywords: +patch pull_requests: +26492 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28046 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 14:37:37 2021 From: report at bugs.python.org (Diana) Date: Sun, 29 Aug 2021 18:37:37 +0000 Subject: [issue20803] doc: clarify that struct.pack_into writes 0x00 for pad bytes In-Reply-To: <1393579049.39.0.501282349647.issue20803@psf.upfronthosting.co.za> Message-ID: <1630262257.89.0.841828344478.issue20803@roundup.psfhosted.org> Diana added the comment: I'm working on this ---------- nosy: +DonnaDia _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 14:43:09 2021 From: report at bugs.python.org (Diana) Date: Sun, 29 Aug 2021 18:43:09 +0000 Subject: [issue20803] doc: clarify that struct.pack_into writes 0x00 for pad bytes In-Reply-To: <1393579049.39.0.501282349647.issue20803@psf.upfronthosting.co.za> Message-ID: <1630262589.6.0.914722912576.issue20803@roundup.psfhosted.org> Change by Diana : ---------- keywords: +patch pull_requests: +26493 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28047 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 15:19:42 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 29 Aug 2021 19:19:42 +0000 Subject: [issue33262] Deprecate shlex.split(None) to read from stdin. In-Reply-To: <1523442529.49.0.682650639539.issue33262@psf.upfronthosting.co.za> Message-ID: <1630264782.04.0.195561163034.issue33262@roundup.psfhosted.org> Andrei Kulakov added the comment: Can be closed as fixed (or perhaps renamed and kept open to track eventual raising of error in the future?) ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 15:33:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 29 Aug 2021 19:33:20 +0000 Subject: [issue45047] Update demo files Message-ID: <1630265600.47.0.0322461155035.issue45047@roundup.psfhosted.org> New submission from Irit Katriel : Please explain the issue - in what way should the demo files be updated? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 16:20:13 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 29 Aug 2021 20:20:13 +0000 Subject: [issue45047] Update demo files In-Reply-To: <1630265600.47.0.0322461155035.issue45047@roundup.psfhosted.org> Message-ID: <1630268413.06.0.934843104721.issue45047@roundup.psfhosted.org> Eric V. Smith added the comment: It looks like they want to add a RatinMaze.py demo program, which solves a maze. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 16:40:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 20:40:00 +0000 Subject: [issue41046] unittest: make skipTest a classmethod In-Reply-To: <1592613393.95.0.180040510992.issue41046@roundup.psfhosted.org> Message-ID: <1630269600.32.0.355778179298.issue41046@roundup.psfhosted.org> Serhiy Storchaka added the comment: Since you always can raise a SkipTest in setUpClass() and setUpModule() and changing skipTest() can break existing code (for example the code which calls cls.skipTest(None, reason) for some strange reasons), I think that it is not worth to change it. ---------- nosy: +serhiy.storchaka status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 16:51:56 2021 From: report at bugs.python.org (Laurent Lyaudet) Date: Sun, 29 Aug 2021 20:51:56 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630270316.24.0.936221129014.issue34561@roundup.psfhosted.org> Laurent Lyaudet added the comment: My benchmarks could be improved but however I found that Shivers' sort and adaptive Shivers' sort (aka Jug?'s sort) performs better than Tim's sort. it can be done easily by switching the main natural merge strategy like I did here : https://github.com/LLyaudet/TSODLULS/commit/2968c4b4ca58ae794157dc9636ed87017e5f7a17 The relevant code is not very long : /** * This strategy is from ShiversSort: * see the research report by Olin Shivers, Georgia Institute of Technology, 2002. * It uses bitwise tricks to check condition on floor of logarithms in base 2 of runs lengths. * When I benchmark it, it is slightly faster than Tim's sort strategy. */ #define TSODLULS_natural_merge_main_strategy__Shivers_sort \ while(merge_state.i_run_instances_count > 1){\ size_t i_merge_at = merge_state.i_run_instances_count - 2;\ size_t i_order_of_magnitude = merge_state.arr_run_instances[i_merge_at + 1].i_length;\ if(i_order_of_magnitude < ((~i_order_of_magnitude) & merge_state.arr_run_instances[i_merge_at].i_length) ){\ break;\ }\ i_compare_result = TSODLULS_MERGE_TWO_RUNS(&merge_state, i_merge_at);\ if(i_compare_result != 0){\ goto clean_and_return_error;\ }\ }\ /** * This strategy is from AdaptiveShiversSort: * see the articles by Vincent Jug?, for example 1024 Bulletin de la SIF, avril 2020, in French, * or the preprint on arXiv or SODA 2020 proceedings. * It uses bitwise tricks to check condition on floor of logarithms in base 2 of runs lengths. * When I benchmark it, it is slightly faster than Tim's sort strategy. * Despite its ressemblance with Shivers's sort, * the distinct properties of this strategy make that Jug?Sort would probably be a better name than AdaptiveShiversSort, * or an even better name for the whole algorithm should be TimShiversJug?Sort and I must have missed many names ;) * With AdaptiveShiversSort we avoid '?' and diacritics in function names ;P */ #define TSODLULS_natural_merge_main_strategy__adaptive_Shivers_sort \ while(merge_state.i_run_instances_count > 2){\ size_t i_merge_at = merge_state.i_run_instances_count - 3;\ size_t i_order_of_magnitude = merge_state.arr_run_instances[i_merge_at + 1].i_length | merge_state.arr_run_instances[i_merge_at + 2].i_length;\ if(i_order_of_magnitude < ((~i_order_of_magnitude) & merge_state.arr_run_instances[i_merge_at].i_length) ){\ break;\ }\ i_compare_result = TSODLULS_MERGE_TWO_RUNS(&merge_state, i_merge_at);\ if(i_compare_result != 0){\ goto clean_and_return_error;\ }\ }\ I will try to provide a patch before the end of the week. ---------- nosy: +LLyaudet _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 17:02:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 21:02:02 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1630270922.06.0.559227449624.issue36674@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: -14706 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 17:07:49 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 29 Aug 2021 21:07:49 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630271269.53.0.555503633668.issue34561@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 17:11:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 29 Aug 2021 21:11:23 +0000 Subject: [issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls) In-Reply-To: <1555752054.75.0.256314796752.issue36674@roundup.psfhosted.org> Message-ID: <1630271483.2.0.831043574361.issue36674@roundup.psfhosted.org> Serhiy Storchaka added the comment: See issue41620 for run() returning None. ---------- dependencies: +Python Unittest does not return results object when the test is skipped nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 17:12:54 2021 From: report at bugs.python.org (DragonEggBedrockBreaking) Date: Sun, 29 Aug 2021 21:12:54 +0000 Subject: [issue45048] subprocess.run(capture_output=Bool) does the opposite of expected Message-ID: <1630271574.19.0.912939412698.issue45048@roundup.psfhosted.org> New submission from DragonEggBedrockBreaking : If you run subprocess.run(capture_output=True), it doesn't show output, but if you run subprocess.run(capture_output=False) (or if you just run subprocess.run() since False is default), it does show output. In the example in the docs, it shows this in the examples section: ```py >>> subprocess.run(["ls", "-l"]) # doesn't capture output CompletedProcess(args=['ls', '-l'], returncode=0) >>> subprocess.run(["ls", "-l", "/dev/null"], capture_output=True) CompletedProcess(args=['ls', '-l', '/dev/null'], returncode=0, stdout=b'crw-rw-rw- 1 root root 1, 3 Jan 23 16:23 /dev/null\n', stderr=b'') ``` This clearly shows capture_output showing output if true but not if false. Test code: ```py import subprocess subprocess.run("dir", shell=True, capture_output=False) subprocess.run("dir", shell=True, capture_output=False) ``` Other notes: for some reason I get an error if I don't add shell=True, so maybe that contributes? I am on Windows 10 if that matters. ---------- components: Library (Lib) messages: 400561 nosy: DragonEggBedrockBreaking priority: normal severity: normal status: open title: subprocess.run(capture_output=Bool) does the opposite of expected versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 18:07:51 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sun, 29 Aug 2021 22:07:51 +0000 Subject: [issue45048] subprocess.run(capture_output=Bool) does the opposite of expected In-Reply-To: <1630271574.19.0.912939412698.issue45048@roundup.psfhosted.org> Message-ID: <1630274871.41.0.583150096668.issue45048@roundup.psfhosted.org> Vedran ?a?i? added the comment: I think it is exactly what "capture" means: "not allow it to escape" (to the console). Maybe you should read the documentation? ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 18:11:50 2021 From: report at bugs.python.org (RAW) Date: Sun, 29 Aug 2021 22:11:50 +0000 Subject: [issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h In-Reply-To: <1359956347.87.0.611737971795.issue17120@psf.upfronthosting.co.za> Message-ID: <1630275110.98.0.813160850171.issue17120@roundup.psfhosted.org> RAW added the comment: Please look at configure.ac which is used to create configure which will generate pyconfig.h from pyconfig.h.in according to what features are detected in the system. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 18:12:58 2021 From: report at bugs.python.org (RAW) Date: Sun, 29 Aug 2021 22:12:58 +0000 Subject: [issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h In-Reply-To: <1359956347.87.0.611737971795.issue17120@psf.upfronthosting.co.za> Message-ID: <1630275178.05.0.433218871795.issue17120@roundup.psfhosted.org> Change by RAW : ---------- resolution: out of date -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 18:14:18 2021 From: report at bugs.python.org (DragonEggBedrockBreaking) Date: Sun, 29 Aug 2021 22:14:18 +0000 Subject: [issue45048] subprocess.run(capture_output=Bool) does the opposite of expected In-Reply-To: <1630271574.19.0.912939412698.issue45048@roundup.psfhosted.org> Message-ID: <1630275258.57.0.674222146533.issue45048@roundup.psfhosted.org> DragonEggBedrockBreaking added the comment: I read the documentation, and I saw in the example that when capture_output was true, command output was printed, otherwise it isn't printed. my observations directly contradict the examples given in the docs, as stated in my original issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 18:50:18 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 29 Aug 2021 22:50:18 +0000 Subject: [issue45048] subprocess.run(capture_output=Bool) does the opposite of expected In-Reply-To: <1630271574.19.0.912939412698.issue45048@roundup.psfhosted.org> Message-ID: <1630277418.16.0.729633870024.issue45048@roundup.psfhosted.org> Eryk Sun added the comment: The documentation states that "[i]f capture_output is true, stdout and stderr will be captured". This implies a container of some kind. So look to what subprocess.run() returns: "[w]ait for command to complete, then return a CompletedProcess instance". The `stdout` attribute of a CompletedProcess is the "[c]aptured stdout from the child process". For example: >>> p = subprocess.run("dir", shell=True, capture_output=True) >>> p.stdout[:18] b' Volume in drive C' If the output is not captured, the child process inherits the standard output/error files of the parent process, which is typically a console or terminal. FYI, the `dir` command is internal to the CMD shell in Windows, so it only works with shell=True. There is no "dir.exe" executable that can be executed with shell=False. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 19:42:55 2021 From: report at bugs.python.org (Tim Peters) Date: Sun, 29 Aug 2021 23:42:55 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630280575.96.0.101290038424.issue34561@roundup.psfhosted.org> Tim Peters added the comment: Added new runstack.py. New `shivers2()` adds the implementation of adaptive ShiversSort from Vincent's later paper. While the code is simpler, it appears to behave identically. New `shivers3()` adds, from the same paper, the new "length-adaptive ShiversSort". Wow! This is the only thing we've seen yet that's in the same universe as powersort. In fact, it usually does a tiny bit better (on the randomized cases). But it's not obvious how to rework its "if" test to be truly efficient (as-is, it needs two divisions, two calls to `log2()`, and two calls to `floor()`). Worth some thought, though. From the results here, length-adaptive ShiversSort is a bigger improvement over (plain-old) adaptive ShiversSort than the latter is over timsort. ---------- Added file: https://bugs.python.org/file50241/runstack.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 20:11:14 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 30 Aug 2021 00:11:14 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630282274.09.0.982598889586.issue45045@roundup.psfhosted.org> Dong-hee Na added the comment: With Ken Jin's suggestion +---------------+--------+----------------------+ | Benchmark | base | PR 28043 | +===============+========+======================+ | bench pattern | 482 ns | 373 ns: 1.29x faster | +---------------+--------+----------------------+ ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 20:33:16 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 30 Aug 2021 00:33:16 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630283596.12.0.376863564575.issue45045@roundup.psfhosted.org> Tim Peters added the comment: And another runstack.py adds `shivers4()`, which reworks `shivers3()` (length-adaptive ShiversSort) so that division, log2(), and floor() aren't used anymore. It does need a loop, though, which needs to go around a number of times `k` such that k is the smallest integer for which 2**k * max(run_length_1, run_length_2, run_length3) >= 1 + len(original_list) ---------- nosy: +tim.peters Added file: https://bugs.python.org/file50242/runstack.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 20:33:43 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 30 Aug 2021 00:33:43 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630283623.93.0.0457152736227.issue45045@roundup.psfhosted.org> Change by Tim Peters : ---------- Removed message: https://bugs.python.org/msg400568 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 20:34:05 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 30 Aug 2021 00:34:05 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630283645.21.0.849666668496.issue45045@roundup.psfhosted.org> Change by Tim Peters : Removed file: https://bugs.python.org/file50242/runstack.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 20:34:55 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 30 Aug 2021 00:34:55 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630283695.16.0.77922677699.issue34561@roundup.psfhosted.org> Tim Peters added the comment: And another runstack.py adds `shivers4()`, which reworks `shivers3()` (length-adaptive ShiversSort) so that division, log2(), and floor() aren't used anymore. It does need a loop, though, which needs to go around a number of times `k` such that k is the smallest integer for which 2**k * max(run_length_1, run_length_2, run_length3) >= 1 + len(original_list) ---------- Added file: https://bugs.python.org/file50243/runstack.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 22:05:14 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 30 Aug 2021 02:05:14 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630289114.81.0.102826730844.issue45021@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +davin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 22:45:16 2021 From: report at bugs.python.org (Mark Lierley) Date: Mon, 30 Aug 2021 02:45:16 +0000 Subject: [issue44828] Using tkinter.filedialog crashes on macOS Python 3.9.6 In-Reply-To: <1628076093.82.0.287740145135.issue44828@roundup.psfhosted.org> Message-ID: <1630291516.23.0.742894260123.issue44828@roundup.psfhosted.org> Mark Lierley added the comment: I am also experiencing this issue. I have an M1 Macbook Air running MaOS Monterey Version 12.0 Beta (21A5304g) with a fresh install of Python 3.9.6. When attempting to save or open anything from either the editor or console window I get the following error message "The Save file operation failed. The save file operation failed to connect to the open and save panel service.? I have granted the IDEL full drive access which hasn't resolved the issue. The dialog prevents any savings from occurring making the IDEL useless. I have submitted this issue through Apple's Feedback tool as well. ---------- nosy: +mlierley Added file: https://bugs.python.org/file50244/Screen Shot 2021-08-29 at 7.44.33 PM.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Aug 29 23:29:18 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 30 Aug 2021 03:29:18 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630294158.98.0.625042165521.issue36521@roundup.psfhosted.org> Inada Naoki added the comment: > I think that would require a change in the signature of PyFunction_New. I don't think so. For example, func_annotation don't require changing PyFunction_New(). ``` case TARGET(MAKE_FUNCTION): { PyObject *codeobj = POP(); PyFunctionObject *func = (PyFunctionObject *) PyFunction_New(codeobj, GLOBALS()); (snip) if (oparg & 0x04) { assert(PyTuple_CheckExact(TOP())); func->func_annotations = POP(); } ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 00:29:38 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 30 Aug 2021 04:29:38 +0000 Subject: [issue24444] In argparse empty choices cannot be printed in the help In-Reply-To: <1434178022.79.0.230343884775.issue24444@psf.upfronthosting.co.za> Message-ID: <1630297778.08.0.0310011185005.issue24444@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +26494 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28050 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 01:32:05 2021 From: report at bugs.python.org (Ayush Parikh) Date: Mon, 30 Aug 2021 05:32:05 +0000 Subject: [issue45047] Update demo files In-Reply-To: <1630268413.06.0.934843104721.issue45047@roundup.psfhosted.org> Message-ID: Ayush Parikh added the comment: yes eric you're right as that demo folder already consists of some common software problems like n-queens ,etc so i also want to ratinmaze.py demo program their ! On Mon, Aug 30, 2021 at 1:50 AM Eric V. Smith wrote: > > Eric V. Smith added the comment: > > It looks like they want to add a RatinMaze.py demo program, which solves a > maze. > > ---------- > nosy: +eric.smith > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 01:55:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Aug 2021 05:55:50 +0000 Subject: [issue35741] unittest.skipUnless(time._STRUCT_TM_ITEMS == 11, "needs tm_zone support") doesn't work In-Reply-To: <1547544727.75.0.967204925198.issue35741@roundup.psfhosted.org> Message-ID: <1630302950.29.0.648589883799.issue35741@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +lemburg, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 02:18:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Aug 2021 06:18:16 +0000 Subject: [issue25894] unittest subTest failure causes result to be omitted from listing In-Reply-To: <1450331375.94.0.689081172202.issue25894@psf.upfronthosting.co.za> Message-ID: <1630304296.43.0.762440061866.issue25894@roundup.psfhosted.org> Serhiy Storchaka added the comment: Were not subtests proposed as a more flexible replacement of parametrized tests? I think that every subtest should be counted as a separate test case: in verbose mode it should output a separate line and in non-verbose mode it should output a separate character. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 02:28:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 30 Aug 2021 06:28:02 +0000 Subject: [issue45047] Update demo files In-Reply-To: <1630265600.47.0.0322461155035.issue45047@roundup.psfhosted.org> Message-ID: <1630304882.12.0.380681434128.issue45047@roundup.psfhosted.org> Terry J. Reedy added the comment: This submission is somewhat similar to #45037 more promising. It at least needs more explanation as to what it contributes that is not already present. Plus see review comment. (This part of my previous answer still applies: "When responding by email, please delete the text you are responding to.") We are not really looking for new examples for Tools/demo and there is no policy I know of for adding anything. The files were, at least, reviewed and updated a couple of years ago in #38539, where Raymond described it as "a quaint museum to the past." He also noted that beginners seldom see it. You are likely to get a better response if you write a bugfix patch, or an enhancement that a core developer has expressed an interest in. You should also know that comments like "can u plz review it so that it can be merged !" produce a negative impression, at least on me. ---------- nosy: +rhettinger, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 02:38:01 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 30 Aug 2021 06:38:01 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630305481.32.0.160687839549.issue45007@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +26495 pull_request: https://github.com/python/cpython/pull/28051 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 02:56:02 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 30 Aug 2021 06:56:02 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630306562.66.0.692378182468.issue44689@roundup.psfhosted.org> Ned Deily added the comment: New changeset 71853a73024a98aa38a3c0444fe364dbd9709134 by Tobias Bergkvist in branch 'main': bpo-44689: ctypes.util.find_library() now finds macOS 11+ system libraries when built on older macOS systems (#27251) https://github.com/python/cpython/commit/71853a73024a98aa38a3c0444fe364dbd9709134 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 02:56:05 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 06:56:05 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630306565.52.0.232035062509.issue44689@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26496 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28052 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 02:56:09 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 06:56:09 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630306569.75.0.00759419857608.issue44689@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26497 pull_request: https://github.com/python/cpython/pull/28053 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 02:56:14 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 06:56:14 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630306574.54.0.988003288384.issue44689@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26498 pull_request: https://github.com/python/cpython/pull/28054 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 03:08:57 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 30 Aug 2021 07:08:57 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630307337.58.0.729848338423.issue44689@roundup.psfhosted.org> Change by Ned Deily : ---------- assignee: -> ned.deily stage: patch review -> commit review title: MacOS: Python binaries not portable between Catalina and Big Sur -> ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 03:11:28 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 07:11:28 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630307488.7.0.348288685414.issue45007@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +26499 pull_request: https://github.com/python/cpython/pull/28055 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 03:12:40 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 07:12:40 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630307560.21.0.887423695519.issue45007@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26500 pull_request: https://github.com/python/cpython/pull/28056 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 03:53:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 30 Aug 2021 07:53:17 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630309997.42.0.778215248427.issue36521@roundup.psfhosted.org> Irit Katriel added the comment: Are you suggesting that anyone who calls PyFunction_New needs to add a doc string assignment following the call? This is public api, so that would break people?s working code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 04:02:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 30 Aug 2021 08:02:46 +0000 Subject: [issue45047] Update demo files In-Reply-To: <1630265600.47.0.0322461155035.issue45047@roundup.psfhosted.org> Message-ID: <1630310566.91.0.676050974943.issue45047@roundup.psfhosted.org> Irit Katriel added the comment: The demos directory is described as follows: ?This directory contains a collection of demonstration scripts for various aspects of Python programming.? Which aspect of python programming does the rat in a maze demo cover which is not already covered by the existing demo scripts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 04:20:28 2021 From: report at bugs.python.org (Georg Brandl) Date: Mon, 30 Aug 2021 08:20:28 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630311628.55.0.429774905723.issue45025@roundup.psfhosted.org> Change by Georg Brandl : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 04:39:06 2021 From: report at bugs.python.org (Ruairidh MacLeod) Date: Mon, 30 Aug 2021 08:39:06 +0000 Subject: [issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly In-Reply-To: <1410474786.78.0.264797717105.issue22393@psf.upfronthosting.co.za> Message-ID: <1630312746.33.0.300529987976.issue22393@roundup.psfhosted.org> Change by Ruairidh MacLeod : ---------- nosy: +rkm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 04:43:55 2021 From: report at bugs.python.org (Georg Brandl) Date: Mon, 30 Aug 2021 08:43:55 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630313035.44.0.124424884408.issue45025@roundup.psfhosted.org> Change by Georg Brandl : ---------- nosy: +georg.brandl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 04:48:02 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 30 Aug 2021 08:48:02 +0000 Subject: [issue44919] TypedDict subtypes ignore any other metaclasses in 3.9+ In-Reply-To: <1629030216.33.0.128972085225.issue44919@roundup.psfhosted.org> Message-ID: <1630313282.8.0.479393108914.issue44919@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch nosy: +uriyyo nosy_count: 1.0 -> 2.0 pull_requests: +26501 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28057 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 04:52:56 2021 From: report at bugs.python.org (Ayush Parikh) Date: Mon, 30 Aug 2021 08:52:56 +0000 Subject: [issue45049] added cbrt() in MATH_RADIANS_METHODDEF which is missing before Message-ID: <1630313576.26.0.444362528628.issue45049@roundup.psfhosted.org> Change by Ayush Parikh : ---------- nosy: Ayushparikh-code priority: normal pull_requests: 26502 severity: normal status: open title: added cbrt() in MATH_RADIANS_METHODDEF which is missing before type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 04:54:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Aug 2021 08:54:07 +0000 Subject: [issue45047] Update demo files In-Reply-To: <1630265600.47.0.0322461155035.issue45047@roundup.psfhosted.org> Message-ID: <1630313647.42.0.368536125845.issue45047@roundup.psfhosted.org> Serhiy Storchaka added the comment: There are currently many resources in internet where you can find examples and demos on Python. The CPython distribution should not include every piece of code written by Python learner. You can publish it on GitHab, on StackOverflow, on more specialized resources, in your own blog, include in your book. If any core developer is interested in your code and wants to include it in CPython, they will contact you. ---------- nosy: +serhiy.storchaka resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 04:57:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Aug 2021 08:57:45 +0000 Subject: [issue45049] added cbrt() in MATH_RADIANS_METHODDEF which is missing before Message-ID: <1630313865.88.0.0877773902522.issue45049@roundup.psfhosted.org> New submission from Serhiy Storchaka : We do not need a duplicate of function declaration. ---------- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 05:07:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 09:07:27 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630314447.34.0.706080915371.issue44689@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7234e67642bc8e75f44a2e1f2ce06687b5ac72ec by Miss Islington (bot) in branch '3.8': bpo-44689: ctypes.util.find_library() now finds macOS 11+ system libraries when built on older macOS systems (GH-27251) (GH-28054) https://github.com/python/cpython/commit/7234e67642bc8e75f44a2e1f2ce06687b5ac72ec ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 05:08:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 09:08:20 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630314500.33.0.172679827116.issue44689@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4b55837e7c747e0f3bd2df1b5c8996ce86c6f60a by Miss Islington (bot) in branch '3.9': bpo-44689: ctypes.util.find_library() now finds macOS 11+ system libraries when built on older macOS systems (GH-27251) (GH-28053) https://github.com/python/cpython/commit/4b55837e7c747e0f3bd2df1b5c8996ce86c6f60a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 05:09:39 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 09:09:39 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630314579.57.0.879768741431.issue44689@roundup.psfhosted.org> miss-islington added the comment: New changeset 41c87c41761739e90867a43de26e0f6755c80ff7 by Miss Islington (bot) in branch '3.10': bpo-44689: ctypes.util.find_library() now finds macOS 11+ system libraries when built on older macOS systems (GH-27251) https://github.com/python/cpython/commit/41c87c41761739e90867a43de26e0f6755c80ff7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 05:13:18 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 30 Aug 2021 09:13:18 +0000 Subject: [issue39320] Handle unpacking of */** arguments and rvalues in the compiler In-Reply-To: <1578918490.54.0.342025462897.issue39320@roundup.psfhosted.org> Message-ID: <1630314798.08.0.296974658331.issue39320@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 05:16:19 2021 From: report at bugs.python.org (DragonEggBedrockBreaking) Date: Mon, 30 Aug 2021 09:16:19 +0000 Subject: [issue45048] subprocess.run(capture_output=Bool) does the opposite of expected In-Reply-To: <1630271574.19.0.912939412698.issue45048@roundup.psfhosted.org> Message-ID: <1630314979.62.0.0727278882792.issue45048@roundup.psfhosted.org> DragonEggBedrockBreaking added the comment: Ok, thanks, I understand now. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 05:27:55 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 09:27:55 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630315675.94.0.507266554014.issue45007@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26503 pull_request: https://github.com/python/cpython/pull/28059 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 05:50:36 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 09:50:36 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630317036.21.0.873900193572.issue45007@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1f89e51fef8f4c15a719fbb3d1cec8ca7e2bc46f by Miss Islington (bot) in branch '3.8': bpo-45007: Update macOS installer builds to use OpenSSL 1.1.1l (GH-28051) (GH-28059) https://github.com/python/cpython/commit/1f89e51fef8f4c15a719fbb3d1cec8ca7e2bc46f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 06:02:42 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 30 Aug 2021 10:02:42 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630317762.98.0.535235337803.issue45045@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset e6497fe698f6e87344501a68ffdea106eafcb257 by Dong-hee Na in branch 'main': bpo-45045: Optimize mapping patterns of structural pattern matching (GH-28043) https://github.com/python/cpython/commit/e6497fe698f6e87344501a68ffdea106eafcb257 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 06:05:18 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 30 Aug 2021 10:05:18 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630317918.55.0.272896896175.issue45045@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 06:05:02 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 30 Aug 2021 10:05:02 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630317902.03.0.987543194054.issue45045@roundup.psfhosted.org> Dong-hee Na added the comment: For the record, Final benchmark with optimization build + thin LTO option. +---------------+---------------+----------------------+ | Benchmark | thin_lto_base | thin_lto_opt | +===============+===============+======================+ | bench pattern | 357 ns | 287 ns: 1.24x faster | +---------------+---------------+----------------------+ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 07:48:02 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 30 Aug 2021 11:48:02 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630324082.06.0.836142723247.issue45042@roundup.psfhosted.org> Nikita Sobolev added the comment: Looks like that this happens because tests classes are decorated with `@hashlib_helper.requires_hashdigest('md5')`: https://github.com/python/cpython/blob/2a8127cafe1d196f858a3ecabf5f1df3eebf9a12/Lib/test/_test_multiprocessing.py#L4482-L4485 Tests above run fine without this decorator. It was added in https://bugs.python.org/issue17258 The problem is that `` was treating a decorated entity as a function, not a class. https://github.com/python/cpython/blob/e6497fe698f6e87344501a68ffdea106eafcb257/Lib/test/support/hashlib_helper.py#L25 But, it was decorating classes as well. So, it needs to changed to respect classes. I will make a PR shortly. ---------- nosy: +sobolevn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 07:53:25 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 30 Aug 2021 11:53:25 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630324405.84.0.252215223317.issue45042@roundup.psfhosted.org> Change by Nikita Sobolev : ---------- keywords: +patch pull_requests: +26504 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28060 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 08:15:39 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 30 Aug 2021 12:15:39 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630325739.0.0.247598545002.issue45042@roundup.psfhosted.org> Antoine Pitrou added the comment: Wow. I hope this didn't hide any regression :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 08:25:01 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 12:25:01 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630326301.8.0.446947514342.issue45007@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26505 pull_request: https://github.com/python/cpython/pull/28061 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 08:24:59 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 12:24:59 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630326299.77.0.871572231093.issue45007@roundup.psfhosted.org> miss-islington added the comment: New changeset d6cb5dd9e19210f5963ff8beadde7ca2fda71574 by ?ukasz Langa in branch 'main': bpo-45007: Update multissl to openssl 1.1.1l as well (GH-28044) https://github.com/python/cpython/commit/d6cb5dd9e19210f5963ff8beadde7ca2fda71574 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 08:28:06 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 30 Aug 2021 12:28:06 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630326486.93.0.701580599525.issue45007@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +26506 pull_request: https://github.com/python/cpython/pull/28062 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 08:30:47 2021 From: report at bugs.python.org (Christian Heimes) Date: Mon, 30 Aug 2021 12:30:47 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630326647.14.0.513134220861.issue45007@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +26507 pull_request: https://github.com/python/cpython/pull/28063 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 08:36:22 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 30 Aug 2021 12:36:22 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630325739.0.0.247598545002.issue45042@roundup.psfhosted.org> Message-ID: Nikita Sobolev added the comment: Looks like it did, two newly-unignored tests are failing: https://github.com/python/cpython/pull/28060#issuecomment-908295411 ??, 30 ???. 2021 ?. ? 15:16, Antoine Pitrou : > > Antoine Pitrou added the comment: > > Wow. I hope this didn't hide any regression :-( > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:07:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 13:07:59 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630328879.0.0.42470426232.issue45007@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 576803d7a8083cb25c58be08d3cb31e05d5d2f8a by Christian Heimes in branch '3.9': [3.9] bpo-45007: Update multissl to openssl 1.1.1l as well (GH-28044) (GH-28062) https://github.com/python/cpython/commit/576803d7a8083cb25c58be08d3cb31e05d5d2f8a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:08:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 13:08:16 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630328896.09.0.791470195478.issue45007@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8371290753bed7fbb939a51ea7ff0991ea32a89c by Christian Heimes in branch '3.8': [3.8] bpo-45007: Update multissl to openssl 1.1.1l as well (GH-28044) (GH-28063) https://github.com/python/cpython/commit/8371290753bed7fbb939a51ea7ff0991ea32a89c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:07:51 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 13:07:51 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630328871.6.0.524245981948.issue45007@roundup.psfhosted.org> miss-islington added the comment: New changeset dc46f4c9846ad16567ab293b405efc3ed10ab9d5 by Miss Islington (bot) in branch '3.10': bpo-45007: Update multissl to openssl 1.1.1l as well (GH-28044) https://github.com/python/cpython/commit/dc46f4c9846ad16567ab293b405efc3ed10ab9d5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:13:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Aug 2021 13:13:37 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630329217.58.0.507735354628.issue45042@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you Nikita. The difference between the original and the proposed in PR 28060 code is that in the original code the conditional was tested at the testing time, while in the proposed code it is tested at the loading time. I do not know what effect it causes on tests. If it does not matter, the code can be simpler: return unittest.skipIf(should_be_skipped, f"hash digest '{digestname}' is not available.") But if it matters, there are two options: 1. In requires_hashdigest() raise exception if func is a class. Remove the decorator from classes and add it to test and setup methods or just to the setUpClass() classmethod. 2. In requires_hashdigest() check if func is a class, and if it is true, patch its test and setup methods (or just add a decorated setUpClass() classmethod). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:16:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 13:16:33 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1630329393.12.0.439130346127.issue41620@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7e246a3a7b43762480ee4fe0cfb859e8e997a8c8 by Serhiy Storchaka in branch 'main': bpo-41620: TestCase.run() now always return a TestResult instance (GH-28030) https://github.com/python/cpython/commit/7e246a3a7b43762480ee4fe0cfb859e8e997a8c8 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:16:37 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 13:16:37 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1630329397.63.0.837718800699.issue41620@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26509 pull_request: https://github.com/python/cpython/pull/28065 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:16:33 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 13:16:33 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1630329393.89.0.572507216647.issue41620@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +26508 pull_request: https://github.com/python/cpython/pull/28064 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:19:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 13:19:20 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630329560.76.0.709214448316.issue45007@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 52bdda50d7b79e1ad7e57967850beff64c3ede92 by ?ukasz Langa in branch '3.10': [3.10] bpo-45007: Update to OpenSSL 1.1.1l in Windows build and CI (GH-28009) (GH-28039) https://github.com/python/cpython/commit/52bdda50d7b79e1ad7e57967850beff64c3ede92 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:20:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Aug 2021 13:20:29 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630329629.44.0.087918553813.issue45042@roundup.psfhosted.org> Serhiy Storchaka added the comment: Here is the implementation of the second option: def requires_hashdigest(digestname, openssl=None, usedforsecurity=True): def decorator(func): if isinstance(func, type): setUpClass = func.__dict__.get('setUpClass') if setUpClass is None: def setUpClass(cls): super(func, cls).setUpClass() setUpClass.__qualname__ = func.__qualname__ + '.setUpClass' setUpClass.__module__ = func.__module__ else: setUpClass = setUpClass.__func__ setUpClass = classmethod(decorator(setUpClass)) func.setUpClass = setUpClass return func @functools.wraps(func) def wrapper(*args, **kwargs): try: if openssl and _hashlib is not None: _hashlib.new(digestname, usedforsecurity=usedforsecurity) else: hashlib.new(digestname, usedforsecurity=usedforsecurity) except ValueError: raise unittest.SkipTest( f"hash digest '{digestname}' is not available." ) return func(*args, **kwargs) return wrapper return decorator ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:21:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 13:21:44 +0000 Subject: [issue45007] OpenSSL 1.1.1l is released In-Reply-To: <1629948864.78.0.632969356818.issue45007@roundup.psfhosted.org> Message-ID: <1630329704.7.0.878915819006.issue45007@roundup.psfhosted.org> ?ukasz Langa added the comment: CI as well as Windows and macOS installers upgraded to use 1.1.1l all the way to 3.8 inclusive. Closing. Thanks all! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:24:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 13:24:46 +0000 Subject: [issue44449] Segfault in _PyTrash_begin when faulthandler tries to dump thread stacks In-Reply-To: <1624012030.73.0.910498447609.issue44449@roundup.psfhosted.org> Message-ID: <1630329886.69.0.640821682205.issue44449@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fe997e1a67835a929705c8c305d41c4d7dd326e3 by Victor Stinner in branch '3.10': bpo-44449: faulthandler don't modify frame refcnt (GH-27850) https://github.com/python/cpython/commit/fe997e1a67835a929705c8c305d41c4d7dd326e3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:24:47 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 13:24:47 +0000 Subject: [issue44449] Segfault in _PyTrash_begin when faulthandler tries to dump thread stacks In-Reply-To: <1624012030.73.0.910498447609.issue44449@roundup.psfhosted.org> Message-ID: <1630329887.4.0.0049770513821.issue44449@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26510 pull_request: https://github.com/python/cpython/pull/28066 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:39:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 13:39:03 +0000 Subject: [issue44874] Deprecate Py_TRASHCAN_SAFE_BEGIN/END In-Reply-To: <1628535485.5.0.0461415222233.issue44874@roundup.psfhosted.org> Message-ID: <1630330743.98.0.778873444948.issue44874@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Irit for making progress on this annoying old C API! ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:39:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 13:39:34 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630330774.75.0.427327477579.issue44394@roundup.psfhosted.org> STINNER Victor added the comment: I created https://python-security.readthedocs.io/vuln/expat-billion-laughs.html to track this vulnerability. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:42:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 13:42:41 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1630330961.98.0.548102802107.issue41620@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0c5e0aa73f6f70d16d21ad9e1eb2d0fe3a334f0a by Miss Islington (bot) in branch '3.9': bpo-41620: TestCase.run() now always return a TestResult instance (GH-28030) (GH-28065) https://github.com/python/cpython/commit/0c5e0aa73f6f70d16d21ad9e1eb2d0fe3a334f0a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:43:42 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 13:43:42 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1630331022.26.0.446917092969.issue41620@roundup.psfhosted.org> miss-islington added the comment: New changeset 243b8de0b15061704581974c0a27db1232a43b93 by Miss Islington (bot) in branch '3.10': bpo-41620: TestCase.run() now always return a TestResult instance (GH-28030) https://github.com/python/cpython/commit/243b8de0b15061704581974c0a27db1232a43b93 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:44:34 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 13:44:34 +0000 Subject: [issue41620] Python Unittest does not return results object when the test is skipped In-Reply-To: <1598205044.1.0.669094685419.issue41620@roundup.psfhosted.org> Message-ID: <1630331074.19.0.484349335576.issue41620@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for the report and initial patch, Iman! ? ? ? And thanks Serhiy for pushing this across the finish line. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:47:05 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 30 Aug 2021 13:47:05 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630331225.55.0.3825795309.issue45042@roundup.psfhosted.org> Nikita Sobolev added the comment: Serhiy, yes, you are right. I guess, it is safe to assume that load-time/test-time might make a difference, especially with `_hashlib`. I've commited your suggestion, thanks a lot for your help! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:49:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 30 Aug 2021 13:49:41 +0000 Subject: [issue31299] Add "ignore_modules" option to TracebackException.format() In-Reply-To: <1503992745.47.0.33675937395.issue31299@psf.upfronthosting.co.za> Message-ID: <1630331381.75.0.687844199694.issue31299@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +26511 pull_request: https://github.com/python/cpython/pull/28067 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:51:14 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 30 Aug 2021 13:51:14 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630331474.83.0.781020009643.issue34561@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 09:56:10 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 13:56:10 +0000 Subject: [issue44449] Segfault in _PyTrash_begin when faulthandler tries to dump thread stacks In-Reply-To: <1624012030.73.0.910498447609.issue44449@roundup.psfhosted.org> Message-ID: <1630331770.6.0.871177922657.issue44449@roundup.psfhosted.org> miss-islington added the comment: New changeset 720aef48b558e68c07937f0cc8d62a60f23dcb3d by Miss Islington (bot) in branch '3.9': bpo-44449: faulthandler don't modify frame refcnt (GH-27850) https://github.com/python/cpython/commit/720aef48b558e68c07937f0cc8d62a60f23dcb3d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 10:04:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 14:04:32 +0000 Subject: [issue44449] Segfault in _PyTrash_begin when faulthandler tries to dump thread stacks In-Reply-To: <1624012030.73.0.910498447609.issue44449@roundup.psfhosted.org> Message-ID: <1630332272.45.0.375550465466.issue44449@roundup.psfhosted.org> STINNER Victor added the comment: The bug should now be fixed in 3.9 and 3.10 branches. The main branch should not be impacted, it has a different implementation. Thanks for the bug report Duncan Grisby. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 10:08:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 14:08:22 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630332502.79.0.28278567039.issue45021@roundup.psfhosted.org> STINNER Victor added the comment: I don't understand anything about multiprocessing, nor its API, but some people seem to find it useful :-D I remove myself from the nosy list ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 10:14:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 14:14:20 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630332860.05.0.960369272445.issue45021@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 10:15:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 30 Aug 2021 14:15:01 +0000 Subject: [issue20658] os.environ.clear() fails with empty keys (posix.unsetenv) In-Reply-To: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> Message-ID: <1630332901.57.0.964483168739.issue20658@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: test needed -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 10:22:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 14:22:24 +0000 Subject: [issue20658] os.environ.clear() fails with empty keys (posix.unsetenv) In-Reply-To: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> Message-ID: <1630333344.31.0.19426044089.issue20658@roundup.psfhosted.org> STINNER Victor added the comment: The following command still fails on the Python main branch on Linux: --- $ env -i =value ./python -c 'import pprint, os; pprint.pprint(os.environ); del os.environ[""]' environ({'': 'value', 'LC_CTYPE': 'C.UTF-8'}) Traceback (most recent call last): File "", line 1, in File "/home/vstinner/python/main/Lib/os.py", line 689, in __delitem__ unsetenv(encodedkey) ^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 22] Invalid argument --- 'del os.environ[""]' calls unsetenv("") which fails with EINVAL. Python is a thin wrapper to C functions setenv() and unsetenv(), and raises an exception when a C function fails. It works as expected. Python exposes the variable with an empty name which is found in the environment variables: again, it works as expected. I don't see how Python could do better, since the glibc unsetenv() fails with EINVAL if the string is empty. It is even a documented behaviour, see the unsetenv() manual page: --- ERRORS EINVAL name is NULL, points to a string of length 0, or contains an '=' character. --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 10:24:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 14:24:00 +0000 Subject: [issue20658] os.environ.clear() fails with empty keys (posix.unsetenv) In-Reply-To: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> Message-ID: <1630333440.51.0.32479545196.issue20658@roundup.psfhosted.org> STINNER Victor added the comment: By the way: --- The env command from GNU coreutils supports setting the environment variable with an empty name but not unsetting it. That's a bug. $ env '=wibble' env |grep wibble =wibble $ env '=wibble' env -u '' env env: cannot unset `': Invalid argument --- https://unix.stackexchange.com/questions/178522/unsetting-environment-variable-with-an-empty-name ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 10:26:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 30 Aug 2021 14:26:53 +0000 Subject: [issue20658] os.environ.clear() fails with empty keys (posix.unsetenv) In-Reply-To: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> Message-ID: <1630333613.01.0.807397989695.issue20658@roundup.psfhosted.org> Irit Katriel added the comment: I see, so intercepting the assignment is not enough. Reopening. ---------- resolution: out of date -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 10:33:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 14:33:39 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630334019.19.0.316622086025.issue45042@roundup.psfhosted.org> ?ukasz Langa added the comment: FYI, there seem to be two Windows-specific regressions since the tests were unintentionally disabled, namely test_shared_memory_basics and test_checksum_fodder. Following Serhiy's advice, I elect to have those tests skipped for now on Windows and fix them through separate issues. We will be releasing 3.9.7 according to schedule today. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 10:56:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 14:56:38 +0000 Subject: [issue20658] os.environ.clear() fails with empty keys (posix.unsetenv) In-Reply-To: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> Message-ID: <1630335398.52.0.860146249199.issue20658@roundup.psfhosted.org> STINNER Victor added the comment: Attached set_unset_env.c program calls putenv("=hello world") and then unsetenv(""). On my Fedora 34 with glibc-2.33-20.fc34.x86_64, putenv() succeed, but unsetenv() fails. --- $ gcc set_unset_env.c -g -o set_unset_env && ./set_unset_env putenv("=hello world") -> hello world ERROR: unsetenv("") failed: [error 22] Invalid argument --- By the way, getenv() fails to find an environment variable if its name is empty: I reimplemented getenv() using the 'environ' variable for my test. ---------- Added file: https://bugs.python.org/file50245/set_unset_env.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:01:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:01:21 +0000 Subject: [issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h In-Reply-To: <1359956347.87.0.611737971795.issue17120@psf.upfronthosting.co.za> Message-ID: <1630335681.45.0.289082897432.issue17120@roundup.psfhosted.org> STINNER Victor added the comment: On my Fedora 34, running ./configure creates pyconfig.h with these values: $ grep -E '_POSIX_C_SOURCE|_XOPEN_SOURCE' -B1 pyconfig.h /* Define to activate features from IEEE Stds 1003.1-2008 */ #define _POSIX_C_SOURCE 200809L -- /* Define to the level of X/Open that your system supports */ #define _XOPEN_SOURCE 700 -- /* Define to activate Unix95-and-earlier features */ #define _XOPEN_SOURCE_EXTENDED 1 Relevant lines in configure.ac: --- if test $define_xopen_source = yes then # X/Open 7, incorporating POSIX.1-2008 AC_DEFINE(_XOPEN_SOURCE, 700, Define to the level of X/Open that your system supports) # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else # several APIs are not declared. Since this is also needed in some # cases for HP-UX, we define it globally. AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Define to activate Unix95-and-earlier features) AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008) fi --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:03:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:03:16 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630335796.98.0.59467730832.issue45025@roundup.psfhosted.org> STINNER Victor added the comment: > At least the PyASCIIObject struct in Include/cpython/unicodeobject.h uses bit fields. Various preprocessor macros like PyUnicode_IS_ASCII() and PyUnicode_KIND() access this struct's bit field. What is your use case? Which functions do you need? You should not access directly the PyASCIIObject structure. Python provides many functions to access the content of a Unicode string object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:08:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:08:59 +0000 Subject: [issue20658] os.environ.clear() fails with empty keys (posix.unsetenv) In-Reply-To: <1392642368.27.0.300660634921.issue20658@psf.upfronthosting.co.za> Message-ID: <1630336139.57.0.0512696550972.issue20658@roundup.psfhosted.org> STINNER Victor added the comment: For the very specific case of os.environ.clear(), the C function clearenv() could be used if available. While clearenv() is available in the glibc, it's not a POSIX function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:14:27 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 30 Aug 2021 15:14:27 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630336467.56.0.0521199383238.issue45025@roundup.psfhosted.org> Petr Viktorin added the comment: The macro PyUnicode_KIND is part of the documented public C API. It accesses the bit field "state.kind" directly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:16:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:16:42 +0000 Subject: [issue14088] sys.executable generating canonical path In-Reply-To: <1329928617.24.0.609517948319.issue14088@psf.upfronthosting.co.za> Message-ID: <1630336602.62.0.512548955586.issue14088@roundup.psfhosted.org> STINNER Victor added the comment: test_sys: def test_executable(self): # sys.executable should be absolute self.assertEqual(os.path.abspath(sys.executable), sys.executable) IMO the test is wrong. It must test: test.assertTrue(os.path.isabs(sys.executable)). The path is not required to be normalized. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:17:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:17:50 +0000 Subject: [issue14088] sys.executable generating canonical path In-Reply-To: <1329928617.24.0.609517948319.issue14088@psf.upfronthosting.co.za> Message-ID: <1630336670.06.0.369731080947.issue14088@roundup.psfhosted.org> STINNER Victor added the comment: > The path is not required to be normalized. I'm talking about the current implementation. I'm not against making Python even better: attempt to normalize the path ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:24:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:24:40 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630337080.58.0.861233648777.issue45025@roundup.psfhosted.org> STINNER Victor added the comment: > The macro PyUnicode_KIND is part of the documented public C API. IMO it was a mistake to expose it as part of the public C API. This is an implementation detail which should not be exposed. The C API should not expose *directly* how characters are stored in memory, but provide an abstract way to read and write Unicode characters. The PEP 393 implementation broke the old C API in many ways because it exposed too many implementation details. Sadly, the new C API is... not better :-( If tomorrow, CPython is modified to use UTF-8 internally (as PyPy does), the C API will likely be broken *again* in many (new funny) ways. 11 years after the PEP 393 (Python 3.3), we only start fixing the old C API :-( The work will be completed in 2 or 3 Python releases (Python 3.12 or 3.13): * https://www.python.org/dev/peps/pep-0623/ * https://www.python.org/dev/peps/pep-0624/ The C API for Unicode strings is causing a lot of issues in PyPy which uses UTF-8 internally. C extensions can fail to build on PyPy if they use functions (macros) like PyUnicode_KIND(). ---------- nosy: +methane, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:25:30 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 30 Aug 2021 15:25:30 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1630337130.62.0.36037011918.issue37596@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +26512 pull_request: https://github.com/python/cpython/pull/28068 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:26:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:26:43 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630337203.54.0.025027053226.issue45025@roundup.psfhosted.org> STINNER Victor added the comment: > In order to avoid undefined behavior, Python's C API should avoid all use of bit fields. See also the PEP 620. IMO more generally, the C API should not expose structures, but provide ways to access it through getter and setter functions. See bpo-40120 "Undefined C behavior going beyond end of struct via a [1] arrays" which is a similar issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:30:43 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 30 Aug 2021 15:30:43 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630337443.9.0.906321661038.issue45025@roundup.psfhosted.org> Petr Viktorin added the comment: PyUnicode_KIND does *not* expose the implementation details to the programmer. If the internal representation os strings is switched to use masks and shifts instead of bitfields, PyUnicode_KIND (and others) can be adapted to the new details without breaking API compatibility. And that switch would fix this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:31:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:31:09 +0000 Subject: [issue25867] os.stat raises exception when using unicode and no locale is set In-Reply-To: <1450168391.42.0.368048088305.issue25867@psf.upfronthosting.co.za> Message-ID: <1630337469.61.0.83053285862.issue25867@roundup.psfhosted.org> STINNER Victor added the comment: > It's doing this now, so seems like it has been fixed: % env -i ./python.exe (...) Right. It's correct to close the issue. The PEP 540 added a UTF-8 Mode. This mode is enabled if Python is started with the "C" or "POSIX" locale (LC_CTYPE category). If the UTF-8 Mode is enabled, Python uses UTF-8 for its "filesystem" encoding: * https://docs.python.org/dev/library/os.html#python-utf-8-mode * https://docs.python.org/dev/glossary.html#term-filesystem-encoding-and-error-handler Moreover, the PEP 538 also tries to use a UTF-8 variable of "C" and "POSIX" locales, which also fix this issue. I documented how Python configures its "filesystem encoding" at: https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.filesystem_encoding ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:37:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:37:53 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630337873.69.0.767162203537.issue45025@roundup.psfhosted.org> STINNER Victor added the comment: > PyUnicode_KIND does *not* expose the implementation details to the programmer. PyUnicode_KIND() is very specific to the exact PEP 393 implementation. Documentation of this field: --- /* Character size: - PyUnicode_WCHAR_KIND (0): * character type = wchar_t (16 or 32 bits, depending on the platform) - PyUnicode_1BYTE_KIND (1): * character type = Py_UCS1 (8 bits, unsigned) * all characters are in the range U+0000-U+00FF (latin1) * if ascii is set, all characters are in the range U+0000-U+007F (ASCII), otherwise at least one character is in the range U+0080-U+00FF - PyUnicode_2BYTE_KIND (2): * character type = Py_UCS2 (16 bits, unsigned) * all characters are in the range U+0000-U+FFFF (BMP) * at least one character is in the range U+0100-U+FFFF - PyUnicode_4BYTE_KIND (4): * character type = Py_UCS4 (32 bits, unsigned) * all characters are in the range U+0000-U+10FFFF * at least one character is in the range U+10000-U+10FFFF */ unsigned int kind:3; --- I don't think that PyUnicode_KIND() makes sense if CPython uses UTF-8 tomorrow. > If the internal representation os strings is switched to use masks and shifts instead of bitfields, PyUnicode_KIND (and others) can be adapted to the new details without breaking API compatibility. PyUnicode_KIND() was exposed in the *public* C API because unicodeobject.h provides functions as macros for best performances, and these macros use PyUnicode_KIND() internally. Macros like PyUnicode_READ(kind, data, index) are also designed for best performances with the exact PEP 393 implementation. The public C API should only contain PyUnicode_READ_CHAR(unicode, index): this macro doesn't use "kind" or "data" which are (again) specific to the PEP 393. In the CPython implementation, we should use the most efficient code, it's fine to use macros accessing directly structures. But for the public C API, I would recommend to only provide abstractions, even if there are a little bit slower. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:38:54 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 30 Aug 2021 15:38:54 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630337934.43.0.562992698216.issue45045@roundup.psfhosted.org> Brandt Bucher added the comment: Thanks, this is awesome. FYI, there's probably more low-hanging fruit like this scattered about the pattern matching implementation. It's all very new code, mostly written by one person ;). (I wouldn't worry too much about the pattern compiler, though... I'm currently finishing up a total rewrite of that!) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:42:06 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 30 Aug 2021 15:42:06 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630338126.93.0.4539401008.issue45045@roundup.psfhosted.org> Brandt Bucher added the comment: I'm also in the process of creating some pattern matching benchmarks. You might find them useful for benching optimizations like this in the future: https://github.com/brandtbucher/patmaperformance In particular, I'm curious to see the impact of this change on "patma_holdem". I bet it's quite good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:50:45 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:50:45 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1630338645.78.0.265879327189.issue44019@roundup.psfhosted.org> STINNER Victor added the comment: Python 2.7 had apply(func, args, kwargs) which called func(*args, **kwargs). https://docs.python.org/2.7/library/functions.html#apply There is also functools.partial(func, *args, **kwargs)(*args2, **kwargs2) which calls func(*args, *args2, **kwargs, **kwargs2). https://docs.python.org/dev/library/functools.html#functools.partial operator.methodcaller(name, /, *args, **kwargs)(obj) calls getattr(obj, name)(*args, **kwargs). https://docs.python.org/dev/library/operator.html#operator.methodcaller I'm not convinced that operator.caller() would be useful to me. Why do you consider that it belongs to the stdlib? It is a common pattern? Did you see in this pattern in the current stdlib? Can't you easily implement such helper function in a few lines of Python? operator documentation says: "The operator module exports a set of efficient functions corresponding to the intrinsic operators of Python". I don't see how operator.caller() implements an existing "intrinsic operators of Python". methodcaller() can be implemented in 4 lines of Python, as shown in its documentation: --- def methodcaller(name, /, *args, **kwargs): def caller(obj): return getattr(obj, name)(*args, **kwargs) return caller --- ---------- nosy: +brett.cannon, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 11:51:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 15:51:53 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1630338713.62.0.952620825379.issue44019@roundup.psfhosted.org> STINNER Victor added the comment: > An actual use case I had for such an operator was collecting a bunch of callables in a list and wanting to dispatch them to concurrent.futures.Executor.map, i.e. something like `executor.map(operator.call, funcs)` (to get the parallelized version of `[func() for func in funcs]`). Can't you use functools.partial() for that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:08:02 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 30 Aug 2021 16:08:02 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630110572.22.0.000406266939046.issue45020@roundup.psfhosted.org> Message-ID: Eric Snow added the comment: On Fri, Aug 27, 2021 at 6:29 PM Guido van Rossum wrote: > The plot thickens. By searching my extensive GMail archives for Jeethu Rao I found > an email from Sept. 14 to python-dev by Larry Hastings titled "Store startup modules > as C structures for 20%+ startup speed improvement?" Thanks for finding that, Guido! On Fri, Aug 27, 2021 at 6:37 PM Guido van Rossum wrote: > Either way it's a suboptimal experience for people contributing to those modules. But > we stand to gain a ~20% startup time improvement. Agreed, and I think a solution shouldn't be too hard to reach. On Fri, Aug 27, 2021 at 7:48 PM Larry Hastings wrote: > In experimenting with the prototype, I observed that simply calling stat() to ensure > the frozen .py file hadn't changed on disk lost us about half the performance win > from this approach. Yeah, this is an approach others had suggested and I'd considered. We have other solutions available that don't have that penalty. On Fri, Aug 27, 2021 at 8:08 PM Larry Hastings wrote: > There should be a boolean flag that enables/disables cached copies of .py files from > Lib/. You should be able to turn it off with either an environment variable or a > command-line option, and when it's off it skips all the internal cached stuff and > uses the normal .py / .pyc machinery. > > With that in place, it'd be great to pre-cache all the .py files automatically read in > at startup. Yeah, something along these lines should be good enough. > [snip] > But then I'm not sure this is a very good analogy--the workflow for making Clinic > changes is very different from people hacking on Lib/*.py. Agreed. On Fri, Aug 27, 2021 at 10:06 PM Guido van Rossum wrote: > [snip] > FWIW in my attempts to time this, it looks like the perf benefits of Eric's approach are > close to those of deep-freezing. And deep-freezing causes much more bloat of the > source code and of the resulting binary. The question of freeze vs deep-freeze (i.e. is deep-freeze better enough) is one we can discuss separately, and your point here is probably the fundamental center of that discussion. However, I don't think it has a lot of bearing on the change proposed in this issue. > [snip] > I think the only solution here was hinted at in the python-dev thread from 2018: have > a command-line flag to turn it on or off (e.g. -X deepfreeze=1/0) and have a policy for > what the default for that flag should be (e.g. on by default in production builds, off by > default in developer builds -- anything that doesn't use --enable-optimizations). Agreed. > [snip] > it wasn't so clear that code objects should be immutable -- that realization came later, > when Greg Stein proposed making them ROM-able. That didn't work out, but the > notion that code objects should be strictly mutable (to the python user, at least) > was born This sounds like an interesting story. Do you have any mailing list links handy? (Otherwise I can search the archives.) > In fact, Eric's approach freezes everything in the encodings package, which turns out > to be a lot of files and a lot of code (lots of simple data tables expressed in code), and > I found that for basic startup time, it's best not to deep-freeze the encodings module > except for __init__.py, aliases.py and utf_8.py. Yeah, this is something to consider. FWIW, in my testing, dropping encodings.* from the list of frozen modules reduced the performance gains (from 20 ms to 21 ms). -eric ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:09:02 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 30 Aug 2021 16:09:02 +0000 Subject: [issue45045] Optimize mapping patterns of structural pattern matching In-Reply-To: <1630252568.97.0.406594835978.issue45045@roundup.psfhosted.org> Message-ID: <1630339742.6.0.602084454618.issue45045@roundup.psfhosted.org> Dong-hee Na added the comment: > https://github.com/brandtbucher/patmaperformance Nice benchmark suite, I will take a look :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:14:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 30 Aug 2021 16:14:42 +0000 Subject: [issue44887] test_input_tty hangs when run multiple times in the same process on macOS 10.15 In-Reply-To: <1628676266.46.0.173635281643.issue44887@roundup.psfhosted.org> Message-ID: <1630340082.34.0.0150525460411.issue44887@roundup.psfhosted.org> STINNER Victor added the comment: Is it related to https://bugs.python.org/issue41034 ? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:17:25 2021 From: report at bugs.python.org (Ayush Parikh) Date: Mon, 30 Aug 2021 16:17:25 +0000 Subject: [issue45050] created unittest file analyze_text.py Message-ID: <1630340245.5.0.292799395135.issue45050@roundup.psfhosted.org> Change by Ayush Parikh : ---------- nosy: Ayushparikh-code priority: normal pull_requests: 26513 severity: normal status: open title: created unittest file analyze_text.py type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:24:55 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Aug 2021 16:24:55 +0000 Subject: [issue45050] created unittest file analyze_text.py Message-ID: <1630340695.26.0.445080446002.issue45050@roundup.psfhosted.org> New submission from Serhiy Storchaka : It is unneeded. ---------- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:26:08 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 16:26:08 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1630340768.3.0.239518277956.issue43913@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +26514 pull_request: https://github.com/python/cpython/pull/28070 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:26:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 16:26:07 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1630340767.34.0.810720578258.issue43913@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 08d9e597c8ef5a2b26375ac954fdf224f5d82c3c by Serhiy Storchaka in branch 'main': bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) https://github.com/python/cpython/commit/08d9e597c8ef5a2b26375ac954fdf224f5d82c3c ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:32:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Aug 2021 16:32:02 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1630341122.76.0.949059586297.issue43913@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26515 pull_request: https://github.com/python/cpython/pull/28071 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:38:54 2021 From: report at bugs.python.org (Gregory Szorc) Date: Mon, 30 Aug 2021 16:38:54 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630341534.57.0.645111343874.issue45025@roundup.psfhosted.org> Gregory Szorc added the comment: My use case for these low-level APIs is to write tests for low-level string/encoding handling in my custom use of the PyPreConfig and PyConfig structs. I wanted to verify that exact byte sequences were turned into specific representations inside of Python strings. This includes ensuring that certain byte sequences retain their appropriate "character" width in internal storage. I know there are alternative ways of performing this testing. But testing against the actual data structure used internally by CPython seemed the most precise since it isolates problems to the "store in Python" side of the problem and not "what does Python do once the data is stored." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:44:02 2021 From: report at bugs.python.org (Ayush Parikh) Date: Mon, 30 Aug 2021 16:44:02 +0000 Subject: [issue45051] wrote optimised async_test.py for async lib Message-ID: <1630341842.53.0.675248638365.issue45051@roundup.psfhosted.org> Change by Ayush Parikh : ---------- nosy: Ayushparikh-code priority: normal pull_requests: 26516 severity: normal status: open title: wrote optimised async_test.py for async lib type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 12:48:18 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 30 Aug 2021 16:48:18 +0000 Subject: [issue45051] wrote optimised async_test.py for async lib Message-ID: <1630342098.98.0.822866069834.issue45051@roundup.psfhosted.org> New submission from Zachary Ware : Ayush, your PRs are starting to look like spam. Please slow down and ask for advice on what contributions would be welcome. We have several resources available for this, such as the core-mentorship at python.org mailing list, the discuss.python.org discussion forum, not to mention the devguide which even includes a more complete list of places to get help: https://devguide.python.org/help/ I'm closing this PR and issue; please hold off on submitting more until you have followed the above advice. ---------- nosy: +zach.ware resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 13:21:58 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 30 Aug 2021 17:21:58 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630127679.66.0.551195032564.issue45020@roundup.psfhosted.org> Message-ID: Eric Snow added the comment: On Fri, Aug 27, 2021 at 11:14 PM Larry Hastings wrote: > [snip] On the other hand: if we made a viable tool that could consume some arbitrary > set of .py files and produce a C file, and said C file could then be compiled into a > shared library, end users could enjoy this speedup over the subset of the standard > library their program used, and perhaps even their own source tree(s). Yeah, that would be interesting to investigate. On Sat, Aug 28, 2021 at 5:17 AM Marc-Andre Lemburg wrote: > Eric's approach, as I understand it, is pretty much what PyRun does. > [further details] It's reassuring to hear that the approach is known to be viable. :) > In fact, you save quite a bit of disk space compared to a full Python installation and > additionally benefit from the memory mapping the OS does for sharing access to the > marshal'ed byte code between processes. That's a good point. > That said, some things don't work with such an approach, e.g. a few packages > include additional data files which they expect to find on disk. Since those are > not available anymore, they fail. > > For PyRun I have patched some of those packages to include the data in form of > Python modules instead, so that it gets frozen as well, e.g. the Python grammar files. For stdlib modules it wouldn't be a big problem to set __file__ on frozen modules. Would that be enough to solve the problem? On Sat, Aug 28, 2021 at 5:41 PM Gregory Szorc wrote: > When I investigated freezing the standard library for PyOxidizer, I ran into a rash > of problems. The frozen importer doesn't behave like PathFinder. It doesn't > (didn't?) set some common module-level attributes This is mostly fixable for stdlib modules. Which attributes would need to be added? Are there other missing behaviors? > Also, when I last looked at the CPython source, the frozen importer performed > a linear scan of its indexed C array performing strcmp() on each entry until it > found what it was looking for. So adding hundreds of modules could result in > sufficient overhead and justify using a more efficient lookup algorithm. > (PyOxidizer uses Rust's HashMap to index modules by name.) Yeah, we noticed this too. I wasn't sure it was something to worry about at first because we're not freezing the entire stdlib. We're freezing on the order of 10, plus all the (80+) encoding modules. I figured we could look at an alternative to that linear search afterward if it made sense. > * Make sure you run unit tests against the frozen modules. If you don't do this, subtle differences in how the different importers behave will lead to problems. We'll do what we already do with importlib: run the tests against both the frozen and the source modules. Thanks for the reminder to do this though! On Sat, Aug 28, 2021 at 5:53 PM Gregory Szorc wrote: > Oh, PyOxidizer also ran into more general issues with the frozen importer in that > it broke various importlib APIs. e.g. because the frozen importer only supports > bytecode, you can't use .__loader__.get_source() to obtain the source of a module. > This makes tracebacks more opaque and breaks legitimate API consumers relying > on these importlib interfaces. Good point. Supporting more of the FileLoader API on the frozen loader is something to look into, at least for stdlib modules. > The fundamental limitations with the frozen importer are why I implemented my > own meta path importer (implemented in pure Rust), which is more fully featured, > like the PathFinder importer that most people rely on today. That importer is > available on PyPI (https://pypi.org/project/oxidized-importer/) and has its own API > to facilitate PyOxidizer-like functionality > (https://pyoxidizer.readthedocs.io/en/stable/oxidized_importer.html) if anyone > wants to experiment with it. Awesome! I'll take a look. On Sat, Aug 28, 2021 at 6:14 PM Guido van Rossum wrote: > I agree that we should shore up the frozen importer -- probably in a separate PR though. > (@Eric: do you think this is worth its own bpo issue?) Yeah. -eric ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 13:22:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 17:22:29 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1630344149.13.0.611803131587.issue43913@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9827710a400848c9430ed364ed5d2d54f0926701 by Serhiy Storchaka in branch '3.9': [3.9] bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) (GH-28071) https://github.com/python/cpython/commit/9827710a400848c9430ed364ed5d2d54f0926701 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 13:32:14 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 30 Aug 2021 17:32:14 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630344734.61.0.75358780129.issue45020@roundup.psfhosted.org> Eric Snow added the comment: At this point, here are the open questions I'm seeing: + The editing-stdlib-.py-files problem: * use a command-line flag to opt-out of frozen modules? * use a build flag to opt out (e.g. a configure flag or a new Py_NO_FROZEN or even Py_DEBUG)? * ignore frozen modules if it's a dev build? * (note: importlib._bootstrap and importlib._bootstrap_external must always be frozen, regardless of a flag) * accommodate users of an installed Python that sometimes edit stdlib modules while debugging code? * always emit a warning if a frozen module is ignored (in favor of the source module)? + Compatibility: * set __file__ (and __path__) on frozen modules? * store the hash of the source file for frozen modules (in the frozen .h files)? * support more of the FileLoader API on the frozen loader? + Penalty for too many frozen modules: * should we only freeze the UTF-8 encoding? * should we use something other than linear search for looking up frozen modules? FWIW, I think the ideal mechanism for a dev build will be to opt in to using frozen modules (instead of the source modules). Otherwise it is too easy for the unaware contributor to waste substantial time figuring out why their changes are not getting used. Consequently, here's my order of preference for ignoring frozen modules: 1. use Py_DEBUG as an opt-out flag (if we think contributors are editing stdlib modules on a build without Py_DEBUG then that isn't good enough) 2. automatically skip frozen modules if it's a dev build, with an explicit configure flag to opt in to frozen modules ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 13:33:10 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 30 Aug 2021 17:33:10 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630344790.88.0.802020745744.issue45020@roundup.psfhosted.org> Eric Snow added the comment: > * tricks to inject hooks ASAP (e.g. coverage.py swaps the encodings module) may lose their entry point FWIW, I asked Ned Batchelder about this and he said this approach ("fullcoverage" [1]) was added to support running coverage on the stdlib. It doesn't affect other users of coverage.py. He didn't have any info on where this is used currently, though I'm pretty sure we do run coverage in CI. Furthermore, the devguide talks about running coverage.py on the stdlib and initially indicates that modules imported during startup are not covered. [2] However, it does have a section talking about using "fullcoverage" to cover startup modules. I expect that any solution we make for contributors editing stdlib source files will resolve the potential issue for coverage.py. [1] https://github.com/nedbat/coveragepy/tree/master/coverage/fullcoverage [2] https://devguide.python.org/coverage/?highlight=coverage#measuring-coverage [3] https://devguide.python.org/coverage/?highlight=coverage#coverage-results-for-modules-imported-early-on ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 13:34:40 2021 From: report at bugs.python.org (Antony Lee) Date: Mon, 30 Aug 2021 17:34:40 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1630344880.61.0.636395665694.issue44019@roundup.psfhosted.org> Antony Lee added the comment: > I'm not convinced that operator.caller() would be useful to me. To be clear, as noted above, I have realized that the semantics I initially proposed (now known as "caller") are not particularly useful; the semantics I am proposing (and implementing in the linked PR) are `call(f, *args, **kwargs) == f(*args, **kwargs)`. > I don't see how operator.caller() implements an existing "intrinsic operators of Python". Agreed; on the other hand function calling is much more intrinsic(?!) > Can't you use functools.partial() for that? How do you propose to do that? Perhaps I am missing an easy solution... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 13:38:42 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 30 Aug 2021 17:38:42 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1630345122.77.0.339851078858.issue43913@roundup.psfhosted.org> miss-islington added the comment: New changeset d65fad04fad1a73b6bb17bcb08ca6f0a24376952 by Miss Islington (bot) in branch '3.10': bpo-43913: Fix bugs in cleaning up classes and modules in unittest. (GH-28006) https://github.com/python/cpython/commit/d65fad04fad1a73b6bb17bcb08ca6f0a24376952 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 13:49:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 30 Aug 2021 17:49:42 +0000 Subject: [issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory In-Reply-To: <1614855277.19.0.209861526791.issue43398@roundup.psfhosted.org> Message-ID: <1630345782.07.0.152419250262.issue43398@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f62763d26755260c31c717fb396550e00eb6b2a0 by Erlend Egeberg Aasland in branch 'main': bpo-43398: Add test for defect connection factories (GH-27966) https://github.com/python/cpython/commit/f62763d26755260c31c717fb396550e00eb6b2a0 ---------- nosy: +pablogsal status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 13:49:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 30 Aug 2021 17:49:59 +0000 Subject: [issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory In-Reply-To: <1614855277.19.0.209861526791.issue43398@roundup.psfhosted.org> Message-ID: <1630345799.77.0.785846338209.issue43398@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is something missing here? ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:02:06 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 18:02:06 +0000 Subject: [issue43913] unittest module cleanup functions not run unless tearDownModule() is defined In-Reply-To: <1619112603.21.0.888509270435.issue43913@roundup.psfhosted.org> Message-ID: <1630346526.7.0.0284032166498.issue43913@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for the fix, Serhiy, and Ryan for reporting the problem! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:14:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 30 Aug 2021 18:14:36 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630347276.59.0.480297340535.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: I think the leak happens when we invoke GC while the recursion limit is exceeded. It goes way if make this change: def recurse_in_body_and_except(): try: recurse_in_body_and_except() except RecursionError as e: gc.disable() recurse_in_body_and_except() gc.enable() I also added a __del__ to B and saw it being called when recursion limit is small (though adding the __del__ makes the leak go away. Actually just adding "def f(): pass" is enough to make it go away). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:21:28 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 30 Aug 2021 18:21:28 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows Message-ID: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> New submission from Nikita Sobolev : While working on https://github.com/python/cpython/pull/28060 we've noticed that `test.test_multiprocessing_spawn.WithProcessesTestSharedMemory.test_shared_memory_basics` fails on Windows: ``` ====================================================================== FAIL: test_shared_memory_basics (test.test_multiprocessing_spawn.WithProcessesTestSharedMemory) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\_test_multiprocessing.py", line 3794, in test_shared_memory_basics self.assertEqual(sms.size, sms2.size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 512 != 4096 ``` For now it is ignored. Related issue: https://bugs.python.org/issue45042 ---------- components: Tests messages: 400646 nosy: sobolevn priority: normal severity: normal status: open title: WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:21:45 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 30 Aug 2021 18:21:45 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1630347705.36.0.251159251264.issue45052@roundup.psfhosted.org> Nikita Sobolev added the comment: I would like to work on this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:22:59 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 30 Aug 2021 18:22:59 +0000 Subject: [issue45053] MD5SumTests.test_checksum_fodder fails on Windows Message-ID: <1630347779.05.0.821089086925.issue45053@roundup.psfhosted.org> New submission from Nikita Sobolev : While working on https://github.com/python/cpython/pull/28060 we've noticed that `test.test_tools.test_md5sum.MD5SumTests.test_checksum_fodder` fails on Windows: ``` ====================================================================== FAIL: test_checksum_fodder (test.test_tools.test_md5sum.MD5SumTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_tools\test_md5sum.py", line 41, in test_checksum_fodder self.assertIn(part.encode(), out) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: b'@test_1772_tmp\xc3\xa6' not found in b'd38dae2eb1ab346a292ef6850f9e1a0d @test_1772_tmp\xe6\\md5sum.fodder\r\n' ``` For now it is ignored. Related issue: https://bugs.python.org/issue45042 ---------- components: Tests messages: 400648 nosy: sobolevn priority: normal severity: normal status: open title: MD5SumTests.test_checksum_fodder fails on Windows type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:23:16 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 30 Aug 2021 18:23:16 +0000 Subject: [issue45053] MD5SumTests.test_checksum_fodder fails on Windows In-Reply-To: <1630347779.05.0.821089086925.issue45053@roundup.psfhosted.org> Message-ID: <1630347796.74.0.0591843003796.issue45053@roundup.psfhosted.org> Nikita Sobolev added the comment: I would love to work on this issue :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:23:56 2021 From: report at bugs.python.org (Nikita Sobolev) Date: Mon, 30 Aug 2021 18:23:56 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630347836.8.0.268944839853.issue45042@roundup.psfhosted.org> Nikita Sobolev added the comment: Two new issues created: 1. https://bugs.python.org/issue45053 2. https://bugs.python.org/issue45052 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:25:35 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 30 Aug 2021 18:25:35 +0000 Subject: [issue14088] sys.executable generating canonical path In-Reply-To: <1329928617.24.0.609517948319.issue14088@psf.upfronthosting.co.za> Message-ID: <1630347935.0.0.777054032844.issue14088@roundup.psfhosted.org> Ned Deily added the comment: > I'm not against making Python even better: attempt to normalize the path ;-) I would be very cautious about doing that. I'm pretty sure it would break some existing code. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:30:03 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 30 Aug 2021 18:30:03 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630348203.78.0.188851493296.issue34561@roundup.psfhosted.org> Tim Peters added the comment: New runstack.py mostly adds comments about a surprise: the idea that length-adaptive ShiversSort eeks out better results than powersort appears nearly unique to the specific "0.80" cutoff used in the random-case generation code to pick between two uniform distributions. Change that cutoff, and powersort almost always does better. So powersort remains the best known overall, although shivers4 remains competitive with it. ---------- Added file: https://bugs.python.org/file50246/runstack.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:32:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 30 Aug 2021 18:32:28 +0000 Subject: [issue16379] SQLite error code not exposed to python In-Reply-To: <1351764878.68.0.13361347428.issue16379@psf.upfronthosting.co.za> Message-ID: <1630348348.85.0.819043496255.issue16379@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 86d8b465231473f850cc5e906013ba8581ddb503 by Erlend Egeberg Aasland in branch 'main': bpo-16379: expose SQLite error codes and error names in `sqlite3` (GH-27786) https://github.com/python/cpython/commit/86d8b465231473f850cc5e906013ba8581ddb503 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:33:19 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 30 Aug 2021 18:33:19 +0000 Subject: [issue43398] [sqlite3] sqlite3.connect() segfaults if given a faulty Connection factory In-Reply-To: <1614855277.19.0.209861526791.issue43398@roundup.psfhosted.org> Message-ID: <1630348399.61.0.622804535135.issue43398@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Is something missing here? No; all good. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:48:14 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 30 Aug 2021 18:48:14 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1630349294.9.0.350365713569.issue45001@roundup.psfhosted.org> Ned Deily added the comment: New changeset e9b85afd7dc004460f6d914375ab67d617a8a7ff by Miss Islington (bot) in branch '3.7': bpo-45001: Make email date parsing more robust against malformed input (GH-27946) (GH-27975) https://github.com/python/cpython/commit/e9b85afd7dc004460f6d914375ab67d617a8a7ff ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:49:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Aug 2021 18:49:54 +0000 Subject: [issue45053] MD5SumTests.test_checksum_fodder fails on Windows In-Reply-To: <1630347779.05.0.821089086925.issue45053@roundup.psfhosted.org> Message-ID: <1630349394.49.0.57119073786.issue45053@roundup.psfhosted.org> Serhiy Storchaka added the comment: Test is failing because TESTFN contains now non-ASCII characters. The path is written to stdout using the default stdout encoding on Windows (like cp1252), but test searches the path encoded with UTF-8. This test should fail also on other platforms with non-UTF-8 locale. The simplest way to "fix" the test is using TESTFN_ASCII instead of TESTFN. But there is also an issue in the script itself. It fails or produces a mojibake when the filesystem encoding and the stdout encoding do not match. There are similar issues in other scripts which output file names. ---------- components: +Unicode nosy: +ezio.melotti, serhiy.storchaka, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:57:27 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 30 Aug 2021 18:57:27 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1630349847.49.0.548508870078.issue45001@roundup.psfhosted.org> Ned Deily added the comment: New changeset da9d6c554697414b1d275c8502e00a07c2ce06e6 by Miss Islington (bot) in branch '3.6': bpo-45001: Make email date parsing more robust against malformed input (GH-27946) (GH-27976) https://github.com/python/cpython/commit/da9d6c554697414b1d275c8502e00a07c2ce06e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 14:58:53 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 30 Aug 2021 18:58:53 +0000 Subject: [issue45001] Date parsing helpers in email module incorrectly raise IndexError for some malformed inputs In-Reply-To: <1629897807.12.0.728438817983.issue45001@roundup.psfhosted.org> Message-ID: <1630349933.32.0.928106741419.issue45001@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the PR! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 15:00:56 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 30 Aug 2021 19:00:56 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1630350056.0.0.663892446447.issue45052@roundup.psfhosted.org> Serhiy Storchaka added the comment: It may be a bug in the constructor of SharedMemory. It ignores the size argument on Windows. ---------- components: +Library (Lib), Windows nosy: +davin, paul.moore, pitrou, serhiy.storchaka, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 15:06:55 2021 From: report at bugs.python.org (Gregory Szorc) Date: Mon, 30 Aug 2021 19:06:55 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630350415.27.0.579190641812.issue45020@roundup.psfhosted.org> Gregory Szorc added the comment: > For stdlib modules it wouldn't be a big problem to set __file__ on > frozen modules. > Would that be enough to solve the problem? What do you set __file__ to? Do you still materialize the .py[c] files on disk and set to that? (This would make the most sense.) If you support setting __file__ on a frozen module, how does this work at the C level? A stdlib module would want a different __file__ from a 3rd party module using the frozen module API. This would seemingly require enhancements to the frozen modules C API or some kind of hackery only available to stdlib frozen modules. >> When I investigated freezing the standard library for PyOxidizer, I ran into a rash >> of problems. The frozen importer doesn't behave like PathFinder. It doesn't >> (didn't?) set some common module-level attributes > This is mostly fixable for stdlib modules. Which attributes would > need to be added? Are there other missing behaviors? It was a few years ago and I can't recall specifics. I just remember that after encountering a couple unrelated limitations with the frozen importer I decided it was far too primitive to work as a general importer and decided I'd have to roll my own. > Good point. Supporting more of the FileLoader API on the frozen > loader is something to look into, at least for stdlib modules. >> I agree that we should shore up the frozen importer -- probably in a separate PR though. >> (@Eric: do you think this is worth its own bpo issue?) > Yeah. I have some observations about the implications of this. I typed up a long comment but then realized someone would probably complain about me distracting from the technical parts of this issue. Which forum is most appropriate for this less technical commentary? (I want to lay out the case for building out an official importer far more advanced than frozen importer.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 15:16:31 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 30 Aug 2021 19:16:31 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630350991.49.0.827325121732.issue43124@roundup.psfhosted.org> Ned Deily added the comment: New changeset d2cc04cd3024869101e894f73307944d98d187c8 by Miss Islington (bot) in branch '3.7': [3.7] bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) (GH-28037) https://github.com/python/cpython/commit/d2cc04cd3024869101e894f73307944d98d187c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 15:18:24 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 30 Aug 2021 19:18:24 +0000 Subject: [issue16379] SQLite error code not exposed to python In-Reply-To: <1351764878.68.0.13361347428.issue16379@psf.upfronthosting.co.za> Message-ID: <1630351104.77.0.878690306209.issue16379@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks, Torsten for this nice suggestion, Daniel & Aviv for the initial patches, Gerhard & Ezio for helping improving the API, and Pablo, Asif, Hai Shi, & Michael for reviewing and merging! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 15:22:05 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 30 Aug 2021 19:22:05 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1630351325.0.0.348352069562.issue43124@roundup.psfhosted.org> Ned Deily added the comment: New changeset 29d97d17fb7adab3b0df9e178b73f70292d1cf64 by Miss Islington (bot) in branch '3.6': [3.6] bpo-43124: Fix smtplib multiple CRLF injection (GH-25987) (GH-28038) https://github.com/python/cpython/commit/29d97d17fb7adab3b0df9e178b73f70292d1cf64 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 16:10:42 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 30 Aug 2021 20:10:42 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630354242.74.0.0219693250044.issue45020@roundup.psfhosted.org> Guido van Rossum added the comment: > FWIW, I asked Ned Batchelder about this and he said this approach ("fullcoverage" [1]) was added to support running coverage on the stdlib. [...] The docs you pointed out in [3] (where it talks about a *horrible hack you should never use" :-) should be amended with something explaining that "you need to comment out the line "" from frozen_module.py for this to work, else the frozen version of the encodings module will take priority over the imposter from "fullcoverage"." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 16:14:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 30 Aug 2021 20:14:45 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630354485.47.0.969183808614.issue45020@roundup.psfhosted.org> Guido van Rossum added the comment: [Gregory Szorc] > What do you set __file__ to? [...] Exactly. I think it should not be set, just like it's not set for builtin modules. > I have some observations about the implications of this. I typed up a long comment but then realized someone would probably complain about me distracting from the technical parts of this issue. Which forum is most appropriate for this less technical commentary? (I want to lay out the case for building out an official importer far more advanced than frozen importer.) That seems to be something for python-dev. (There used to be an "import-sig" but the last mention I have from it is about that list shutting down for lack of traffic.) Or if you're still looking for more brainstorming you could try python-ideas first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 16:18:41 2021 From: report at bugs.python.org (Jordan Borean) Date: Mon, 30 Aug 2021 20:18:41 +0000 Subject: [issue37179] asyncio loop.start_tls() provide support for TLS in TLS In-Reply-To: <1559843713.76.0.0171515478407.issue37179@roundup.psfhosted.org> Message-ID: <1630354721.87.0.578850098649.issue37179@roundup.psfhosted.org> Change by Jordan Borean : ---------- pull_requests: +26517 pull_request: https://github.com/python/cpython/pull/28073 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 16:22:36 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 30 Aug 2021 20:22:36 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630354956.97.0.382811595655.issue45020@roundup.psfhosted.org> Guido van Rossum added the comment: > At this point, here are the open questions I'm seeing: > + The editing-stdlib-.py-files problem: [...] > + Compatibility: [...] ? + Penalty for too many frozen modules: [...] > FWIW, I think the ideal mechanism for a dev build will be to opt in to using frozen modules (instead of the source modules). Otherwise it is too easy for the unaware contributor to waste substantial time figuring out why their changes are not getting used. Agreed. I don't care much about people (even myself) editing installed modules. But I care a lot about people who do a git checkout and build from source editing modules and testing them without doing an install (Personally I never install what I build from source except to test the installation process.) > Consequently, here's my order of preference for ignoring frozen modules: > 1. use Py_DEBUG as an opt-out flag > (if we think contributors are editing stdlib modules on a build without Py_DEBUG then that isn't good enough) > 2. automatically skip frozen modules if it's a dev build, with an explicit configure flag to opt in to frozen modules. I propose to only opt in by default in **PGO builds**. After all what we're doing is another extreme optimization. It should always be possible to opt in using some -X flag (e.g. to debug the freeze import loader) and it should also always be possible to opt *out* (for those cases where you want to edit an installed stdlib module in-place in anger). I don't know how the -X mechanism works exactly but probably we could make the spelling python -X freeze=on|off with a dynamic default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 16:43:01 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 30 Aug 2021 20:43:01 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630354956.97.0.382811595655.issue45020@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: FWIW, I'd be okay with doing the -X flag in a separate PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 16:45:39 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 30 Aug 2021 20:45:39 +0000 Subject: [issue45041] [sqlite3] simplify executescript() In-Reply-To: <1630186940.75.0.867509999699.issue45041@roundup.psfhosted.org> Message-ID: <1630356339.55.0.4536253713.issue45041@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26518 pull_request: https://github.com/python/cpython/pull/28074 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 17:01:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 21:01:17 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1630357277.38.0.215903832242.issue44756@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26519 pull_request: https://github.com/python/cpython/pull/28075 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 17:01:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 30 Aug 2021 21:01:21 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630357281.89.0.649804124879.issue36521@roundup.psfhosted.org> Guido van Rossum added the comment: I think we shouldn't change *which* code object contains the docstring (changing anything about that is likely to disturb someone's workflow in a way that's hard to fix) -- only how PyFunction_New finds that docstring in the code object (if that breaks someone's workflow, the fix will be obvious). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 17:11:58 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 30 Aug 2021 21:11:58 +0000 Subject: [issue24139] Use sqlite3 extended error codes In-Reply-To: <1430990375.51.0.367829317248.issue24139@psf.upfronthosting.co.za> Message-ID: <1630357918.41.0.199194180622.issue24139@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26520 pull_request: https://github.com/python/cpython/pull/28076 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 17:14:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 30 Aug 2021 21:14:32 +0000 Subject: [issue45041] [sqlite3] simplify executescript() In-Reply-To: <1630186940.75.0.867509999699.issue45041@roundup.psfhosted.org> Message-ID: <1630358072.92.0.950395046222.issue45041@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset e34bb409197d72711ae2c6197f9d8305533034d4 by Erlend Egeberg Aasland in branch 'main': bpo-45041: Increase coverage for sqlite3.Cursor.executescript() (GH-28074) https://github.com/python/cpython/commit/e34bb409197d72711ae2c6197f9d8305533034d4 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 17:27:11 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 30 Aug 2021 21:27:11 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1630358831.71.0.561592501236.issue37596@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks! This comes right in time, because we're working on freezing many more modules, and modules containing frozen sets didn't have a consistent frozen representation. Now they do! (See issue45019, issue45020) ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 17:31:56 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 30 Aug 2021 21:31:56 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1630359116.78.0.862130599852.issue39452@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks, the rewrite is great! I have one nit: did you consider which of these two idioms is better? if __name__ == "__main__": main() vs. if __name__ == "__main__": sys.exit(main()) Your docs seem to promote the second, whereas I've usually preferred the former. Was this a considered choice on your part? ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 17:54:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 21:54:57 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1630360497.05.0.987058050532.issue44756@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 5246dbc2a12bf8e64e18efee2fdce02a350bbf09 by ?ukasz Langa in branch 'main': bpo-44756: Remove misleading NEWS entries of a change that was reverted before release (GH-28075) https://github.com/python/cpython/commit/5246dbc2a12bf8e64e18efee2fdce02a350bbf09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 17:56:40 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 30 Aug 2021 21:56:40 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1630360600.48.0.816773979452.issue44756@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9ef1843892500e209afe5d916db26ecdbccd5e62 by ?ukasz Langa in branch '3.9': bpo-44756: Remove misleading NEWS entries of a change that was reverted before release (GH-28075) https://github.com/python/cpython/commit/9ef1843892500e209afe5d916db26ecdbccd5e62 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 18:08:31 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 30 Aug 2021 22:08:31 +0000 Subject: [issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docs lie) In-Reply-To: <1364595911.19.0.826873230127.issue17576@psf.upfronthosting.co.za> Message-ID: <1630361311.7.0.68495423768.issue17576@roundup.psfhosted.org> Raymond Hettinger added the comment: > So I really *do* want to see the ability of __float__ > to return a non-float eventually removed. Note, the __str__ method on strings does not require an exact str. class S: def __str__(self): return self print(type(str(S('hello world')))) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 18:49:30 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 30 Aug 2021 22:49:30 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630354956.97.0.382811595655.issue45020@roundup.psfhosted.org> Message-ID: Eric Snow added the comment: On Mon, Aug 30, 2021 at 2:22 PM Guido van Rossum wrote: > I propose to only opt in by default in **PGO builds**. After all what we're doing is another extreme optimization. > > It should always be possible to opt in using some -X flag (e.g. to debug the freeze import loader) and it should also always be possible to opt *out* (for those cases where you want to edit an installed stdlib module in-place in anger). > > I don't know how the -X mechanism works exactly but probably we could make the spelling > > python -X freeze=on|off > > with a dynamic default. +1 to all that ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 18:49:48 2021 From: report at bugs.python.org (Roundup Robot) Date: Mon, 30 Aug 2021 22:49:48 +0000 Subject: [issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux In-Reply-To: <1397851923.06.0.0550198760464.issue21302@psf.upfronthosting.co.za> Message-ID: <1630363788.03.0.584754278724.issue21302@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 4.0 -> 5.0 pull_requests: +26521 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28077 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 19:25:20 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 30 Aug 2021 23:25:20 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1630365920.75.0.881193557284.issue45019@roundup.psfhosted.org> Eric Snow added the comment: New changeset 044e8d866fdde3804bdb2282c7d23a8074de8f6f by Eric Snow in branch 'main': bpo-45019: Add a tool to generate list of modules to include for frozen modules (gh-27980) https://github.com/python/cpython/commit/044e8d866fdde3804bdb2282c7d23a8074de8f6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 20:09:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 31 Aug 2021 00:09:45 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1630368585.27.0.345850147274.issue45019@roundup.psfhosted.org> Guido van Rossum added the comment: Is this ready to close? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 20:30:37 2021 From: report at bugs.python.org (Kevin Mills) Date: Tue, 31 Aug 2021 00:30:37 +0000 Subject: [issue45054] json module should issue warning about duplicate keys Message-ID: <1630369837.94.0.281309391119.issue45054@roundup.psfhosted.org> New submission from Kevin Mills : The json module will allow the following without complaint: import json d1 = {1: "fromstring", "1": "fromnumber"} string = json.dumps(d1) print(string) d2 = json.loads(string) print(d2) And it prints: {"1": "fromstring", "1": "fromnumber"} {'1': 'fromnumber'} This would be extremely confusing to anyone who doesn't already know that JSON keys have to be strings. Not only does `d1 != d2` (which the documentation does mention as a possibility after a round trip through JSON), but `len(d1) != len(d2)` and `d1['1'] != d2['1']`, even though '1' is in both. I suggest that if json.dump or json.dumps notices that it is producing a JSON document with duplicate keys, it should issue a warning. Similarly, if json.load or json.loads notices that it is reading a JSON document with duplicate keys, it should also issue a warning. ---------- components: Library (Lib) messages: 400678 nosy: Zeturic priority: normal severity: normal status: open title: json module should issue warning about duplicate keys type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 20:44:22 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 31 Aug 2021 00:44:22 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1630370662.97.0.69950152959.issue45019@roundup.psfhosted.org> Eric Snow added the comment: I'm just waiting for the buildbots to finish. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 21:36:47 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 31 Aug 2021 01:36:47 +0000 Subject: [issue45054] json module should issue warning about duplicate keys In-Reply-To: <1630369837.94.0.281309391119.issue45054@roundup.psfhosted.org> Message-ID: <1630373807.89.0.182134076434.issue45054@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +bob.ippolito _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 21:44:59 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 31 Aug 2021 01:44:59 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c Message-ID: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> New submission from Guido van Rossum : When I make a fresh checkout of the main branch on Windows and type "pcbuild\build" it starts downloading some distributions (e.g. sqlite) and then starts building. Fine. But at some point there's a whole bunch of errors that seem to come from building zlibmodule.c. Re-running pcbuild\build then downloads some extra thing and then everything builds to completion. First set of downloads and selected logs: Using py -3.9 (found 3.9 with py.exe) Fetching external libraries... Fetching bzip2-1.0.6... Fetching sqlite-3.35.5.0... Fetching xz-5.2.2... Fetching zlib-1.2.11... Traceback (most recent call last): File "C:\Users\gvanrossum\deepfreeze\PCbuild\get_external.py", line 60, in main() File "C:\Users\gvanrossum\deepfreeze\PCbuild\get_external.py", line 56, in main extract_zip(args.externals_dir, zip_path).replace(final_name) File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1395, in replace self._accessor.replace(self, target) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\gvanrossum\\deepfreeze\\PCbuild\\..\\externals\\cpython-source-deps-zlib-1.2.11' -> 'C:\\Users\\gvanrossum\\deepfreeze\\PCbuild\\..\\externals\\zlib-1.2.11' Fetching external binaries... Fetching libffi-3.3.0... Fetching openssl-bin-1.1.1l... Fetching tcltk-8.6.11.0... Finished. Using "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" (found in the Visual Studio installation) Using py -3.9 (found 3.9 with py.exe) C:\Users\gvanrossum\deepfreeze>"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" "C:\Users\gvanrossum\deepfreeze\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m /clp:summary /p:Configuration=Release /p:Platform=x64 /p:IncludeExternals=true /p:IncludeCTypes=true /p:IncludeSSL=true /p:IncludeTkinter=true /p:UseTestMarker= /p:GIT="C:\Program Files\Git\cmd\git.exe" Killing any running python.exe instances... Regenerate pycore_ast.h pycore_ast_state.h Python-ast.c C:\Users\gvanrossum\deepfreeze\Python\Python-ast.c, C:\Users\gvanrossum\deepfreeze\Include\inte rnal\pycore_ast.h, C:\Users\gvanrossum\deepfreeze\Include\internal\pycore_ast_state.h regenerat ed. Regenerate opcode.h opcode_targets.h Include\opcode.h regenerated from Lib\opcode.py Jump table written into Python\opcode_targets.h Regenerate token-list.inc token.h token.c token.py Generated sources are up to date Getting build info from "C:\Program Files\Git\cmd\git.exe" Building heads/deepfreeze:044e8d866f deepfreeze _abc.c ... Errors: Compiling... thread.c traceback.c zlibmodule.c C:\Users\gvanrossum\deepfreeze\Modules\zlibmodule.c(10,10): fatal error C1083: Cannot open includ e file: 'zlib.h': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.vc xproj] adler32.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\adler32.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.vc xproj] compress.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\compress.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.v cxproj] crc32.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\crc32.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.vcxp roj] deflate.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\deflate.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.vc xproj] infback.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\infback.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.vc xproj] inffast.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\inffast.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.vc xproj] inflate.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\inflate.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.vc xproj] inftrees.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\inftrees.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.v cxproj] trees.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\trees.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.vcxp roj] uncompr.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\uncompr.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.vc xproj] zutil.c c1 : fatal error C1083: Cannot open source file: 'C:\Users\gvanrossum\deepfreeze\externals\zlib-1 .2.11\zutil.c': No such file or directory [C:\Users\gvanrossum\deepfreeze\PCbuild\pythoncore.vcxp roj] dl_nt.c Build FAILED. (Followed by the same errors repeated.) Second build: Using py -3.9 (found 3.9 with py.exe) Fetching external libraries... bzip2-1.0.6 already exists, skipping. sqlite-3.35.5.0 already exists, skipping. xz-5.2.2 already exists, skipping. Fetching zlib-1.2.11... Fetching external binaries... libffi-3.3.0 already exists, skipping. openssl-bin-1.1.1l already exists, skipping. tcltk-8.6.11.0 already exists, skipping. Finished. And then everything builds problem-free. ---------- components: Build, Windows messages: 400680 nosy: gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Fresh build on Windows fails the first time for zlib.c versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 21:57:48 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 31 Aug 2021 01:57:48 +0000 Subject: [issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array In-Reply-To: <1578202492.29.0.981939629191.issue39218@roundup.psfhosted.org> Message-ID: <1630375068.55.0.803447869536.issue39218@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 793f55bde9b0299100c12ddb0e6949c6eb4d85e5 by Raymond Hettinger in branch 'main': bpo-39218: Improve accuracy of variance calculation (GH-27960) https://github.com/python/cpython/commit/793f55bde9b0299100c12ddb0e6949c6eb4d85e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 21:58:53 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 31 Aug 2021 01:58:53 +0000 Subject: [issue39218] Assertion failure when calling statistics.variance() on a float32 Numpy array In-Reply-To: <1578202492.29.0.981939629191.issue39218@roundup.psfhosted.org> Message-ID: <1630375133.62.0.405747914813.issue39218@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 22:52:22 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 31 Aug 2021 02:52:22 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630378342.8.0.11681106809.issue36521@roundup.psfhosted.org> Inada Naoki added the comment: I grepped top 5000 downloaded packages and I can not find any real use of PyFunction_New(WithQualName). So I don't know what is current workflow of PyFunction_New. My current wip implementation adds new API (e.g. PyFunction_NewWithDoc()). Old API keep using co_consts[0] for docstring for backward compatibility. Adding code.co_doc is not free. * All code objects have one additional pointer. So it eats memory. * Unmarshal need to call `r_object()` for all code objects. So it increase startup time. Note that code objects is not for only functions. Class, modules, lambdas, comprehensions uses code objects without docstring. And if PEP 649 is accepted, even function annotations will use code objects. It will double the number of code objects in the highly annotated source files. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 23:41:56 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 31 Aug 2021 03:41:56 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts Message-ID: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> New submission from Inada Naoki : Python 3.10 compiler adds None to co_consts even when None is not used at all. ``` $ cat x1.py def foo(): "docstring" return 42 import dis dis.dis(foo) print(foo.__code__.co_consts) $ python3.9 x1.py 3 0 LOAD_CONST 1 (42) 2 RETURN_VALUE ('docstring', 42) $ python3.10 x1.py 3 0 LOAD_CONST 1 (42) 2 RETURN_VALUE ('docstring', 42, None) ``` ---------- components: Interpreter Core keywords: 3.10regression messages: 400683 nosy: methane priority: normal severity: normal status: open title: compiler: Unnecessary None in co_consts versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 23:47:34 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 31 Aug 2021 03:47:34 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1630381654.53.0.0761123307826.issue36521@roundup.psfhosted.org> Inada Naoki added the comment: This is WIP pull request. https://github.com/methane/cpython/pull/35 Some tests are failing because of bpo-36521. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Aug 30 23:55:18 2021 From: report at bugs.python.org (Laurie Opperman) Date: Tue, 31 Aug 2021 03:55:18 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1630382118.05.0.192540191269.issue42414@roundup.psfhosted.org> Laurie Opperman added the comment: No new mailing list thread, but there is one from January 2020: https://mail.python.org/archives/list/python-ideas at python.org/thread/RHB6XFGFVM66AZTRKNTBAKFEVVEYUDD3/ ---------- nosy: +Epic_Wink _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 00:14:50 2021 From: report at bugs.python.org (Takuo Matsuoka) Date: Tue, 31 Aug 2021 04:14:50 +0000 Subject: [issue44983] Wrong definition of a starred expression in the Language Reference In-Reply-To: <1629725570.26.0.70854073558.issue44983@roundup.psfhosted.org> Message-ID: <1630383290.82.0.130113424427.issue44983@roundup.psfhosted.org> Takuo Matsuoka added the comment: Thanks ?ric Araujo, for the information. Actually, I sought for a similar issue here in the tracker, but didn't find one filed, so this report appears to be unique. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 00:24:54 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 31 Aug 2021 04:24:54 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630383894.97.0.671111723546.issue45056@roundup.psfhosted.org> Guido van Rossum added the comment: I wonder what the 3.10 compiler does different to cause this -- in 3.9 that extra None is not in co_consts. (Note: Mark is on vacation for 2 weeks.) ---------- nosy: +Mark.Shannon, gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 00:39:03 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 31 Aug 2021 04:39:03 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630384743.66.0.284721762097.issue45056@roundup.psfhosted.org> Inada Naoki added the comment: I think LOAD_CONST None + RETURN_VALUE is added here. And it removed by optimize_cfg(). https://github.com/python/cpython/blob/793f55bde9b0299100c12ddb0e6949c6eb4d85e5/Python/compile.c#L7795-L7797 I don't know how easy to remove this unnecessary None. But LOAD_COMMON_CONST idea can remove all None from co_consts. https://github.com/iritkatriel/cpython/pull/27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 00:42:06 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 31 Aug 2021 04:42:06 +0000 Subject: [issue45052] WithProcessesTestSharedMemory.test_shared_memory_basics fails on Windows In-Reply-To: <1630347688.96.0.848198201023.issue45052@roundup.psfhosted.org> Message-ID: <1630384926.22.0.400295212168.issue45052@roundup.psfhosted.org> Eryk Sun added the comment: > It may be a bug in the constructor of SharedMemory. It ignores > the size argument on Windows. The `size` argument is always ignored when `create` is false, on all platforms, not that I understand the reason for it. The difference compared to POSIX is that the size of a mapping that's backed by the paging file is rounded up to a multiple of the page size in Windows (e.g. 4 KiB). ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 01:04:01 2021 From: report at bugs.python.org (hai shi) Date: Tue, 31 Aug 2021 05:04:01 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630386241.21.0.0380506715193.issue45021@roundup.psfhosted.org> hai shi added the comment: Is it a defined behavior? I got this sentence from pep-3148: Deadlock can occur when the callable associated with a Future waits on the results of another Future. ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 01:12:01 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 31 Aug 2021 05:12:01 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630386721.08.0.214697347287.issue44394@roundup.psfhosted.org> Ned Deily added the comment: New changeset 79101b890ee021a901a8b6837a3a320d57adb725 by ?ukasz Langa in branch '3.7': [3.7] bpo-44394: Update libexpat copy to 2.4.1 (GH-26945) (GH-28042) https://github.com/python/cpython/commit/79101b890ee021a901a8b6837a3a320d57adb725 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 01:12:01 2021 From: report at bugs.python.org (hai shi) Date: Tue, 31 Aug 2021 05:12:01 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630386721.09.0.792027043933.issue45020@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 01:57:40 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 31 Aug 2021 05:57:40 +0000 Subject: [issue45056] compiler: Unnecessary None in co_consts In-Reply-To: <1630381316.63.0.607874885673.issue45056@roundup.psfhosted.org> Message-ID: <1630389460.89.0.0652569930182.issue45056@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 01:58:32 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 31 Aug 2021 05:58:32 +0000 Subject: [issue45054] json module should issue warning about duplicate keys In-Reply-To: <1630369837.94.0.281309391119.issue45054@roundup.psfhosted.org> Message-ID: <1630389512.9.0.200143037038.issue45054@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 02:15:40 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 06:15:40 +0000 Subject: [issue38965] test_stack_overflow (test.test_faulthandler.FaultHandlerTests) is stuck with GCC10 In-Reply-To: <1575448401.0.0.574576942819.issue38965@roundup.psfhosted.org> Message-ID: <1630390540.87.0.331406040977.issue38965@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26522 pull_request: https://github.com/python/cpython/pull/28079 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 02:24:59 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 31 Aug 2021 06:24:59 +0000 Subject: [issue38965] test_stack_overflow (test.test_faulthandler.FaultHandlerTests) is stuck with GCC10 In-Reply-To: <1575448401.0.0.574576942819.issue38965@roundup.psfhosted.org> Message-ID: <1630391099.02.0.274289916505.issue38965@roundup.psfhosted.org> Ned Deily added the comment: New changeset 8934bb0c3179e4c020cd6f08dea64bccbf56ffa2 by Miss Islington (bot) in branch '3.6': bpo-38965: Fix faulthandler._stack_overflow() on GCC 10 (GH-17467) (GH-28079) https://github.com/python/cpython/commit/8934bb0c3179e4c020cd6f08dea64bccbf56ffa2 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 02:30:47 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 31 Aug 2021 06:30:47 +0000 Subject: [issue38965] test_stack_overflow (test.test_faulthandler.FaultHandlerTests) is stuck with GCC10 In-Reply-To: <1575448401.0.0.574576942819.issue38965@roundup.psfhosted.org> Message-ID: <1630391447.47.0.739346336287.issue38965@roundup.psfhosted.org> Ned Deily added the comment: I decided to also backport this fix for 3.6.15 since the problem causes test hangs when using GCC 10, as is now that case on one of my test machines. Note that the devguide says: "You should also consider fixing hard-failing tests in open security branches since it is important to be able to run the tests successfully before releasing." https://devguide.python.org/devcycle/#security-branches ---------- versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 02:34:02 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 31 Aug 2021 06:34:02 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630391642.76.0.0320795335673.issue44394@roundup.psfhosted.org> Change by Ned Deily : ---------- pull_requests: +26523 pull_request: https://github.com/python/cpython/pull/28080 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 02:35:39 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 31 Aug 2021 06:35:39 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630391739.94.0.234347880515.issue44394@roundup.psfhosted.org> Ned Deily added the comment: New changeset 910886a6448e4bf1edf49eeace4aa240b6403772 by Ned Deily in branch '3.6': [3.6] bpo-44394: Update libexpat copy to 2.4.1 (GH-26945) (GH-28042) (GH-28080) https://github.com/python/cpython/commit/910886a6448e4bf1edf49eeace4aa240b6403772 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 03:05:24 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 31 Aug 2021 07:05:24 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1630393524.15.0.00637605938481.issue44394@roundup.psfhosted.org> Ned Deily added the comment: PRs merged in 3.7 branch for release in 3.7.12 and in 3.6 branch for release in 3.6.15. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 03:08:50 2021 From: report at bugs.python.org (Kevin Mills) Date: Tue, 31 Aug 2021 07:08:50 +0000 Subject: [issue45054] json module should issue warning about duplicate keys In-Reply-To: <1630369837.94.0.281309391119.issue45054@roundup.psfhosted.org> Message-ID: <1630393730.57.0.732699333884.issue45054@roundup.psfhosted.org> Kevin Mills added the comment: Sorry to the people I'm pinging, but I just noticed the initial dictionary in my example code is wrong. I figured I should fix it before anybody tested it and got confused about it not matching up with my description of the results. It should've been: import json d1 = {"1": "fromstring", 1: "fromnumber"} string = json.dumps(d1) print(string) d2 = json.loads(string) print(d2) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 03:24:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 07:24:28 +0000 Subject: [issue45057] Simplify RegressionTestResult Message-ID: <1630394668.9.0.639670262222.issue45057@roundup.psfhosted.org> New submission from Serhiy Storchaka : RegressionTestResult is a subclass of TextTestResult, but it completely ignores the TextTestResult function of outputting results and re-implements it. The problem of this is not only duplicating the code, but that if TextTestResult is changed (for example to fix issue25894) the corresponding changes should be re-implemented in RegressionTestResult. And since implementations that produce the same result are different (somewhere in subtle way), it adds much work and is errorprone. The proposed PR removes any text output code from RegressionTestResult and allows to use TextTestResult for output. ---------- components: Tests messages: 400697 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Simplify RegressionTestResult type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 03:27:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 07:27:49 +0000 Subject: [issue45057] Simplify RegressionTestResult In-Reply-To: <1630394668.9.0.639670262222.issue45057@roundup.psfhosted.org> Message-ID: <1630394869.1.0.745120717082.issue45057@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26524 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28081 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 03:46:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 07:46:17 +0000 Subject: [issue45057] Simplify RegressionTestResult In-Reply-To: <1630394668.9.0.639670262222.issue45057@roundup.psfhosted.org> Message-ID: <1630395977.33.0.0984157543526.issue45057@roundup.psfhosted.org> Serhiy Storchaka added the comment: RegressionTestResult was introduced in issue34582. ---------- nosy: +ezio.melotti, michael.foord, rbcollins, steve.dower, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 03:46:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 07:46:48 +0000 Subject: [issue45057] Simplify RegressionTestResult In-Reply-To: <1630394668.9.0.639670262222.issue45057@roundup.psfhosted.org> Message-ID: <1630396008.31.0.251591654278.issue45057@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 03:55:56 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 07:55:56 +0000 Subject: [issue25894] unittest subTest failure causes result to be omitted from listing In-Reply-To: <1450331375.94.0.689081172202.issue25894@psf.upfronthosting.co.za> Message-ID: <1630396556.54.0.365407205342.issue25894@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26525 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/28082 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 04:15:44 2021 From: report at bugs.python.org (Techn010 Je11y) Date: Tue, 31 Aug 2021 08:15:44 +0000 Subject: [issue45036] turtle.onrelease() event doesn't get triggered sometimes In-Reply-To: <1630156514.02.0.346025167609.issue45036@roundup.psfhosted.org> Message-ID: <1630397744.41.0.421001449498.issue45036@roundup.psfhosted.org> Techn010 Je11y added the comment: I tried EP's fix. Sometimes it doesn't pendown when I drag, and only does when I stop moving my mouse for a moment(or just release). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 04:16:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 08:16:13 +0000 Subject: [issue25894] unittest subTest failure causes result to be omitted from listing In-Reply-To: <1450331375.94.0.689081172202.issue25894@psf.upfronthosting.co.za> Message-ID: <1630397773.4.0.568148134648.issue25894@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 28082 is a draft that implements this idea. Skipped and failed (but not successfully passed) subtests are now reported separately, as a character (sFE) or a line ("skipped", "FAIL", "ERROR"). The description of the subtest is included in the line. For example: $ tests=.sFE ./python test_issue25894.py sFE ====================================================================== ERROR: test_subTest (__main__.TestClass) [3] (t='E') ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/test_issue25894.py", line 15, in test_subTest raise Exception('error') ^^^^^^^^^^^^^^^^^^^^^^^^ Exception: error ====================================================================== FAIL: test_subTest (__main__.TestClass) [2] (t='F') ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/test_issue25894.py", line 13, in test_subTest self.fail('failed') ^^^^^^^^^^^^^^^^^^^ AssertionError: failed ---------------------------------------------------------------------- Ran 1 test in 0.001s FAILED (failures=1, errors=1, skipped=1) $ tests=.sFE ./python test_issue25894.py -v test_subTest (__main__.TestClass) ... test_subTest (__main__.TestClass) [1] (t='s') ... skipped 'skipped' test_subTest (__main__.TestClass) [2] (t='F') ... FAIL test_subTest (__main__.TestClass) [3] (t='E') ... ERROR ====================================================================== ERROR: test_subTest (__main__.TestClass) [3] (t='E') ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/test_issue25894.py", line 15, in test_subTest raise Exception('error') ^^^^^^^^^^^^^^^^^^^^^^^^ Exception: error ====================================================================== FAIL: test_subTest (__main__.TestClass) [2] (t='F') ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython/test_issue25894.py", line 13, in test_subTest self.fail('failed') ^^^^^^^^^^^^^^^^^^^ AssertionError: failed ---------------------------------------------------------------------- Ran 1 test in 0.001s FAILED (failures=1, errors=1, skipped=1) As a side effect, the test description is also repeated for every error in the test cleanup code (in tearDown() and doCleanup()). Similar changes should be added also in RegressionTestResult. If apply issue45057 first they will be much simpler. Issue29152 can be related. If call addError() and addFailure() from addSubTest(), PR 28082 should be rewritten. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 04:16:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 08:16:59 +0000 Subject: [issue37719] addSubtest not calling addFailure and addError In-Reply-To: <1564479966.23.0.678975484256.issue37719@roundup.psfhosted.org> Message-ID: <1630397819.58.0.347445288143.issue37719@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> unittest subTest does not call addFailure _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 05:25:39 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 31 Aug 2021 09:25:39 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1630401939.49.0.793875183188.issue45055@roundup.psfhosted.org> Steve Dower added the comment: This looks like a typical "lingering open handle" issue, though I can't tell whether it's in the destination or the source. Probably just needs a bit of retry logic (personally I'd be fine putting in CPython itself, though that doesn't help this build which is using an already-released version). So get_externals.py needs it. It's certainly not reliably reproducible or the CI system would be on the floor ;) This runs on every build ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 05:32:33 2021 From: report at bugs.python.org (Antony Lee) Date: Tue, 31 Aug 2021 09:32:33 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630402353.84.0.203487342129.issue27175@roundup.psfhosted.org> Change by Antony Lee : ---------- keywords: +patch pull_requests: +26526 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28083 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 05:44:37 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 09:44:37 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1630403077.82.0.617580633167.issue44925@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26527 pull_request: https://github.com/python/cpython/pull/28084 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 05:44:39 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 31 Aug 2021 09:44:39 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1630403079.33.0.0805815504165.issue44925@roundup.psfhosted.org> Ken Jin added the comment: New changeset edae42f99f8153b92ccf365dbd1c2fa954f913b4 by DonnaDia in branch 'main': bpo-44925: [docs] Fix confusing deprecation notice for typing.IO (GH-28004) https://github.com/python/cpython/commit/edae42f99f8153b92ccf365dbd1c2fa954f913b4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 05:51:43 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 31 Aug 2021 09:51:43 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630403503.16.0.4369649639.issue27175@roundup.psfhosted.org> Antoine Pitrou added the comment: What does "converting" mean in this context? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 06:07:53 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 10:07:53 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1630404473.36.0.561883272491.issue44925@roundup.psfhosted.org> miss-islington added the comment: New changeset 1d0c5596142eeb35fea172c3642e23aeca128f5d by Miss Islington (bot) in branch '3.10': bpo-44925: [docs] Fix confusing deprecation notice for typing.IO (GH-28004) https://github.com/python/cpython/commit/1d0c5596142eeb35fea172c3642e23aeca128f5d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 06:09:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 31 Aug 2021 10:09:39 +0000 Subject: [issue44925] [docs] Confusing deprecation notice for typing.IO In-Reply-To: <1629120123.92.0.171925756948.issue44925@roundup.psfhosted.org> Message-ID: <1630404579.95.0.359712338769.issue44925@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for the report, Jesse, and Diana for the fix! ? ? ? ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 06:21:36 2021 From: report at bugs.python.org (Antony Lee) Date: Tue, 31 Aug 2021 10:21:36 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630405296.93.0.380963784552.issue27175@roundup.psfhosted.org> Antony Lee added the comment: It means the Path/PurePath that would be constructed with the same single str parameter, or equivalently that has the same os.fspath(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 06:27:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 10:27:05 +0000 Subject: [issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docs lie) In-Reply-To: <1364595911.19.0.826873230127.issue17576@psf.upfronthosting.co.za> Message-ID: <1630405625.47.0.942758627213.issue17576@roundup.psfhosted.org> Serhiy Storchaka added the comment: PyNumber_Index() now always returns an instance of int. - If the argument is a direct int then return it. - If it is a subclass of int then return a direct int copy. - Otherwise call type(obj).__index__(obj) - If a direct int, return it - If a subclass of int, raise a DeprecationWarning and return a direct int copy - If not an int, raise TypeError If we go in this direction we should add a DeprecationWarning for __str__() returning not direct str. I am not sure that it is right. It adds a burden on authors of special methods to always convert the result to the corresponding direct type, while this conversion can silently (and more efficiently) be performed in the interpreter core. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 06:34:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 31 Aug 2021 10:34:13 +0000 Subject: [issue34135] The results of time.tzname print broken. In-Reply-To: <1531803123.68.0.56676864532.issue34135@psf.upfronthosting.co.za> Message-ID: <1630406053.26.0.23623382842.issue34135@roundup.psfhosted.org> Irit Katriel added the comment: issue16322 was closed as a duplicate of issue36779 which was fixed. Does that resolve this problem as well? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 06:35:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 10:35:42 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630406142.97.0.793165019963.issue27175@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think that you mean that PosixPath will be converted to PurePosixPath on Windows, and WindowsPath will be converted to PureWindowsPath on Posix. In can be easily achieved by making alias PosixPath=PurePosixPath on Windows and WindowsPath=PureWindowsPath on Posix. It will have other effects, would they be positive or negative? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 07:06:08 2021 From: report at bugs.python.org (uosiu) Date: Tue, 31 Aug 2021 11:06:08 +0000 Subject: [issue45012] DirEntry.stat method should release GIL In-Reply-To: <1629978813.83.0.528049638414.issue45012@roundup.psfhosted.org> Message-ID: <1630407968.89.0.0121193678339.issue45012@roundup.psfhosted.org> Change by uosiu : ---------- keywords: +patch pull_requests: +26528 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28085 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 07:31:30 2021 From: report at bugs.python.org (kftse) Date: Tue, 31 Aug 2021 11:31:30 +0000 Subject: [issue45058] Undefined behavior for syntax "except AError or BError:" accepted by interpreter Message-ID: <1630409490.64.0.879285632353.issue45058@roundup.psfhosted.org> New submission from kftse : Test case: try: raise TypeError() except TypeError or ValueError: print("OK") try: raise ValueError() except TypeError or ValueError: print("OK") Output: (Python 3.9.0) OK OK # seem to eventually lead to segmentation fault elsewhere (Python 3.8.0) OK Traceback (most recent call last): File "test.py", line 7, in raise ValueError() ValueError I understand that this code is incorrect syntax for exception. The awkward behavior is that the interpreter accepted this syntax and the output being correct in some case, or even in both cases, but seem to eventually lead to segmentation fault elsewhere. ---------- components: Interpreter Core messages: 400710 nosy: kftse20031207 priority: normal severity: normal status: open title: Undefined behavior for syntax "except AError or BError:" accepted by interpreter type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 07:34:00 2021 From: report at bugs.python.org (Antony Lee) Date: Tue, 31 Aug 2021 11:34:00 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630409640.2.0.808985503862.issue27175@roundup.psfhosted.org> Antony Lee added the comment: You are correct as to the meaning of "convert". The alternative approach you suggest would also work, but that seems to go much more against the design of pathlib to me. OTOH I guess it is up to Antoine to rule on that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 07:40:23 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 31 Aug 2021 11:40:23 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1630410023.06.0.116110261847.issue42064@roundup.psfhosted.org> Petr Viktorin added the comment: Here's a gotcha you might not be aware of: `create_callback_context` stashes away a pointer to `state`. I don't think we can prove that the `state` will always outlive the callback_context after it'll become possible to deallocate the module The state doesn't have a refcount, but it is owned by a module object, so callback_context should own a reference to the module object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 07:41:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 11:41:52 +0000 Subject: [issue45059] Typo: using "==" instead of "=" Message-ID: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> New submission from Serhiy Storchaka : While searching for use the equality operator with None I found the possible use of "==" instead of "=" (assignment) in Lib/idlelib/idle_test/test_macosx.py. for platform, types in ('darwin', alltypes), ('other', nontypes): with self.subTest(platform=platform): macosx.platform = platform macosx._tk_type == None macosx._init_tk_type() self.assertIn(macosx._tk_type, types) ---------- assignee: terry.reedy components: IDLE, Tests messages: 400713 nosy: serhiy.storchaka, taleinat, terry.reedy priority: normal severity: normal status: open title: Typo: using "==" instead of "=" type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 07:43:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 11:43:48 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630410228.1.0.606884456016.issue45059@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26529 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28086 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 07:47:13 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 31 Aug 2021 11:47:13 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630410433.44.0.0423467703954.issue27175@roundup.psfhosted.org> Antoine Pitrou added the comment: I guess the question is: why do people expect Paths to be picklable accross platforms? Is there a particular use case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 07:47:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 11:47:38 +0000 Subject: [issue45060] Do not use the equality operators with None Message-ID: <1630410458.57.0.930194989698.issue45060@roundup.psfhosted.org> New submission from Serhiy Storchaka : There are few uses of operators "==" and "!=" with None in the stdlib (against more than 8000 uses of "is" and "is not"). It is very uncommon writing, contradicts PEP 8, and is not safe in general. One bug was found -- using "==" instead of assignment (issue45059). ---------- components: Library (Lib) messages: 400715 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Do not use the equality operators with None versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 07:50:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 11:50:13 +0000 Subject: [issue45060] Do not use the equality operators with None In-Reply-To: <1630410458.57.0.930194989698.issue45060@roundup.psfhosted.org> Message-ID: <1630410613.33.0.950116550777.issue45060@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26530 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28087 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:01:27 2021 From: report at bugs.python.org (Antony Lee) Date: Tue, 31 Aug 2021 12:01:27 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630411287.56.0.541477139861.issue27175@roundup.psfhosted.org> Antony Lee added the comment: Despite the now well-known security limitations of pickle, it is still used as a simple way (from the user PoV) to exchange arbitrary Python objects (see e.g. https://joblib.readthedocs.io/en/latest/persistence.html). Such objects can sometimes include Paths as attributes, and it seems unfortunate that the presence of a Path makes the entire object (which may include many more things than just the Path) impossible to unpickle on a different OS (especially if unpickling into a PurePath keeps all the functionality that makes sense on that other OS). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:04:10 2021 From: report at bugs.python.org (0x0L) Date: Tue, 31 Aug 2021 12:04:10 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630411450.69.0.258394090344.issue45021@roundup.psfhosted.org> 0x0L added the comment: In the last reproducing example, one can drop the .result() and just submit the task: we're not waiting on any result explicitly. It's the shutdown of the ProcessPoolExecutor that waits forever for the children to exit. Generally speaking it's probably a bad idea to mix multi-thread and forks. See https://www.linuxprogrammingblog.com/threads-and-fork-think-twice-before-using-them ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:04:55 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 12:04:55 +0000 Subject: [issue45058] Undefined behavior for syntax "except AError or BError:" accepted by interpreter In-Reply-To: <1630409490.64.0.879285632353.issue45058@roundup.psfhosted.org> Message-ID: <1630411495.17.0.904574579336.issue45058@roundup.psfhosted.org> Serhiy Storchaka added the comment: I get the correct result (a ValueError traceback) in 3.9.6, I get a crash in 3.9.0. It was a bug in 3.9.0 which is now fixed. The syntax is legal. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:16:01 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 31 Aug 2021 12:16:01 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630412161.83.0.955540035025.issue27175@roundup.psfhosted.org> Antoine Pitrou added the comment: I understand. Unpickling to PurePath might make enough sense indeed... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:16:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 12:16:11 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630412171.35.0.528796306895.issue27175@roundup.psfhosted.org> Serhiy Storchaka added the comment: Pickling Patch can be useful in multiprocessing, you can pass the Patch argument to function executed in other process. It can also be useful if you save the state of your program and restore it at the next start. In both cases you pickle and unpickle on the same computer. If unpickle Path on other platform, the only meaningful operation on result are these which are implemented in PurePath. So Antony's proposition looks reasonable to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:16:06 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 31 Aug 2021 12:16:06 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1630412166.6.0.57896460453.issue42064@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks, good catch! I'll add that after PR 27934 is merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:16:41 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 31 Aug 2021 12:16:41 +0000 Subject: [issue27175] Unpickling Path objects In-Reply-To: <1464772684.94.0.191025907363.issue27175@psf.upfronthosting.co.za> Message-ID: <1630412201.54.0.660651373814.issue27175@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- type: behavior -> enhancement versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:18:52 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 12:18:52 +0000 Subject: [issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...) In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1630412332.37.0.733157489098.issue44991@roundup.psfhosted.org> miss-islington added the comment: New changeset 001ef4600f5ab2e1d7825ddbc0f253377c234d7e by Erlend Egeberg Aasland in branch 'main': bpo-44991: Make GIL handling more explicit in `sqlite3` callbacks (GH-27934) https://github.com/python/cpython/commit/001ef4600f5ab2e1d7825ddbc0f253377c234d7e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:20:26 2021 From: report at bugs.python.org (kftse) Date: Tue, 31 Aug 2021 12:20:26 +0000 Subject: [issue45058] Undefined behavior for syntax "except AError or BError:" accepted by interpreter In-Reply-To: <1630409490.64.0.879285632353.issue45058@roundup.psfhosted.org> Message-ID: <1630412426.8.0.136627970342.issue45058@roundup.psfhosted.org> kftse added the comment: Tested 3.9.6 to have same behavior as 3.8.0. to clarify, I suppose legal merely means syntactically correct, not effect of "except AError or BError:" === "except (AError, BError)" right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:23:50 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 31 Aug 2021 12:23:50 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630412630.49.0.807429568711.issue45021@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:23:44 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 31 Aug 2021 12:23:44 +0000 Subject: [issue45021] Race condition in thread.py In-Reply-To: <1630008557.08.0.231587430513.issue45021@roundup.psfhosted.org> Message-ID: <1630412624.94.0.777487261298.issue45021@roundup.psfhosted.org> Antoine Pitrou added the comment: As the multiprocessing doc says (https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods): """Note that safely forking a multithreaded process is problematic.""" The reproducer is trivially fixed by adding a call to `multiprocessing.set_start_method("forkserver")` (you can also replace "forkserver" with "spawn") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:34:48 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 31 Aug 2021 12:34:48 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1630413288.44.0.287327138396.issue42064@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 01dea5f12b31862999217c091399a318f23b460a by Petr Viktorin in branch 'main': bpo-42064: Offset arguments for PyObject_Vectorcall in the _sqlite module (GH-27931) https://github.com/python/cpython/commit/01dea5f12b31862999217c091399a318f23b460a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:49:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 31 Aug 2021 12:49:35 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1630414175.9.0.628490881489.issue42064@roundup.psfhosted.org> Erlend E. Aasland added the comment: > The state doesn't have a refcount, but it is owned by a module object, so callback_context should own a reference to the module object. Would it be sufficient to hold a reference to the connection object? The connection holds a reference to the connection type, and the connection type holds a reference to the module, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 08:58:16 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 31 Aug 2021 12:58:16 +0000 Subject: [issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...) In-Reply-To: <1629810432.44.0.0891439205465.issue44991@roundup.psfhosted.org> Message-ID: <1630414696.32.0.899286220466.issue44991@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +26531 pull_request: https://github.com/python/cpython/pull/28088 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:04:50 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 31 Aug 2021 13:04:50 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1630415090.7.0.965078320878.issue45055@roundup.psfhosted.org> Eryk Sun added the comment: I can't directly reproduce the problem. Does it reproduce reliably for you? My guess would be that there's a file open in "cpython-source-deps-zlib-1.2.11" when get_external.py tries to rename it to "zlib-1.2.11". Maybe an anti-malware scanner or content indexer has a file open. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:17:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 13:17:39 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions Message-ID: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> New submission from STINNER Victor : Writing C extensions using directly the C API is error prone. It's easy to add or forget a Py_INCREF or Py_DECREF. Adding Py_DECREF(Py_True) or Py_DECREF(Py_False) by mistake causes a surprising crash at Python exit: --- Debug memory block at address p=0x8a6e80: API '' 0 bytes originally requested The 7 pad bytes at p-7 are not all FORBIDDENBYTE (0xfd): at p-7: 0x00 *** OUCH at p-6: 0x00 *** OUCH at p-5: 0x00 *** OUCH at p-4: 0x00 *** OUCH at p-3: 0x00 *** OUCH at p-2: 0x00 *** OUCH at p-1: 0x00 *** OUCH Because memory is corrupted at the start, the count of bytes requested may be bogus, and checking the trailing pad bytes may segfault. The 8 pad bytes at tail=0x8a6e80 are not all FORBIDDENBYTE (0xfd): at tail+0: 0x00 *** OUCH at tail+1: 0x00 *** OUCH at tail+2: 0x00 *** OUCH at tail+3: 0x00 *** OUCH at tail+4: 0x00 *** OUCH at tail+5: 0x00 *** OUCH at tail+6: 0x00 *** OUCH at tail+7: 0x00 *** OUCH Enable tracemalloc to get the memory block allocation traceback Fatal Python error: _PyMem_DebugRawFree: bad ID: Allocated using API '', verified using API 'o' Python runtime state: finalizing (tstate=0x0000000001f43c50) Current thread 0x00007f3f562fa740 (most recent call first): Garbage-collecting Abandon (core dumped) --- In my case, the bug occurs at Python exit, in code_dealloc(): "Py_XDECREF(co->co_consts);" destroys a tuple which contains True. It calls object_dealloc() which calls PyBool_Type.tp_dealloc(Py_True), but this object is allocated statically, and so its memory must not deallocated by the Python dynamic memory allocator. In debug mode, PyObject_Free() triggers a fatal error. Concrete example of such bug in PySide with Python 3.10 which is now stricter on reference counting (thanks to the work made in bpo-1635741 and for Python subinterpreters): https://bugreports.qt.io/browse/PYSIDE-1436 I propose to add a specific deallocator functions on bool to detect such bug, to ease debugging. There is already a similar deallocator for the None singleton. ---------- components: Extension Modules messages: 400728 nosy: vstinner priority: normal severity: normal status: open title: [C API] Detect refcount bugs on True/False in C extensions versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:19:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 13:19:06 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630415946.38.0.0952155160956.issue45061@roundup.psfhosted.org> STINNER Victor added the comment: To reproduce the bug, apply attached os_uname_refcount_bug.patch and call os.uname(): --- $ ./python -c 'import os; os.uname()' (...) Fatal Python error: _PyMem_DebugRawFree: bad ID: Allocated using API '', verified using API 'o' (...) --- ---------- keywords: +patch Added file: https://bugs.python.org/file50247/os_uname_refcount_bug.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:24:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 13:24:06 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630416246.3.0.531259984702.issue45061@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +26532 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28089 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:34:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 13:34:42 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630416882.89.0.177507439038.issue45061@roundup.psfhosted.org> STINNER Victor added the comment: There was such bug in CPython stdlib, in the _testcapi module, see commit 310e2d25170a88ef03f6fd31efcc899fe062da2c of bpo-36854: commit 310e2d25170a88ef03f6fd31efcc899fe062da2c Author: Victor Stinner Date: Fri Nov 22 10:58:00 2019 +0100 bpo-36854: Fix refleak in subinterpreter (GH-17331) finalize_interp_clear() now explicitly clears the codec registry and then trigger a GC collection to clear all references. diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index baa6907b7e..0908f3457f 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -6721,11 +6721,14 @@ PyInit__testcapi(void) PyModule_AddObject(m, "instancemethod", (PyObject *)&PyInstanceMethod_Type); PyModule_AddIntConstant(m, "the_number_three", 3); + PyObject *v; #ifdef WITH_PYMALLOC - PyModule_AddObject(m, "WITH_PYMALLOC", Py_True); + v = Py_True; #else - PyModule_AddObject(m, "WITH_PYMALLOC", Py_False); + v = Py_False; #endif + Py_INCREF(v); + PyModule_AddObject(m, "WITH_PYMALLOC", v); TestError = PyErr_NewException("_testcapi.error", NULL, NULL); Py_INCREF(TestError); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:38:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 13:38:14 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630417094.82.0.705006249338.issue45061@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +26533 pull_request: https://github.com/python/cpython/pull/28090 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:39:28 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 13:39:28 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1630417168.35.0.528132041718.issue44135@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26534 pull_request: https://github.com/python/cpython/pull/28091 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:39:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 31 Aug 2021 13:39:23 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1630417163.06.0.743897376199.issue44135@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 08767c73b5bf1f28792d5fef7f41d52822a4989f by Zack Kneupper in branch 'main': bpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193) https://github.com/python/cpython/commit/08767c73b5bf1f28792d5fef7f41d52822a4989f ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:43:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 13:43:37 +0000 Subject: [issue45062] test_asyncio: test_huge_content_recvinto() failed Message-ID: <1630417417.52.0.890945752162.issue45062@roundup.psfhosted.org> New submission from STINNER Victor : PPC64LE RHEL8 Refleaks 3.9: https://buildbot.python.org/all/#/builders/482/builds/128 test test_asyncio failed -- Traceback (most recent call last): File "/home/buildbot/buildarea/3.9.cstratak-RHEL8-ppc64le.refleak/build/Lib/test/test_asyncio/test_sock_lowlevel.py", line 373, in test_huge_content_recvinto self.loop.run_until_complete( File "/home/buildbot/buildarea/3.9.cstratak-RHEL8-ppc64le.refleak/build/Lib/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/home/buildbot/buildarea/3.9.cstratak-RHEL8-ppc64le.refleak/build/Lib/test/test_asyncio/test_sock_lowlevel.py", line 366, in _basetest_huge_content_recvinto self.assertEqual(size, 0) AssertionError: 978216 != 0 Full output (reformatted for readability): --- 0:22:42 load avg: 10.83 [300/425/1] test_asyncio failed (1 failure) (22 min 40 sec) -- running: (...) beginning 6 repetitions 123456 Unknown child process pid 201442, will report returncode 255 Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 201442 is closed ... Unknown child process pid 240062, will report returncode 255 Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 240062 is closed . /home/buildbot/buildarea/3.9.cstratak-RHEL8-ppc64le.refleak/build/Lib/test/support/__init__.py:1468: ResourceWarning: unclosed gc.collect() ResourceWarning: Enable tracemalloc to get the object allocation traceback Task exception was never retrieved future: exception=ConnectionResetError(104, 'Connection reset by peer')> Traceback (most recent call last): File "/home/buildbot/buildarea/3.9.cstratak-RHEL8-ppc64le.refleak/build/Lib/asyncio/selector_events.py", line 462, in sock_sendall return await fut File "/home/buildbot/buildarea/3.9.cstratak-RHEL8-ppc64le.refleak/build/Lib/asyncio/selector_events.py", line 470, in _sock_sendall n = sock.send(view[start:]) ConnectionResetError: [Errno 104] Connection reset by peer test test_asyncio failed -- Traceback (most recent call last): File "/home/buildbot/buildarea/3.9.cstratak-RHEL8-ppc64le.refleak/build/Lib/test/test_asyncio/test_sock_lowlevel.py", line 373, in test_huge_content_recvinto self.loop.run_until_complete( File "/home/buildbot/buildarea/3.9.cstratak-RHEL8-ppc64le.refleak/build/Lib/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/home/buildbot/buildarea/3.9.cstratak-RHEL8-ppc64le.refleak/build/Lib/test/test_asyncio/test_sock_lowlevel.py", line 366, in _basetest_huge_content_recvinto self.assertEqual(size, 0) AssertionError: 978216 != 0 --- Moreover, test_huge_content_recvinto() seems to change the event loop policy without restoring it once done: --- 0:48:26 load avg: 1.00 Re-running test_asyncio in verbose mode (matching: test_huge_content_recvinto) beginning 6 repetitions 123456 test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok ---------------------------------------------------------------------- Ran 3 tests in 0.367s OK test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok ---------------------------------------------------------------------- Ran 3 tests in 0.363s OK test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok ---------------------------------------------------------------------- Ran 3 tests in 0.402s OK test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok ---------------------------------------------------------------------- Ran 3 tests in 0.338s OK test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok ---------------------------------------------------------------------- Ran 3 tests in 0.332s OK test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) ... ok test_huge_content_recvinto (test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok ---------------------------------------------------------------------- Ran 3 tests in 0.384s OK ...... Warning -- asyncio.events._event_loop_policy was modified by test_asyncio Before: None After: 1 test failed again: test_asyncio --- ---------- components: Tests, asyncio messages: 400732 nosy: asvetlov, erlendaasland, lukasz.langa, pablogsal, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio: test_huge_content_recvinto() failed versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:45:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 13:45:41 +0000 Subject: [issue45062] test_asyncio: test_huge_content_recvinto() failed on PPC64LE RHEL8 Refleaks 3.9 In-Reply-To: <1630417417.52.0.890945752162.issue45062@roundup.psfhosted.org> Message-ID: <1630417541.33.0.39549372145.issue45062@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_asyncio: test_huge_content_recvinto() failed -> test_asyncio: test_huge_content_recvinto() failed on PPC64LE RHEL8 Refleaks 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 09:47:04 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 31 Aug 2021 13:47:04 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1630417624.65.0.850384670879.issue42064@roundup.psfhosted.org> Petr Viktorin added the comment: > Would it be sufficient to hold a reference to the connection object? Yes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 10:00:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 14:00:08 +0000 Subject: [issue45060] Do not use the equality operators with None In-Reply-To: <1630410458.57.0.930194989698.issue45060@roundup.psfhosted.org> Message-ID: <1630418408.5.0.902841600769.issue45060@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 3c65457156d87e55010507d616b4eecb7a02883d by Serhiy Storchaka in branch 'main': bpo-45060: Get rid of few uses of the equality operators with None (GH-28087) https://github.com/python/cpython/commit/3c65457156d87e55010507d616b4eecb7a02883d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 10:00:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 14:00:15 +0000 Subject: [issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched In-Reply-To: <1623225511.63.0.739788412824.issue44359@roundup.psfhosted.org> Message-ID: <1630418415.06.0.972699995663.issue44359@roundup.psfhosted.org> STINNER Victor added the comment: aarch64 Fedora Stable Clang 3.10: https://buildbot.python.org/all/#/builders/635/builds/253 0:00:23 load avg: 12.40 [404/427/1] test_ftplib failed (env changed) Warning -- Uncaught thread exception: Exception Exception in thread Thread-34: Traceback (most recent call last): File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/asyncore.py", line 90, in read obj.handle_read_event() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/asyncore.py", line 427, in handle_read_event self.handle_read() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/asynchat.py", line 179, in handle_read self.found_terminator() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/test/test_ftplib.py", line 134, in found_terminator method(arg) File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/test/test_ftplib.py", line 159, in cmd_pasv conn, addr = sock.accept() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/socket.py", line 293, in accept fd, addr = self._accept() TimeoutError: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/threading.py", line 1009, in _bootstrap_inner self.run() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/test/test_ftplib.py", line 297, in run asyncore.loop(timeout=0.1, count=1) File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/asyncore.py", line 214, in loop poll_fun(timeout, map) File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/asyncore.py", line 157, in poll read(obj) File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/asyncore.py", line 94, in read obj.handle_error() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-aarch64.clang/build/Lib/test/test_ftplib.py", line 139, in handle_error raise Exception Exception ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 10:03:56 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 14:03:56 +0000 Subject: [issue45060] Do not use the equality operators with None In-Reply-To: <1630410458.57.0.930194989698.issue45060@roundup.psfhosted.org> Message-ID: <1630418636.16.0.448487179971.issue45060@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26535 pull_request: https://github.com/python/cpython/pull/28092 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 10:05:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 14:05:56 +0000 Subject: [issue45063] PEP 657 Fine Grained Error Locations: make the traceback less verbose when possible Message-ID: <1630418756.59.0.674837335232.issue45063@roundup.psfhosted.org> New submission from STINNER Victor : The PEP 657 introduced ^^^ in tracebacks. It is useful when the error happens on an sub-expression in a long line. Example: File "/home/vstinner/python/main/Lib/ftplib.py", line 462, in retrlines with self.transfercmd(cmd) as conn, \ ^^^^^^^^^^^^^^^^^^^^^ But ^^^ makes the output more verbose and doesn't bring much value when the error concerns the whole line: File "/home/vstinner/python/main/Lib/socket.py", line 845, in create_connection raise err ^^^^^^^^^ Would it be possible to omit ^^^ when it concerns the whole line? Full example (currently): ERROR: test_retrlines (test.test_ftplib.TestFTPClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 603, in test_retrlines self.client.retrlines('retr', received.append) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/ftplib.py", line 462, in retrlines with self.transfercmd(cmd) as conn, \ ^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/ftplib.py", line 393, in transfercmd return self.ntransfercmd(cmd, rest)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/ftplib.py", line 354, in ntransfercmd conn = socket.create_connection((host, port), self.timeout, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/socket.py", line 845, in create_connection raise err ^^^^^^^^^ File "/home/vstinner/python/main/Lib/socket.py", line 833, in create_connection sock.connect(sa) ^^^^^^^^^^^^^^^^ ConnectionRefusedError: [Errno 111] Connection refused I would prefer: ERROR: test_retrlines (test.test_ftplib.TestFTPClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 603, in test_retrlines self.client.retrlines('retr', received.append) File "/home/vstinner/python/main/Lib/ftplib.py", line 462, in retrlines with self.transfercmd(cmd) as conn, \ ^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/ftplib.py", line 393, in transfercmd return self.ntransfercmd(cmd, rest)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/ftplib.py", line 354, in ntransfercmd conn = socket.create_connection((host, port), self.timeout, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/vstinner/python/main/Lib/socket.py", line 845, in create_connection raise err File "/home/vstinner/python/main/Lib/socket.py", line 833, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused In term of release process, can we change the traceback after Python 3.10.0 final? Or can we only change it in Python 3.11? I mark the issue as a release blocker, but I let Pablo (author of the PEP and Python 3.10 release manager) decide. ---------- components: Interpreter Core messages: 400736 nosy: BTaskaya, lukasz.langa, pablogsal, vstinner priority: release blocker severity: normal status: open title: PEP 657 Fine Grained Error Locations: make the traceback less verbose when possible versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 10:07:12 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 31 Aug 2021 14:07:12 +0000 Subject: [issue45019] Freezing modules has manual steps but could be automated. In-Reply-To: <1630004779.62.0.284599538008.issue45019@roundup.psfhosted.org> Message-ID: <1630418832.93.0.95395199968.issue45019@roundup.psfhosted.org> Change by Eric Snow : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 10:07:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 14:07:33 +0000 Subject: [issue45060] Do not use the equality operators with None In-Reply-To: <1630410458.57.0.930194989698.issue45060@roundup.psfhosted.org> Message-ID: <1630418853.69.0.92165915944.issue45060@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26536 pull_request: https://github.com/python/cpython/pull/28093 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 10:23:38 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 14:23:38 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1630419818.15.0.402715970878.issue44135@roundup.psfhosted.org> miss-islington added the comment: New changeset ab8fed88fc602282167f6459b43f2cf0c771f60a by Miss Islington (bot) in branch '3.10': bpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193) https://github.com/python/cpython/commit/ab8fed88fc602282167f6459b43f2cf0c771f60a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 10:26:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 14:26:18 +0000 Subject: [issue45063] PEP 657 Fine Grained Error Locations: make the traceback less verbose when possible In-Reply-To: <1630418756.59.0.674837335232.issue45063@roundup.psfhosted.org> Message-ID: <1630419978.66.0.255576618171.issue45063@roundup.psfhosted.org> STINNER Victor added the comment: I looked at the implementation. It's more complex than what I expected. tb_displayline(): _Py_DisplaySourceLine() returns the source line with the indentation, but then it truncates the indentation. extract_anchors_from_line() includes the indentation if I understand correctly. There is also a special case for trailing spaces. Like this code path: // If this is a multi-line expression, then we will highlight until // the last non-whitespace character. There is also a funny part about bytes vs Unicode vs UTF-8, that I don't get. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 10:53:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 14:53:03 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1630421583.83.0.295831874646.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: Recent failure on AMD64 Fedora Rawhide Refleaks 3.x: https://buildbot.python.org/all/#/builders/565/builds/131 test_typing leaked [1, 1, 1] memory blocks, sum=3 (...) 0:46:40 load avg: 0.00 Re-running test_typing in verbose mode test_typing leaked [1, 1, 1] memory blocks, sum=3 I don't reopen the issue since I failed to reproduce it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 10:59:50 2021 From: report at bugs.python.org (Diana) Date: Tue, 31 Aug 2021 14:59:50 +0000 Subject: [issue32835] Add documention mentioning that Cygwin isn't fully compatible In-Reply-To: <1518469943.71.0.467229070634.issue32835@psf.upfronthosting.co.za> Message-ID: <1630421990.51.0.853212920705.issue32835@roundup.psfhosted.org> Diana added the comment: Hi, I've created a pull request for pep 11. https://github.com/python/peps/pull/2065 ---------- nosy: +DonnaDia _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:04:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 15:04:34 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630422274.6.0.0841179582301.issue44895@roundup.psfhosted.org> STINNER Victor added the comment: A variant of this problem: bpo-36560 with a leak 1 memory block per iteration. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:05:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 15:05:41 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1630422341.18.0.654391051662.issue36560@roundup.psfhosted.org> STINNER Victor added the comment: I can see the test_typing issue with this patch: diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index b94826a5da..49e5f03414 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -124,7 +124,7 @@ def check_rc_deltas(deltas): # # [5, 5, 6] # [10, 1, 1] - return all(delta >= 1 for delta in deltas) + return any(delta >= 1 for delta in deltas) def check_fd_deltas(deltas): return any(deltas) Examples: $ ./python -m test test_typing -R 3:20 (...) beginning 23 repetitions 12345678901234567890123 ....................... test_typing leaked [1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] memory blocks, sum=3 test_typing failed (reference leak) $ ./python -m test test_typing -R 1:20 WARNING: Running tests with --huntrleaks/-R and less than 3 warmup repetitions can give false positives! (...) beginning 21 repetitions 123456789012345678901 ..................... test_typing leaked [6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] references, sum=6 test_typing leaked [4, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] memory blocks, sum=7 test_typing failed (reference leak) (...) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:07:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 31 Aug 2021 15:07:24 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1630422444.39.0.210725658796.issue44135@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +26537 pull_request: https://github.com/python/cpython/pull/28094 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:11:37 2021 From: report at bugs.python.org (Mateusz) Date: Tue, 31 Aug 2021 15:11:37 +0000 Subject: [issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__ Message-ID: <1630422697.09.0.31446327761.issue45064@roundup.psfhosted.org> New submission from Mateusz : A descriptor that is raising AttributeError in __get__() causes that the Python's interpreter continues searching for attributes in __mro__ calling __getattr__() function in inherited classes. Let's take a look for example script with this bug. class A1: def __getattr__(self, name): print("A1 visited") raise AttributeError(f"{self.__class__.__name__}: {name} not found.") class A2(A1): def __getattr__(self, name): print("A2 visited") super().__getattr__(name) class A3(A2): def __getattr__(self, name): print("A3 visited") super().__getattr__(name) class B: def __init__(self, f): self.f = f def __get__(self, obj, objtype=None): raise AttributeError("Python bug?") class C(A3): @B def test(self): return 25 B is a decorator attached to C.test() and it is throwing AttributeError. When c.test() is performed it starts for walking through C.__mro__ and calling __getattr__() function in objects. >>> from bug import C >>> c = C() >>> c.test() A3 visited A2 visited A1 visited Traceback (most recent call last): File "", line 1, in File "/home/blooser/python-bug/bug.py", line 17, in __getattr__ super().__getattr__(name) File "/home/blooser/python-bug/bug.py", line 11, in __getattr__ super().__getattr__(name) File "/home/blooser/python-bug/bug.py", line 6, in __getattr__ raise AttributeError(f"{self.__class__.__name__}: {name} not found.") AttributeError: C: test not found. Changing error in B.__get__() to NameError: class B: def __init__(self, f): self.f = f def __get__(self, obj, objtype=None): raise NameError("Python bug?") causes it omits C.__mro__. >>> from bug import C >>> c = C() >>> c.test() Traceback (most recent call last): File "", line 1, in File "/home/blooser/python-bug/bug.py", line 26, in __get__ raise NameError("Python bug?") NameError: Python bug? I'm thinking that it is expected behavior or is this a bug? ---------- components: Interpreter Core files: bug.py messages: 400743 nosy: blooser priority: normal severity: normal status: open title: Raising AttributeError in descriptor decorator causing searching attribute in __mro__ type: behavior versions: Python 3.11 Added file: https://bugs.python.org/file50248/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:17:31 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 31 Aug 2021 15:17:31 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1630423051.74.0.789628897859.issue44135@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +26538 pull_request: https://github.com/python/cpython/pull/28095 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:26:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 15:26:55 +0000 Subject: [issue45065] test_asyncio failed (env changed) on s390x RHEL8 Refleaks 3.10: RuntimeError('Event loop is closed') in _SSLProtocolTransport.__del__ Message-ID: <1630423615.96.0.978514058482.issue45065@roundup.psfhosted.org> New submission from STINNER Victor : s390x RHEL8 Refleaks 3.10: https://buildbot.python.org/all/#/builders/669/builds/121 Reformatted output: 0:19:31 load avg: 2.74 [316/427/1] test_asyncio failed (env changed) (14 min 36 sec) -- running: test_statistics (37.6 sec), test_signal (16 min 51 sec), test_pydoc (5 min 36 sec), test_xmlrpc (1 min 49 sec), test_subprocess (1 min 15 sec) beginning 6 repetitions 123456 Unknown child process pid 1398289, will report returncode 255 Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 1398289 is closed . Unknown child process pid 1404140, will report returncode 255 Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 1404140 is closed . /home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/sslproto.py:320: ResourceWarning: unclosed transport _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback Warning -- Unraisable exception Exception ignored in: Traceback (most recent call last): File "/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/sslproto.py", line 321, in __del__ self.close() File "/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/sslproto.py", line 316, in close self._ssl_protocol._start_shutdown() File "/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/sslproto.py", line 590, in _start_shutdown self._abort() File "/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/sslproto.py", line 731, in _abort self._transport.abort() File "/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/selector_events.py", line 680, in abort self._force_close(None) File "/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/selector_events.py", line 731, in _force_close self._loop.call_soon(self._call_connection_lost, exc) File "/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/base_events.py", line 745, in call_soon self._check_closed() File "/home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/base_events.py", line 510, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed /home/dje/cpython-buildarea/3.10.edelsohn-rhel8-z.refleak/build/Lib/asyncio/selector_events.py:704: ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=9> _warn(f"unclosed transport {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback Task was destroyed but it is pending! task: wait_for=> Unknown child process pid 1411156, will report returncode 255 Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 1411156 is closed . Unknown child process pid 1415148, will report returncode 255 Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 1415148 is closed .. Unknown child process pid 1426190, will report returncode 255 Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 1426190 is closed . ---------- components: Tests, asyncio messages: 400744 nosy: asvetlov, erlendaasland, lukasz.langa, pablogsal, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio failed (env changed) on s390x RHEL8 Refleaks 3.10: RuntimeError('Event loop is closed') in _SSLProtocolTransport.__del__ versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:28:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 15:28:59 +0000 Subject: [issue45065] test_asyncio failed (env changed) on s390x RHEL8 Refleaks 3.10: RuntimeError('Event loop is closed') in _SSLProtocolTransport.__del__ In-Reply-To: <1630423615.96.0.978514058482.issue45065@roundup.psfhosted.org> Message-ID: <1630423739.02.0.0703461118377.issue45065@roundup.psfhosted.org> STINNER Victor added the comment: PPC64LE RHEL8 LTO 3.10: https://buildbot.python.org/all/#/builders/680/builds/279 0:01:14 load avg: 8.67 [236/427/1] test_asyncio failed (env changed) (1 min 5 sec) -- running: test_gdb (1 min 2 sec), test_tokenize (47.0 sec) Warning -- Unraisable exception Exception ignored in: Traceback (most recent call last): File "/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/sslproto.py", line 321, in __del__ self.close() File "/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/sslproto.py", line 316, in close self._ssl_protocol._start_shutdown() File "/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/sslproto.py", line 590, in _start_shutdown self._abort() File "/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/sslproto.py", line 731, in _abort self._transport.abort() File "/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/selector_events.py", line 680, in abort self._force_close(None) File "/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/selector_events.py", line 731, in _force_close self._loop.call_soon(self._call_connection_lost, exc) File "/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/base_events.py", line 745, in call_soon self._check_closed() File "/home/buildbot/buildarea/3.10.cstratak-RHEL8-ppc64le.lto/build/Lib/asyncio/base_events.py", line 510, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:34:56 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 15:34:56 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630424096.63.0.304344300168.issue45061@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +26539 pull_request: https://github.com/python/cpython/pull/28096 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:34:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 15:34:39 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630424079.56.0.295888876459.issue45061@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 888d4cc06b887e77f281ba4d640e281cb4c61b7b by Victor Stinner in branch 'main': bpo-45061: Enhance faulthandler traceback wit no Python frame (GH-28090) https://github.com/python/cpython/commit/888d4cc06b887e77f281ba4d640e281cb4c61b7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:42:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 15:42:26 +0000 Subject: [issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docs lie) In-Reply-To: <1364595911.19.0.826873230127.issue17576@psf.upfronthosting.co.za> Message-ID: <1630424546.91.0.74394540992.issue17576@roundup.psfhosted.org> STINNER Victor added the comment: > If we go in this direction we should add a DeprecationWarning for __str__() returning not direct str. I saw str subclass being used for translation. Example: class Message(str): """A Message object is a unicode object that can be translated. Translation of Message is done explicitly using the translate() method. For all non-translation intents and purposes, a Message is simply unicode, and can be treated as such. """ https://github.com/openstack/oslo.i18n/blob/master/oslo_i18n/_message.py There is likely other funny use cases. I don't know if str() is used on Message instances. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:53:28 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 15:53:28 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630425208.62.0.70016965705.issue45061@roundup.psfhosted.org> miss-islington added the comment: New changeset c4c57e5c0eb79795d4fd1d9d8292455567c60070 by Miss Islington (bot) in branch '3.10': bpo-45061: Enhance faulthandler traceback wit no Python frame (GH-28090) https://github.com/python/cpython/commit/c4c57e5c0eb79795d4fd1d9d8292455567c60070 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 11:59:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 31 Aug 2021 15:59:21 +0000 Subject: [issue45063] PEP 657 Fine Grained Error Locations: make the traceback less verbose when possible In-Reply-To: <1630418756.59.0.674837335232.issue45063@roundup.psfhosted.org> Message-ID: <1630425561.13.0.322867885401.issue45063@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > In term of release process, can we change the traceback after Python 3.10.0 final? Or can we only change it in Python 3.11? I don't follow what you want to change in 3.10.0 final, PEP 657 is for Python 3.11. Can you clarify? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:00:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 31 Aug 2021 16:00:24 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1630425624.19.0.519130260706.issue44135@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 5f66ad09ff2c51521e1512888cac84e0cc0907d4 by ?ukasz Langa in branch '3.9': bpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193) (GH-28094) https://github.com/python/cpython/commit/5f66ad09ff2c51521e1512888cac84e0cc0907d4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:01:25 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 16:01:25 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1630425685.02.0.44018343007.issue44135@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26540 pull_request: https://github.com/python/cpython/pull/28097 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:01:21 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 31 Aug 2021 16:01:21 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1630425681.33.0.491323921539.issue44135@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9a7ec2fcdee2da9e080ca459d4c240776df72567 by Ken Jin in branch 'main': bpo-44135: [docs] Fix inline markup (GH-28095) https://github.com/python/cpython/commit/9a7ec2fcdee2da9e080ca459d4c240776df72567 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:01:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 31 Aug 2021 16:01:43 +0000 Subject: [issue45063] PEP 657 Fine Grained Error Locations: make the traceback less verbose when possible In-Reply-To: <1630418756.59.0.674837335232.issue45063@roundup.psfhosted.org> Message-ID: <1630425703.24.0.497293570259.issue45063@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Regarding the issue: I understand what you mean but I don't think we should get into suppressing the indicators in special situations. Some people may say that in a line that assigns to a call: x = foo(x) ^^^^^^ highlighting foo() is also not very valuable but this case is much harder to detect so I don't want to open the window to "special cases". Also, it will be very confusing to users why some lines are highlighted and why some lines aren't. So, in general, I feel we should not do this, but I am open to more discussion about it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:05:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 16:05:22 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630425922.65.0.50282427025.issue45061@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 4300352000beed22fb525ec45fd331918d206528 by Victor Stinner in branch 'main': bpo-45061: Detect Py_DECREF(Py_True) bug (GH-28089) https://github.com/python/cpython/commit/4300352000beed22fb525ec45fd331918d206528 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:05:56 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 31 Aug 2021 16:05:56 +0000 Subject: [issue36560] test_functools leaks randomly 1 memory block In-Reply-To: <1554733336.52.0.331530875309.issue36560@roundup.psfhosted.org> Message-ID: <1630425956.05.0.720463384717.issue36560@roundup.psfhosted.org> Ken Jin added the comment: @Victor, with your patch applied, for test_typing (locally, Windows x64): $ ./python -m test test_typing -R 3:20 Different result on every run (race condition maybe?) $ ./python -m test test_typing -R 1:20 Same result as yours on every run. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:05:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 16:05:53 +0000 Subject: [issue45061] [C API] Detect refcount bugs on True/False in C extensions In-Reply-To: <1630415859.84.0.961228000434.issue45061@roundup.psfhosted.org> Message-ID: <1630425953.14.0.355529198581.issue45061@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:18:43 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 31 Aug 2021 16:18:43 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1630426723.58.0.8419267674.issue37596@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 51999c960e7fc45feebd629421dec6524a5fc803 by Brandt Bucher in branch 'main': bpo-37596: Clean up the set/frozenset marshalling code (GH-28068) https://github.com/python/cpython/commit/51999c960e7fc45feebd629421dec6524a5fc803 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:25:17 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 16:25:17 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1630427117.05.0.063490491254.issue44135@roundup.psfhosted.org> miss-islington added the comment: New changeset 8711b3d0ac89599fcd16edcb107169bb19a00737 by Miss Islington (bot) in branch '3.10': bpo-44135: [docs] Fix inline markup (GH-28095) https://github.com/python/cpython/commit/8711b3d0ac89599fcd16edcb107169bb19a00737 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:36:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 31 Aug 2021 16:36:38 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630427798.71.0.0825794893645.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: Victor - I am also getting a feeling that this may not be a real leak but rather a bug in the refleaks test bookkeeping. It could be a problem with the way _Py_RefTotal is incremented/decremented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 12:54:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 31 Aug 2021 16:54:04 +0000 Subject: [issue44135] issubclass documentation doesn't explain tuple semantic In-Reply-To: <1621016667.05.0.821636272564.issue44135@roundup.psfhosted.org> Message-ID: <1630428844.98.0.0528475879034.issue44135@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:32:14 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 17:32:14 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630431134.72.0.0973632562091.issue45059@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26542 pull_request: https://github.com/python/cpython/pull/28099 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:32:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 31 Aug 2021 17:32:09 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630431129.77.0.774525518129.issue45059@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 54f100514b02f6628450043e21ccfe39350d7ac7 by Serhiy Storchaka in branch 'main': bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086) https://github.com/python/cpython/commit/54f100514b02f6628450043e21ccfe39350d7ac7 ---------- message_count: 1.0 -> 2.0 nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26541 pull_request: https://github.com/python/cpython/pull/28098 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:32:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 31 Aug 2021 17:32:09 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630431129.77.0.774525518129.issue45059@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 54f100514b02f6628450043e21ccfe39350d7ac7 by Serhiy Storchaka in branch 'main': bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086) https://github.com/python/cpython/commit/54f100514b02f6628450043e21ccfe39350d7ac7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:41:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 17:41:28 +0000 Subject: [issue45039] use ADDOP_LOAD_CONST consistently In-Reply-To: <1630172782.32.0.00459227167262.issue45039@roundup.psfhosted.org> Message-ID: <1630431688.46.0.845519127964.issue45039@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 70ccee418d1f9d34ed15cfe7104221f9cfd27d03 by Irit Katriel in branch 'main': bpo-45039: Consistently use ADDOP_LOAD_CONST in compiler rather than ADDOP_O(c, LOAD_CONST,...) (GH-28015) https://github.com/python/cpython/commit/70ccee418d1f9d34ed15cfe7104221f9cfd27d03 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:41:30 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 31 Aug 2021 17:41:30 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630431690.73.0.884517254822.issue45059@roundup.psfhosted.org> Terry J. Reedy added the comment: Definitely a typo. Will apply fix and backport. The first import of macosx initializes _tk_type to None. The line in question intends to re-initialize it so that the subsequent assert can only pass if _init_tk_type changes it to something required. Many other tests also set _tk_type as needed. _tk_type should be restored in tearDownModule. I will add that in a separate PR. (The class cleanup already restores platform.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:42:01 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 17:42:01 +0000 Subject: [issue45039] use ADDOP_LOAD_CONST consistently In-Reply-To: <1630172782.32.0.00459227167262.issue45039@roundup.psfhosted.org> Message-ID: <1630431721.99.0.360077884611.issue45039@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +26543 pull_request: https://github.com/python/cpython/pull/28100 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:45:19 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 17:45:19 +0000 Subject: [issue45057] Simplify RegressionTestResult In-Reply-To: <1630394668.9.0.639670262222.issue45057@roundup.psfhosted.org> Message-ID: <1630431919.23.0.493580334351.issue45057@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +26544 pull_request: https://github.com/python/cpython/pull/28101 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:45:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 17:45:18 +0000 Subject: [issue45057] Simplify RegressionTestResult In-Reply-To: <1630394668.9.0.639670262222.issue45057@roundup.psfhosted.org> Message-ID: <1630431918.04.0.919645774521.issue45057@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 2b76a5322fdf71d62b531fd765085f96f981c244 by Serhiy Storchaka in branch 'main': bpo-45057: Simplify RegressionTestResult (GH-28081) https://github.com/python/cpython/commit/2b76a5322fdf71d62b531fd765085f96f981c244 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:47:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 31 Aug 2021 17:47:18 +0000 Subject: [issue45039] use ADDOP_LOAD_CONST consistently In-Reply-To: <1630172782.32.0.00459227167262.issue45039@roundup.psfhosted.org> Message-ID: <1630432038.82.0.0487257360193.issue45039@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:50:49 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 31 Aug 2021 17:50:49 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630432249.97.0.768309618545.issue45059@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +26545 pull_request: https://github.com/python/cpython/pull/28102 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:50:52 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 17:50:52 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630432252.71.0.21742977485.issue45059@roundup.psfhosted.org> miss-islington added the comment: New changeset 337c8adf31c46b688a5f82bcb64dc6f1ad56703d by Miss Islington (bot) in branch '3.10': bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086) https://github.com/python/cpython/commit/337c8adf31c46b688a5f82bcb64dc6f1ad56703d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:51:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 31 Aug 2021 17:51:48 +0000 Subject: [issue45057] Simplify RegressionTestResult In-Reply-To: <1630394668.9.0.639670262222.issue45057@roundup.psfhosted.org> Message-ID: <1630432308.54.0.521928241469.issue45057@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +26546 pull_request: https://github.com/python/cpython/pull/28103 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 13:53:51 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 17:53:51 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630432431.63.0.0353551036985.issue45059@roundup.psfhosted.org> miss-islington added the comment: New changeset c1db7598790d037e58cd99c06d5c166433d63322 by Miss Islington (bot) in branch '3.9': bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086) https://github.com/python/cpython/commit/c1db7598790d037e58cd99c06d5c166433d63322 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:04:32 2021 From: report at bugs.python.org (anarcat) Date: Tue, 31 Aug 2021 18:04:32 +0000 Subject: [issue45066] email parser fails to decode quoted-printable rfc822 message attachemnt Message-ID: <1630433072.94.0.61440036856.issue45066@roundup.psfhosted.org> New submission from anarcat : If an email message has a message/rfc822 part *and* that part is quoted-printable encoded, Python freaks out. Consider this code: import email.parser import email.policy # python 3.9.2 cannot decode this message, it fails with # "email.errors.StartBoundaryNotFoundDefect" mail = """Mime-Version: 1.0 Content-Type: multipart/report; boundary=aaaaaa Content-Transfer-Encoding: 7bit --aaaaaa Content-Type: message/rfc822 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=3D"=3Dbbbbbb" --=3Dbbbbbb Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=3Dutf-8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= x --=3Dbbbbbb-- --aaaaaa-- """ msg_abuse = email.parser.Parser(policy=email.policy.default + email.policy.strict).parsestr(mail) That crashes with: email.errors.StartBoundaryNotFoundDefect This should normally work: the sub-message is valid, assuming you decode the content. But if you do not, you end up in this bizarre situation, because the multipart boundary is probably considered to be something like `3D"=3Dbbbbbb"`, and of course the above code crashes with the above exception. If you remove the quoted-printable part from the equation, the parser actually behaves: import email.parser import email.policy # python 3.9.2 cannot decode this message, it fails with # "email.errors.StartBoundaryNotFoundDefect" mail = """Mime-Version: 1.0 Content-Type: multipart/report; boundary=aaaaaa Content-Transfer-Encoding: 7bit --aaaaaa Content-Type: message/rfc822 Content-Disposition: inline MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=bbbbbb" --=bbbbbb Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --=bbbbbb-- --aaaaaa-- """ msg_abuse = email.parser.Parser(policy=email.policy.default + email.policy.strict).parsestr(mail) The above correctly parses the message. This problem causes all sorts of weird issues. In one real-world example, it would just stop parsing headers inside the email because long lines in headers (typical in Received-by headers) would get broken up... So it would not actually fail completely. Or, to be more accurate, by *default* (ie. if you do not use strict), it does not crash and instead produces invalid data (e.g. a message without a Message-ID or From). On most messages that are encoded this way, the strict mode will actually fail with: email.errors.MissingHeaderBodySeparatorDefect because it will stumble upon a header line that should be a continuation but instead is treated like a full header line, so it's missing a colon (":"). ---------- components: email messages: 400764 nosy: anarcat, barry, r.david.murray priority: normal severity: normal status: open title: email parser fails to decode quoted-printable rfc822 message attachemnt type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:08:41 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 18:08:41 +0000 Subject: [issue45039] use ADDOP_LOAD_CONST consistently In-Reply-To: <1630172782.32.0.00459227167262.issue45039@roundup.psfhosted.org> Message-ID: <1630433321.31.0.222230679807.issue45039@roundup.psfhosted.org> miss-islington added the comment: New changeset ebbd0ac5d8850a1630090c210b2454b4b26c7daa by Miss Islington (bot) in branch '3.10': bpo-45039: Consistently use ADDOP_LOAD_CONST in compiler rather than ADDOP_O(c, LOAD_CONST,...) (GH-28015) https://github.com/python/cpython/commit/ebbd0ac5d8850a1630090c210b2454b4b26c7daa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:10:27 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 31 Aug 2021 18:10:27 +0000 Subject: [issue44188] ThreadPoolExecutor unbalanced semaphore count In-Reply-To: <1621511496.17.0.839085647104.issue44188@roundup.psfhosted.org> Message-ID: <1630433427.08.0.142205293477.issue44188@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:14:39 2021 From: report at bugs.python.org (Brett Cannon) Date: Tue, 31 Aug 2021 18:14:39 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630433679.71.0.35583706938.issue45020@roundup.psfhosted.org> Brett Cannon added the comment: > set __file__ (and __path__) on frozen modules? See https://bugs.python.org/issue21736 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:23:35 2021 From: report at bugs.python.org (anarcat) Date: Tue, 31 Aug 2021 18:23:35 +0000 Subject: [issue45066] email parser fails to decode quoted-printable rfc822 message attachemnt In-Reply-To: <1630433072.94.0.61440036856.issue45066@roundup.psfhosted.org> Message-ID: <1630434215.95.0.62213482857.issue45066@roundup.psfhosted.org> anarcat added the comment: looking at email.feedparser.FeedParser._parse_gen(), it looks like this is going to be really hard to fix, because the parser just happily recurses into the sub-part without ever checking the CTE (content-transfer-encoding). that's typically only done on "get_payload()", which is obviously not called there because we're streaming the email in. in general, it looks like support for quoted-printable, as a CTE (which is https://datatracker.ietf.org/doc/html/rfc2045#section-6.7), seems to be spotty at best. multipart/ parts will raise the (undocumented) exception InvalidMultipartContentTransferEncodingDefect if they encounter it, for example: https://github.com/python/cpython/blob/3.9/Lib/email/feedparser.py#L322 so I'm not sure how to handle this. it's not clear to me either how to workaround this problem at all... is there a way to keep the parser from recursing like this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:36:25 2021 From: report at bugs.python.org (Diego Ramirez) Date: Tue, 31 Aug 2021 18:36:25 +0000 Subject: [issue45066] email parser fails to decode quoted-printable rfc822 message attachemnt In-Reply-To: <1630433072.94.0.61440036856.issue45066@roundup.psfhosted.org> Message-ID: <1630434985.57.0.856852237661.issue45066@roundup.psfhosted.org> Change by Diego Ramirez : ---------- nosy: +DiddiLeija _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:37:09 2021 From: report at bugs.python.org (Diego Ramirez) Date: Tue, 31 Aug 2021 18:37:09 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630435029.18.0.463006068742.issue45059@roundup.psfhosted.org> Change by Diego Ramirez : ---------- nosy: +DiddiLeija _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:37:57 2021 From: report at bugs.python.org (Diego Ramirez) Date: Tue, 31 Aug 2021 18:37:57 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1630435077.45.0.181858654613.issue45055@roundup.psfhosted.org> Change by Diego Ramirez : ---------- nosy: +DiddiLeija _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:38:49 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Tue, 31 Aug 2021 18:38:49 +0000 Subject: [issue44188] ThreadPoolExecutor unbalanced semaphore count In-Reply-To: <1621511496.17.0.839085647104.issue44188@roundup.psfhosted.org> Message-ID: <1630435129.8.0.820863174601.issue44188@roundup.psfhosted.org> Antoine Pitrou added the comment: To be clear, this probably doesn't have any actual consequence, since the right number of threads is launched anyway (at least in the example). But it's probably worth making the implementation less quirky (also, the semaphore's internal counter *might* overflow at some point?). ---------- components: +Library (Lib) -asyncio nosy: +pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:39:48 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 31 Aug 2021 18:39:48 +0000 Subject: [issue33426] [doc] Behavior of os.path.join does not match documentation In-Reply-To: <1525459146.45.0.682650639539.issue33426@psf.upfronthosting.co.za> Message-ID: <1630435188.66.0.510049467293.issue33426@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:53:27 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 31 Aug 2021 18:53:27 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630433679.71.0.35583706938.issue45020@roundup.psfhosted.org> Message-ID: <26f7ebde-573c-ef0b-2482-18cefeeac7ec@egenix.com> Marc-Andre Lemburg added the comment: On 31.08.2021 20:14, Brett Cannon wrote: > > Brett Cannon added the comment: > >> set __file__ (and __path__) on frozen modules? > > See https://bugs.python.org/issue21736 The patch on that ticket is straight from PyRun, where the __file__ location is set in a way which signals that the file does not exist, but instead is baked into the executable: >>> import os >>> os.__file__ '/os.py' Not doing this breaks too many tests in the test suite for no good reason, which is why I mentioned "practicality beats purity" in the ticket. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:55:09 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 31 Aug 2021 18:55:09 +0000 Subject: [issue45055] Fresh build on Windows fails the first time for zlib.c In-Reply-To: <1630374299.93.0.725029231147.issue45055@roundup.psfhosted.org> Message-ID: <1630436109.16.0.3799690371.issue45055@roundup.psfhosted.org> Guido van Rossum added the comment: I've seen it a few times. I don't do this that often, but since I've discovered "git worktree" this has occurred to me a few times (can't recall if it was every time, but today wasn't the first). I'm totally happy to be the human in the retry loop. :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:59:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 31 Aug 2021 18:59:41 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630436381.54.0.655499013349.issue45059@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 22fe0eb13c3441b71b60aaea0e7fe289a29783da by Terry Jan Reedy in branch 'main': bpo-45059: Add module cleanup to IDLE test_macosx (GH-28102) https://github.com/python/cpython/commit/22fe0eb13c3441b71b60aaea0e7fe289a29783da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 14:59:54 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 18:59:54 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630436394.7.0.191282315937.issue45059@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26547 pull_request: https://github.com/python/cpython/pull/28104 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 15:01:00 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 19:01:00 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630436460.39.0.842122773902.issue45059@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26548 pull_request: https://github.com/python/cpython/pull/28105 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 15:21:36 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 19:21:36 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630437696.33.0.857497729969.issue45059@roundup.psfhosted.org> miss-islington added the comment: New changeset 0f274cb2d78f71073e9d7295df3b9006e7bf1097 by Miss Islington (bot) in branch '3.10': bpo-45059: Add module cleanup to IDLE test_macosx (GH-28102) https://github.com/python/cpython/commit/0f274cb2d78f71073e9d7295df3b9006e7bf1097 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 15:24:53 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 31 Aug 2021 19:24:53 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630437893.52.0.666703898241.issue45059@roundup.psfhosted.org> miss-islington added the comment: New changeset 2280bc116301d45efc4d69cea452d272fdcd05b1 by Miss Islington (bot) in branch '3.9': bpo-45059: Add module cleanup to IDLE test_macosx (GH-28102) https://github.com/python/cpython/commit/2280bc116301d45efc4d69cea452d272fdcd05b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 15:32:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 31 Aug 2021 19:32:19 +0000 Subject: [issue45059] Typo: using "==" instead of "=" In-Reply-To: <1630410112.9.0.510923106875.issue45059@roundup.psfhosted.org> Message-ID: <1630438339.83.0.922504540727.issue45059@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 15:56:01 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 31 Aug 2021 19:56:01 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1630439761.77.0.470306892992.issue42064@roundup.psfhosted.org> Erlend E. Aasland added the comment: >> Would it be sufficient to hold a reference to the connection object? > > Yes Good, that simplifies things. I'll wait with this until we've resolved PR 27940 though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 16:02:36 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 31 Aug 2021 20:02:36 +0000 Subject: [issue21736] Add __file__ attribute to frozen modules In-Reply-To: <1402589689.02.0.501075866976.issue21736@psf.upfronthosting.co.za> Message-ID: <1630440156.76.0.0233611542659.issue21736@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 16:12:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 31 Aug 2021 20:12:25 +0000 Subject: [issue24981] Add a test which uses the ast module to compile the stdlib In-Reply-To: <1441140555.75.0.593788380292.issue24981@psf.upfronthosting.co.za> Message-ID: <1630440745.58.0.645960998482.issue24981@roundup.psfhosted.org> Irit Katriel added the comment: I think there is something like this here: https://github.com/python/cpython/blob/22fe0eb13c3441b71b60aaea0e7fe289a29783da/Lib/test/test_ast.py#L1498 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 16:32:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 31 Aug 2021 20:32:54 +0000 Subject: [issue42791] There is no way to json encode object to str. In-Reply-To: <1609359771.92.0.340715050179.issue42791@roundup.psfhosted.org> Message-ID: <1630441974.3.0.589720677202.issue42791@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +ezio.melotti, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 16:34:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 31 Aug 2021 20:34:24 +0000 Subject: [issue42791] There is no way to json encode object to str. In-Reply-To: <1609359771.92.0.340715050179.issue42791@roundup.psfhosted.org> Message-ID: <1630442064.74.0.239539436791.issue42791@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue35111. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 16:42:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 31 Aug 2021 20:42:18 +0000 Subject: [issue31299] Add "ignore_modules" option to TracebackException.format() In-Reply-To: <1503992745.47.0.33675937395.issue31299@psf.upfronthosting.co.za> Message-ID: <1630442538.57.0.677209480411.issue31299@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 863154c9292e70c5a8a1a3f22ef4ee42e2304281 by Irit Katriel in branch 'main': bpo-31299: make it possible to filter out frames from tracebacks (GH-28067) https://github.com/python/cpython/commit/863154c9292e70c5a8a1a3f22ef4ee42e2304281 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 16:59:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 31 Aug 2021 20:59:12 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1630443552.75.0.936138123592.issue42414@roundup.psfhosted.org> Andrei Kulakov added the comment: Laurie: thanks for linking that, it seems like there isn't that much enthusiasm. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:20:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 21:20:29 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630444829.78.0.171480486796.issue44895@roundup.psfhosted.org> STINNER Victor added the comment: > It could be a problem with the way _Py_RefTotal is incremented/decremented. It can be a cache which is kept alive and then clear the following iteration. See my previous comment: test leaked [-4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4] references, sum=0 libregrtest/refleak.py does its best to clear *all* caches, type caches, free lists, etc. A single cache which is not cleared can confused libregrtest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:21:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 21:21:22 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1630444882.15.0.699334538207.issue42064@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:29:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 21:29:08 +0000 Subject: [issue45063] PEP 657 Fine Grained Error Locations: omit indicators if they are one the whole line, to make tracebacks shorter In-Reply-To: <1630418756.59.0.674837335232.issue45063@roundup.psfhosted.org> Message-ID: <1630445348.93.0.776853947619.issue45063@roundup.psfhosted.org> STINNER Victor added the comment: > I don't follow what you want to change in 3.10.0 final, PEP 657 is for Python 3.11. Can you clarify? Ah, I thaught that the PEP was implemented in 3.10, I didn't notice that it's a new feature of Python 3.11 :-) > Regarding the issue: I understand what you mean but I don't think we should get into suppressing the indicators in special situations. In my example, there are 6 frames. The indicators cover the whole line of 3 frames: 50%. It's a common case, it's not special. Python tracebacks are already very verbose: a single exception can easily take 20-30 lines. It's worse for chained exceptions. Python 3.11 makes it worse: up to 1.5x longer. ---------- priority: release blocker -> title: PEP 657 Fine Grained Error Locations: make the traceback less verbose when possible -> PEP 657 Fine Grained Error Locations: omit indicators if they are one the whole line, to make tracebacks shorter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:31:37 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 31 Aug 2021 21:31:37 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1630445497.4.0.0695616946594.issue39452@roundup.psfhosted.org> G?ry added the comment: @jack__d Thanks for the rewrite! This is a great expansion. Unfortunately I didn?t have the time to review it before the merge. If I find something to be improved I will let you know. @gvanrossum > Your docs seem to promote the second, whereas I've usually preferred the former. Are you sure? Yet in your 2003 blog post [*Python main() functions*](https://www.artima.com/weblogs/viewpost.jsp?thread=4829) you promoted the opposite idiom `if __name__ == "__main__": sys.exit(main())` over the idiom `if __name__ == "__main__": main()`: > Now the `sys.exit()` calls are annoying: when `main()` calls `sys.exit()`, your interactive Python interpreter will exit! The remedy is to let `main()`'s return value specify the exit status. I am interested in the rationale if you changed your mind. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:40:03 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 31 Aug 2021 21:40:03 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1630446003.16.0.860657123525.issue39452@roundup.psfhosted.org> Guido van Rossum added the comment: You're right, I'm being inconsistent. :-( I withdraw my objection. There are cases where sys.exit() is easier than returning an exit code, e.g. when the error is discovered deep inside some other code. But it's probably better to raise a dedicated exception in that case and catch it in main(), rather than just calling sys.exit() deep inside the other code. It's probably too fine a point for a tutorial. Sorry! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:45:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 31 Aug 2021 21:45:33 +0000 Subject: [issue45063] PEP 657 Fine Grained Error Locations: omit indicators if they are one the whole line, to make tracebacks shorter In-Reply-To: <1630418756.59.0.674837335232.issue45063@roundup.psfhosted.org> Message-ID: <1630446333.68.0.188202451293.issue45063@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >In my example, there are 6 frames. The indicators cover the whole line of 3 frames: 50%. It's a common case, it's not special. Special is not uncommon, is just some different behaviour rather than the default one. I am not arguing that is a rare scenario, I am arguing that is a special case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:46:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 31 Aug 2021 21:46:26 +0000 Subject: [issue45063] PEP 657 Fine Grained Error Locations: omit indicators if they are one the whole line, to make tracebacks shorter In-Reply-To: <1630418756.59.0.674837335232.issue45063@roundup.psfhosted.org> Message-ID: <1630446386.76.0.920944556335.issue45063@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Python 3.11 makes it worse: up to 1.5x longer Sound like you likely want to use the environment variable to deactivate the extra information ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:52:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 21:52:56 +0000 Subject: [issue45053] MD5SumTests.test_checksum_fodder fails on Windows In-Reply-To: <1630347779.05.0.821089086925.issue45053@roundup.psfhosted.org> Message-ID: <1630446776.68.0.206312407078.issue45053@roundup.psfhosted.org> STINNER Victor added the comment: > But there is also an issue in the script itself. It fails or produces a mojibake when the filesystem encoding and the stdout encoding do not match. I don't know Tools/scripts/md5sum.py. Can you show an example which currently fails? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:53:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 21:53:36 +0000 Subject: [issue45042] Many multiprocessing tests are silently skipped since 3.9 In-Reply-To: <1630234890.74.0.652972390758.issue45042@roundup.psfhosted.org> Message-ID: <1630446816.54.0.676104302765.issue45042@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:56:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 21:56:48 +0000 Subject: [issue44019] operator.call/operator.__call__ In-Reply-To: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> Message-ID: <1630447008.79.0.651478192046.issue44019@roundup.psfhosted.org> STINNER Victor added the comment: > `call(f, *args, **kwargs) == f(*args, **kwargs)` So you can want to reintroduce the Python 2 apply() function which was removed in Python 3. You can reimplement it in 2 lines, no? def call(func, *args, **kwargs): return func(*args, **kwargs) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 17:58:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 21:58:44 +0000 Subject: [issue14088] sys.executable generating canonical path In-Reply-To: <1329928617.24.0.609517948319.issue14088@psf.upfronthosting.co.za> Message-ID: <1630447124.02.0.725758887599.issue14088@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-20443 "__code__. co_filename should always be an absolute path". I had a revert a change which affected sys.argv[0]: commit a1a99b4bb7cbe2dbc55a1d92c3c509b4466d3c3b Author: Victor Stinner Date: Mon Dec 9 17:34:02 2019 +0100 bpo-20443: No longer make sys.argv[0] absolute for script (GH-17534) In Python 3.9.0a1, sys.argv[0] was made an asolute path if a filename was specified on the command line. Revert this change, since most users expect sys.argv to be unmodified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 18:02:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 22:02:29 +0000 Subject: [issue45025] Reliance on C bit fields in C API is undefined behavior In-Reply-To: <1630028833.13.0.234586694862.issue45025@roundup.psfhosted.org> Message-ID: <1630447349.68.0.443293117091.issue45025@roundup.psfhosted.org> STINNER Victor added the comment: > My use case for these low-level APIs is to write tests for low-level string/encoding handling in my custom use of the PyPreConfig and PyConfig structs. I wanted to verify that exact byte sequences were turned into specific representations inside of Python strings. This includes ensuring that certain byte sequences retain their appropriate "character" width in internal storage. CPython contains many checks to ensure that a string always use the most effecient storage, especially in debug mode. The C API should not allow to create a string using an inefficient storage, unless you "abuse" the C API :-D I'm not sure what do you test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 18:03:11 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 31 Aug 2021 22:03:11 +0000 Subject: [issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__ In-Reply-To: <1630422697.09.0.31446327761.issue45064@roundup.psfhosted.org> Message-ID: <1630447391.69.0.96812215533.issue45064@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: Hi Mateusz, It's not a bug, it's expected behavior. __getattr__ called when the default attribute access fails with an AttributeError (either __getattribute__() raises an AttributeError because name is not an instance attribute or an attribute in the class tree for self; or __get__() of a name property raises AttributeError). You can find more information here: https://docs.python.org/3/reference/datamodel.html?highlight=__getattr__#object.__getattr__ ---------- nosy: +uriyyo resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 18:06:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 31 Aug 2021 22:06:54 +0000 Subject: [issue27334] [sqlite3] context manager leaves db locked if commit fails in __exit__ In-Reply-To: <1466095550.35.0.353945818907.issue27334@psf.upfronthosting.co.za> Message-ID: <1630447614.84.0.592771348372.issue27334@roundup.psfhosted.org> STINNER Victor added the comment: Nice! ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 18:31:41 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 31 Aug 2021 22:31:41 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1630449101.4.0.020742342801.issue39452@roundup.psfhosted.org> Jack DeVries added the comment: > Your docs seem to promote the second, whereas I've usually preferred the > former. Was this a considered choice on your part? First and foremost, stupid GitHub is not letting the permalink load for some reason, but yes; this was discussed in the conversation with @graingert on June 29th ??it was his suggestion. Later, @pradyunsg from PyPa added some suggestions about how the document described console script entrypoints, and the documentation around this issue changed a bit again. As far as my perspective, I also never personally use the sys.exit idiom myself. After all, an exception is going to cause a non-zero exit code, and a traceback is always going to have a lot more value than an exit code. I was, however, surprised to learn how pip treats console script entry points in the course of working on this document. Specifically, it generates an executable script that does wrap the function in sys.exit.I definitely think that the way the document communicates this fact while teaching the idiom is a good thing, so I think that whole "Idiomatic Usage" section is good. I do think we can tweak the document slightly to make it less prescriptive, though, because in reality a lot of people _don't_ use this idiom, so presenting it as a de-facto standard is misleading. Plus, it's not Pythonic to dole out prescriptive boilerplate. I attached a diff that steers in that direction. What do you all think? It is a pretty slight change, but I think it better strikes a balance. ---------- Added file: https://bugs.python.org/file50249/less_prescriptive.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 18:46:04 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 31 Aug 2021 22:46:04 +0000 Subject: [issue45064] Raising AttributeError in descriptor decorator causing searching attribute in __mro__ In-Reply-To: <1630422697.09.0.31446327761.issue45064@roundup.psfhosted.org> Message-ID: <1630449964.68.0.0378824989312.issue45064@roundup.psfhosted.org> Raymond Hettinger added the comment: To get a better insight into what is going on, see https://docs.python.org/3/howto/descriptor.html#invocation-from-an-instance The relevant text is, "So if __getattr__() exists, it is called whenever __getattribute__() raises AttributeError (either directly or in one of the descriptor calls)." If needed, you can bypass the __getattr__ hook by calling object.__getattribute__ directly: >>> object.__getattribute__(C(), 'test') Traceback (most recent call last): File "", line 1, in object.__getattribute__(c, 'test') File "/Users/raymond/Documents/tmp14.py", line 26, in __get__ raise AttributeError("Python bug?") AttributeError: Python bug? ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 18:55:18 2021 From: report at bugs.python.org (=?utf-8?b?R8Opcnk=?=) Date: Tue, 31 Aug 2021 22:55:18 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1630450518.23.0.690099329.issue39452@roundup.psfhosted.org> G?ry added the comment: No worries, it was almost twenty years ago. > But it's probably better to raise a dedicated exception in that case and catch it in main(), rather than just calling sys.exit() deep inside the other code. Yes I agree, and I think you explained very clearly why it is better in the blog post: > Another refinement is to define a Usage() exception, which we catch in an except clause at the end of main(): > [?] > This gives the main() function a single exit point, which is preferable over multiple return 2 statements. So I think you made two independent points: - raising a dedicated exception instead of calling `sys.exit` inside nested functions and catching it inside `main` allows a single exit point; - calling `sys.exit` outside of `main` instead of inside prevents exiting the Python interpreter in an interactive session. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 19:02:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 31 Aug 2021 23:02:17 +0000 Subject: [issue44895] refleak test failure in test_exceptions In-Reply-To: <1628727218.93.0.270541838756.issue44895@roundup.psfhosted.org> Message-ID: <1630450937.02.0.992459533297.issue44895@roundup.psfhosted.org> Irit Katriel added the comment: Oh, I see now what you meant. I think you're right that it's cleanup. I changed dash_R_cleanup to put the sys._clear_type_cache() after clear_caches() and the leak is gone: @@ -166,9 +166,6 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs): zipimport._zip_directory_cache.clear() zipimport._zip_directory_cache.update(zdc) - # clear type cache - sys._clear_type_cache() - # Clear ABC registries, restoring previously saved ABC registries. abs_classes = [getattr(collections.abc, a) for a in collections.abc.__all__] abs_classes = filter(isabstract, abs_classes) @@ -181,6 +178,12 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs): clear_caches() + # clear type cache + sys._clear_type_cache() + + support.gc_collect() + I did this because I suspected it's something related to types, because it only happen when we define the exception classes (A and B) inside the test function. So maybe the type objects of these exceptions are not cleared from the type cache because they have refcount > 0 but by the time clear_caches() and gc.collect() finish they are cleared? Note this doesn't mean the change I made is always right - maybe the whole body of dash_R_cleanup should be in a loop until nothing changes? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 19:39:03 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Tue, 31 Aug 2021 23:39:03 +0000 Subject: [issue45067] Failed to build _curses on CentOS 7 Message-ID: <1630453143.24.0.854803512429.issue45067@roundup.psfhosted.org> New submission from Senthil Kumaran : I verified that ncurses-devel is installed. ./configure is able to verify ncurses checking curses.h usability... yes checking curses.h presence... yes checking for curses.h... yes checking ncurses.h usability... yes checking ncurses.h presence... yes checking for ncurses.h... yes checking for term.h... yes But _curses fails to build, this is the output message from `make` gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -DHAVE_NCURSESW=1 -I/usr/include/ncursesw -I./Include -I. -I/usr/local/include -I/local/home/senthilx/cpython/Include -I/local/home/senthilx/cpython -c /local/home/senthilx/cpython/Modules/_curses_panel.c -o build/temp.linux-x86_64-3.11/local/home/senthilx/cpython/Modules/_curses_panel.o gcc -pthread -shared build/temp.linux-x86_64-3.11/local/home/senthilx/cpython/Modules/_curses_panel.o -L/usr/local/lib -lpanelw -lncursesw -o build/lib.linux-x86_64-3.11/_curses_panel.cpython-311-x86_64-linux-gnu.so *** WARNING: renaming "_curses_panel" since importing it failed: No module named '_curses' The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc pwd time Failed to build these modules: _curses Following modules built successfully but were removed because they could not be imported: _curses_panel ---------- messages: 400795 nosy: orsenthil priority: normal severity: normal status: open title: Failed to build _curses on CentOS 7 type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 19:46:20 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 31 Aug 2021 23:46:20 +0000 Subject: [issue45020] Freeze all modules imported during startup. In-Reply-To: <1630005838.27.0.743852977618.issue45020@roundup.psfhosted.org> Message-ID: <1630453580.95.0.0267946242318.issue45020@roundup.psfhosted.org> Change by Eric Snow : ---------- keywords: +patch pull_requests: +26549 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28107 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 20:01:37 2021 From: report at bugs.python.org (hai shi) Date: Wed, 01 Sep 2021 00:01:37 +0000 Subject: [issue45062] test_asyncio: test_huge_content_recvinto() failed on PPC64LE RHEL8 Refleaks 3.9 In-Reply-To: <1630417417.52.0.890945752162.issue45062@roundup.psfhosted.org> Message-ID: <1630454497.6.0.0584294009969.issue45062@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 20:01:53 2021 From: report at bugs.python.org (hai shi) Date: Wed, 01 Sep 2021 00:01:53 +0000 Subject: [issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched In-Reply-To: <1623225511.63.0.739788412824.issue44359@roundup.psfhosted.org> Message-ID: <1630454513.87.0.177118228683.issue44359@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +shihai1991 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 20:25:32 2021 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 01 Sep 2021 00:25:32 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1630455932.39.0.339379249882.issue44450@roundup.psfhosted.org> Ned Batchelder added the comment: Looks like this is fixed with 3.10.0rc1, thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 21:13:14 2021 From: report at bugs.python.org (Gregory Szorc) Date: Wed, 01 Sep 2021 01:13:14 +0000 Subject: [issue44689] ctypes.util.find_library() does not find macOS 11+ system libraries when built on older macOS systems In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1630458794.71.0.160000905501.issue44689@roundup.psfhosted.org> Gregory Szorc added the comment: I think patch broke building on macOS < 11 when building with a 11.0+ SDK and targeting macOS < 11? This build configuration previously used to work with 3.9.6. clang -Wno-unused-result -Wsign-compare -g -O0 -Wall -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fPIC -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/ncursesw -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/uuid -Werror=unguarded-availability-new -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -arch x86_64 -mmacosx-version-min=10.9 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fPIC -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/ncursesw -I/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmpkfji88v7/tools/deps/include/uuid -Werror=unguarded-availability-new -DMACOSX -DUSING_MALLOC_CLOSURE_DOT_C=1 -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 -DPy_BUILD_CORE_BUILTIN -I_ctypes/darwin -c ./Modules/_ctypes/callproc.c -o Modules/callproc.o python-3.9> ./Modules/_ctypes/callproc.c:1459:15: error: redefinition of '_dyld_shared_cache_contains_path' as different kind of symbol cpython-3.9> static bool (*_dyld_shared_cache_contains_path)(const char *path); cpython-3.9> ^ cpython-3.9> /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.h:121:13: note: previous definition is here cpython-3.9> extern bool _dyld_shared_cache_contains_path(const char* path) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) DYLD_DRIVERKIT_UNAVAILABLE; cpython-3.9> ^ cpython-3.9> ./Modules/_ctypes/callproc.c:1464:42: error: non-object type 'bool (const char *)' is not assignable cpython-3.9> _dyld_shared_cache_contains_path = dlsym(libsystem_b_handle, "_dyld_shared_cache_contains_path"); cpython-3.9> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ cpython-3.9> ./Modules/_ctypes/callproc.c:1464:9: error: '_dyld_shared_cache_contains_path' is only available on macOS 11.0 or newer [-Werror,-Wunguarded-availability-new] cpython-3.9> _dyld_shared_cache_contains_path = dlsym(libsystem_b_handle, "_dyld_shared_cache_contains_path"); cpython-3.9> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cpython-3.9> /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.h:121:13: note: '_dyld_shared_cache_contains_path' has been marked as being introduced in macOS 11.0 here, but the deployment target is macOS 10.9.0 cpython-3.9> extern bool _dyld_shared_cache_contains_path(const char* path) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) DYLD_DRIVERKIT_UNAVAILABLE; cpython-3.9> ^ cpython-3.9> ./Modules/_ctypes/callproc.c:1464:9: note: enclose '_dyld_shared_cache_contains_path' in a __builtin_available check to silence this warning cpython-3.9> _dyld_shared_cache_contains_path = dlsym(libsystem_b_handle, "_dyld_shared_cache_contains_path"); cpython-3.9> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cpython-3.9> ./Modules/_ctypes/callproc.c:1482:10: error: '_dyld_shared_cache_contains_path' is only available on macOS 11.0 or newer [-Werror,-Wunguarded-availability-new] cpython-3.9> if (HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME) { cpython-3.9> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cpython-3.9> ./Modules/_ctypes/callproc.c:1474:5: note: expanded from macro 'HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME' cpython-3.9> _dyld_shared_cache_contains_path != NULL cpython-3.9> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cpython-3.9> /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.h:121:13: note: '_dyld_shared_cache_contains_path' has been marked as being introduced in macOS 11.0 here, but the deployment target is macOS 10.9.0 cpython-3.9> extern bool _dyld_shared_cache_contains_path(const char* path) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) DYLD_DRIVERKIT_UNAVAILABLE; cpython-3.9> ^ cpython-3.9> ./Modules/_ctypes/callproc.c:1482:10: note: enclose '_dyld_shared_cache_contains_path' in a __builtin_available check to silence this warning cpython-3.9> if (HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME) { cpython-3.9> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cpython-3.9> ./Modules/_ctypes/callproc.c:1474:5: note: expanded from macro 'HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME' cpython-3.9> _dyld_shared_cache_contains_path != NULL cpython-3.9> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cpython-3.9> ./Modules/_ctypes/callproc.c:1495:14: error: '_dyld_shared_cache_contains_path' is only available on macOS 11.0 or newer [-Werror,-Wunguarded-availability-new] cpython-3.9> r = _dyld_shared_cache_contains_path(name_str); cpython-3.9> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cpython-3.9> /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/mach-o/dyld.h:121:13: note: '_dyld_shared_cache_contains_path' has been marked as being introduced in macOS 11.0 here, but the deployment target is macOS 10.9.0 cpython-3.9> extern bool _dyld_shared_cache_contains_path(const char* path) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) DYLD_DRIVERKIT_UNAVAILABLE; cpython-3.9> ^ cpython-3.9> ./Modules/_ctypes/callproc.c:1495:14: note: enclose '_dyld_shared_cache_contains_path' in a __builtin_available check to silence this warning cpython-3.9> r = _dyld_shared_cache_contains_path(name_str); cpython-3.9> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------- nosy: +indygreg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:10:44 2021 From: report at bugs.python.org (xcl-1) Date: Wed, 01 Sep 2021 03:10:44 +0000 Subject: [issue45068] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i Message-ID: <1630465844.21.0.724335860149.issue45068@roundup.psfhosted.org> New submission from xcl-1 <1318683902 at qq.com>: Calls to EVP_CipherUpdate, EVP_EncryptUpdate and EVP_DecryptUpdate may overflow the output length argument in some cases where the input length is close to the maximum permissable length for an integer on the platform. In such cases the return value from the function call will be 1 (indicating success), but the output length value will be negative. This could cause applications to behave incorrectly or crash. OpenSSL versions 1.1.1i and below are affected by this issue. Users of these versions should upgrade to OpenSSL 1.1.1j. OpenSSL versions 1.0.2x and below are affected by this issue. However OpenSSL 1.0.2 is out of support and no longer receiving public updates. Premium support customers of OpenSSL 1.0.2 should upgrade to 1.0.2y. Other users should upgrade to 1.1.1j. Fixed in OpenSSL 1.1.1j (Affected 1.1.1-1.1.1i). Fixed in OpenSSL 1.0.2y (Affected 1.0.2-1.0.2x). ---------- components: Build messages: 400798 nosy: xcl123 priority: normal severity: normal status: open title: python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:17:46 2021 From: report at bugs.python.org (xcl-1) Date: Wed, 01 Sep 2021 03:17:46 +0000 Subject: =?utf-8?q?=5Bissue45068=5D_python_3=2E9=2E2_contains_wininst-10=2E0-amd64?= =?utf-8?q?=2Eexe=2E_wininst-10=2E0=2Eexe=2Ewininst-7=2E1=2Eexe=2E_wininst?= =?utf-8?q?-8=2E0=2Eexe=2Ewininst-9=2E0=2Eexe=2Ewininst-9=2E0-amd64=2Eexe?= =?utf-8?q?=2Ewininst-14=2E0-amd64=2Eexe_and_wininst-14=2E0=2Eexe_associat?= =?utf-8?q?es_CVE-2016-9843=E3=80=81CVE-2016-9841=E3=80=81CVE-2016-9840_an?= =?utf-8?b?ZCBDVkUtMjAxNi05ODQyIG9mIHpsaWIoMS4yLjgsIDEuMi4zLDEuMi41KQ==?= In-Reply-To: <1630465844.21.0.724335860149.issue45068@roundup.psfhosted.org> Message-ID: <1630466266.25.0.279414263689.issue45068@roundup.psfhosted.org> xcl-1 <1318683902 at qq.com> added the comment: python 3.9.2 contains wininst-10.0-amd64.exe. wininst-10.0.exe.wininst-7.1.exe. wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe and wininst-14.0.exe associates CVE-2016-9843?CVE-2016-9841?CVE-2016-9840 and CVE-2016-9842 of zlib(1.2.8, 1.2.3,1.2.5) ---------- title: python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i -> python 3.9.2 contains wininst-10.0-amd64.exe. wininst-10.0.exe.wininst-7.1.exe. wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe and wininst-14.0.exe associates CVE-2016-9843?CVE-2016-9841?CVE-2016-9840 and CVE-2016-9842 of zlib(1.2.8, 1.2.3,1.2.5) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:19:31 2021 From: report at bugs.python.org (xcl-1) Date: Wed, 01 Sep 2021 03:19:31 +0000 Subject: =?utf-8?q?=5Bissue45070=5D_python_3=2E9=2E2_contains_wininst-10=2E0-amd64?= =?utf-8?q?=2Eexe=2E_wininst-10=2E0=2Eexe=2Ewininst-7=2E1=2Eexe=2E_wininst?= =?utf-8?q?-8=2E0=2Eexe=2Ewininst-9=2E0=2Eexe=2Ewininst-9=2E0-amd64=2Eexe?= =?utf-8?q?=2Ewininst-14=2E0-amd64=2Eexe_and_wininst-14=2E0=2Eexe_associat?= =?utf-8?q?es_CVE-2016-9843=E3=80=81CVE-2016-9841=E3=80=81CVE-2016-9840_an?= =?utf-8?b?ZCBDVkUtMjAxNi05ODQyIG9mIHpsaWIoMS4yLjgsIDEuMi4zLDEuMi41KQ==?= Message-ID: <1630466371.81.0.178412542042.issue45070@roundup.psfhosted.org> New submission from xcl-1 <1318683902 at qq.com>: python 3.9.2 contains wininst-10.0-amd64.exe. wininst-10.0.exe.wininst-7.1.exe. wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe and wininst-14.0.exe associates CVE-2016-9843?CVE-2016-9841?CVE-2016-9840 and CVE-2016-9842 of zlib(1.2.8, 1.2.3,1.2.5) ---------- messages: 400801 nosy: xcl123 priority: normal severity: normal status: open title: python 3.9.2 contains wininst-10.0-amd64.exe. wininst-10.0.exe.wininst-7.1.exe. wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe and wininst-14.0.exe associates CVE-2016-9843?CVE-2016-9841?CVE-2016-9840 and CVE-2016-9842 of zlib(1.2.8, 1.2.3,1.2.5) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:19:17 2021 From: report at bugs.python.org (xcl-1) Date: Wed, 01 Sep 2021 03:19:17 +0000 Subject: [issue45069] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i Message-ID: <1630466357.81.0.93174296975.issue45069@roundup.psfhosted.org> New submission from xcl-1 <1318683902 at qq.com>: python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i ---------- messages: 400800 nosy: xcl123 priority: normal severity: normal status: open title: python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:21:03 2021 From: report at bugs.python.org (xcl-1) Date: Wed, 01 Sep 2021 03:21:03 +0000 Subject: [issue45071] python 3.9.2 contains _bz2.pyd associates CVE-2019-12900 and CVE-2016-3189 of bzip2-1.0.6 Message-ID: <1630466463.38.0.708138715693.issue45071@roundup.psfhosted.org> New submission from xcl-1 <1318683902 at qq.com>: python 3.9.2 contains _bz2.pyd associates CVE-2019-12900 and CVE-2016-3189 of bzip2-1.0.6 ---------- messages: 400802 nosy: xcl123 priority: normal severity: normal status: open title: python 3.9.2 contains _bz2.pyd associates CVE-2019-12900 and CVE-2016-3189 of bzip2-1.0.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:23:04 2021 From: report at bugs.python.org (xcl-1) Date: Wed, 01 Sep 2021 03:23:04 +0000 Subject: [issue45072] python 3.9.2 contains ensurepip and pip associates CVE-2021-3572 of pip-20.2.3 Message-ID: <1630466584.74.0.362679690335.issue45072@roundup.psfhosted.org> New submission from xcl-1 <1318683902 at qq.com>: python 3.9.2 contains ensurepip and pip associates CVE-2021-3572 of pip-20.2.3 ---------- messages: 400803 nosy: xcl123 priority: normal severity: normal status: open title: python 3.9.2 contains ensurepip and pip associates CVE-2021-3572 of pip-20.2.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:27:44 2021 From: report at bugs.python.org (Tim Peters) Date: Wed, 01 Sep 2021 03:27:44 +0000 Subject: [issue34561] Replace list sorting merge_collapse()? In-Reply-To: <1535764924.6.0.56676864532.issue34561@psf.upfronthosting.co.za> Message-ID: <1630466864.77.0.106744773827.issue34561@roundup.psfhosted.org> Change by Tim Peters : ---------- keywords: +patch pull_requests: +26550 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28108 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:33:43 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 01 Sep 2021 03:33:43 +0000 Subject: [issue45068] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i In-Reply-To: <1630465844.21.0.724335860149.issue45068@roundup.psfhosted.org> Message-ID: <1630467223.6.0.195846730558.issue45068@roundup.psfhosted.org> Zachary Ware added the comment: v3.9.2 is rather out of date at this point; v3.9.7 was released just yesterday and includes OpenSSL v1.1.1l. If you're concerned about issues in the version of OpenSSL included with Python v3.9.2, you are encouraged to update to the latest v3.9.7, or replace the OpenSSL DLLs with your own. The various wininst-*.exe executables are helpers for the deprecated distutils bdist_wininst command, and you are encouraged to not use them :). You can safely remove them if you do not need bdist_wininst functionality. They will not be updated. ---------- nosy: +zach.ware resolution: -> out of date stage: -> resolved status: open -> closed title: python 3.9.2 contains wininst-10.0-amd64.exe. wininst-10.0.exe.wininst-7.1.exe. wininst-8.0.exe.wininst-9.0.exe.wininst-9.0-amd64.exe.wininst-14.0-amd64.exe and wininst-14.0.exe associates CVE-2016-9843?CVE-2016-9841?CVE-2016-9840 and CVE-2016-9842 of zlib(1.2.8, 1.2.3,1.2.5) -> python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:40:43 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 01 Sep 2021 03:40:43 +0000 Subject: [issue45072] python 3.9.2 contains ensurepip and pip associates CVE-2021-3572 of pip-20.2.3 In-Reply-To: <1630466584.74.0.362679690335.issue45072@roundup.psfhosted.org> Message-ID: <1630467643.42.0.745824995149.issue45072@roundup.psfhosted.org> Zachary Ware added the comment: As noted in bpo-45068, v3.9.2 is out of date. v3.9.7 includes pip v21.2.3. ---------- nosy: +zach.ware resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:42:41 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 01 Sep 2021 03:42:41 +0000 Subject: =?utf-8?q?=5Bissue45070=5D_python_3=2E9=2E2_contains_wininst-10=2E0-amd64?= =?utf-8?q?=2Eexe=2E_wininst-10=2E0=2Eexe=2Ewininst-7=2E1=2Eexe=2E_wininst?= =?utf-8?q?-8=2E0=2Eexe=2Ewininst-9=2E0=2Eexe=2Ewininst-9=2E0-amd64=2Eexe?= =?utf-8?q?=2Ewininst-14=2E0-amd64=2Eexe_and_wininst-14=2E0=2Eexe_associat?= =?utf-8?q?es_CVE-2016-9843=E3=80=81CVE-2016-9841=E3=80=81CVE-2016-9840_an?= =?utf-8?b?ZCBDVkUtMjAxNi05ODQyIG9mIHpsaWIoMS4yLjgsIDEuMi4zLDEuMi41KQ==?= In-Reply-To: <1630466371.81.0.178412542042.issue45070@roundup.psfhosted.org> Message-ID: <1630467761.56.0.650249415838.issue45070@roundup.psfhosted.org> Zachary Ware added the comment: As noted in bpo-45068, these executables are helpers for deprecated functionality. It is safe to delete them if they concern you and you don't need the deprecated functionality. They will not be updated except to remove them. ---------- components: +Distutils, Windows nosy: +dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, zach.ware resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Aug 31 23:45:20 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 01 Sep 2021 03:45:20 +0000 Subject: [issue45071] python 3.9.2 contains _bz2.pyd associates CVE-2019-12900 and CVE-2016-3189 of bzip2-1.0.6 In-Reply-To: <1630466463.38.0.708138715693.issue45071@roundup.psfhosted.org> Message-ID: <1630467920.56.0.697198868077.issue45071@roundup.psfhosted.org> Zachary Ware added the comment: This is a duplicate of bpo-44549. For future reports, please first check for existing issues, and also ensure that you are looking at the latest release of the version you are reporting against. ---------- nosy: +zach.ware resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> BZip 1.0.6 Critical Vulnerability _______________________________________ Python tracker _______________________________________